Algorithm Search⌘K

Algorithmadvanced

Reversible reference system propagator algorithm

Also called r-RESPA, multiple time step integrator.

Splits forces into fast and slow parts and integrates the fast part with smaller steps inside a symplectic Trotter splitting.

Time
O(n F + S + n N) worst
Space
O(N) extra
Where
F = the cost of one fast force; N = the number of coordinates; S = the cost of one slow force; n = the number of inner steps per outer step
Properties
deterministicsymplectictime reversible
Origin
Mark Tuckerman, Bruce J. Berne, Glenn J. Martyna, 1992

The reversible reference system propagator algorithm, r-RESPA, is a multiple time step integrator for molecular dynamics. It splits the force into a fast part, such as bond vibrations, which is cheap and changes quickly, and a slow part, such as long-range electrostatics, which is costly and changes slowly. One outer step of size hh gives a half kick with the slow force, then nn velocity Verlet steps of size h/nh/n with the fast force alone, then a second half kick with the slow force. The slow force is computed once per outer step instead of nn times. Each part is the exact flow of a Hamiltonian, so the step is symplectic, time reversible and of order 2. Its limit is resonance: when hh is close to half a period of a fast motion, or as Ma, Izaguirre and Skeel found, even a third of one, the slow kicks pump energy into the fast motion. The shadow Hamiltonian theory explains the good energy behaviour of a symplectic method with a step small against all time scales; RESPA uses an outer step that is not small against the fast ones, which is why the resonance is possible.

In plain words

In a molecule, some forces change very fast and some change slowly. A normal integrator must use a step small enough for the fastest force, and it pays for all forces at every small step. That is a waste, because the slow forces are often the costly ones.

RESPA gives the slow force a big step and the fast force many small steps inside it. It starts with half a push from the slow force, then lets the atoms move under the fast force alone for many small steps, then gives the second half push from the slow force. The pattern is the same backward and forward in time, which keeps the energy from drifting. The big step must not match the rhythm of the fast motion, or the pushes build it up like a swing.

The problem

There are positions xx and velocities vv with inverse masses WW, and the force is split as F=Ffast+FslowF = F_{\text{fast}} + F_{\text{slow}}, where both parts come from potentials, Ffast=−∇UfastF_{\text{fast}} = -\nabla U_{\text{fast}} and Fslow=−∇UslowF_{\text{slow}} = -\nabla U_{\text{slow}}. Given an outer step hh and a number nn of inner steps, find a map Ψh\Psi_h that approximates the flow of H=12vTW−1v+Ufast+UslowH = \frac12 v^{\mathsf T} W^{-1} v + U_{\text{fast}} + U_{\text{slow}} with one evaluation of FslowF_{\text{slow}} per step. The operator form is the Trotter splitting

Ψh=eh2Lslow[eδ2LfasteδLxeδ2Lfast]neh2Lslow,δ=h/n,\Psi_h = e^{\frac{h}{2} L_{\text{slow}}} \bigl[ e^{\frac{\delta}{2} L_{\text{fast}}} e^{\delta L_x} e^{\frac{\delta}{2} L_{\text{fast}}} \bigr]^n e^{\frac{h}{2} L_{\text{slow}}}, \qquad \delta = h / n,

where LslowL_{\text{slow}} and LfastL_{\text{fast}} are the kicks with each force and LxL_x is the free drift.

The algorithm

  1. RESPA-STEP(x, v, W, F_fast, F_slow, h, n)
  2. 1v ← v + (h/2) W F_slow(x) ▷ slow half kick
  3. 2for k ← 1 to n do ▷ δ = h / n
  4. 3v ← v + (δ/2) W F_fast(x)
  5. 4x ← x + δ v
  6. 5v ← v + (δ/2) W F_fast(x)
  7. 6v ← v + (h/2) W F_slow(x) ▷ slow half kick
  8. 7return (x, v)

