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. The result is a reproducible finite-time experiment, together with an explanation of why a small conservation error alone does not establish an accurate solution or prove integrability.
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 |
The outer particles first approach, turn, and then separate. The central particle stays at rest by symmetry. A nonzero numerical error can coexist with exact cancellation of both and , so this trajectory alone is insufficient for testing those diagnostics.
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
This factorization solution is discussed in Bloch and Karp 2023, pp. 1–2, arXiv v1 PDF. Their general symmetric matrix variable gives the negative sign and factor used here. The code evaluates the exponential from the symmetric eigendecomposition of ; it does not advance an ODE in time.
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 initial invariants are approximately . The unequal bonds and nonzero cubic invariant expose mistakes that the first case’s symmetry can hide. Both cases use and final time .
Measure error and convergence
Section titled “Measure error and convergence”Let and define 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, gives . The measured orders approach : from to in the symmetric case and from to in 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 reference is checked separately. Across the 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 largest component residual is about for symmetric data and for asymmetric data. Results at spacing are also retained. These derivative residuals and reference discrepancies are distinct from the Verlet discretization 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.
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.
The calculations support the stated finite-time accuracy and second-order refinement of the implemented scheme. They do not prove involution, functional independence, or an all-time numerical error bound. The analytic three-particle integrability argument supplies the separate mathematical result.
Shift and boost
Section titled “Shift and boost”Hint. Position differences are unchanged, and adding to every momentum adds times the identity matrix to .
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 would leave the reconstructed differences and Lax matrix correct while shifting every position by relative to the required solution. This is another failure invisible to the spectral invariants. 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.
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.