Time Integrators for Molecular Dynamics

This paper invites the reader to learn more about time integrators for Molecular Dynamics simulation through a simple MATLAB implementation. An overview of methods is provided from an algorithmic viewpoint that emphasizes long-time stability and finite-time dynamic accuracy. The given software simulates Langevin dynamics using an explicit, second-order (weakly) accurate integrator that exactly reproduces the Boltzmann-Gibbs density. This latter feature comes from adding a Metropolis acceptance-rejection step to the integrator. The paper discusses in detail the properties of the integrator. Since these properties do not rely on a specific form of a heat or pressure bath model, the given algorithm can be used to simulate other bath models including, e.g., the widely used v-rescale thermostat.


Introduction
Molecular Dynamics (MD) simulation refers to the time integration of Hamilton's equations often coupled to a heat or pressure bath [1][2][3][4][5].From its early use in computing equilibrium dynamics of homogeneous molecular systems [6][7][8][9][10][11][12][13] and pico-to nano-scale protein dynamics [14][15][16][17][18][19][20][21][22][23], the method has evolved into a general purpose tool for simulating statistical properties of heterogeneous molecular systems [24].Accessible time horizons have increased remarkably: the time line in Figure 1 attempts to capture this nearly billion-fold improvement in capability over the last forty or so years.To put this speedup in perspective, though, computing power has increased by about eight powers of ten over this time period as predicted by Moore's law.
Near future applications of MD simulation include micro-to milli-scale simulations of biomolecular processes, like protein folding, ligand binding, membrane transport and biopolymer conformational changes [51][52][53].In addition, atomistic MD simulations are used more sparingly in multiscale models [54][55][56][57][58] and rare event simulation, such as the finite temperature string method and milestoning [59][60][61][62].Given this continuous development and generalization of MD, it is not a stretch to suppose that MD will play a transformative role in medicine, technology and education in the twenty-first century.

Methods Applica/ons F a s t N e i g h b o r L i s t s N o s e --H o o v e r --L a n g e v i n T h e r m o s t a t
×10 8 longer simula/on, even with explicit solvent

C e l l L i n k e d L i s t S i m u l a 9 o n o f L i q u i d W a t e r M u l 9 p l e T i m e --S t e p I n t e g r a t o r s 2010 1 0 m u s p r o t e i n s i m u l a 9 o n i n w a t e r
( 2 0 0 8 )