The fast force at the end of one inner step is the one at the start of the next, so one call per inner step is enough. The slow force at the end of an outer step is the one at the start of the next. More levels are possible: the fast loop can itself be a RESPA step with a faster force inside.

Example

Take one particle of mass 1 with a fast spring Ffast=−Ω2xF_{\text{fast}} = -\Omega^2 x, Ω=10\Omega = 10, so the fast period is 0.6280.628, and a slow pendulum force Fslow=−sin⁡xF_{\text{slow}} = -\sin x. Start at x=1x = 1, v=0v = 0, with the energy H=50.4597H = 50.4597, and run to the time 20. The largest energy error over the run:

method slow force calls fast force calls largest energy error
Verlet, h=0.1h = 0.1 200 200 12.72
RESPA, h=0.1h = 0.1, n=10n = 10 200 2000 0.293
RESPA, h=0.05h = 0.05, n=10n = 10 400 4000 0.0707
Verlet, h=0.01h = 0.01 2000 2000 0.127

RESPA with ten inner steps cuts the error of Verlet with the large step by a factor of 43 at the same number of slow force calls. Halving the outer step divides the error by 4.1, the second order. Verlet with the small step is more accurate, but it calls the slow force ten times as often.

Resonance. Replace the slow force by −κx-\kappa x with κ=1\kappa = 1, and use n=200n = 200 inner steps. The one-step map is linear with determinant 1, so it is stable only when the absolute value of its trace is below 2. The trace from the code agrees to 3×10−53 \times 10^{-5} with the formula 2cos⁡(Ωh)−κhsin⁡(Ωh)/Ω2 \cos(\Omega h) - \kappa h \sin(\Omega h) / \Omega:

outer step hh trace
0.1 1.0722
0.2 -0.8505
0.25 -1.6173
0.3 -1.9842
(π−0.015)/10=0.31266(\pi - 0.015)/10 = 0.31266 -2.00024

The last step is just below half the fast period, and the map is unstable there: after 3000 steps the amplitude has grown by a factor of about 3×10193 \times 10^{19}. The same total force with a third of that step is stable.

Correctness

The proof below shows these claims:

  1. The step is the composition of the slow half kick, nn velocity Verlet steps with the fast force, and the slow half kick, the Trotter splitting above.
  2. Special cases. With n=1n = 1 it is velocity Verlet with the full force. With no slow force it is nn Verlet steps of size h/nh/n.
  3. Symplectic. Each part is the exact flow of a Hamiltonian, and a composition of symplectic maps is symplectic.
  4. Time reversible. The composition is a palindrome, so reversing the velocities and taking one step returns to the start.
  5. Order 2, because a symmetric method has even order.
  6. Resonance in a linear model. With the inner loop replaced by its exact limit, the trace of the step is 2cos⁡(Ωh)−κhsin⁡(Ωh)/Ω2 \cos(\Omega h) - \kappa h \sin(\Omega h) / \Omega, and there are unstable steps just below π/Ω\pi / \Omega for every κ>0\kappa > 0. This is a theorem for the model; the limit of about a third of the fast period found by Ma, Izaguirre and Skeel (2003) for nonlinear systems is a measurement.

The tests check both special cases, reversibility to 10−1010^{-10}, the preserved area to 10−610^{-6}, the second order of the energy error, and the resonance.

Proof: r-RESPA is a symmetric composition of exact Hamiltonian flows, so it is symplectic, reversible and of order 2, and it is unstable near half a fast periodfull

We use the line numbers of the pseudocode. The state is (x,v)(x, v), WW is the diagonal matrix of inverse masses, and the force is F=Ffast+FslowF = F_{\text{fast}} + F_{\text{slow}} with Ffast=−∇UfastF_{\text{fast}} = -\nabla U_{\text{fast}} and Fslow=−∇UslowF_{\text{slow}} = -\nabla U_{\text{slow}}. Define three maps for a time tt:

