Theoremadvanced
Shadow Hamiltonian theorem
Also called modified Hamiltonian of a symplectic integrator.
For a symplectic method with a small step h on an analytic Hamiltonian, a modified energy near H is conserved to within e^(-c/h) over times exponentially long in 1/h.
The shadow Hamiltonian theorem explains why the energy of a molecular dynamics run with the Verlet method does not drift. It has three hypotheses: the method is symplectic, the Hamiltonian is analytic, and the step is small. Then there is a modified Hamiltonian , close to , such that the numerical solution conserves up to an error of size in each step. As long as the solution stays in a bounded region, itself then oscillates in a band of width for times exponentially long in . The theorem is a result of backward error analysis: the method is the exact flow of a nearby system, up to that tiny error. Backward error analysis gives a modified equation for any method; the special fact for symplectic methods is that the modified equation is again Hamiltonian. The theorem is about energy, not about integrators: it says when a method such as RATTLE or RESPA keeps a good energy, and when it does not.
Statement
Setting. Let be a real analytic Hamiltonian on an open set , and the Hamiltonian system. Let be a one-step method of order that is symplectic, and whose map is analytic in and ; the Störmer-Verlet method is an example, with . Let be compact.
Theorem (Benettin and Giorgilli, 1994; Hairer, Lubich and Wanner, Theorem IX.8.1). There are , and, for each , an analytic function , with of order , such that for
So if the numerical solution stays in , then
Exact case. For the harmonic oscillator and the velocity Verlet method with , the quadratic form is conserved exactly by every step.
In plain words
A simulation of moving atoms makes a small error at every step, so you would expect the total energy to wander away over a long run. With the most common method it does not. The energy wobbles a little, but its average stays the same for millions of steps.
The reason is that the method follows the laws of motion of a slightly different system almost perfectly. That other system has its own energy, very close to the true one, and the simulation keeps it almost exactly. The true energy can then only move by the small difference between the two, so it wobbles but cannot drift.
This needs three things: a method of the right kind, smooth forces, and a step that is small against the fastest motion. Without any one of them, a slow drift can come back.
Proof
The exact case. One velocity Verlet step for is , , . In terms of , the two points satisfy and . Write . Then
The difference is , since . So is conserved. For , , so the level sets of are ellipses and the solution is bounded.
The modified equation is Hamiltonian. Backward error analysis gives, for any method of order with smooth coefficients, vector fields such that the flow of the truncated modified equation satisfies . We show by induction that each on a simply connected domain. Suppose that are Hamiltonian. Then is the flow of a Hamiltonian system, so it is symplectic. The next term is defined by , so
Insert this into the symplecticity conditions and , and use . The terms of order give , which says that the Jacobian of is symmetric. By the Poincaré lemma, for a function on a simply connected domain. So every truncation is a Hamiltonian system with the Hamiltonian , and its flow conserves exactly.
The exponential estimate. This step is cited, not proved here. For analytic and an analytic method, Cauchy estimates bound the functions on a slightly smaller domain by a constant times times a power. Choosing of order , which is near the smallest term of the series, gives
This is the theorem of Benettin and Giorgilli (1994), and Section IX.7 of Hairer, Lubich and Wanner gives it in this form.
The energy statement. The flow conserves , so
and is bounded on a neighbourhood of , so this difference is at most . Summing over steps that stay in gives . On , , because the terms are bounded and . For , the sum is at most , which is smaller than for small , and so .
The exact case and the Hamiltonian form of the modified equation are proved here in full. The exponential estimate is the cited part.
Consequences
- The exact case by hand. With and the start , one step gives and . Then before and after, while falls from to . In general , so moves in the band for all time.
- The second-order term. For velocity Verlet and in one dimension, the first correction is . For the pendulum from , , run to the time 200, the largest error in is , and for , which is order 2. The error in is , and , which is order 4 (a measurement).
- No drift in practice. The same pendulum with for steps has the largest energy error in the first steps and the same value in the last . The explicit midpoint method, of the same order but not symplectic, has the error in the first steps, and by the end the pendulum has gained so much energy that it turns over the top, with the error (a measurement).
- Constrained and split methods. RATTLE is symplectic on the constraint manifold, and RESPA is a composition of exact Hamiltonian flows, so both have a modified Hamiltonian when is small against every time scale of the system.
- Forces must be gradients. Smooth particle mesh Ewald gives forces that are the gradient of an energy, so the theorem can apply. Plain particle mesh Ewald does not, and its runs can drift.
- Monitoring. A computed approximation of moves much less than , so its drift shows errors such as a loose constraint tolerance that the noise of would hide (Engle, Skeel and Drees, 2005).
- Hamiltonian Monte Carlo. In HMC, the acceptance rate depends on the change of along a Verlet trajectory. Because the change is and does not grow with the length of the trajectory, long trajectories keep a good acceptance rate.
Tightness
- The step must be small. For the harmonic oscillator, degenerates as , and for velocity Verlet is unstable. In molecular dynamics, the fastest motion sets the limit, and RESPA with an outer step near half a fast period shows resonant growth, even though each step is symplectic.
- Analyticity. A force with a cutoff, a switch that is only a few times differentiable, or a table with linear interpolation is not analytic. Then only a finite number of terms of the modified Hamiltonian exist, and the available estimates hold only over times that grow like a power of . A force that jumps at the cutoff gives energy errors at each crossing, and these add up to a drift.
- Rounding. In floating point, every step adds rounding errors of size about the unit roundoff times . If they behave like independent random errors, performs a random walk whose spread grows like the square root of the number of steps, a heuristic estimate.
- The method must be symplectic and the step fixed. Changing from step to step, or using a method that is only accurate, breaks the argument, and the energy then drifts as in the midpoint example. Thermostats and stochastic methods change the dynamics, and the theorem is not about them.
- The error term cannot be removed. The series for diverges in general, so no method other than an exact solver conserves a modified energy exactly, except in special cases such as linear systems.
- The region. The constants depend on the compact set . A trajectory that leaves every compact set, or comes close to a singularity of , such as two atoms that overlap, is not covered.
History
Toxvaerd (1994) showed in a molecular dynamics setting that the discrete Verlet dynamics has a conserved Hamiltonian close to the true one. In the same year, Benettin and Giorgilli (1994) proved that a symplectic map close to the identity is the time- map of a Hamiltonian flow up to an exponentially small error, and applied this to symplectic integrators. Reich (1999) and Hairer, Lubich and Wanner developed backward error analysis for structure-preserving methods, and their book gives the long-time energy result as Theorem IX.8.1. Skeel and Hardy (2001) and Engle, Skeel and Drees (2005) gave practical ways to compute shadow Hamiltonians and to use them to measure drift in simulations.
References
- Giancarlo Benettin and Antonio Giorgilli, On the Hamiltonian interpolation of near-to-the-identity symplectic mappings with application to symplectic integration algorithms, Journal of Statistical Physics 74(5-6), 1994, 1117-1143, the exponentially small error of the interpolating Hamiltonian
- Sebastian Reich, Backward error analysis for numerical integrators, SIAM Journal on Numerical Analysis 36(5), 1999, 1549-1570, modified equations that keep the geometric structure, with exponential estimates
- Ernst Hairer, Christian Lubich and Gerhard Wanner, Geometric Numerical Integration, second edition, Springer, 2006, Section IX.3 (modified equations of symplectic methods), Section IX.7 (exponentially small error estimates) and Theorem IX.8.1 (long-time energy conservation)
- Ernst Hairer, Christian Lubich and Gerhard Wanner, Geometric numerical integration illustrated by the Störmer-Verlet method, Acta Numerica 12, 2003, 399-450, the modified Hamiltonian of the Störmer-Verlet method and its long-time energy behaviour
- Søren Toxvaerd, Hamiltonians for discrete dynamics, Physical Review E 50(3), 1994, 2271-2274, the conserved Hamiltonian of the discrete Verlet dynamics in molecular dynamics
- Robert D. Engle, Robert D. Skeel and Matthew Drees, Monitoring energy drift with shadow Hamiltonians, Journal of Computational Physics 206(2), 2005, 432-452, the use of computed shadow Hamiltonians to measure drift in molecular dynamics
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag VGNNE7 Edit this page History Report an error Markdown