Explore Random Matrices: Why Do Energy Levels Repel?
Atomic nuclei are so complex that physicists tried an unusual idea
Heavy atomic nuclei such as uranium contain many protons and neutrons that interact in complex ways. A nucleus cannot have any continuously varying energy: quantum mechanics allows only certain values. Physicists call these allowed energies energy levels.
Calculating every energy level of a complex nucleus from first principles is often extremely difficult. There are many particles, all influencing one another. Even when the basic physical laws are known, it may be impossible to calculate every level precisely.
In the 1950s, physicist Eugene Wigner proposed a bold idea: instead of asking for the exact value of each level, could we learn more by studying the statistical patterns that emerge across many levels?
He tried using random matrices to describe such complex systems. “Random” does not mean that nuclei literally behave randomly. When a system is too complicated to calculate detail by detail, a random model can help us study its overall statistical properties.
What is a random matrix?
A matrix is a rectangular array of numbers, usually arranged in a square. In quantum mechanics, an important mathematical object called the Hamiltonian describes a system's energy. In a suitable basis it can be written as a matrix, whose eigenvalues correspond to the possible energies of the system. In short, matrix eigenvalues let us study a quantum system's energy levels.
If a system's exact matrix is unknown or difficult to determine, we can generate a collection of random matrices and study their statistical patterns. The entries are not filled independently without constraints: in a real symmetric matrix, entries mirrored across the main diagonal must match; in a Hermitian matrix, they must be complex conjugates. Usually only the independent entries on one side are generated randomly, and the other side is filled in using the symmetry rule.
This demonstration mainly compares two classic matrix structures: real symmetric and Hermitian matrices. They are characteristic structures of the Gaussian Orthogonal Ensemble (GOE) and Gaussian Unitary Ensemble (GUE). Strictly speaking, membership in either Gaussian ensemble also depends on the probability distribution used for the matrix entries. These are not arbitrary number grids.
Each plot on this page is made by generating a batch of these random matrices, calculating their eigenvalues, and combining the results. We will now look at how the eigenvalues are arranged.
Shake things up: spacing between energy levels
Start with the “Spacing” view. We sort each matrix's eigenvalues and measure the gaps between neighboring values. Eigenvalues from different matrices may have different overall densities, so we normalize the gaps to make their average equal to 1. This lets us compare different samples.
The orange curve shows the theoretical spacing distribution of a Poisson process. Imagine a sequence of random points with no repulsion: some may be very close, while others are far apart. When the average spacing is normalized to 1, about 25.9% of gaps are less than 0.3.
Eigenvalues of random matrices look different: the blue bars become much less common near zero spacing. In other words, two eigenvalues are unlikely to be extremely close. This statistical phenomenon is called level repulsion.
In this demonstration, about 25.9% of Poisson-process gaps are less than 0.3 times the mean, while for random matrices the proportion is only a few percent. The latter depends on matrix type, sample size, and statistical method. Generate new matrices to observe the overall trend rather than treating one simulation's value as a fixed constant.
Why do they repel?
If matrix entries are generated randomly, why don't their eigenvalues crowd together like completely independent random points? The key is that matrix entries can be generated by random rules, but the eigenvalues calculated from them are not independent of one another. The matrix's mathematical structure creates statistical correlations between the eigenvalues.
The mathematician Dyson used a vivid analogy: imagine the eigenvalues as a row of small balls carrying the same electric charge. They repel one another, so they tend not to crowd into the same spot. This describes a statistical pattern; it does not mean a physical force really acts between eigenvalues.
Mathematically, the joint probability distribution of the eigenvalues contains a factor that depends on their separations. The closer two eigenvalues are, the lower the probability density; when they coincide, the density tends to zero. This is the mathematical reason for level repulsion.
The strength of repulsion also differs between matrix types. For GOE, the spacing distribution at very small gaps grows roughly in proportion to the spacing; for GUE, it grows roughly in proportion to the square of the spacing. GUE therefore suppresses tiny gaps more strongly. The theoretical curves shown here usually use convenient approximations to illustrate the difference; finite matrices do not all follow one exact curve.
Why distinguish these matrix types? For many quantum systems, the matrix type is related to time-reversal symmetry. Roughly speaking, if a process is played backward, do the basic laws remain unchanged? Often, systems with time-reversal symmetry correspond to GOE, while systems that break it often correspond to GUE. More complex cases can involve other matrix classes.
The surprising semicircle
Switch to the “Semicircle” view. This time, instead of looking at gaps between neighboring eigenvalues, we consider all the eigenvalues together and see how they are distributed along the number line.
You will see a striking shape: eigenvalues are denser in the middle and sparser toward the edges, forming an approximate semicircle. This is the Wigner semicircle law. With the normalization used in this demonstration, the semicircle extends roughly from -2 to 2.
Remarkably, the matrix entries are random, yet the overall distribution of eigenvalues can form such a smooth shape. This result is not limited to one particular random distribution: under suitable statistical conditions and normalization, many different random matrix models approach the same semicircle distribution as the matrix becomes large. This relative independence from details is called universality.
The conditions matter: independent matrix entries alone do not guarantee the semicircle law. Typically, the independent entries need suitable properties such as their means and variances, and the matrices must be scaled appropriately as their size grows.
The larger the table, the clearer the semicircle usually becomes. Try “One large matrix”: a matrix of order 200 already makes the shape fairly clear. Then try “A small matrix of order six”: the distribution fluctuates a lot and does not yet look like a smooth semicircle. Order 200 is just the size used in this demonstration, not a fixed threshold for the law to apply.
Regular or random?
Switch to the “Point rows” view to compare three rows. The top row is perfectly regular, with equal spacing everywhere. The bottom row contains points from a Poisson process: some bunch together while large gaps appear elsewhere. The middle row shows eigenvalues of a random matrix.
Random-matrix eigenvalues are neither as rigid as the first row nor as disordered as the third. Their spacing is not fixed, but they tend not to get too close: the closer two points are, the less likely that arrangement is.
The page also marks the smallest gap in each row. Randomly scattered points may almost coincide, while random-matrix eigenvalues rarely have such tiny gaps. This does not mean there is an absolute minimum distance; very small gaps are simply uncommon.
Back to the world of primes
Remember why zeros resemble energy levels in atomic nuclei? Mathematicians found that the spacing statistics of the nontrivial zeros of the Riemann ζ function are remarkably similar to the eigenvalue spacings of GUE random matrices. This compares statistical patterns across many zeros and many random-matrix eigenvalues; it does not mean each zero corresponds directly to a particular energy level in a nucleus.
Why should a mathematical model for quantum systems share such similar statistical patterns with the zeros that arise in the study of prime numbers? We do not yet have a complete explanation. This connection also does not mean random matrices have proved the Riemann hypothesis, but it builds a surprising bridge between mathematics and physics.
From atomic nuclei to random matrices, and from random matrices back to primes: seemingly unrelated fields meet in their statistical patterns. Now generate a batch of matrices yourself and see how these patterns emerge from random numbers.
Try it yourself: generate a batch of matrices
Click “Next” below the image to switch views. You can also change the settings below and click “Try it”. Each time you click “Try it”, a new batch of random matrices is generated. The exact plots and numbers may vary. With enough samples, you can see whether they follow the overall trends described above.
Matrix size: How large the table is (4 to 200; Hermitian matrices are limited to 150). Larger matrices usually make overall statistical patterns easier to see, but take longer to compute.
Number of matrices: How many matrices to generate and combine (1 to 2000). More matrices usually make the statistical plot smoother. To keep the page responsive, the count is automatically reduced for very large matrices.
Type: Compare real symmetric matrices (GOE) and Hermitian matrices (GUE) to see how their repulsion patterns differ at small spacings.
View: Energy-level spacing, semicircle, and three point rows. These show local spacing statistics, the overall eigenvalue distribution, and a visual comparison between random-matrix eigenvalues and other point sequences.
The pink theoretical curve is an approximate formula for comparison. It helps you see whether the simulation is close to the theoretical trend. It will not match finite-sample results exactly; differences depend on matrix size, number of matrices, and statistical fluctuations. In the point-row view, drag horizontally with the mouse and zoom with the scroll wheel.
Keep exploring the world of physics
Energy levels, random matrices, and prime zeros seem to belong to unrelated worlds, yet they share similar statistical patterns. Deeper mathematical structures may lie behind them. We do not fully understand this connection, but this universality across different fields fascinates physicists and mathematicians.
Random matrices show that even when we do not know every detail of a complex system, its overall statistical patterns may still reveal meaningful structure. If you enjoy unexpected patterns emerging from simple rules, explore other Physics Wonder Box experiments about waves, motion, and randomness.
You can also explore more fascinating physics phenomena or read the Wikipedia article about random matrices.
Further Reading
- Random Matrices From the perspective of energy-level statistics: why do the eigenvalues of random matrices repel one another and follow patterns resembling those of quantum systems?
- Particle in a Box: Standing Waves From the perspective of quantization: how does a particle confined in a box form standing waves that correspond to discrete energy levels?