The high cost of evaluating forces in molecular dynamics makes it necessary to use approximations. The most effective approximations for nonbonded 2-body interactions, such as particle–particle particle–mesh, particle–mesh Ewald, and multilevel summation, split the potential into a short-range part which is evaluated directly and a long-range part which is interpolated from a mesh. This results in a force that, though still conservative, is not translation-invariant, resulting in drift in the linear momentum. A common remedy is to apply a uniform correction to all forces to conserve linear momentum, but this results in a force that is not conservative. Described here is a mass-weighted correction, based on the simple idea of constraining the center of mass, which does yield a conservative force.
Consider a system of
N particles with masses
mi and positions
i =
i(
t),
i = 1, 2, . . . ,
N, which evolve in time
t as dictated by Newton’s second law of motion
where
R denotes
1,
2,…,
N,. Often linear momentum Σ
imi
i is conserved, which is equivalent to Σ
i
i =
![[0 with right arrow above]](/corehtml/pmc/pmcents/x0030x20D7.gif)
. In particular, a translation-invariant potential energy function
yields forces
i = −
iU(
R) that sum up to zero.
For a computer simulation the cost of evaluating forces can be very high. In particular, 2-body nonbonded interactions require

operations unless approximations are used. The most efficient approximations are obtained with methods such as particle–particle particle–mesh [
1], particle–mesh Ewald (PME) [
2], and multilevel summation [
3–
5], which split the potential into a short-range part calculated directly and a long-range part interpolated from a mesh. The use of a mesh yields an approximation
Ua(
R) to the long-range part of the potential energy which is not translation-invariant. This leads not only to a violation of Newton’s third law but causes particles to exert forces on themselves [
6]! (Methods based on a hierarchical clustering of interactions, such as the fast multipole method [
7], do not have this problem; however, they compute forces that are not conservative [
8] and appear to be otherwise less efficient for molecular dynamics [
9,
4], though these studies are based on older versions of the methods.)
Failure to conserve linear momentum is at best a nuisance, since it means that even if the center of mass is initially at rest, it will start moving as the simulation progresses. A common remedy [
2,
10,
11] is to subtract out the average net force (1/
N)

from each force

. However, the resulting force is not conservative even if the original approximate force is conservative. For a conservative force, the Jacobian matrix of
i with respect to
j must equal the transpose of the Jacobian matrix of
j with respect to
i. However, such is not the case for the adjusted force

, whose Jacobian matrix with respect to position
j is given by
Where

is the (
i, j)th 3 × 3 block of the Hessian of the potential energy function
Ua.
The negative effect of this simple force correction on conservation of energy is observed in [12, p. 30]. A system of 216 rigid SPC waters is simulated for 10 ns in a cube of side length 18.7 Å. PME is used with a 18 × 18 × 18 grid, a direct sum cutoff of 8 Å, and the Verlet integrator with a 2 fs time step. The use of the force correction produces a drift of −0.14 kcal/mol amidst fluctuations of ±0.05 kcal/mol. Without the force correction the drift is not discernible.
A mass-weighted correction to the force is conservative, however. Assume that the initial linear momentum is zero:
(which is attained by subtracting a constant velocity from each velocity).
Denote the displacement of the center of mass by
where mtot = Σkmk, and conservation of linear momentum is equivalent to the holonomic constraint
This can be combined with the equations of motion (
1) by adding constraint forces
where
![[lambda with right arrow above]](/corehtml/pmc/pmcents/x03BBx20D7.gif)
is a set of Lagrange multipliers and its coefficient is obtained from the Jacobian matrix of

(
R) with respect to
i. Eliminating
![[lambda with right arrow above]](/corehtml/pmc/pmcents/x03BBx20D7.gif)
(by twice differentiating the constraints and substituting in the equations of motion) leads to
A direct proof that the corrected force is conservative is obtained by defining a corrected potential energy function
This is translation-invariant, and the use of a potential leads to conservative forces
The assumption of zero initial linear momentum together with conservation of linear momentum implies

(
R(
t))
![[0 with right arrow above]](/corehtml/pmc/pmcents/x0030x20D7.gif)
. Practical numerical integrators also exactly conserve linear momentum, so the corrected force simplifies to
Extension of this technique to nonzero initial linear momentum is possible using
Eq. (2), but the calculations become more complicated and time consuming. If the term

(
R) is omitted, the force will not be conservative.
To test the value of the mass-weighted correction, a system of 826 TIP3 water molecules in a cubic box of length 29.08 Å was simulated for 10 ns. Three simulations were performed with the same (equilibrated) initial positions and velocities: one with no force correction, one with a uniform correction, and one with a mass-weighted correction. The simulation was performed with NAMD [
13] using PME with cubic B-spline interpolation from a 24 × 24 × 24 grid and the Verlet integrator with a time step of 2 fs. A tolerance of 10
−6 was used for the direct part of the Ewald sum, which dictates the choice of the parameter in the Ewald splitting. A switching distance of 7 Å and a cutoff of 8 Å was used for Lennard-Jones interactions with an XPLOR switching function (which is continuously differentiable). Rigid water constraints were solved analytically using SETTLE [
14]. confirms that the force-corrected simulations conserve momentum whereas the uncorrected simulation terminates with a speed of 0.26 Å/ps and a displacement of 1180 Å for the center of mass. (The reason that the plot shows momentum not to be exactly conserved for the two force-corrected simulations is that NAMD, for parallel performance reasons, outputs the linear momentum before applying the force correction.) The values plotted in this graph, and the one that follows, are block-averaged over 50-ps intervals. shows total energy as a function of time. The simulations without a force correction and with a mass-weighted correction each experience a little energy drift. Theoretical and empirical evidence [
15] indicates that some drift occurs for the Verlet integrator even with a conservative force and a modest stepsize. However, the simulation with the uniform correction experiences an energy drift that is an order of magnitude greater. Similar results were also obtained for two other 10-ns simulations. Hence, a simulation with the weighted correction can be run an order of magnitude longer before temperature change becomes problematic. (The Verlet integrator is symplectic for a conservative force but merely preserves volume in phase space for a nonconservative force.)
Implementation of a force correction on a parallel distributed-memory computer requires a reduction operation followed by a broadcast. Fortunately, the mass-weighted correction is latency tolerant—unlike the uniform correction. Practical integrators such as the Verlet scheme and its extension to constraints [
16] and to multiple time stepping [
17,
18] incorporate force evaluations as impulses and exactly integrate these impulses. Hence force corrections (
mi/
mtot)
n introduced at time
t =
n Δ
t change the positions by an amount (
t –
n Δ
t) Δ
t
n/
mtot for
t =
n Δ
t,
which is the same for all particles. More-over, this remains true as long as only translation-invariant forces are applied. Hence the correction to positions and velocities need not be applied until just before the next evaluation of forces that are not translation-invariant. In practice, these forces are long-range nonbonded electrostatic forces, evaluated using the largest time step. Such a technique is implemented in version 2.6 of NAMD [
19].