Skip to content

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.

Use the dimensionless open Toda model on (q,p)∈R6(q,p)\in\mathbb R^6, with canonical brackets {qi,pj}=δij\{q_i,p_j\}=\delta_{ij} and Hamiltonian

H=12(p12+p22+p32)+eq1−q2+eq2−q3.H=\frac12(p_1^2+p_2^2+p_3^2) +e^{q_1-q_2}+e^{q_2-q_3}.

There are two bonds, no periodic closing bond, and no forces from external endpoints. Set

q(0)=(0,0,0),p(0)=(1,0,−1),q˙=p,p˙=F(q),F(q)=(−e1,e1−e2,e2),e1=eq1−q2,e2=eq2−q3.\begin{aligned} q(0)&=(0,0,0),& p(0)&=(1,0,-1),\\ \dot q&=p,& \dot p&=F(q),\\ F(q)&=(-e_1,e_1-e_2,e_2),& e_1&=e^{q_1-q_2},\quad e_2=e^{q_2-q_3}. \end{aligned}

The time interval for the experiment is 0≤t≤60\leq t\leq6. 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

q˙(0)=(1,0,−1),p˙(0)=(−1,0,1).\dot q(0)=(1,0,-1),\qquad \dot p(0)=(-1,0,1).

The Lax matrix has diagonal pip_i and adjacent entries ai=e(qi−qi+1)/2a_i=e^{(q_i-q_{i+1})/2}. Thus

L(0)=(11010101−1),spec⁡L(0)={−3,0,3}.L(0)=\begin{pmatrix}1&1&0\\1&0&1\\0&1&-1\end{pmatrix}, \qquad \operatorname{spec}L(0)=\{-\sqrt3,0,\sqrt3\}.

For Ik=tr⁡(Lk)/kI_k=\operatorname{tr}(L^k)/k, monitor

P=I1=p1+p2+p3,I2=H,I3=13(p13+p23+p33)+(p1+p2)e1+(p2+p3)e2.\begin{aligned} P=I_1&=p_1+p_2+p_3,\qquad I_2=H,\\ I_3&=\frac13(p_1^3+p_2^3+p_3^3) +(p_1+p_2)e_1+(p_2+p_3)e_2. \end{aligned}

Initially (P,H,I3)=(0,3,0)(P,H,I_3)=(0,3,0). 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 hh, first apply half a momentum kick, then a full position drift, then the remaining kick:

pn+1/2=pn+h2F(qn),qn+1=qn+hpn+1/2,pn+1=pn+1/2+h2F(qn+1).\begin{aligned} p^{n+1/2}&=p^n+\frac h2 F(q^n),\\ q^{n+1}&=q^n+h p^{n+1/2},\\ p^{n+1}&=p^{n+1/2}+\frac h2 F(q^{n+1}). \end{aligned}

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 hh; 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_half
p_new = p_half + 0.5 * h * force(q_new)

Because the components of FF 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.

A closed form for the symmetric initial data

Section titled “A closed form for the symmetric initial data”

Uniqueness and reflection symmetry preserve q=(x,0,−x)q=(x,0,-x) and p=(v,0,−v)p=(v,0,-v). The equations reduce to x˙=v\dot x=v, v˙=−ex\dot v=-e^x, and energy conservation becomes v2+2ex=3v^2+2e^x=3. Define

s(t)=32t−artanh⁡13,x(t)=log⁡32−2log⁡cosh⁡s(t),v(t)=−3tanh⁡s(t).\begin{aligned} s(t)&=\frac{\sqrt3}{2}t-\operatorname{artanh}\frac1{\sqrt3},\\ x(t)&=\log\frac32-2\log\cosh s(t),\\ v(t)&=-\sqrt3\tanh s(t). \end{aligned}

This gives x(0)=0x(0)=0, v(0)=1v(0)=1, x˙=v\dot x=v, and

v˙=−32sech⁡2s=−ex.\dot v=-\frac32\operatorname{sech}^2s=-e^x.

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 q2=p2=0q_2=p_2=0, q3=−xq_3=-x, and p3=−vp_3=-v.

Time ttPosition x(t)x(t)Momentum v(t)v(t)
00.0000001.000000
10.362695−0.354407
2−0.576350−1.369711
4−3.826786−1.719430
6−7.283816−1.731654

Both signed bond differences equal xx. All three positions coincide at t=0t=0, and the two outer sites initially move apart while both bond energies exe^x increase. At the turning time

t∗=23artanh⁡13≃0.760346t_*=\frac{2}{\sqrt3}\operatorname{artanh}\frac{1}{\sqrt3} \simeq 0.760346

the outer momenta vanish and x=log⁡(3/2)x=\log(3/2). The sites reverse, pass through their common starting position at 2t∗2t_*, and continue with q1<q2<q3q_1\lt q_2\lt q_3. 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.