Kts(x,v)=(x,v+tWFslow(x)),Ktf(x,v)=(x,v+tWFfast(x)),Dt(x,v)=(x+tv,v).\mathcal{K}^{\text{s}}_t(x, v) = (x, v + t W F_{\text{slow}}(x)), \qquad \mathcal{K}^{\text{f}}_t(x, v) = (x, v + t W F_{\text{fast}}(x)), \qquad \mathcal{D}_t(x, v) = (x + t v, v).

Each is the exact flow for time tt of a Hamiltonian: Uslow(x)U_{\text{slow}}(x), Ufast(x)U_{\text{fast}}(x) and the kinetic energy 12vTW−1v\frac12 v^{\mathsf T} W^{-1} v, in the coordinates (x,W−1v)(x, W^{-1} v).

Claim 1 (the step). With δ=h/n\delta = h / n, one call of respa_step is

Ψh=Kh/2s∘(Kδ/2f∘Dδ∘Kδ/2f)n∘Kh/2s.\Psi_h = \mathcal{K}^{\text{s}}_{h/2} \circ \bigl(\mathcal{K}^{\text{f}}_{\delta/2} \circ \mathcal{D}_\delta \circ \mathcal{K}^{\text{f}}_{\delta/2}\bigr)^n \circ \mathcal{K}^{\text{s}}_{h/2}.

Proof. Line L1 is Kh/2s\mathcal{K}^{\text{s}}_{h/2}. Each pass of the loop of line L2 applies line L3, a fast half kick at the current xx, line L4, a drift, and line L5, a fast half kick at the new xx, which is Kδ/2f∘Dδ∘Kδ/2f\mathcal{K}^{\text{f}}_{\delta/2} \circ \mathcal{D}_\delta \circ \mathcal{K}^{\text{f}}_{\delta/2}. The code computes the fast force once per pass, because the force at the end of one pass is the force at the start of the next. Line L6 is Kh/2s\mathcal{K}^{\text{s}}_{h/2} at the final xx. □\square

Claim 2 (special cases). For n=1n = 1, Ψh\Psi_h is the velocity Verlet step with the full force FF. For Fslow=0F_{\text{slow}} = 0, Ψh\Psi_h is nn velocity Verlet steps of size δ\delta with the force FfastF_{\text{fast}}.

Proof. Kicks change only vv by an amount that depends only on xx, so any two kicks commute, and Kts∘Ktf=Kt\mathcal{K}^{\text{s}}_t \circ \mathcal{K}^{\text{f}}_t = \mathcal{K}_t, the kick with the full force. For n=1n = 1, Ψh=Kh/2∘Dh∘Kh/2\Psi_h = \mathcal{K}_{h/2} \circ \mathcal{D}_h \circ \mathcal{K}_{h/2}, the velocity Verlet step. For Fslow=0F_{\text{slow}} = 0 the slow kicks are the identity. □\square

Claim 3 (symplectic). Ψh\Psi_h is a symplectic map.

Proof. The exact flow of a Hamiltonian system is symplectic, and a composition of symplectic maps is symplectic. □\square

Claim 4 (time reversal). Let R(x,v)=(x,−v)R(x, v) = (x, -v). Then R∘Ψh∘R=Ψh−1R \circ \Psi_h \circ R = \Psi_h^{-1}: from (x′,−v′)(x', -v') with (x′,v′)=Ψh(x,v)(x', v') = \Psi_h(x, v), one step returns to (x,−v)(x, -v).

Proof. For each of the three maps, R∘Mt∘R=M−t=Mt−1R \circ \mathcal{M}_t \circ R = \mathcal{M}_{-t} = \mathcal{M}_t^{-1}: for a kick, RR flips the sign of the velocity change, and for a drift, RR flips the sign of the position change. R∘RR \circ R is the identity, so R∘Ψh∘RR \circ \Psi_h \circ R is the same composition with each tt replaced by −t-t, and since the list of factors reads the same from both ends, this is the inverse of Ψh\Psi_h. □\square

