Test finite-chain Bethe solutions
Does a proposed Bethe solution actually produce an eigenstate of the finite spin chain? In this project you will reconstruct and normalize a two-magnon wavefunction, apply two independently built Hamiltonians, and compare its energy with direct diagonalization. The six-site example gives a concrete success; a reversed scattering ratio, a missing closing bond, and a zero-vector solution show what can go wrong.
Required background. Use the coordinate wavefunction and ring equations from Quantize magnons on a ring. You should be able to run Python and form a complex inner product; the entry repair reviews normalization and residuals.
Helpful background. The XXX course gives the sequence, the model defines its regime, and the two-magnon derivation explains the contact equation behind the formulas tested here.
The periodic XXX eigenstate test
Section titled “The periodic XXX eigenstate test”Take spin- sites on a ring, with , , lattice spacing one, and ferromagnetic coupling . The Hamiltonian and periodic identification are
Here swaps two neighboring spins. The all-up state has energy zero. We index sites by and let count down spins; the sector has dimension . The two-site ring is excluded because it needs a separate convention for counting bonds.
For , set and use
This amplitude orientation matters. In Karbach and Müller’s notation the ratio is the inverse of our ; their energy is shifted by the vacuum value . See Karbach and Müller 1997, arXiv v1 (submitted 1998), pp. 1–3, equations (1), (9)–(18), PDF, and the site’s spin-chain conventions.
We test the explicit real-root branch
Here , and the ring equations reduce to . The energy prediction is
The code evaluates these analytic roots; it does not run a root finder or enumerate all solutions.
Entry check and repair
Section titled “Entry check and repair”
For , compute and normalize the vector. Let . Its normalized expectation value is ; does that make an eigenvector with eigenvalue ?
Repair. The inner product uses complex conjugation: . Thus . The residual is
An expectation value is not an eigenvalue equation. In NumPy, use np.vdot(v, v) for the complex inner product and np.linalg.norm(H @ v - E * v) for the residual. Normalize first: scaling a wrong vector toward zero would otherwise make its unnormalized residual small.
Reproduce the calculation
Section titled “Reproduce the calculation”Download and extract the complete finite-chain experiment (ZIP), then open its xxx folder. Individual files are also available: experiment.py, inputs.json, results.json, requirements.txt, and the README.
The recorded run used Python 3.9.6 and NumPy 2.0.2. For a fresh environment with Python 3.9–3.12, run from the extracted xxx folder:
python3 -m venv .venv.venv/bin/python -m pip install -r requirements.txt.venv/bin/python experiment.py --checkOn Windows use .venv\Scripts\python.exe. With NumPy already installed, use python3 experiment.py --check in the extracted folder. In a repository checkout, run python3 public/computations/xxx/experiment.py --check from the repository root.
The check recomputes the experiment and compares it with the saved values without changing any files. With no option the script prints fresh JSON; --write deliberately replaces results.json. Make extensions in a copied folder so that the original experiment remains available for comparison.
Build the Hamiltonian in two ways
Section titled “Build the Hamiltonian in two ways”The full construction uses explicit Pauli tensor products in the -dimensional space. The local basis is up and down , with site zero the leftmost tensor factor.
The independent sector construction uses increasing tuples of down-spin positions. On one bond,
These rules produce a diagonal contribution and a swapped-state contribution whenever neighboring spins differ. The sector routine does not call the Pauli construction or share its bond iterator. Comparing the resulting matrices catches implementation errors that a single representation can conceal.
Before testing Bethe states, the script checks Hermiticity, total- conservation, the zero-energy vacuum, and the entire one-magnon spectrum
It also applies the one-magnon matrix to every corresponding plane wave. These checks fix the energy scale, sign, and ring boundary condition before introducing the two-magnon scattering phase.
Work through six sites
Section titled “Work through six sites”Set , , and . Writing and gives
Its squared norm is , so the normalized coefficients are . One way to verify that normalization is to group the 15 basis states by separation:
The prediction is checked against the Hamiltonian and its spectrum. The second selected six-site state has and .
Define the dimensionless unit-vector residual and the independent energy discrepancy by
The saved run gives the following values. For , the table reports the larger residual from the full tensor and sector constructions.
The script also checks both algebraic ring equations and the cyclic seam for every ordered pair. The saved file retains the complex normalized coefficients. When comparing to diagonalization, it projects onto the whole matching eigenspace, so arbitrary eigenvector phases or a different basis in a degenerate eigenspace do not create false failures.
What the wider checks and failures show
Section titled “What the wider checks and failures show”Across , the script tests nine selected two-magnon states. The full and sector Hamiltonian blocks agree exactly in the recorded arithmetic. The largest one-magnon spectral discrepancy divided by is , the largest two-magnon eigenstate residual is , and the largest algebraic Bethe residual is .
These values are consistent with binary64 rounding. The equation checks use tolerance . Saved-data comparison allows absolute tolerance and relative tolerance for platform-dependent last digits. There is no time step or spatial discretization to refine: the matrices are the finite system being tested.
Two deliberate mistakes give much larger residuals. For the first six-site state:
| Calculation | |
|---|---|
| Correct periodic state | |
| Replace by only | |
| Delete the closing bond only |
The wrong-ratio control keeps the same roots and energy; its predicted energy still occurs in the spectrum. Thus a small nearest-energy discrepancy alone would miss this error. Reversing the ratio while also consistently relabeling the roots would be a different, equivalent convention change; this control deliberately changes only the ratio.
A formal solution can give a zero vector
Section titled “A formal solution can give a zero vector”At , take exactly . The displayed scattering formula gives , and both algebraic equations hold: . But
for every basis state. The code rejects its zero norm instead of pretending to normalize it. It also rejects the undefined ratio at . Other singular limits may require separate limiting constructions; these tests do not classify them.
There are also physical states outside the selected branch. The script independently constructs in the tensor basis. After normalization it is the uniform two-down-spin state, and its energy is zero. Every bond annihilates this uniform vector because swapping neighboring spins leaves it unchanged. This is a descendant of the ferromagnetic vacuum, not one of the selected nonzero-momentum root pairs.
Two tested six-site states cannot span a 15-dimensional sector. Neither the selected real roots, the descendant check, nor small residuals establish completeness. Other total momenta, complex roots, and singular constructions remain outside this project’s enumeration.
Exercises
Section titled “Exercises”
Guided practice: normalize before testing
Section titled “Guided practice: normalize before testing”For and , form the coefficients for all . Verify the raw squared norm by the separation sum above, normalize, and calculate the Bethe residual and . Then retain the same energy and roots but replace only by its inverse. Explain why the nearest diagonalized energy does not diagnose this mistake while does.
Independent practice: another state and another size
Section titled “Independent practice: another state and another size”Without copying the first state’s energy, repeat the reconstruction for , . Then use , and predict its energy and raw squared norm before reading the saved results. Explain which of the following you have established: an eigenstate at each tested size, every state in those sectors, or a thermodynamic-limit result.
Changed setting: cut the ring
Section titled “Changed setting: cut the ring”For the first six-site state, remove only the bond between sites and , keeping the same normalized wavefunction and predicted energy. Identify the new operator , relate its residual to the removed bond, and reproduce the negative-control value. Does that residual mean that the open Hamiltonian is non-Hermitian or that every open-chain model is nonintegrable? State what would need to change in a valid open-boundary Bethe calculation.
Normalization and orientation. There are ordered pairs with separation . Use absolute squares for complex coefficients. The wrong ratio changes the vector but not the energy formula evaluated at the original roots.
Other cases. Evaluate separately for each angle. For the selected regular branch, the finite separation sum gives raw squared norm .
Open boundary. Write . Start from the exact periodic equation before considering floating-point error.
Solutions and checks
Section titled “Solutions and checks”
Normalization and orientation
Section titled “Normalization and orientation”The separation sum is and the normalized state uses . The energy is . The saved Bethe-equation residual is , and the larger of the two Hamiltonian residuals is .
With only the ratio inverted, the dimensionless Hamiltonian residual becomes about and the algebraic Bethe residual about . The energy number is unchanged, so it is still within roundoff of an eigenvalue. The reconstructed vector, however, fails the contact and ring conditions in the retained convention. An energy match checks a scalar; an eigenstate residual checks every basis component.
Other cases
Section titled “Other cases”For the second six-site state,
Its larger dimensionless Hamiltonian residual is . For and , and the raw squared norm is . The code verifies the corresponding state with the same independent constructions and residual threshold.
These are checks of particular finite-size eigenstates. The two-magnon sectors have dimensions and , respectively, and the chosen branch supplies only a subset. Varying a few small chain lengths neither enumerates those sectors nor controls an limit.
Open boundary
Section titled “Open boundary”The missing bond gives
For the exact periodic eigenvector,
Its dimensionless residual is about , agreeing with the implemented missing-bond control. The changed Hamiltonian remains Hermitian and preserves the number of down spins. The failed test says that this periodic state and energy do not solve that changed boundary problem.
A valid open-boundary construction must satisfy the endpoint equations and account for reflected waves with the appropriate quantization conditions. The periodic seam equations cannot simply be retained after deleting a bond. No general nonintegrability conclusion follows from this mismatch.
Interpret the result
Section titled “Interpret the result”A successful project result includes the fixed convention, a nonzero normalized state, residual definitions, agreement between independent Hamiltonians, and controls that detect meaningful mistakes. Here those checks support the stated finite eigenpairs. They do not substitute for the analytic contact derivation, prove Bethe completeness, or establish the full commuting-transfer-matrix structure.
Return to the XXX sequence to connect the calculation with the model and derivation. For extensions, preserve the original inputs and state exactly which boundary, root family, or observable has changed.
The singular-state reproduction develops a different finite-chain test: a root pair can solve cleared Bethe equations while its unregularized vector vanishes. The Research benchmark separates a physical pair with a delicate limit from a formally similar pair rejected by translation symmetry.
References
Section titled “References”- Karbach, Michael, and Gerhard Müller. “Introduction to the Bethe ansatz I.” Computers in Physics 11 (1997), pp. 36–43. DOI. Author version arXiv:cond-mat/9809162v1, submitted 1998. Open PDF, with printed pages 1–8.