The chain is the standard disordered Heisenberg model used in many-body localization studies:
H = J Σᵢ [Sᶻᵢ Sᶻᵢ₊₁ + ½(S⁺ᵢS⁻ᵢ₊₁ + S⁻ᵢS⁺ᵢ₊₁)] + Σᵢ hᵢ Sᶻᵢ
hᵢ ~ Uniform[−W, W] (open chain, J = 1)
The engine builds the full Hamiltonian in the zero-magnetization sector (a real symmetric matrix of dimension C(L, L/2)) and exactly diagonalizes it with a cyclic Jacobi eigenvalue solver — no approximation, the same method used in small-system MBL papers. From the sorted eigenvalues {Eₙ} it forms the adjacent gap ratio
sₙ = Eₙ₊₁ − Eₙ
rₙ = min(sₙ, sₙ₋₁) / max(sₙ, sₙ₋₁)
This is the key diagnostic used by Oganesyan & Huse (2007) and Pal & Huse (2010) to locate the MBL transition without needing dynamics at all — just the spectrum. In the thermal (ergodic) phase, energy levels repel each other like eigenvalues of a random matrix (Gaussian Orthogonal Ensemble): ⟨r⟩ → 0.5307. In the many-body localized phase, distant real-space regions barely talk to each other, so levels cross freely and the spacings become uncorrelated (Poisson): ⟨r⟩ → 2ln2 − 1 ≈ 0.3863.
- L (chain length) — larger L gives a much bigger Hilbert space (C(L,L/2): 20 for L=6, 70 for L=8, 252 for L=10) and sharper statistics, at the cost of slower diagonalization.
- Disorder strength W/J — sweep it up to watch ⟨r⟩ drift from the GOE value toward the Poisson value; the crossover for this model sits near W/J ≈ 3.5–4.
- Realizations averaged — each disorder draw gives one random Hamiltonian; averaging r over many draws (and over the middle 50% of each spectrum, to avoid edge effects) suppresses sample noise.
- The spiral shows every eigenvalue of the last diagonalized sample as a bead, colored red→green by its local rₙ — a localized spectrum visibly clumps beads together (crossings), a thermal spectrum keeps them evenly spaced (repulsion). The bar chart is the full histogram of r over all sampled levels, overlaid on the two theoretical curves P_Poisson(r) = 2/(1+r)² and P_GOE(r) = (27/8)(r+r²)/(1+r+r²)^(5/2).
Real-world relevance: this level-statistics test is the standard exact-diagonalization fingerprint physicists use to map the MBL phase diagram in cold-atom and trapped-ion quantum simulators, since it needs only the static spectrum, not a time-resolved measurement.