Claim 5 (order 2). For a fixed nn and smooth forces, the local error of Ψh\Psi_h is O(h3)O(h^3), so the global error over a fixed time is O(h2)O(h^2).

Proof. Each factor agrees with the identity plus tt times its vector field up to O(t2)O(t^2), so the composition agrees with the exact flow of FF up to O(h2)O(h^2): the method has order at least 1. A method whose map satisfies Ψ−h=Ψh−1\Psi_{-h} = \Psi_h^{-1} has even order (Hairer, Lubich and Wanner, the theorem on symmetric methods). The palindromic composition of Claim 4 with hh replaced by −h-h is the same composition with all times negated, which is Ψh−1\Psi_h^{-1}, so Ψh\Psi_h is symmetric and its order is at least 2. □\square

The test measures the largest energy error over t≤20t \le 20 for a fast spring of frequency Ω=10\Omega = 10 and a slow pendulum force: it falls from 0.293 to 0.0707, a factor of 4.15, when hh is halved with n=10n = 10.

Claim 6 (resonance in the linear model, a theorem). Let xx be one coordinate with w=1w = 1, Ffast=−Ω2xF_{\text{fast}} = -\Omega^2 x and Fslow=−κxF_{\text{slow}} = -\kappa x with κ>0\kappa > 0, and replace the inner loop by the exact rotation of the fast oscillator over time hh, which is its limit as n→∞n \to \infty. Then the step matrix has determinant 1 and trace

tr⁡=2cos⁡(Ωh)−κhΩsin⁡(Ωh),\operatorname{tr} = 2 \cos(\Omega h) - \frac{\kappa h}{\Omega} \sin(\Omega h),

and for each κ>0\kappa > 0 there are steps hh just below π/Ω\pi / \Omega with ∣tr⁡∣>2|\operatorname{tr}| > 2, where the method is unstable.

Proof. The rotation is R=(cos⁡Ωhsin⁡(Ωh)/Ω−Ωsin⁡Ωhcos⁡Ωh)R = \begin{pmatrix} \cos \Omega h & \sin(\Omega h)/\Omega \\ -\Omega \sin \Omega h & \cos \Omega h \end{pmatrix}, and the slow half kick is K=(10−a1)K = \begin{pmatrix} 1 & 0 \\ -a & 1 \end{pmatrix} with a=κh/2a = \kappa h / 2. Both have determinant 1, so KRKK R K does. Its trace is 2cos⁡Ωh−2asin⁡(Ωh)/Ω2\cos \Omega h - 2a \sin(\Omega h)/\Omega. Put Ωh=π−ε\Omega h = \pi - \varepsilon with small ε>0\varepsilon > 0: tr⁡=−2+ε2−κhΩε+O(ε3)\operatorname{tr} = -2 + \varepsilon^2 - \frac{\kappa h}{\Omega} \varepsilon + O(\varepsilon^3), which is below −2-2 when ε<κh/Ω\varepsilon < \kappa h / \Omega up to higher order. A real 2×22 \times 2 matrix with determinant 1 and ∣tr⁡∣>2|\operatorname{tr}| > 2 has a real eigenvalue of modulus above 1, so the iterates grow exponentially. □\square

The width of the unstable band in hh is about κπ/Ω3\kappa \pi / \Omega^3, small when the slow force is weak, but it is there for every κ>0\kappa > 0, and the same holds near every multiple of π/Ω\pi / \Omega. In the test, Ω=10\Omega = 10, κ=1\kappa = 1 and h=(π−0.015)/10h = (\pi - 0.015)/10 give a trace of −2.0002-2.0002, and 3000 steps make the amplitude grow by a factor of more than 101910^{19}. For nonlinear systems, Ma, Izaguirre and Skeel (2003) report instabilities when hh is as small as a third, or possibly a fourth, of the period of the fastest motion. That bound is a measurement and an analysis of model problems, not a theorem for all force fields.

