Molecular Dynamics Simulation
Molecular dynamics is the in-silico realization of classical statistical mechanics: given a potential-energy surface and initial conditions, one integrates Newton's equations forward in time. The resulting trajectory is a single realization of the classical -body problem; because that problem is chaotic for , individual trajectories are exponentially sensitive to their initial data (Lyapunov instability), yet the statistical distribution they visit is robust. This is exactly the regime where statistical mechanics is meant to apply — we never ask where one trajectory goes, only how often it visits each region of phase space. The conceptual engine is ergodicity. If the trajectory explores the constant-energy surface uniformly with respect to the microcanonical measure, then long time averages of an observable equal its ensemble average, and thermodynamics becomes a sampling problem: run long enough, average, and read off pressure, energy, radial distribution functions and heat capacities. Beyond statics, molecular dynamics has a unique strength — genuine dynamics: the Green–Kubo and Einstein relations express diffusion constants, viscosities and thermal conductivities as time integrals of equilibrium correlation functions, which molecular dynamics computes directly. That side of the story — the fluctuation–dissipation content — is owned by the langevin-equation and fluctuation-dissipation-theorem articles, recalled here by name. The algorithmic heart is the integrator, and its single most important property is not raw local accuracy but geometric fidelity. The velocity-Verlet scheme succeeds because it is symplectic — it exactly conserves a nearby "shadow" Hamiltonian — and time-reversible, so its energy error oscillates within a bounded band forever rather than accumulating. A naively "more accurate" but non-symplectic integrator like explicit Euler suffers secular energy drift and destroys the sampled ensemble over long runs. This contrast is the article's owned thesis, and it is why a single conceptual choice separates a simulation you can run for steps from one that explodes. Bare Newtonian dynamics samples the microcanonical () ensemble; extending it to fixed temperature or pressure is the job of thermostats and barostats, owned by the thermostats-md-ensembles article.
- Molecular dynamics (MD) integrates Newton's equations for interacting particles, producing a deterministic phase-space trajectory.
- Time averages along the trajectory estimate equilibrium ensemble averages by the ergodic hypothesis; time-correlation functions yield transport coefficients via Green–Kubo relations.
- The standard integrator is velocity Verlet: symplectic, time-reversible, conserving a shadow Hamiltonian, with global error and bounded (non-secular) energy error — the decisive property for long runs.
- A non-symplectic scheme like explicit Euler is locally comparable but suffers secular energy drift, silently biasing the sampled ensemble; geometric fidelity beats per-step accuracy.
- Bare Newtonian MD samples the microcanonical () ensemble; temperature is a diagnostic via equipartition , and pressure comes from the virial. Thermostats/barostats extend it to /.
- Key idea: integrate deterministic, time-reversible, symplectic dynamics on a fixed potential; trust ergodicity to convert time averages into ensemble averages and time-correlation functions into transport coefficients — and pick a symplectic integrator so the energy error stays bounded forever.
Integrate deterministic, time-reversible, symplectic dynamics on a fixed potential; trust ergodicity to convert time averages into ensemble averages, and time-correlation functions into transport coefficients. The symplectic velocity-Verlet integrator conserves a shadow Hamiltonian so its energy error is bounded, whereas non-symplectic schemes drift secularly and corrupt the sampled ensemble.
Where this lives today
Molecular dynamics is the microscope of computational science. From the trajectory one builds the radial distribution function (whose Fourier transform is the measured structure factor ), computes transport coefficients from Green–Kubo integrals of the velocity, stress and heat-current autocorrelations (water's self-diffusion at 298 K), and simulates protein folding, ligand binding and membrane dynamics on microsecond–millisecond scales with empirical force fields (AMBER, CHARMM, OPLS) on GPUs and special-purpose hardware. Constraint algorithms (SHAKE/RATTLE) freeze the stiffest bond vibrations to permit fs, and particle-mesh Ewald handles long-range electrostatics at . In materials science, MD with embedded-atom or machine-learned potentials resolves dislocation motion, crack propagation, melting and nucleation — atomistic mechanisms invisible to continuum models. Coupled to thermostats and barostats it spans ensembles; coupled to enhanced sampling it reaches rare events.
The physical picture
Think of molecular dynamics as releasing billiard-like particles on a smooth potential landscape and filming them. Any single frame-to-frame path is unpredictable past a fraction of a nanosecond (chaos), but the histogram of where the particles spend their time converges to the Boltzmann distribution. Statistical mechanics is the claim that this histogram, not the path, is what physics cares about — and that is what makes deterministic chaos a virtue rather than a bug. The Verlet integrator works because it respects geometry, not arithmetic. It does not minimize the local truncation error; it preserves phase-space volume (symplecticity) and time-reversal symmetry. As a result the discrete trajectory exactly conserves a "shadow Hamiltonian" close to the true one, so the energy wanders within a bounded band forever instead of drifting away. Explicit Euler, though of the same nominal order per step, is neither symplectic nor time-reversible; its energy climbs secularly, and a plot of versus for the two integrators is the single clearest picture of why symplecticity matters. Two observables are read directly off the trajectory. Temperature is not an input but a diagnostic: equipartition lets you infer from the instantaneous kinetic energy (fixing its mean and fluctuations is what a thermostat does). Pressure comes from the virial, , a mechanical route that needs only forces. And transport is fluctuation: the same spontaneous velocity correlations that decay in equilibrium, integrated over time, give the diffusion constant — a direct microscopic Green–Kubo measurement, which the langevin-equation and fluctuation-dissipation articles ground.
The core equations
The dynamics are Newton's second law on the potential-energy surface; everything else follows from integrating it.
where: — mass of particle ; — position; — total potential (force field); — net force on . The workhorse integrator is velocity Verlet, a kick–drift–kick scheme that is symplectic and time-reversible. It is the discrete map whose long-time behaviour this article is about.
where: — velocity; — acceleration; — timestep. Temperature is inferred from the kinetic energy by equipartition — a diagnostic, not an input. The canonical ensemble that fixes is owned by the SM2 canonical-ensemble article and by thermostats-md-ensembles.
where: — Boltzmann constant; — number of constraints (conserved momenta/rigid bonds subtracted). Pressure comes from the virial — a mechanical route needing only forces, which is why it is natural in molecular dynamics.
where: — volume; — pair virial. The ergodic hypothesis identifies the time average with the ensemble average — the bridge that makes the trajectory a thermodynamic sampler.
where: — phase-space point ; — number of sampled steps. The discrete map does not conserve exactly, but it conserves a nearby shadow Hamiltonian to all orders in — the mathematical reason the energy error stays bounded.
where: — conserved quantity of the symplectic map; — Baker–Campbell–Hausdorff corrections.
The purpose of this derivation is to expose why velocity Verlet is symplectic and time-reversible — properties that are invisible if one simply writes down the update rules. Starting from the exact Liouville propagator and applying a symmetric (Strang/Trotter) operator splitting, each factor turns out to be an exactly solvable symplectic map, and the symmetric ordering makes the whole step invariant under time reversal. These two structural facts are what guarantee a conserved shadow Hamiltonian and hence bounded energy error, the central claim of the article.
Step 1. Write the Liouville operator generating the phase-space flow:
whose exact propagator is . Why: advances any phase-space function by one exact step; the integrator approximates this exponential.
Step 2. Split into a position-streaming part (drift) and a velocity-kick part (kick). Each sub-propagator is exactly solvable because it moves only one set of variables.
Step 3. Apply the symmetric factorization
Reading the factors right to left gives: a half-velocity kick ; a full position drift ; recompute forces; a second half-kick — exactly the velocity-Verlet equations (2).
Step 4. Read off the structural properties. Each factor is a shear map with unit Jacobian, hence symplectic (phase-space-volume-preserving); the symmetric ordering is invariant under with momentum reversal, hence time-reversible. Why this guarantees stability: a symplectic map conserves a shadow Hamiltonian (6) to all orders, so the true energy oscillates within a bounded band — no secular drift. Verified: the update reproduces velocity Verlet, and the symplectic/time-reversible energy stability vs Euler's secular drift is demonstrated numerically on the SHO in verify_aq-sm-molecular-dynamics.py.
Go deeper · Derivation B · 1 minVirial expression for the pressure
This derivation gives molecular dynamics its mechanical route to pressure — computing from interparticle forces rather than from a thermodynamic volume derivative. It starts from the Clausius virial theorem, separates the external (wall) and internal (pairwise) forces, and uses Newton's third law to collapse the double sum to distinct pairs. The result is the estimator (4) used at every step of a production run, and it reduces correctly to the ideal-gas law when interactions vanish.
Step 1. Virial theorem. For a bounded equilibrium system the average of is constant, so its time derivative vanishes, giving
Why: ; the first term averages to by equipartition, and the whole time-derivative averages to zero.
Step 2. Split the forces into wall (external) and internal parts, . The wall part integrates to (the confining pressure acting inward over the boundary).
Step 3. Collapse the internal sum with Newton's third law and :
the pairwise virial. Why pairs: each action–reaction pair contributes once through the relative coordinate.
Step 4. Assemble: , i.e.
The first term is the ideal-gas pressure; the second is the interaction correction, which vanishes for the ideal gas (). Verified: the virial pressure reduces to for the ideal gas and the pairwise-sum collapse is checked in verify_aq-sm-molecular-dynamics.py.
Limiting cases
| Case | Result | Meaning |
|---|---|---|
| Timestep stability | The step must resolve the fastest vibrational period (C–H stretch fs → – fs; constraints allow larger). | |
| Classical limit | Classical MD needs the thermal de Broglie wavelength small versus spacing ; fails for light atoms (H, He) at low — use path-integral MD. | |
| Finite size | (force range) | The box must exceed the correlation length and force cutoff; periodic boundaries suppress but do not remove finite-size artifacts. |
| Ergodicity / sampling | Time average → ensemble average only if the run far exceeds the slowest relaxation time; glassy/folding systems break this. | |
| Non-symplectic integrator | (secular) | Explicit Euler or RK4 drift in energy over long runs, biasing the ensemble — the failure velocity Verlet avoids. |
Worked examples
Example 1 — One velocity-Verlet step for the harmonic oscillator. Take the SHO (unit mass) with , , , . Compute explicitly and the energy after one step.
Step 1. Acceleration at : . Position update: .
Step 2. Acceleration at : . Velocity update: .
Step 3. Energy: , versus . The energy changed by only in one step and, crucially, will oscillate around rather than drift — the symplectic guarantee.
Example 2 — Symplectic versus non-symplectic energy drift over a long run. Integrate the same SHO for steps with velocity Verlet and with explicit Euler, and compare the energy behaviour.
Step 1. Velocity Verlet. The energy oscillates within a band of relative width and shows no net drift over steps — the mean energy stays at . This is the shadow-Hamiltonian conservation in action.
Step 2. Explicit Euler (, ). Each step multiplies the phase-space area by , so the energy grows geometrically: after steps of the energy has blown up by a factor , astronomically large. Same nominal order, opposite fate: the non-symplectic scheme's secular drift makes the ensemble meaningless, while the symplectic one is stable indefinitely.
Origins · 1 minloup verlet and how this was discovered
Going further
References. Pathria & Beale, Statistical Mechanics, 3rd ed., ch. on computer simulation · Frenkel & Smit, Understanding Molecular Simulation, 2nd ed. · Allen & Tildesley, Computer Simulation of Liquids, 2nd ed. · Sethna, Statistical Mechanics: Entropy, Order Parameters, and Complexity · Tuckerman, Statistical Mechanics: Theory and Molecular Simulation · Verlet, Phys. Rev. 159, 98 (1967).
Provenance. A verifier should recompute: (i) the LJ force by differentiating ; (ii) the velocity-Verlet update from the symmetric Trotter factorization of and its symplectic/time-reversible energy stability versus explicit Euler's secular drift (this article's verify script); (iii) the virial pressure from the Clausius virial theorem, reducing to for the ideal gas. The water self-diffusion value ( at 298 K) is a standard experimental number. The Green–Kubo/fluctuation–dissipation content is owned by the langevin-equation and fluctuation-dissipation-theorem articles; the canonical ensemble by SM2 and thermostats-md-ensembles.
Builds on: Hamiltonian and Newtonian mechanics · Microcanonical and canonical ensembles · Kinetic Theory and the Boltzmann Equation · Fluctuation–Dissipation Theorem. Leads to: Thermostats and Ensemble Control in Molecular Dynamics · Monte Carlo Method · Langevin Equation and Stochastic Differential Equations · Green–Kubo and transport coefficients.
Why does chaos not ruin molecular dynamics?
Because MD does not need individual trajectories to be accurate — only their statistics. The classical -body problem is chaotic (Lyapunov instability), so a computed trajectory diverges exponentially from the "true" one within a fraction of a nanosecond. But statistical mechanics asks only how often phase space is visited, and that distribution is robust to the chaotic scrambling. The shadow-Hamiltonian argument makes this rigorous for symplectic integrators: the computed trajectory is the exact trajectory of a slightly perturbed Hamiltonian, so it samples a slightly perturbed but well-defined ensemble.
What is the shadow Hamiltonian, concretely?
A symplectic integrator does not conserve the true Hamiltonian , but by the Baker–Campbell–Hausdorff expansion of the split propagator it conserves a nearby to all orders. Because is exactly conserved by the discrete map and differs from by only , the true energy stays within an band of its initial value forever — it oscillates rather than drifts. This is the precise statement behind "bounded energy error."
How does MD extract a diffusion constant?
Two equivalent routes. The Green–Kubo route integrates the velocity autocorrelation function, ; the Einstein route fits the long-time slope of the mean-squared displacement, . They are equivalent because the MSD is the double time-integral of the velocity correlation. The langevin-equation and fluctuation-dissipation-theorem articles own the fluctuation–dissipation content that makes these equilibrium correlations equal to a transport coefficient; MD simply computes the correlation directly from the trajectory.
Why can't I just rescale velocities to control temperature?
Because naive velocity rescaling produces a "perfectly conserved" kinetic energy that is NOT canonical — it suppresses the physical kinetic-energy fluctuations that a real heat bath would impose, and it drains energy into center-of-mass motion (the "flying ice cube" artifact). The correct way to fix temperature is a thermostat that reproduces the right distribution, not just the right mean. That machinery — Nosé–Hoover, Andersen, Langevin thermostats — is owned by the thermostats-md-ensembles article, which this one recalls by name.
When does classical MD break down?
When quantum effects on the nuclei matter. Classical MD treats nuclei as point particles obeying Newton's laws, valid only when the thermal de Broglie wavelength is small compared to the interparticle spacing. For light atoms (hydrogen, helium) at low temperature, zero-point motion and delocalization are significant, and one must switch to path-integral MD (which maps each quantum particle onto a classical ring polymer) or apply quantum corrections. Electronic degrees of freedom are always treated separately, via the force field or an ab-initio potential.
What is the role of neighbour lists and Ewald summation?
They make MD scale to large systems. Evaluating all pairwise forces naively costs ; for short-range potentials, neighbour/cell lists restrict each particle to nearby partners, giving scaling. Long-range Coulomb interactions cannot be cut off, so they are handled by Ewald summation — splitting the sum into a rapidly converging real-space part and a reciprocal-space part — with particle-mesh Ewald (PME) achieving via the fast Fourier transform. These are engineering choices that do not change the physics but determine whether a simulation is feasible.