F a s t M u l 9 p o l e M e t h o d Q u a s i --s y m p l e c 9 c i n t e g r a t o r s I m p u l s e i n t e g r a t o r s f o r L a n g e v i n
In its standard form, the method inputs a random initial condition, physical and numerical parameters and outputs a long discrete path of the molecular system.Statistical quantities, like velocity correlation or mean radius of gyration, are usually computed online, i.e., as points along this trajectory are produced.MD simulation is built atop a cheap forward Euler-like integrator that requires only a single interactomic force field evaluation per step.Even though MD seems straightforward, software implementations of MD are typically optimized for performance [36,63,64], and as a side effect, make it cumbersome for non-experts to learn and modify.Also, besides this issue, due to the interplay between stochastic Brownian and molecular forces, infinitely long trajectories of existing MD integrators do not have the right distribution.What happens is that the Brownian force can cause the integrator to enter regions where its approximation to the molecular force is inaccurate and possibly destabilizing.In the latter case, the approximation spends a disproportionate amount of time at higher energies, and thus, the invariant measure of the approximation, if it even exists, is not correct.This phenomenon is a well-known shortcoming of explicit integrators for nonlinear diffusions [65][66][67][68][69].
Recently, a probabilistic approach was proposed to solve this problem, which questions the notion that Monte Carlo methods and MD have different aims: the former strictly samples probability distributions, and the latter estimates dynamics.The basic idea is to combine a standard MD integrator with a Metropolis-Hastings algorithm targeted to the Boltzmann-Gibbs distribution [70][71][72].Because the scheme is a Monte Carlo method, it exactly preserves the desired distribution [71,72].This property implies numerical stability over long-time simulations.However, the price to be paid for this stability is a loss of accuracy whenever a move is rejected and some overhead in evaluating the Metropolis acceptance-rejection step.Still, a Metropolized integrator is dynamically accurate on finite-time intervals [72,73], and so, even though a Metropolized integrator involves a Monte Carlo step, its aim and philosophy are very different from Monte Carlo methods, whose only goal is to sample a target distribution with no concern for the dynamics [71,[74][75][76][77][78][79][80][81][82].In principle, this approach offers a simple alternative to costly implicit integrators, but are Metropolized integrators ready for daily use in MD simulation?The answer to this question is unclear, since this approach is new and has not been tested on enough examples.
Motivated by these issues, this paper builds a software system for MD simulation with a Metropolis step built in and applies it to a homogeneous molecular system.The algorithm and its properties are introduced in a step-by-step fashion.In particular, we show that the integrator is second-order weakly accurate on finite-time intervals and converges to the Boltzmann-Gibbs distribution in the long-time limit.The software version of the algorithm is written in the latest version of MATLAB with plenty of comments, variables that are descriptively named and operations that can be easily translated into mathematical expressions [83].Since MATLAB is widely available, this design ensures that the software will be easy-to-use and cross-platform.The following MATLAB-specific file formats will be used.
(F1) MATLAB script and function files are written in the MATLAB language and can be run from the MATLAB command line without ever compiling them.
(F2) MATLAB executable (MEX) files are written in the "C" language and compiled using the MATLAB mex function.The resulting executable is comparable in efficiency to a "C" code and can be called directly from the MATLAB command line.We will use MEX-files for performance-critical routines [84].
(F3) MATLAB binary (MAT) files will be used to store simulation data.
The paper is organized as follows.We begin with an overview of integrators that have been proposed in MD simulation in Section 2. We explain how to Metropolize each of these schemes to make them long-time stable in Section 3, and as an application, we use a Metropolized scheme to generate a long trajectory of a Lennard-Jones fluid in Section 4. Generalizations of corrected MD integrators to other molecular models are discussed in Section 5.The paper closes by discussing some potential pitfalls in high dimension and tricks to get the integrator to scale well in Section 6.

Algorithmic Introduction to Time Integrators for MD Simulation
For pedagogical reasons, we will start with Langevin dynamics of a system of N molecules.Then, we show in Section 5 how to simulate more general models of molecular systems.Denote by m j > 0 and q j the mass and position of the j-th molecule, respectively.The governing Langevin equation is given by: where q = (q 1 , • • • , q N ) and p = (p 1 , • • • , p N ) denote the positions and momenta of the particles, kT is the temperature factor, and {w j } N j=1 are N -independent Brownian motions.The last two terms in the second equation in (1) represent the effect of a heat bath with parameter γ.In Langevin dynamics, positions are differentiable, and due to the irregularity of the Brownian force, momenta are just continuous, but not differentiable.This difference in regularity explains why the first equation in ( 1) is written as an ordinary differential equation (ODE) and the second equation is written as a stochastic differential equation (SDE).
The bath-free dynamics is a Hamiltonian system with the following Hamiltonian energy function: Since the masses are constant, this Hamiltonian nicely separates into a kinetic and potential energy that are purely functions of p and q, respectively.The stationary probability density of the solution to Equation ( 1) is the Boltzmann-Gibbs density given by: Let h be a given time step size and m = diag(m 1 , • • • , m N ).Let (Q 0 , P 0 ) denote the position and momentum of the molecular system at time t > 0. The simplest approximation to Equation ( 1) is a forward Euler discretization or Euler-Maruyama scheme [85] that computes an updated position and momentum (Q 1 , P 1 ) at t + h using: Here, ξ ∈ R n denotes a Gaussian random vector with mean zero and covariance E(ξ i ξ j ) = δ ij .The problem with this approximation is that the forward Euler method is known to diverge in finite-time when the derivatives of the potential are unbounded, which is the norm in MD simulation.The precise statement and proof of divergence in a general setting can be found in [86].By far the most computationally intensive part of the time-stepping algorithm is the evaluation of the potential force.Thus, we will restrict our discussion to schemes that, like Euler, only require a single force field evaluation per step.
An improvement to the forward Euler method is the following two-step scheme: In the limit, γ → 0, this scheme reduces to the well-known Verlet integrator for MD simulation [7].Just like Verlet, this integrator defines a map on pairs of molecular system configurations.Substituting the approximation, e −γh ≈ (1−γh/2)/(1+γh/2), into the above yields the Brünger-Brooks-Karplus (BBK) scheme, as appearing in [35].Like the forward Euler method, this method is explicit and only requires one new force evaluation per step.Second-order accurate schemes that generalize the Velocity Verlet integrator to Langevin dynamics were proposed in a sequence of papers [42][43][44]87,88].Here, we mention two of these schemes that are both Strang splittings of Equation (1).The first was proposed by Ricci and Ciccotti [42] and consists of the following sub-steps: exactly evolve by a step Each step in this decomposition can be exactly solved.Clearly, the half-steps are easy to solve, since momentum is constant over each of these half-steps.The SDE appearing in the inner step can also be exactly solved, since it is linear in momentum (see Chapter 5 in [89]).This splitting is quite natural, since it treats the heat bath forces in the same way as the potential forces.
A related, but different, splitting method was proposed by Bussi and Parinello in [43] and is given by: approximately evolve using a step of Verlet Notice that this decomposition splits the Langevin dynamics into its Hamiltonian and heat bath parts, which makes it easy to analyze the structural properties of the scheme.A Velocity Verlet integrator is used to approximate the Hamiltonian dynamics.This approximation exactly preserves phase space volume and preserves energy to third-order accuracy per step.Moreover, the solution to the SDE appearing in the half-steps exactly preserves the Boltzmann-Gibbs density.
Since the Velocity Verlet integrator does not exactly preserve energy, the composition above does not exactly preserve the stationary distribution with density in Equation (3).In [90], it was shown that if the derivatives of the potential are all bounded, the Bussi and Parinello integrator possesses an invariant measure that is O(h 2 ) close to the Boltzmann-Gibbs distribution.In this same context, the leading order error term in the integrator's approximation to the invariant measure was explicitly determined [91].Technically speaking, however, these results do not directly apply to MD simulation, since real MD simulation involves potentials whose derivatives are unbounded, e.g., Lennard-Jones forces.As a consequence of this irregularity in the force fields and discretization error, explicit schemes, like this one, may either not detect features of the potential energy properly, which leads to unnoticed, but large errors in dynamic quantities such as the mean first passage time, or may mishandle soft-or hard-core potentials, which leads to numerical instabilities; see the numerical examples in [92].These numerical artifacts motivate adding a Metropolis accept/refusal sub-step to the integrator.In the next section, we show how to Metropolize all of the MD integrators presented in this section.In Section 5, we explain how to generalize the Metropolis-corrected Bussi and Parinello algorithm to a larger class of diffusion processes.

