Algorithm Search⌘K

Algorithmcore

Andersen thermostat

Samples the canonical ensemble by giving randomly chosen particles new velocities from the Maxwell-Boltzmann distribution at a set collision rate.

Time
O(S N^2) worst
Space
O(N) extra
Where
N = the number of particles; S = the number of time steps
Properties
randomizediterativerandomizednot symmetricnot symplectic
Origin
Hans C. Andersen, 1980

The Andersen thermostat runs molecular dynamics at a fixed temperature TT by letting the particles collide with an imaginary heat bath. At random times, at a rate ν\nu per particle, a particle forgets its velocity and gets a new one drawn from the Maxwell-Boltzmann distribution at TT. Between collisions the particles follow Newton's equations. Each collision keeps the canonical ensemble, and the Hamiltonian motion keeps it too, so the method samples the canonical distribution, up to the time step error of the integrator. The price is the dynamics: the collisions destroy the velocity memory at the rate ν\nu, so transport properties such as the diffusion coefficient depend on ν\nu and are not those of the physical system.

In plain words

Picture the atoms in a box with an invisible gas around them. Now and then, one atom is hit by a gas molecule and leaves with a new random speed and direction. The new speeds are drawn as they would be in a gas at the right temperature. Hot atoms lose energy this way and cold atoms gain it, so the system settles at the temperature of the gas.

The hits are random and independent, and each atom is hit about ν\nu times per unit of time. Between hits nothing changes in the usual simulation. The method gives the right statistics of the positions and the speeds. It does not give the right motion over long times, because each hit wipes out the motion the atom had.

The problem

The input is the positions xi∈Rdx_i \in \mathbb{R}^d, velocities viv_i and masses mi>0m_i > 0 of NN particles, a force field that returns the potential energy U(x)U(x) and the forces fi=−∇iUf_i = -\nabla_i U, a time step h>0h > 0 (the letter hh is the time step, as on the molecular dynamics page), a number of steps SS, the bath temperature kBT>0k_B T > 0, a collision rate ν≥0\nu \ge 0, and a source of random numbers. The output is a trajectory whose stationary distribution is the canonical density

ρ(x,v)∝exp⁡(−β(K(v)+U(x))),β=1kBT,K(v)=∑i12mi∣vi∣2,\rho(x, v) \propto \exp\bigl(-\beta (K(v) + U(x))\bigr), \qquad \beta = \frac{1}{k_B T}, \qquad K(v) = \sum_i \tfrac12 m_i |v_i|^2,

together with the kinetic energy after each step. The kinetic temperature is 2K/Nf2K / N_f with Nf=dNN_f = dN: the collisions do not keep the total momentum, so no degree of freedom is removed.

The algorithm

  1. ANDERSEN-THERMOSTAT(x, v, m, FORCES, h, S, kT, nu)
  2. 1(U, f) ← FORCES(x); p ← 1 - exp(-nu h)
  3. 2for step ← 1 to S do
  4. 3v_i ← v_i + (h / 2) f_i / m_i for each particle i ▷ half kick
  5. 4x_i ← x_i + h v_i for each particle i ▷ drift
  6. 5(U, f) ← FORCES(x)
  7. 6v_i ← v_i + (h / 2) f_i / m_i for each particle i ▷ half kick
  8. 7for each particle i do
  9. 8if UNIFORM(0, 1) < p then ▷ a collision in this step
  10. 9v_i ← sqrt(kT / m_i) · (d independent standard normals)
  11. 10record K(v)
  12. 11return (x, v, the recorded kinetic energies)

Lines L3 to L6 are one velocity Verlet step. Lines L7 to L9 are the collisions. With the collision probability p=1−e−νhp = 1 - e^{-\nu h} per step, the number of steps between two collisions of one particle is geometric, and the times are those of a Poisson process of rate ν\nu observed at the step times. Andersen (1980) used the Poisson times themselves; to put the collisions at the end of the step is the usual discrete form. The implementation copies xx and vv, so the caller's lists do not change.

Example

