A large N×N symmetric matrix A is filled with independent random entries (Gaussian for the classic Gaussian Orthogonal Ensemble, or ±1 coin flips to test universality), symmetrized so Aij = Aji, with diagonal variance doubled to match the GOE convention. Its N real eigenvalues λ₁…λN are found in the browser with a from-scratch cyclic Jacobi eigenvalue solver — repeated plane rotations that zero out off-diagonal entries until the matrix is (numerically) diagonal.
Semicircle law (N → ∞):
ρ(x) = (1/2π) √(4 − x²), x ∈ [−2, 2]
applied to λᵢ / √N
Level-spacing ratio (Oganesyan–Huse):
sᵢ = λᵢ₊₁ − λᵢ
rᵢ = min(sᵢ, sᵢ₋₁) / max(sᵢ, sᵢ₋₁) ∈ [0, 1]
⟨r⟩ ≈ 0.5307 for GOE (chaotic/correlated)
⟨r⟩ ≈ 0.3863 for a Poisson process (uncorrelated)
- Entry distribution — switch between Gaussian and Bernoulli ±1 entries. The bars barely change shape: this is universality — the semicircle law and the ⟨r⟩ statistic depend only on the symmetry of the matrix, not on the exact entry distribution.
- Matrix size N — larger N brings each individual spectrum closer to the smooth theoretical curve (finite-size fluctuations shrink like 1/√N).
- Pooled samples — draws several independent random matrices of the same size N and pools their eigenvalues/ratios, reducing histogram noise without changing N itself.
- Spectral density view — a histogram of the rescaled eigenvalues λ/√N against Wigner's semicircle curve.
- Level spacing view — a histogram of the nearest-neighbour ratio statistic rᵢ against the theoretical GOE curve (gold) and, for reference, the Poisson curve (dashed grey) that uncorrelated random numbers would produce.
Real-world relevance: the same semicircle law and GOE level statistics show up in the energy levels of heavy atomic nuclei (where random matrix theory began, in Wigner's 1955 work), quantum chaos, zeros of the Riemann zeta function, and the spectra of large neural-network weight matrices.