Metropolis-Corrected MD Integrators
Here, we show how to add a Metropolis acceptance-rejection step to a BBK-type scheme and the Bussi and Parinello splitting scheme and then precisely state the properties of these integrators.We start with a detailed description of each algorithm.Both algorithms require evaluating the acceptance probability given by the usual Metropolis ratio: The procedure to Metropolize the Ricci and Ciccotti scheme can be found in Section 2 of [70].
Algorithm 3.1 (First-order BBK-type integrator).Given the current state (Q 0 , P 0 ) at time t, the algorithm proposes a new state (Q 1 , P 1 ) at time t + h for some time step h > 0 via: This "proposal move" (Q 1 , P 1 ) is then accepted or rejected: where x is a Bernoulli random variable with parameter α(Q 0 , P 0 , Q 1 , P 1 ) given by Equation ( 4).The actual update of the system is taken to be: Here, ξ ∈ R n denotes a Gaussian random vector with mean zero and covariance E(ξ i ξ j ) = kT δ ij .
The momenta of the molecules gets reversed if a move is rejected in Step 2 of Algorithm 3.1.This momentum flip is necessary for the algorithm to preserve the correct stationary distribution [70,71], but results in an O(1) error in dynamics.High acceptance rates are therefore needed to ensure that the time lag between successive rejections is frequently long enough for the approximation to capture the desired dynamics.Since the acceptance rate in Equation ( 4) is related to how well the Verlet integrator in (Step 1) preserves energy after a single step, this rejection rate is O(h 3 ).Thus, in practice, we find that the time step required to obtain a sufficiently high acceptance rate is often automatically fulfilled by a time step that sufficiently resolves the desired dynamics.Each step of this algorithm requires: evaluating the atomic force field once in the third equation of (Step 1), generating a Bernoulli random variable with parameter α in (Step 2) and generating an n-dimensional Gaussian vector in (Step 3).We stress that (Step 2) in Algorithm 3.1 is all that is needed to get MD integrators to exactly preserve the Boltzmann-Gibbs density in Equation (3).
Next, we show how to Metropolize the Bussi and Parinello splitting integrator.Algorithm 3.2 (Second-order Bussi and Parinello integrator).Let ξ, η ∈ R n be two independent Gaussian random vectors with mean zero and covariance E(ξ i ξ j ) = E(η i η j ) = δ ij .Given a time step size h and the current state (Q 0 , P 0 ) at time t, the algorithm takes a half-step of the heat bath dynamics: Followed by a full step of Verlet to compute a proposal move ( Q 1 , P 1 ): This proposal move ( Q 1 , P 1 ) is then accepted or rejected: where x is a Bernoulli random variable with parameter α( Q0 , P 0 , Q 1 , P 1 ) given by Equation (4).The actual update of the system at time t + h is taken to be: This algorithm requires generating two independent n-dimensional Gaussian vectors per step.Thus, it is more costly than Algorithm 3.1.However, the advantage of doing this is that the resulting Metropolis corrected algorithm is second-order weakly accurate, as the following Proposition states.Proposition 3.3.Let (Q n , P n ) represent the numerical approximation produced by Algorithm 3.2 at time nh with the same initial condition as the true solution: (Q 0 , P 0 ) = (q(0), p(0)).For every time interval T > 0 and for suitable observables f (q, p), there exists a C(T ) > 0, such that: for all t < T .
This accuracy concept is sufficient for computing means and correlation functions at finite-time and equilibrium correlations.Figure 2 verifies this Proposition by checking the weak accuracy of Algorithms 3.1 and 3.2 on a harmonic oscillator test problem.To be specific, Figure 2 plots the weak accuracy of the Metropolis-corrected MD integrators with respect to the true solution of the Langevin dynamics of a harmonic oscillator: q(t) = p(t) , dp(t) = −q(t) − p(t) + √ 2dw(t), with initial condition q(0) = 1.0 , p(0) = 0.The time steps tested are h = 2 −n , where n is given on the x-axis.The quantity monitored for the error is the estimate of E(q(1) 2 + p(1) 2 ) = 1.699445410 computed analytically.The dashed and solid curves are the graphs of 2 −n (= h) and 2 −2n (= h 2 ) versus n, respectively.
Proof.The desired single-step error estimate can be obtained from an application of the triangle inequality: where ( Q1 , P 1 ) denotes one step of the uncorrected Bussi and Parinello scheme with ( Q0 , P 0 ) = (q(0), p(0)).The first term in the upper bound in Equation ( 6) is O(h 3 ), since the unadjusted scheme is a Strang splitting of Equation (1).To bound the second term in Equation ( 6), note that: where we have introduced the auxilary function: Since the rejection rate is O(h 3 ), it follows from the above expression that the second term in the upper bound of Equation ( 6) is also O(h 3 ).Standard results in numerical analysis for SDEs then imply that the algorithm converges weakly on finite-time intervals with global order two; see, for instance, [93] (Chapter 2.2).
For completeness sake, we also provide a statement that both algorithms are ergodic.
Proposition 3.4.Let (Q n , P n ) be the numerical approximation produced by Algorithms 3.1 or 3.2 at time nh.Then, for suitable observables f (q, p): Here, ν(q, p) denotes the Boltzmann-Gibbs density defined in Equation (3).
A proof of this Proposition can be found in [72].