One step by hand. One particle in one dimension on a spring, with m=k=kBT=1m = k = k_B T = 1 in reduced units, x=1x = 1, v=0v = 0, h=0.1h = 0.1 and ν=1\nu = 1. Lines L3 to L6 give v=−0.05v = -0.05, x=0.995x = 0.995, f=−0.995f = -0.995 and v=−0.09975v = -0.09975, as on the molecular dynamics page. The collision probability is p=1−e−0.1=0.095163p = 1 - e^{-0.1} = 0.095163. If the uniform number of line L8 is 0.5, nothing happens and v=−0.09975v = -0.09975. If it is 0.05, line L9 draws a standard normal, say 0.8, and the new velocity is 1/1⋅0.8=0.8\sqrt{1/1} \cdot 0.8 = 0.8. The old velocity has no effect on the new one.

The kinetic energy of 20 oscillators. Take 20 independent oscillators on a line with m=k=kBT=1m = k = k_B T = 1, all started at x=1x = 1, v=0v = 0, so that Nf=20N_f = 20. The canonical law of KK has mean 10 and variance 10. Run 6000 steps with h=0.05h = 0.05 (seed 11), drop the first 1000 and estimate the error by 10 batch means:

ν\nu mean of KK variance of KK
0.1 9.04±0.459.04 \pm 0.45 6.98±1.426.98 \pm 1.42
1 10.02±0.3010.02 \pm 0.30 9.13±0.749.13 \pm 0.74
10 10.05±0.0710.05 \pm 0.07 9.60±0.479.60 \pm 0.47

These are measurements. With ν=1\nu = 1 and ν=10\nu = 10 both moments agree with the canonical values within two standard errors. With ν=0.1\nu = 0.1 each oscillator has only about 25 collisions in the run, so the run is too short and the errors are large, although the method is still correct in the limit. The test of the page checks ν=1\nu = 1.

The velocity memory of free particles. With f=0f = 0 a velocity changes only at a collision, so the velocity autocorrelation is ⟨v(0)v(t)⟩=(kBT/m)e−νt\langle v(0) v(t) \rangle = (k_B T/m) e^{-\nu t} (proved below). For 400 free particles with h=0.1h = 0.1 and ν=1\nu = 1, the measured correlation at a lag of 10 steps is within 0.06 of e−1=0.3679e^{-1} = 0.3679. The diffusion coefficient is then D=kBT/(mν)D = k_B T / (m\nu): it is set by the thermostat, not by the physics.

Correctness

The proof in proofs/correctness.md shows:

  1. Each collision keeps the canonical density. Under ρ\rho the velocity of particle ii is independent of everything else and has the Maxwell-Boltzmann law, and line L9 replaces it by a fresh draw from that law.
  2. The Hamiltonian flow keeps it. The exact flow keeps the volume of phase space and HH, so it keeps any function of HH. Velocity Verlet keeps the volume, but keeps HH only up to O(h2)O(h^2), so the sampled density is canonical up to the time step error.
  3. Collision times. The probability of no collision of a particle in nn steps is e−νnhe^{-\nu n h}.
  4. Velocity memory. For free particles, E[via(0)via(nh)]=(kBT/mi)e−νnh\mathbb{E}[v_{ia}(0) v_{ia}(nh)] = (k_B T/m_i) e^{-\nu n h}, and so D=kBT/(miν)D = k_B T/(m_i \nu).

The method samples the canonical ensemble, not the microcanonical one: the collisions change the energy on purpose. Ergodicity is not proved on this page, but the collisions reach every velocity, which removes the main way that deterministic thermostats fail, such as the case of one oscillator on the Nose-Hoover page. The dynamics are not physical: momentum is not conserved, and time correlation functions decay faster than they should.

Proof: The Andersen collisions keep the canonical distribution, and they give an exponential velocity memoryfull

We use the pseudocode of the page. The state is (x,v)(x, v) with x,v∈RNdx, v \in \mathbb{R}^{N d}. The canonical density is

ρ(x,v)=1Ze−β(K(v)+U(x))=1Zxe−βU(x)⋅∏i=1N(βmi2π)d/2e−βmi∣vi∣2/2,\rho(x, v) = \frac{1}{Z} e^{-\beta (K(v) + U(x))} = \frac{1}{Z_x} e^{-\beta U(x)} \cdot \prod_{i = 1}^{N} \Bigl(\frac{\beta m_i}{2 \pi}\Bigr)^{d/2} e^{-\beta m_i |v_i|^2 / 2},

with β=1/(kBT)\beta = 1 / (k_B T) and K(v)=∑i12mi∣vi∣2K(v) = \sum_i \frac12 m_i |v_i|^2. So under ρ\rho the positions and the velocities are independent, the velocities of different particles are independent, and each velocity component viav_{i a} is normal with mean 0 and variance kBT/mik_B T / m_i: the Maxwell-Boltzmann distribution.

