Lesson 3.5 · 14 min

Langevin dynamics

Langevin dynamics gives every atom its own small heat bath: a friction force plus random kicks, balanced so the system reaches the right temperature. It is robust and always ergodic, but strong friction slows the real dynamics.

The idea

Paul Langevin (1908) described a pollen grain in water as feeling two forces from the water molecules: a smooth friction that opposes its motion, and rapid random kicks. Langevin dynamics applies the same idea to every atom in a simulation, as if each atom were bathed in an invisible solvent.

The friction alone would cool the system to zero; the kicks alone would heat it forever. For the right temperature they must be balanced: the stronger the friction γ, the stronger the kicks must be. This balance is the fluctuation–dissipation theorem, and it makes the atoms sample the canonical (NVT) distribution at T.

Why it is popular. Each atom is thermostatted on its own (a local thermostat), so there is no global ringing (unlike Nosé–Hoover) and no flying ice cube. The noise makes the dynamics ergodic even for small or stiff systems. It is very stable with large time steps, and it naturally models a solvent you do not simulate explicitly (implicit solvent, coarse-grained models, Brownian dynamics).

The price. The friction and noise change the dynamics. Velocities forget their past in a time 1/γ, and at strong friction atoms move by diffusion like pollen grains. A free particle has D = kBT/(mγ); in a liquid, collisions with neighbours slow it further. Use a small γ (about 0.1–1 ps⁻¹ for atomistic systems) if you care about diffusion or viscosity; a large γ is fine if you only need equilibrium averages.

Key idea. Langevin = Newton + friction + noise, with the noise set by T and γ. Any γ > 0 gives the right ensemble; γ controls how much the dynamics is disturbed. Integrate with BAOAB.

The algorithm

The BAOAB splitting (Leimkuhler and Matthews, 2013) is simple and gives very accurate configurational averages:

c1 = exp(-gamma * dt)
c2 = sqrt((1 - c1**2) * kB * T / m)

every step:
    v += (dt/2) * F / m                  # B: half kick
    x += (dt/2) * v                      # A: half drift
    v  = c1 * v + c2 * gaussian()        # O: friction + noise (exact)
    x += (dt/2) * v                      # A: half drift
    F  = forces(x)
    v += (dt/2) * F / m                  # B: half kick
  1. The O step solves the friction-plus-noise part exactly, so it works for any γ, even very large.
  2. Use a different random number for every atom, direction and step. Total momentum is not conserved, so Nf = 3N.
  3. γ = 0 gives back velocity Verlet (NVE). 1/γ plays the role of the coupling time τ of the other thermostats (the kinetic energy relaxes with time constant 1/(2γ)).
  4. LAMMPS: fix langevin T T damp seed (damp = 1/γ) together with fix nve. GROMACS: integrator = sd with tau-t = 1/γ.