Three-site Toda: equations, invariants & evolution
Can a computation follow the open Toda chain accurately while respecting its conserved quantities? In this project you construct a three-particle trajectory, compare a time-stepping method with an independent exact representation, and measure convergence. You will compare the trajectory error with the drift in the conserved quantities over the same time interval.
Required background. Be able to derive the endpoint forces, construct the Toda Lax pair, calculate its spectral invariants, and check involution and independence. The last capability explains which analytic claims a numerical experiment cannot replace. You need elementary Python to modify the supplied experiment; its mathematical checks can also be worked by hand.
The open Toda learning sequence connects these preparations.
An open chain with three particles
Section titled “An open chain with three particles”Use the dimensionless open Toda model on , with canonical brackets and Hamiltonian
There are two bonds, no periodic closing bond, and no forces from external endpoints. Set
The time interval for the experiment is . Positions need not remain ordered: these real canonical coordinates are not subject to a hard-core constraint.
Before writing a loop, check the initial derivatives and invariants. They must give
The Lax matrix has diagonal and adjacent entries . Thus
For , monitor
Initially . If your initial values differ, repair the Hamiltonian normalization, endpoint forces, or matrix entries before integrating. The spectral-invariants lesson supplies the trace calculation.
Advance the trajectory with velocity Verlet
Section titled “Advance the trajectory with velocity Verlet”For a step size , first apply half a momentum kick, then a full position drift, then the remaining kick:
Recalculate the force at the new position in the last line. This is the separable-Hamiltonian form of the second-order symplectic Störmer–Verlet method. Symplecticity does not mean exact conservation of this Hamiltonian at finite ; measure its drift. See Hairer 2010, Lecture 2, §1, Theorem 2, p. 2, PDF.
The essential implementation is short:
def force(q): e = np.exp(q[:-1] - q[1:]) return np.r_[0.0, e] - np.r_[e, 0.0]
p_half = p + 0.5 * h * force(q)q_new = q + h * p_halfp_new = p_half + 0.5 * h * force(q_new)Because the components of sum to zero, each kick preserves total momentum in exact arithmetic. This is a useful check, but a wrong implementation with equal and opposite bond forces might also preserve momentum.
Compare with an independent reference
Section titled “Compare with an independent reference”A closed form for the symmetric initial data
Section titled “A closed form for the symmetric initial data”Uniqueness and reflection symmetry preserve and . The equations reduce to , , and energy conservation becomes . Define
This gives , , , and
It therefore solves the original initial-value problem, rather than merely matching the energy. It is also an independent reference: evaluating these hyperbolic functions uses neither the force routine nor a matrix eigensolver.
The reference trajectory has the following values. The remaining components are , , and .
| Time | Position | Momentum |
|---|---|---|
| 0 | 0.000000 | 1.000000 |
| 1 | 0.362695 | −0.354407 |
| 2 | −0.576350 | −1.369711 |
| 4 | −3.826786 | −1.719430 |
| 6 | −7.283816 | −1.731654 |
Both signed bond differences equal . All three positions coincide at , and the two outer sites initially move apart while both bond energies increase. At the turning time
the outer momenta vanish and . The sites reverse, pass through their common starting position at , and continue with . The center stays at rest throughout. A numerical trajectory can respect that symmetry while missing the turning time.
The first two time units show the reversal before the long outgoing part of the trajectory.
Exact dimensionless site positions for the symmetric initial state. The solid and dashed curves turn at the circle and square at , then recross the dotted center line together at . Position and time use linear scales.
A QR reference that also works without symmetry
Section titled “A QR reference that also works without symmetry”At each requested time, factor
where is orthogonal and is upper triangular. Then evaluate
Bloch and Karp give the factorization for the general symmetric matrix flow on p. 2. Apply it with . To compare with their positive-bond matrix for the particle chain on pp. 1–2, also conjugate by the diagonal matrix with . This reverses the signs of the bonds, giving with the same diagonal entries. Conjugating both QR factors by preserves orthogonality and the positive diagonal of . The code evaluates the matrix exponential directly from the initial symmetric eigendecomposition. Bloch and Karp, §1, equation (1.1) and the QR formula following (1.3), PDF.
The sign can be checked directly. Set . Differentiating the factorization gives
Since the second term is upper triangular, ; skew symmetry gives , where our has upper entries . Hence . The identity preserves the upper Hessenberg form; combined with symmetry this preserves tridiagonality. The adjacent entries remain positive under their Toda evolution.
Read from the diagonal and recover . The matrix does not record a common shift of all positions. Restore it using
The QR formula is exact mathematically; its evaluation here uses floating-point arithmetic. At very long times the exponential becomes ill-conditioned, so this implementation is only checked over the stated short interval and the nearby points used for derivative checks.
Reproduce the experiment
Section titled “Reproduce the experiment”Download and extract the complete Toda experiment (ZIP), then open its toda folder. The computation notes explain every norm, tolerance, and regeneration command. Individual files are also available: Python experiment, inputs, saved results, and requirements.
The recorded run used Python 3.9.6, NumPy 2.0.2, and IEEE 754 binary64 arithmetic. Use Python 3.9–3.12 for the supplied pinned environment. In the download directory, use a virtual environment:
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 in place of .venv/bin/python. In a repository checkout with NumPy already installed, the equivalent check is:
python3 public/computations/toda/experiment.py --checkThe check recomputes the trajectories and compares them with the saved evidence; it does not rewrite the files. The last floating-point digits may vary across platforms. Use --write only when intentionally regenerating the saved results after an explained change.
The inputs also include a second case:
Its three initial invariants are, in order, 0.5, 2.6640413167 and 0.4562190387. The unequal bonds and nonzero cubic invariant expose mistakes that the first case’s symmetry can hide. Both cases use steps of 0.08, 0.04, 0.02 and 0.01 up to final time six.
Measure error and convergence
Section titled “Measure error and convergence”Let collect the three positions followed by the three momenta. Measure the maximum component error over every integration point in a run.
All components are dimensionless. Use absolute invariant drift , since dividing by or is meaningless in the symmetric case. Compare eigenvalues in ascending order.
The recomputed trajectory errors are:
| Step | Symmetric | Asymmetric |
|---|---|---|
| 0.08 | ||
| 0.04 | ||
| 0.02 | ||
| 0.01 |
For a second-order method, predicts a fourfold decrease in error when the step halves. The observed order is the base-two logarithm of the ratio of successive errors. It goes from to for the symmetric case and from to for the asymmetric case. The plot makes that shared rate visible.
Maximum absolute error in all six position and momentum components against the QR reference over , for the two initial conditions above. Both axes are logarithmic and dimensionless. Filled circles and a solid line denote the symmetric case; hollow squares and a dashed line denote the asymmetric case. These are computed values, not a schematic or a rigorous error bound.
At , the symmetric run has maximum energy drift and maximum eigenvalue drift . Its computed cubic drift is zero by symmetry. In the asymmetric run, the energy, cubic, and eigenvalue drifts are respectively , , and . Total-momentum drift stays below in all runs.
The saved run also checks the reference itself. Across its primary grids, QR and the hyperbolic closed form differ by less than . A fourth-order centered derivative of the QR trajectory is compared with at . With derivative spacing , the saved maximum component residual is about for symmetric data and for asymmetric data. The derivative stencil divides differences of floating-point states by its spacing, so the smallest residuals can vary across numerical libraries. Results at spacing are also retained. These residuals test the differentiated reference, while measures the Verlet trajectory error.
Exercises
Section titled “Exercises”Guided task: check a force and a matrix entry
Section titled “Guided task: check a force and a matrix entry”Write the middle force as . Complete the expression, then derive and compute . Explain how these two entries test different signs or factors. Finally, show that both Verlet kicks preserve without assuming symmetric initial data.
Independent task: assess a numerical claim
Section titled “Independent task: assess a numerical claim”Run the experiment and produce a table of , maximum energy drift, and maximum cubic drift for both inputs. Report the norm, precision, final time, and observed orders. Explain why the primary case’s zero cubic drift is weak evidence. Then consider a curve , with its momentum components left unchanged: do its conserved quantities detect that it follows the flow in the wrong time direction?
Transfer task: shift and boost the chain
Section titled “Transfer task: shift and boost the chain”Choose and . From either original exact solution form
Derive the transformed initial conditions, momentum, energy, cubic invariant, and Lax eigenvalues. Predict whether the QR reconstruction will recover the boost if its mean-position formula is incorrectly replaced by . Test your prediction using copied experiment files so the supplied baseline remains available.
For the symmetric primary data, compare the reconstructed absolute positions at and . Which time would conceal the error in a single photograph? Give one velocity measurement that would still reveal it. Hint and solution
Hints and solutions
Section titled “Hints and solutions”Force, matrix, and momentum checks
Section titled “Force, matrix, and momentum checks”Hint. Differentiate the bond exponential before substituting the symmetric data. For the matrix diagonal, retain both products in the commutator.
The missing term is . The chain rule and the first diagonal commutator entry give
The off-diagonal calculation tests the chain-rule factor ; the diagonal calculation tests the force direction and the sum of the two products. Since , each kick changes by zero. The drift step changes no momenta. Floating-point cancellation is the only source of momentum error in this implementation of those steps.
What the numerical evidence establishes
Section titled “What the numerical evidence establishes”Hint. Inspect the reduced symmetric form before interpreting . A conserved value does not select a direction along a trajectory.
The energy and trajectory errors decrease under refinement as shown above. For and , the two cubic powers and the two bond contributions cancel separately. Preserving this symmetry can therefore keep exactly zero while the trajectory is inaccurate. The nonsymmetric run provides the missing nonzero test.
For , every invariant of remains constant, but instead of , where . At in the primary case, the maximum component residual against the required equation is . Checking the differential equations and comparing an independent trajectory catches the reversal immediately. This curve is distinct from the valid time-reversal transformation that also negates the momenta.
Over the tested interval the trajectory error decreases at second order as the step shrinks. The three-particle integrability argument proves involution and functional independence of the integrals.
Shift and boost
Section titled “Shift and boost”Hint
Position differences are unchanged, and adding to every momentum adds times the identity matrix to . Write the mean position and its derivative before choosing your observation time.
Solution and observation-time check
The new initial data are and . Because the force depends only on position differences, the transformed variables satisfy the same equations. Expanding the traces of gives
For the primary initial data this gives . The mean position is . Setting it to zero leaves every bond and Lax entry correct, but the reconstructed absolute positions differ from the required ones by per particle. At the two sets of positions coincide. At each reconstructed position is too small by . Successive photographs give another check. The faulty reconstruction has mean velocity zero, while the momenta from its own Lax diagonal require .
The supplied shift_boost_check function compares the transformed QR solution with the shifted and boosted hyperbolic solution. Inspect its residuals in the saved results. When modifying the primary input, adapt its closed-form reference too.
Return to the open Toda sequence with your convergence table and explanations. You have completed the project when you can reproduce the trajectory, diagnose both symmetry and position-shift blind spots, and distinguish its numerical evidence from the analytic integrability proof.
Carry the same open-chain convention into the perturbed Toda experiment. There the trajectory still conserves its full energy while an unperturbed cubic charge changes even after time-step refinement.
References
Section titled “References”- Bloch, Anthony M., and Steven N. Karp. “Symmetric Toda, gradient flows, and tridiagonalization.” arXiv:2304.10697v1 [nlin.SI], 2023. Version record; PDF. The QR representation and its symmetric matrix convention appear on pp. 1–2.
- Hairer, Ernst. Geometric Numerical Integration, Lecture 2: Symplectic integrators. TU München, January–February 2010. Author-hosted PDF. See §1, Theorem 2, p. 2 for Störmer–Verlet.
Connected readings
- Builds on
- Related records