Claim 1 (one collision keeps ρ\rho). Fix a particle ii and a probability p∈[0,1]p \in [0, 1]. Let CiC_i be the random map that, with probability pp, replaces viv_i by a new vector whose components are independent normals with variance kBT/mik_B T / m_i, independent of everything else, and with probability 1−p1 - p changes nothing. If (x,v)(x, v) has density ρ\rho, then Ci(x,v)C_i(x, v) has density ρ\rho.

Proof. Write (x,v)=(y,vi)(x, v) = (y, v_i), where yy holds xx and the velocities of the other particles. Under ρ\rho, yy and viv_i are independent and viv_i has the Maxwell-Boltzmann law μi\mu_i. With probability 1−p1 - p the state is unchanged, so its law is ρ\rho. With probability pp the new state is (y,w)(y, w) with w∼μiw \sim \mu_i independent of yy, so its law is (law of yy) ×μi=ρ\times \mu_i = \rho. A mixture of two copies of ρ\rho is ρ\rho. □\square

Lines L7 to L9 apply C1,…,CNC_1, \ldots, C_N in turn with p=1−e−νhp = 1 - e^{-\nu h}, where line L9 draws each component as kBT/mi\sqrt{k_B T / m_i} times a standard normal. By Claim 1, applied NN times, the collision part of a step keeps ρ\rho.

Claim 2 (the Hamiltonian part keeps ρ\rho in exact time). The exact flow ϕt\phi_t of x˙=v\dot x = v, miv˙i=fi(x)m_i \dot v_i = f_i(x) keeps ρ\rho.