Application to Lennard-Jones Fluid
Listing 1 translates Algorithm 3.2 into the MATLAB language.Intrinsically defined MATLAB functions appear in boldface.The algorithm uses MATLAB's built in random number generators to carry out Step 1, Step 3 and Step 4. In particular, the Bernoulli random variable, x, in Step 3 is generated in Line 20, and the Gaussian vectors in Step 1 and Step 4 are generated on Line 9 and Line 29, respectively.In addition to updating the positions and momenta of the system, the program also stores the previous value of the potential energy and force, so that the force and potential energy is evaluated in Line 15 just once per simulation step.This evaluation calls a MEX function, which inputs the current position of the molecular system and outputs the force field and potential energy at that position.We use a MEX function, because the atomistic force field evaluation cannot be easily vectorized and is, by far, the most computationally demanding step in MD.The PreProcessing script file called in Line 2 defines the physical and numerical parameters, sets the initial condition and allocates space for storing simulation data.Sample averages are updated as new points on the trajectory are produced in the UpdateSampleAverages script file invoked in Line 35.Finally, the outputs produced by the algorithm are handled by the PostProcessing script file in Line 39.
Let us consider a concrete example: a Lennard-Jones fluid that consists of N identical atoms [1][2][3].The configuration space of this system is a fixed cubic box with periodic boundary conditions.The distance between the i-th and j-th particle is defined according to the minimum image convention, which states that the distance between q i and q j in a cubic box of length is: where • is the nearest integer function.In terms of this distance, the total potential energy is a sum over all pairs: where U LJ (r) is the following truncated Lennard-Jones potential function: Here, f (r) = 4(1/r 12 − 1/r 6 ) and r c is the cutoff radius, which is bounded above by the size of the simulation box; and we have used dimensionless units to describe this system, where energy is rescaled by the depth of the Lennard-Jones potential energy and length by the point where the potential energy is zero.The error introduced by the truncation in Equation ( 10) is proportional to the density of the molecular system and can be made arbitrarily small by selecting the cutoff distance to be sufficiently large.A direct evaluation of the potential force, ∇U (q), scales like O(N 2 ), and typically dominates the total computational cost.In practice, neighbor/cell lists, also called Verlet lists, are used in order to obtain a force evaluation that scales linearly with system size.Since the system we consider will have just a few hundred atoms, there is, however, little advantage to using these data structures, or using a fast force field evaluation, and thus, ForceFieldmex evaluates the force and energy using a sum over all particle pairs.Lennard-Jones force cutoff radius Listing 2 shows the PreProcessing script, which sets the parameters provided in Table 1 and constructs the initial condition, where the N atoms are assumed to be at rest and on the sites of a face-centered cubic lattice.The command, rng(123), on Line 3 sets the seed of the random number generator functions, RAND and RANDN.The acceptance rates at every step and the velocity autocorrelation are updated in the UpdateSampleAverages script shown in Listing 3. The mean acceptance rate, which is outputted in the PostProcessing script shown in Listing 4, must be high enough to ensure that the dynamics is accurately represented.To compute the autocorrelation of an observable over a time interval of length T , the value of that observable along the entire trajectory is not needed.In fact, it suffices to use the values of this observable along a piece of trajectory over a moving time-window [t i , t i + T ], where t i = i × h.This storage space is allocated in PreProcessing and is updated in UpdateSampleAverages.More precisely, the molecular velocities are stored in the pivot array from i − N a to i, where i is the index of the current position and N a = T /h + 1.Notice that velocity autocorrelations are not computed until after the index, i, exceeds 10 4 .This equilibration time removes some of the statistical bias that may arise from using a non-random initial condition.Short-time trajectories of this molecular system are plotted in Figure 3 from an initial condition where atoms are placed on the sites of a face-centered cubic lattice and at rest.The trajectory is computed using the numerical and physical parameters indicated in Table 1, with the exception of the number of steps, which is set equal to N s = 1000.Notice that at lower densities particle trajectories are more diffusive and less localized.Using the parameters provided in Table 1, we compute velocity autocorrelations for a range of density values in Figure 4. Since the heat bath parameter is set to a small value, these figures are in qualitative agreement with those obtained by simulating the molecular system with no heat bath as shown in Figure 5.2 of [3].