Complexity

One outer step costs nn fast force calls, one slow force call and Θ(nN)\Theta(nN) for the updates, where NN is the number of coordinates. With Verlet at the small step h/nh/n, the same time costs nn calls of each force. RESPA saves almost a factor of nn when the slow force dominates the cost. Memory is Θ(N)\Theta(N), plus one stored slow force.

Properties

  • Symplectic and reversible, so the energy stays in a band for steps away from resonance.
  • Order two in the outer step for a fixed nn.
  • One slow force per outer step, with the stored force reused at the start of the next step.
  • Resonance limited. The outer step must stay below about a third of the shortest period of the fast motion for nonlinear systems, which caps the possible gain.
  • Nested. Three or more levels of forces fit the same pattern.

Variants and improvements

  • Impulse method. The same scheme is the impulse method or Verlet-I of Grubmüller, Heller, Windemuth and Schulten (1991).
  • Mollified impulse. Evaluating the slow force at averaged positions softens the kicks and widens the stable range of steps.
  • Isokinetic and stochastic versions. Thermostats that hold the kinetic energy of each degree of freedom, or Langevin damping on the fast modes, damp the resonance and can allow larger outer steps.
  • Splitting by distance. In molecular dynamics, the slow force is often the long-range part of the electrostatics from SPME, and the fast force contains the bonds and short-range pairs.
  • With constraints. The position and velocity projections of RATTLE fit after each inner drift and kick.

When to use it

Use RESPA when a costly force changes slowly and a cheap force changes fast, for example the reciprocal part of the Ewald sum against bonded and short-range forces. Keep the outer step well below half the shortest period of the fast motion, and in practice below a third of it. When the costly force is not much smoother than the cheap one, or when the bonds to hydrogen are already removed by constraints, the gain is small, and plain Verlet is simpler.

Pitfalls

  • Resonance. An outer step near half a period of any fast motion, or near a multiple of it, makes the energy grow. Scan the outer step on a small test before a long run.
  • A slow force that is not smooth. A sharp cutoff between the fast and slow parts puts fast changes into the slow force. Split with a smooth switching function.
  • Kicks in the wrong place. The slow half kicks must come at both ends of the outer step, not one full kick at one end, or the method loses its symmetry and its second order.
  • Reusing the wrong force. The slow force at the end of an outer step must be computed at the final positions of the inner loop.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

respa_multiple_time_step.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/respa-multiple-time-step/. The authors are listed in prov/2SQEWG.jsonl.
"""r-RESPA: the reversible multiple time step integrator of Tuckerman, Berne and Martyna (1992).

The force is split as F = F_fast + F_slow. One outer step of size h is the
Trotter splitting

    exp(h/2 L_slow) [exp(delta/2 L_fast) exp(delta L_x) exp(delta/2 L_fast)]^n exp(h/2 L_slow),

with delta = h / n: a half kick with the slow force, n velocity Verlet steps
with the fast force alone, and a second half kick with the slow force. The
slow force is computed once per outer step and the fast force n times.

Each factor is the exact flow of a Hamiltonian, so the map is symplectic, and
the splitting is symmetric, so it is time-reversible and of order 2. The
slow kicks are impulses spaced h apart. When h is near a multiple of half
the period of a fast motion the impulses resonate with it and the method is
unstable, even if each force is accurate.

Positions and velocities are flat lists of floats here; inv_mass has one
entry per coordinate.
"""

from typing import Callable

Field = Callable[[list[float]], list[float]]