Proof. The flow is Hamiltonian, so it keeps the volume dx dvdx\,dv (Liouville's theorem), and it keeps H=K+UH = K + U. A density that is a function of HH alone is therefore carried to itself. □\square

Lines L3 to L6 replace ϕh\phi_h by one velocity Verlet step. That step keeps the volume and is time-reversible, but it keeps HH only up to O(h2)O(h^2), so it keeps ρ\rho only approximately. So the algorithm samples a distribution close to ρ\rho. The exact statement is Claim 1 for the collisions and Claim 2 for the dynamics that the Verlet step approximates. The difference is the time step error of the integrator, which this proof does not bound.

Claim 3 (collision times). In each step each particle has a collision with probability p=1−e−νhp = 1 - e^{-\nu h}, independently of the other particles and of the other steps. So the probability that particle ii has no collision in nn steps is e−νnhe^{-\nu n h}, the same as for a Poisson process of rate ν\nu observed at the times h,2h,…h, 2h, \ldots

Proof. Line L8 uses a fresh uniform number for each particle in each step, and the test u<pu < p succeeds with probability pp. Independence gives (1−p)n=e−νnh(1 - p)^n = e^{-\nu n h}. □\square

Claim 4 (velocity memory of free particles). Let f=0f = 0 and let the velocities at step 0 have the Maxwell-Boltzmann law. Then for each particle and component, E[via(0) via(nh)]=(kBT/mi) e−νnh\mathbb{E}[v_{ia}(0)\, v_{ia}(n h)] = (k_B T / m_i)\, e^{-\nu n h}.

Proof. With f=0f = 0, lines L3 and L6 change nothing, so viv_i changes only at a collision. Let AA be the event that particle ii has no collision in steps 1 to nn. On AA, via(nh)=via(0)v_{ia}(nh) = v_{ia}(0). Off AA, via(nh)v_{ia}(nh) is the value drawn at the last collision, which is independent of via(0)v_{ia}(0) and has mean 0. AA is independent of the velocities, so

E[via(0) via(nh)]=P(A) E[via(0)2]+(1−P(A))⋅0=e−νnh kBTmi.□\mathbb{E}[v_{ia}(0)\, v_{ia}(nh)] = P(A)\, \mathbb{E}[v_{ia}(0)^2] + (1 - P(A)) \cdot 0 = e^{-\nu n h}\, \frac{k_B T}{m_i}. \qquad \square

In continuous time this gives the self-diffusion coefficient D=∫0∞E[via(0)via(t)] dt=kBT/(miν)D = \int_0^\infty \mathbb{E}[v_{ia}(0) v_{ia}(t)]\,dt = k_B T / (m_i \nu). It depends on the collision rate ν\nu, a parameter of the thermostat. So the static averages are canonical, but the transport coefficients are those of the thermostat and not those of the physical system.

Claim 5 (inputs). The function copies xx and vv before line L1, so the caller's lists do not change. With ν=0\nu = 0, p=0p = 0, no velocity is replaced, and the run is velocity Verlet. □\square

Complexity

Each step does one force evaluation, O(N)O(N) work in the Verlet part and NN uniform draws. A collision draws dd normals; the expected number of collisions per step is pN≈νhNpN \approx \nu h N. With the all-pairs force loop of the molecular dynamics page, SS steps cost O(SN2)O(S N^2) time, and the thermostat adds O(SN)O(S N). The extra space is O(N)O(N) for the copies of xx, vv and ff.

Properties

  • Ensemble. Canonical (NVT), with Nf=dNN_f = dN, for any ν>0\nu > 0, up to the error of the integrator.
  • Randomized. The trajectory depends on the random numbers. The implementation takes a random.Random object, so a fixed seed gives a fixed run.
  • Not time-reversible and not symplectic. A collision is a random map, not a map of phase space. It is a Markov step that keeps ρ\rho.
  • No conserved energy to monitor. There is no extended energy, so a bad integrator is hidden by the thermostat. Check the integrator without collisions.
  • Momentum. Not conserved. The centre of mass does a random walk.

Variants and improvements

  • Massive collisions. All velocities are redrawn at the same time, every fixed number of steps. This also keeps ρ\rho, and is simple, but it gives a stronger jump in the dynamics.
  • Partial refresh. Replace vv by c v+1−c2kBT/m Rc\,v + \sqrt{1 - c^2}\sqrt{k_B T/m}\,R for all particles in each step. With c=e−γhc = e^{-\gamma h} this is the exact Ornstein-Uhlenbeck step of Langevin dynamics, the O part of the BAOAB integrator.
  • Pairwise collisions. The Lowe-Andersen thermostat redraws the relative velocity of a pair of close particles along their line of centres. It conserves momentum, so hydrodynamics survive, and it is close in spirit to dissipative particle dynamics.
  • Kinetic energy rescaling. Stochastic velocity rescaling changes only the total kinetic energy, with the right random law, and so disturbs the dynamics less.
  • Hamiltonian Monte Carlo. Hamiltonian Monte Carlo redraws all momenta, runs a Verlet trajectory and adds a Metropolis test, which removes the time step error.

When to use it

Use the Andersen thermostat to sample static canonical averages with a simple and robust method: structure, energies, the radial distribution function. It is a good choice for small systems, where deterministic thermostats can fail to be ergodic. Do not use it to compute diffusion coefficients, viscosities or other Green-Kubo integrals, unless ν\nu is so small that the effect is negligible, and then the thermostat is slow. For dynamics, use a weak thermostat that disturbs less, or run NVE after equilibration.

Pitfalls

  • Too large or too small a rate. A large ν\nu makes the dynamics a random walk with a small diffusion coefficient, so the configurations decorrelate slowly. A small ν\nu gives a slow approach to the temperature. A rate near the inverse of a typical collision time of the physical system is a common choice, and it is a choice, not a rule from theory.
  • Using the dynamics. Time correlation functions and transport coefficients depend on ν\nu.
  • Fixing NfN_f wrongly. The thermostat does not keep the total momentum, so Nf=dNN_f = dN. A code that removes the centre of mass motion and also uses this thermostat must decide which NfN_f it reports.
  • Momentum drift. The total momentum does a random walk. With a periodic box this is harmless for static averages, but it shows up in a plot of the centre of mass.
  • Correlated random numbers. The new velocities must be independent of the old ones. Reusing a seed between runs that are averaged together gives correlated runs.

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.

andersen_thermostat.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/andersen-thermostat/. The authors are listed in prov/8Z4JVW.jsonl.
"""Molecular dynamics at constant temperature with the Andersen thermostat.

The state is the positions x and the velocities v of N particles in d
dimensions, with masses m. A force field returns the potential energy U(x)
and the forces f = -grad U(x). Each step of length h is one velocity Verlet
step, followed by the collisions: each particle, with probability
p = 1 - exp(-nu h), forgets its velocity and gets a new one from the
Maxwell-Boltzmann distribution at the temperature kT (each component normal
with mean 0 and variance kT / m_i). This is Andersen (1980): the collisions of
each particle form a Poisson process of rate nu.

All random numbers come from the random.Random object rng, so a run is
reproducible from its seed.

Cost: one force evaluation and Theta(N d) extra work per step.
"""

import math
import random
from typing import Callable

Vec = list[float]
ForceField = Callable[[list[Vec]], tuple[float, list[Vec]]]


def harmonic(k: float) -> ForceField:
    """Independent springs U = k |x_i|^2 / 2 for each particle."""
    def field(pos: list[Vec]) -> tuple[float, list[Vec]]:
        u = sum(0.5 * k * c * c for p in pos for c in p)
        return u, [[-k * c for c in p] for p in pos]
    return field


def free() -> ForceField:
    """No forces: U = 0 and f = 0."""
    def field(pos: list[Vec]) -> tuple[float, list[Vec]]:
        return 0.0, [[0.0] * len(p) for p in pos]
    return field


def kinetic(v: list[Vec], m: list[float]) -> float:
    """The kinetic energy K = sum_i m_i |v_i|^2 / 2."""
    return sum(0.5 * mi * sum(c * c for c in vi) for vi, mi in zip(v, m))


def andersen_thermostat(
    x: list[Vec], v: list[Vec], m: list[float], forces: ForceField, h: float,
    steps: int, kT: float, nu: float, rng: random.Random,
) -> tuple[list[Vec], list[Vec], list[float]]:
    """Run steps of velocity Verlet with Andersen collisions at rate nu.

    Returns the final positions, the final velocities and the kinetic energy
    after each step. The inputs are not changed.
    """
    if h <= 0 or nu < 0 or kT <= 0:
        raise ValueError("need h > 0, nu >= 0 and kT > 0")
    x = [list(p) for p in x]
    v = [list(p) for p in v]
    n = len(x)
    p_coll = 1.0 - math.exp(-nu * h)
    _, f = forces(x)  # @line L1
    ks = []
    for _ in range(steps):  # @line L2
        for i in range(n):
            for a in range(len(x[i])):
                v[i][a] += 0.5 * h * f[i][a] / m[i]  # @line L3
                x[i][a] += h * v[i][a]  # @line L4
        _, f = forces(x)  # @line L5
        for i in range(n):
            for a in range(len(x[i])):
                v[i][a] += 0.5 * h * f[i][a] / m[i]  # @line L6
        for i in range(n):  # @line L7
            if rng.random() < p_coll:  # @line L8
                s = math.sqrt(kT / m[i])
                v[i] = [s * rng.gauss(0.0, 1.0) for _ in v[i]]  # @line L9
        ks.append(kinetic(v, m))  # @line L10
    return x, v, ks  # @line L11
test_andersen_thermostat.py 103 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/andersen-thermostat/. The authors are listed in prov/8Z4JVW.jsonl.
import math
import random

import pytest

from andersen_thermostat import andersen_thermostat, free, harmonic, kinetic


def batch_stats(xs, nb=10):
    """Mean and variance of xs, each with a batch-means standard error."""
    size = len(xs) // nb
    total = sum(xs) / len(xs)
    means, variances = [], []
    for b in range(nb):
        part = xs[b * size:(b + 1) * size]
        means.append(sum(part) / size)
        variances.append(sum((z - total) ** 2 for z in part) / size)

    def summary(vals):
        mu = sum(vals) / nb
        sd = math.sqrt(sum((z - mu) ** 2 for z in vals) / (nb - 1))
        return mu, sd / math.sqrt(nb)
    return summary(means), summary(variances)


def test_kinetic_energy_has_canonical_mean_and_variance():
    # 20 oscillators in 1D, N_f = 20, kT = 1: K is Gamma(10, 1),
    # with mean 10 and variance 10.
    n = 20
    rng = random.Random(11)
    x = [[1.0] for _ in range(n)]
    v = [[0.0] for _ in range(n)]
    _, _, ks = andersen_thermostat(x, v, [1.0] * n, harmonic(1.0), 0.05, 6000, 1.0, 1.0, rng)
    (mean, se_mean), (var, se_var) = batch_stats(ks[1000:])
    assert abs(mean - 10.0) < 4 * se_mean + 0.05
    assert abs(var - 10.0) < 4 * se_var + 0.3
    assert se_mean < 0.4 and se_var < 1.5


def test_free_particle_velocity_correlation_decays_as_exp_minus_nu_t():
    # For free particles a velocity survives n steps with probability
    # exp(-nu n h), and a new velocity is independent of the old one.
    n, h, nu = 400, 0.1, 1.0
    rng = random.Random(5)
    x = [[0.0] for _ in range(n)]
    v = [[rng.gauss(0.0, 1.0)] for _ in range(n)]
    history = []
    for _ in range(120):
        x, v, _ = andersen_thermostat(x, v, [1.0] * n, free(), h, 1, 1.0, nu, rng)
        history.append([p[0] for p in v])
    lag = 10
    num = den = 0.0
    for t in range(0, len(history) - lag):
        num += sum(a * b for a, b in zip(history[t], history[t + lag]))
        den += sum(a * a for a in history[t])
    assert abs(num / den - math.exp(-nu * lag * h)) < 0.06


def test_collision_rate_is_one_minus_exp_minus_nu_h():
    # With no forces a velocity changes only at a collision.
    n, h, nu = 500, 0.2, 0.5
    rng = random.Random(9)
    x = [[0.0] for _ in range(n)]
    v = [[1.0] for _ in range(n)]
    changed = 0
    trials = 20
    for _ in range(trials):
        _, v1, _ = andersen_thermostat(x, v, [1.0] * n, free(), h, 1, 1.0, nu, rng)
        changed += sum(1 for a, b in zip(v, v1) if a[0] != b[0])
    p = 1.0 - math.exp(-nu * h)
    se = math.sqrt(p * (1 - p) / (n * trials))
    assert abs(changed / (n * trials) - p) < 4 * se


def test_new_velocities_have_maxwell_boltzmann_variance():
    # One step with nu h large resets almost every velocity; the variance
    # of a component is kT / m.
    n = 500
    rng = random.Random(2)
    m = [4.0] * n
    x = [[0.0, 0.0] for _ in range(n)]
    v = [[0.0, 0.0] for _ in range(n)]
    _, v1, _ = andersen_thermostat(x, v, m, free(), 1.0, 1, 2.0, 50.0, rng)
    comps = [c for p in v1 for c in p]
    var = sum(c * c for c in comps) / len(comps)
    assert abs(var - 0.5) < 4 * 0.5 * math.sqrt(2.0 / len(comps))


def test_zero_collision_rate_is_velocity_verlet():
    rng = random.Random(0)
    x, v, ks = andersen_thermostat([[1.0]], [[0.0]], [1.0], harmonic(1.0), 0.05, 2000, 1.0, 0.0, rng)
    energy = kinetic(v, [1.0]) + 0.5 * x[0][0] ** 2
    assert abs(energy - 0.5) < 0.001


def test_inputs_are_not_changed_and_bad_arguments_raise():
    x, v = [[1.0]], [[0.5]]
    andersen_thermostat(x, v, [1.0], harmonic(1.0), 0.1, 10, 1.0, 1.0, random.Random(1))
    assert x == [[1.0]] and v == [[0.5]]
    with pytest.raises(ValueError):
        andersen_thermostat(x, v, [1.0], harmonic(1.0), 0.1, 10, 1.0, -1.0, random.Random(1))

History

Andersen (1980) introduced the stochastic collisions together with his method for molecular dynamics at constant pressure, in which the volume is an extra dynamical variable with its own mass. The collision method was one of the first ways to run molecular dynamics in the canonical ensemble. Nose (1984) and Hoover (1985) then gave a deterministic method, the Nose-Hoover thermostat, and the constant-pressure idea was extended to a cell that changes shape by Parrinello and Rahman (1980, 1981).

References

  1. Hans C. Andersen, Molecular dynamics simulations at constant pressure and/or temperature, Journal of Chemical Physics 72(4), 1980, 2384-2393, the section on constant temperature (stochastic collisions at a rate nu with a Poisson process of collision times)
  2. Daan Frenkel and Berend Smit, Understanding Molecular Simulation, From Algorithms to Applications, second edition, Academic Press, 2002, the chapter on molecular dynamics in various ensembles (the Andersen thermostat and its effect on the dynamics)
  3. Michael P. Allen and Dominic J. Tildesley, Computer Simulation of Liquids, second edition, Oxford University Press, 2017, Chapter 3, molecular dynamics (the constant-temperature methods)
  4. Ben Leimkuhler and Charles Matthews, Molecular Dynamics, With Deterministic and Stochastic Numerical Methods, Springer, 2015, Chapter 6, the canonical distribution and stochastic differential equations

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