General Case
Here, we show how the preceding ideas extend to other molecular systems that obey stochastic differential equations.In the process, we generalize the Metropolized Bussi and Parinello integrator (Algorithm 3.2) to a big class of diffusion processes, including the v-rescale thermostat.We begin with the underlying Hamiltonian dynamics of a molecular system.

Bath-Free Dynamics
MD is based on Hamilton's equations for a Hamiltonian H : R 2d → R: where z(t) = (q(t), p(t)) is a vector of molecular positions q(t) ∈ R d and momenta p(t) ∈ R d and J is the 2d × 2d skew-symmetric matrix defined as: The Hamiltonian, H(z), represents the total energy of the molecular system and is typically "separable", meaning that it can be written as: where K(p) and U (q) are the kinetic and potential energy functions, respectively [94].In MD, the kinetic energy function is a positive definite quadratic form, and the potential energy function involves "fudge factors" determined from experimental or quantum mechanical studies of pieces of the molecular system of interest [36].The accuracy of the resulting energy function must be systematically verified by comparing MD simulation data to experimental data [95].The flow that Equation ( 11) determines has the following structure: (S1) volume-preserving (since the vector-field in Equation ( 11) is divergenceless); and (S2) energy-preserving (since J is skew-symmetric and constant).
Explicit symplectic integrators, like the Verlet scheme, exploit these properties to obtain long-time stable schemes for Hamilton's equations [96,97].