The two end positions leave zero in opposite directions, reverse at opposite extrema, and cross the stationary center at time 1.52.

Exact dimensionless site positions for the symmetric initial state. The solid and dashed curves turn at the circle and square at t∗t_*, then recross the dotted center line together at 2t∗2t_*. 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

e−tL(0)/2=Q(t)R(t),Rii(t)>0,e^{-tL(0)/2}=Q(t)R(t),\qquad R_{ii}(t)\gt0,

where QQ is orthogonal and RR is upper triangular. Then evaluate

L(t)=Q(t)TL(0)Q(t).L(t)=Q(t)^{\mathsf T}L(0)Q(t).

Bloch and Karp give the factorization for the general symmetric matrix flow on p. 2. Apply it with M=−L/2M=-L/2. To compare with their positive-bond matrix for the particle chain on pp. 1–2, also conjugate by the diagonal matrix DD with Dii=(−1)i−1D_{ii}=(-1)^{i-1}. This reverses the signs of the bonds, giving −DLD/2-DLD/2 with the same diagonal entries. Conjugating both QR factors by DD preserves orthogonality and the positive diagonal of RR. 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 K=QTQ˙K=Q^{\mathsf T}\dot Q. Differentiating the factorization gives

−12L=K+R˙R−1.-\frac12 L=K+\dot R R^{-1}.

Since the second term is upper triangular, Ki+1,i=−ai/2K_{i+1,i}=-a_i/2; skew symmetry gives K=−BK=-B, where our BB has upper entries −ai/2-a_i/2. Hence L˙=[L,K]=[B,L]\dot L=[L,K]=[B,L]. The identity L=RL(0)R−1L=RL(0)R^{-1} preserves the upper Hessenberg form; combined with symmetry this preserves tridiagonality. The adjacent entries remain positive under their Toda evolution.

Read pip_i from the diagonal and recover qi−qi+1=2log⁡aiq_i-q_{i+1}=2\log a_i. The matrix does not record a common shift of all positions. Restore it using

q‾(t)=q‾(0)+P3t,q‾=q1+q2+q33.\overline q(t)=\overline q(0)+\frac{P}{3}t, \qquad \overline q=\frac{q_1+q_2+q_3}{3}.

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.

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:

Terminal window
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python experiment.py --check

On Windows, use .venv\Scripts\python.exe in place of .venv/bin/python. In a repository checkout with NumPy already installed, the equivalent check is:

Terminal window
python3 public/computations/toda/experiment.py --check

The 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:

q(0)=(0.2,−0.3,0.1),p(0)=(0.7,−0.4,0.2).q(0)=(0.2,-0.3,0.1),\qquad p(0)=(0.7,-0.4,0.2).

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.

Let yy collect the three positions followed by the three momenta. Measure the maximum component error over every integration point in a run.

E(h)=max⁡0≤nh≤6  max⁡1≤j≤6∣yjn−yjQR(nh)∣.E(h)=\max_{0\leq nh\leq6}\; \max_{1\leq j\leq6} \left|y_j^n-y_j^{\mathrm{QR}}(nh)\right|.

All components are dimensionless. Use absolute invariant drift max⁡n∣Ikn−Ik0∣\max_n|I_k^n-I_k^0|, since dividing by P(0)P(0) or I3(0)I_3(0) is meaningless in the symmetric case. Compare eigenvalues in ascending order.

The recomputed trajectory errors are:

Step hhSymmetric E(h)E(h)Asymmetric E(h)E(h)
0.081.240060×10−31.240060\times10^{-3}8.387314×10−48.387314\times10^{-4}
0.043.095107×10−43.095107\times10^{-4}2.084751×10−42.084751\times10^{-4}
0.027.734624×10−57.734624\times10^{-5}5.204395×10−55.204395\times10^{-5}
0.011.933460×10−51.933460\times10^{-5}1.300632×10−51.300632\times10^{-5}

For a second-order method, E(h)≈Ch2E(h)\approx Ch^2 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 2.002352.00235 to 2.000152.00015 for the symmetric case and from 2.008332.00833 to 2.000522.00052 for the asymmetric case. The plot makes that shared rate visible.

Both initial conditions show an approximately fourfold reduction in maximum trajectory error when the Verlet step is halved.