def respa_step(
    x: list[float], v: list[float], inv_mass: list[float], f_fast: Field, f_slow: Field, h: float, n: int,
) -> tuple[list[float], list[float]]:
    """One outer r-RESPA step of size h with n inner steps on the fast force."""
    delta = h / n
    fs = f_slow(x)
    v = [vi + 0.5 * h * wi * fi for vi, wi, fi in zip(v, inv_mass, fs)]  # @line L1
    ff = f_fast(x)
    for _ in range(n):  # @line L2
        v = [vi + 0.5 * delta * wi * fi for vi, wi, fi in zip(v, inv_mass, ff)]  # @line L3
        x = [xi + delta * vi for xi, vi in zip(x, v)]  # @line L4
        ff = f_fast(x)
        v = [vi + 0.5 * delta * wi * fi for vi, wi, fi in zip(v, inv_mass, ff)]  # @line L5
    fs = f_slow(x)
    v = [vi + 0.5 * h * wi * fi for vi, wi, fi in zip(v, inv_mass, fs)]  # @line L6
    return x, v  # @line L7


def velocity_verlet_step(
    x: list[float], v: list[float], inv_mass: list[float], force: Field, h: float,
) -> tuple[list[float], list[float]]:
    """One velocity Verlet step with the full force, the reference for n = 1."""
    f = force(x)
    v = [vi + 0.5 * h * wi * fi for vi, wi, fi in zip(v, inv_mass, f)]
    x = [xi + h * vi for xi, vi in zip(x, v)]
    f = force(x)
    v = [vi + 0.5 * h * wi * fi for vi, wi, fi in zip(v, inv_mass, f)]
    return x, v
test_respa_multiple_time_step.py 111 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/respa-multiple-time-step/. The authors are listed in prov/2SQEWG.jsonl.

import math
import random

from respa_multiple_time_step import respa_step, velocity_verlet_step

OMEGA = 10.0  # frequency of the fast spring


def fast(x):
    return [-OMEGA * OMEGA * c for c in x]


def slow(x):
    return [-math.sin(c) for c in x]


def energy(x, v):
    return sum(0.5 * b * b + 0.5 * OMEGA * OMEGA * a * a + 1 - math.cos(a) for a, b in zip(x, v))


def test_one_inner_step_is_velocity_verlet() -> None:
    rng = random.Random(1)
    x = [rng.uniform(-1, 1) for _ in range(3)]
    v = [rng.uniform(-1, 1) for _ in range(3)]
    w = [1.0, 0.5, 2.0]
    a, b = list(x), list(v)
    for _ in range(50):
        x, v = respa_step(x, v, w, fast, slow, 0.03, 1)
        a, b = velocity_verlet_step(a, b, w, lambda y: [p + q for p, q in zip(fast(y), slow(y))], 0.03)
    assert max(abs(p - q) for p, q in zip(x + v, a + b)) < 1e-12


def test_without_slow_force_it_is_verlet_with_the_small_step() -> None:
    x, v, w = [0.4], [0.1], [1.0]
    a, b = list(x), list(v)
    for _ in range(20):
        x, v = respa_step(x, v, w, fast, lambda y: [0.0], 0.1, 5)
        for _ in range(5):
            a, b = velocity_verlet_step(a, b, w, fast, 0.02)
    assert abs(x[0] - a[0]) < 1e-12 and abs(v[0] - b[0]) < 1e-12


def test_reversibility() -> None:
    x0, v0, w = [0.3, -0.7], [0.5, 0.2], [1.0, 1.0]
    x, v = x0, v0
    for _ in range(100):
        x, v = respa_step(x, v, w, fast, slow, 0.1, 8)
    v = [-c for c in v]
    for _ in range(100):
        x, v = respa_step(x, v, w, fast, slow, 0.1, 8)
    assert max(abs(p - q) for p, q in zip(x, x0)) < 1e-10
    assert max(abs(-p - q) for p, q in zip(v, v0)) < 1e-10