Governing Stochastic Dynamics
In order to mimic experimental conditions, Equation ( 11) is often coupled to a bath that puts the system at constant temperature and/or pressure.The standard way to do this is to assume that the system with a bath is governed by a stochastic ordinary differential equation (SDE) of the type: Here, we have introduced the following notation.
The n × n diffusion matrix, D(x), is defined in terms of the noise coefficient matrix, B(x), as: where B(x) T denotes the transpose of the real matrix, B(x).The diffusion matrix is symmetric and nonnegative definite.Depending on the particular bath that is used, the dimension, n, of Y (t) in Equation ( 14) is related to the dimension, 2d, of z(t) in Equation ( 11) by the inequality: n ≥ 2d.For example, in Nosé-Hoover Langevin dynamics, a single bath degree of freedom is added to Equation (11), so that n = 2d + 1, while in Langevin dynamics, the effect of the bath is modeled by added friction and Brownian forces that keep n = 2d.The Langevin Equation ( 1) can be put in the form of Equation ( 14) by letting x = (q, p), where Equation ( 14) generates a stochastic process, Y (t), that is a Markov diffusion process.We assume that this diffusion process admits a stationary distribution µ(dx), i.e., a probability distribution preserved by the dynamics [98,99].We denote by ν(x) the density of this distribution.Even though the diffusion matrix in Equation ( 15) is not necessarily positive definite, one can use the Hörmander's condition to prove that the process, Y (t), is an ergodic process with a unique stationary distribution [100,101].By the ergodic theorem, it then follows that: where f (x) is a suitable test function.
The evolution of the probability density of the law of Y (t) at time t, ρ(t, x), satisfies the Fokker-Planck equation: where ρ(0, •) is the density of the initial distribution, Y (0) ∼ ρ(0, •), and L is defined as the following second-order partial differential operator: Since µ(dx) = ν(x)dx is a stationary distribution of Y (t), the probability density, ν(x), is a steady-state solution of Equation ( 18), i.e., it satisfies: Define the probability current as the vector field: The stationarity condition in Equation ( 20) implies that j(x) is divergenceless.In the zero-current case, the diffusion process, Y (t), is reversible, and the stationary density ν(x) is called the equilibrium probability density of the diffusion [102].
In this case, the operator, L, is self-adjoint, in the sense that: Lf, g ν = f, Lg ν for all suitable test functions f, g where •, • ν denotes an L 2 inner product weighted by the density, ν(x).This property implies that the diffusion is ν-symmetric [103]: where p t (x, y) denotes the transition probability density of Y (t).Indeed, Equation ( 22) is simply an infinitesimal version of Equation (23), which is referred to as the detailed balance condition.In the self-adjoint case, the drift is uniquely determined by the diffusion matrix and the stationary density ν(x): Long-time stable explicit schemes adapted to this structure have been recently developed [92].

Splitting Approach to MD Simulation
We are now in a position to explain our general approach for deriving a long-time stable scheme for Equation (14).Crucial to our approach is that in MD simulation, we usually have a formula for a function proportional to the stationary density ν(x).Following [90], we can split Equation ( 14) into: where we have introduced H ν (x) = −(log ν)(x).An exact splitting method preserves µ(dx).It is formed by taking the exact solution (in law) of Equation ( 25) in composition with the exact flow of Equation (26).The process produced by Equation ( 25) is self-adjoint with respect to ν(x).Moreover, the stationarity of ν(x) implies that the flow of the ODE (26) preserves it.Since each step is preservative, their composition is, too.In place of the exact splitting, a Metropolized explicit integrator can be used for Equation (25) [92], and a measure-preserving scheme can be designed to solve the ODE [72,104].In [92], explicit schemes are introduced for Equation (25) that: (i) sample the exact equilibrium probability density of the SDE when this density exists (i.e., whenever ν(x) is normalizable); (ii) generates a weakly accurate approximation to the solution of Equation ( 14) at constant kT ; (iii) acquire higher order accuracy in the small noise limit, kT → 0; and (iv) avoid computing the divergence of the diffusion matrix D(x).Compared to the methods in [72], the main novelty of these schemes stems from (iii) and (iv).The resulting explicit splitting method is accurate, since it is an additive splitting of Equation ( 14); and typically ergodic when the continuous process is ergodic [72].
This type of splitting of Equation ( 14) is quite natural and has been used before in MD [43,87], dissipative particle dynamics [105,106] and the simulation of inertial particles [107].Other closely related schemes for Equation ( 14) include Brünger-Brooks-Karplus (BBK) [35], van Gunsteren and Berendsen (vGB) [108] and the Langevin-Impulse (LI) methods [41] and quasi-symplectic integrators [44].However, for general MD force fields, none of these explicit integrators are long-time stable.Our framework to stabilize explicit MD integrators is the Metropolis-Hastings algorithm.