Maximum absolute error in all six position and momentum components against the QR reference over 0≤t≤60\leq t\leq6, 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 h=0.01h=0.01, the symmetric run has maximum energy drift 2.70843×10−52.70843\times10^{-5} and maximum eigenvalue drift 7.81856×10−67.81856\times10^{-6}. Its computed cubic drift is zero by symmetry. In the asymmetric run, the energy, cubic, and eigenvalue drifts are respectively 2.78245×10−52.78245\times10^{-5}, 1.30321×10−51.30321\times10^{-5}, and 1.04651×10−51.04651\times10^{-5}. Total-momentum drift stays below 3.3×10−153.3\times10^{-15} 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 2.9×10−122.9\times10^{-12}. A fourth-order centered derivative of the QR trajectory is compared with (p,F(q))(p,F(q)) at t=0,0.5,1.25,3,6t=0,0.5,1.25,3,6. With derivative spacing 0.0050.005, the saved maximum component residual is about 1.74×10−101.74\times10^{-10} for symmetric data and 1.51×10−91.51\times10^{-9} 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 0.010.01 are also retained. These residuals test the differentiated reference, while E(h)E(h) measures the Verlet trajectory error.

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 F2=eq1−q2−□F_2=e^{q_1-q_2}-\square. Complete the expression, then derive a˙1\dot a_1 and compute [B,L]11[B,L]_{11}. Explain how these two entries test different signs or factors. Finally, show that both Verlet kicks preserve PP 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 E(h)E(h), 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 y~(t)=y(−t)\widetilde y(t)=y(-t), with its momentum components left unchanged: do its conserved quantities detect that it follows the flow in the wrong time direction?

Choose c=0.4c=0.4 and d=−0.2d=-0.2. From either original exact solution form

qi′(t)=qi(t)+d+ct,pi′(t)=pi(t)+c.q_i'(t)=q_i(t)+d+ct,\qquad p_i'(t)=p_i(t)+c.

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 q‾(t)=0\overline q(t)=0. Test your prediction using copied experiment files so the supplied baseline remains available.

For the symmetric primary data, compare the reconstructed absolute positions at t=1/2t=1/2 and t=1t=1. Which time would conceal the error in a single photograph? Give one velocity measurement that would still reveal it. Hint and solution

Hint. Differentiate the bond exponential before substituting the symmetric data. For the matrix diagonal, retain both products in the commutator.

The missing term is eq2−q3e^{q_2-q_3}. The chain rule and the first diagonal commutator entry give

a˙1=12a1(p1−p2),[B,L]11=−12a12−12a12=−a12.\dot a_1=\frac12a_1(p_1-p_2),\qquad [B,L]_{11}=-\frac12a_1^2-\frac12a_1^2=-a_1^2.

The off-diagonal calculation tests the chain-rule factor 1/21/2; the diagonal calculation tests the force direction and the sum of the two products. Since ∑iFi=0\sum_iF_i=0, each kick changes ∑ipi\sum_i p_i by zero. The drift step changes no momenta. Floating-point cancellation is the only source of momentum error in this implementation of those steps.

Hint. Inspect the reduced symmetric form before interpreting I3=0I_3=0. A conserved value does not select a direction along a trajectory.

The energy and trajectory errors decrease under refinement as shown above. For q=(x,0,−x)q=(x,0,-x) and p=(v,0,−v)p=(v,0,-v), the two cubic powers and the two bond contributions cancel separately. Preserving this symmetry can therefore keep I3I_3 exactly zero while the trajectory is inaccurate. The nonsymmetric run provides the missing nonzero test.

For y~(t)=y(−t)\widetilde y(t)=y(-t), every invariant of yy remains constant, but y~˙=−XH(y~)\dot{\widetilde y}=-X_H(\widetilde y) instead of XH(y~)X_H(\widetilde y), where XH=(p,F(q))X_H=(p,F(q)). At t=0t=0 in the primary case, the maximum component residual against the required equation is 22. 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.

Hint

Position differences are unchanged, and adding cc to every momentum adds cc times the identity matrix to LL. Write the mean position and its derivative before choosing your observation time.

Solution and observation-time check

The new initial data are qi′(0)=qi(0)+dq_i'(0)=q_i(0)+d and pi′(0)=pi(0)+cp_i'(0)=p_i(0)+c. Because the force depends only on position differences, the transformed variables satisfy the same equations. Expanding the traces of L′=L+c1L'=L+c\mathbf1 gives

P′=P+3c,H′=H+cP+32c2,I3′=I3+2cH+c2P+c3,λi′=λi+c.\begin{aligned} P'&=P+3c,\\ H'&=H+cP+\frac32c^2,\\ I_3'&=I_3+2cH+c^2P+c^3,\\ \lambda_i'&=\lambda_i+c. \end{aligned}

For the primary initial data this gives (P′,H′,I3′)=(1.2,3.24,2.464)(P',H',I_3')=(1.2,3.24,2.464). The mean position is −0.2+0.4t-0.2+0.4t. Setting it to zero leaves every bond and Lax entry correct, but the reconstructed absolute positions differ from the required ones by 0.2−0.4t0.2-0.4t per particle. At t=1/2t=1/2 the two sets of positions coincide. At t=1t=1 each reconstructed position is too small by 0.20.2. Successive photographs give another check. The faulty reconstruction has mean velocity zero, while the momenta from its own Lax diagonal require q‾˙=P′/3=0.4\dot{\overline q}=P'/3=0.4.

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.

  • 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.