def test_map_preserves_phase_area() -> None:
    def flow(x, v):
        a, b = [x], [v]
        for _ in range(7):
            a, b = respa_step(a, b, [1.0], fast, slow, 0.1, 4)
        return a[0], b[0]

    e = 1e-6
    dx = [(p - m) / (2 * e) for p, m in zip(flow(0.5 + e, 0.2), flow(0.5 - e, 0.2))]
    dv = [(p - m) / (2 * e) for p, m in zip(flow(0.5, 0.2 + e), flow(0.5, 0.2 - e))]
    assert abs(dx[0] * dv[1] - dx[1] * dv[0] - 1.0) < 1e-6


def max_energy_error(h: float, n: int, t_end: float) -> float:
    x, v = [1.0], [0.0]
    e0 = energy(x, v)
    worst = 0.0
    for _ in range(int(round(t_end / h))):
        x, v = respa_step(x, v, [1.0], fast, slow, h, n)
        worst = max(worst, abs(energy(x, v) - e0))
    return worst


def test_energy_error_is_second_order() -> None:
    e1 = max_energy_error(0.1, 10, 20.0)
    e2 = max_energy_error(0.05, 10, 20.0)
    assert e1 < 0.05 * energy([1.0], [0.0])
    assert 3.0 < e1 / e2 < 5.0


def trace_of_linear_map(h: float, kappa: float, n: int) -> float:
    def step(x, v):
        a, b = respa_step([x], [v], [1.0], fast, lambda y: [-kappa * y[0]], h, n)
        return a[0], b[0]

    return step(1.0, 0.0)[0] + step(0.0, 1.0)[1]


def test_resonance_near_half_the_fast_period() -> None:
    kappa, n = 1.0, 200
    # with the inner motion integrated almost exactly, the trace is 2 cos(Omega h) - kappa h sin(Omega h) / Omega
    for h in (0.1, 0.25):
        exact = 2 * math.cos(OMEGA * h) - kappa * h * math.sin(OMEGA * h) / OMEGA
        assert abs(trace_of_linear_map(h, kappa, n) - exact) < 1e-3
        assert abs(trace_of_linear_map(h, kappa, n)) < 2.0
    h_bad = (math.pi - 0.015) / OMEGA
    assert abs(trace_of_linear_map(h_bad, kappa, n)) > 2.0
    # the same total force with a small enough step is stable
    assert abs(trace_of_linear_map(h_bad / 3, kappa, n)) < 2.0
    # an unstable map makes the amplitude grow without bound
    x, v = [1.0], [0.0]
    for _ in range(3000):
        x, v = respa_step(x, v, [1.0], fast, lambda y: [-kappa * y[0]], h_bad, 20)
    assert abs(x[0]) + abs(v[0]) / OMEGA > 10.0

History

Grubmüller, Heller, Windemuth and Schulten (1991) gave the impulse form of multiple time stepping for long-range interactions. Tuckerman, Berne and Martyna (1992) derived the reversible version from a Trotter factorisation of the classical Liouville propagator. Ma, Izaguirre and Skeel (2003) analysed the instabilities and found that nonlinear resonance limits the outer step to about a third of the fastest period.

References

  1. Mark Tuckerman, Bruce J. Berne and Glenn J. Martyna, Reversible multiple time scale molecular dynamics, Journal of Chemical Physics 97(3), 1992, 1990-2001, the Trotter factorisation of the classical propagator into fast and slow parts
  2. Helmut Grubmüller, Helmut Heller, Andreas Windemuth and Klaus Schulten, Generalized Verlet algorithm for efficient molecular dynamics simulations with long-range interactions, Molecular Simulation 6(1-3), 1991, 121-142, the impulse form of the multiple time step method
  3. Qun Ma, Jesús A. Izaguirre and Robert D. Skeel, Verlet-I/r-RESPA/impulse is limited by nonlinear instabilities, SIAM Journal on Scientific Computing 24(6), 2003, 1951-1973, the resonance limit on the outer step
  4. Michael P. Allen and Dominic J. Tildesley, Computer Simulation of Liquids, second edition, Oxford University Press, 2017, Section 5.4, Non-bonded interactions and multiple timesteps

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.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example