Metropolis-Hastings Algorithm
A Metropolis-Hastings method is a Monte Carlo method for producing samples from a probability distribution, given a formula for a function proportional to its density [74,75].The algorithm consists of two sub-steps: firstly, a proposal move is generated according to a transition density, g(x, y); and secondly, this proposal move is accepted or rejected with a probability: Standard results on Metropolis-Hastings methods can be used to classify this algorithm as ergodic [100,109,110].

Conclusions
This paper provided an algorithmic introduction to time integrators for MD simulation.A quick overview of existing algorithms was given.When the derivatives of the potential are bounded, it is well known that these integrators work just fine: they are convergent on finite-time intervals and possess an invariant measure that is nearby the Boltzmann-Gibbs density.However, in realistic MD simulation, the derivatives of the potential are unbounded.This lack of regularity can cause numerical instabilities or artifacts in explicit integrators.The paper demonstrated how a Metropolis acceptance-rejection step can be added to explicit MD integrators to mitigate some of these problems and, in principle, obtain long-time stable and finite-time accurate schemes.A MATLAB implementation of Metropolis-corrected MD integrators was provided and used to compute the velocity autocorrelation of a sea of Lennard-Jones particles at various densities between the solid and liquid phases.The paper did not provide an in-depth review of the theory of Metropolis integrators, which can be found elsewhere [72,73].
Calculating the force field at every step dominates the overall computational cost of MD simulation.These force fields involve: bonded interactions and non-bonded Lennard-Jones and electrostatic interactions.The calculation of bonded interactions is straightforward to vectorize and scales like O(N ).In addition, Lennard-Jones forces rapidly decay with interatomic distance.To a good approximation, every atom interacts only with neighbors within a sufficiently large ball.By using data structures, like neighbor lists and cell linked lists, these interactions can be calculated in O(N ) steps, and therefore, the Lennard-Jones interactions can be calculated in O(N ) steps [46].On the other hand, the electrostatic energy between particles decays, like 1/r, where r denotes an interatomic distance, which leads to long-range interactions between atoms.Unlike Lennard-Jones interaction, this interaction cannot be cutoff without introducing large errors.In this case, one can use sophisticated techniques, like the fast multipole method, to rigorously handle such interactions in O(N ) steps [39,58].
However, the effect of these 'mathematical tricks' for fast calculation of the force field can become muted if the time step requirement for stability or accuracy becomes more severe in high dimension.This can happen in the Metropolis integrator, if the acceptance probability in Step 2 of Algorithm 3.1 or Step 3 of Algorithm 3.2 deteriorates in high dimension.The scaling of Metropolis algorithms has been quantified for the random walk Metropolis, hybrid Monte Carlo and Metropolis-adjusted Langevin algorithm (MALA) [111][112][113][114][115]. Since the acceptance probability is a function of an extensive quantity, the acceptance rate can artificially deteriorate with increasing system size, unless the time step is reduced.Because high acceptance rates are required to maintain dynamic accuracy, the dependence of the time step on system size limits the application of Metropolized schemes to large-scale systems.Fortunately, this scalability issue can often be resolved by using local, rather than global proposal moves, because the change in energy induced by a local move is typically an intensive quantity.For molecular dynamics calculations, this approach was pursued in [73].Using dynamically consistent local moves (a so-called J-splitting [116]), it was shown that in certain situations, a scalable Metropolis integrator can be designed; however, the extent to which this strategy remedies the issue of high rejection rate in high dimension is not clear at this point and should be tested in applications.

Figure 1 .
Figure 1.A time line of selected developments in MD simulation.