We apply the irreversible event-chain Monte Carlo (ECMC) algorithm to the simulation of dense all-atom systems with long-range Coulomb interactions. ECMC is event-driven and exactly samples the Boltzmann distribution. It neither uses time-step approximations nor spatial cutoffs on the range of the interaction potentials. Most importantly, it need not evaluate the total Coulomb potential and thus circumvents the major computational bottleneck of traditional approaches. It only requires the derivatives of the two-particle Coulomb potential, for which we discuss mutually consistent choices. ECMC breaks up the total interaction potential into factors. For particle systems made up of neutral dipolar molecules, we demonstrate the superior performance of dipole–dipole factors that do not decompose the Coulomb potential beyond the two-molecule level. We demonstrate that these long-range factors can nevertheless lead to local lifting schemes, where subsequently moved particles are mostly close to each other. For the simple point-charge water model with flexible molecules (SPC/Fw), which combines the long-ranged intermolecular Coulomb potential with hydrogen–oxygen bond-length vibrations, a flexible hydrogen–oxygen–hydrogen bond angle, and Lennard-Jones oxygen–oxygen potentials, we break up the potential into factors containing between two and six particles. For this all-atom liquid-water model, we demonstrate that the computational complexity of ECMC scales very well with the system size. This is achieved in a pure particle–particle framework, without the interpolating mesh required for the efficient implementation of other modern Coulomb algorithms. Finally, we discuss prospects and challenges for ECMC and outline several future applications.
I. INTRODUCTION
A. Irreversible Markov processes
Numerical methods are ubiquitous in the natural sciences, with Markov-chain Monte Carlo (MCMC)1 and molecular dynamics2 playing central roles. Markov-chain Monte Carlo applies to any computational science problem that can be formulated as an (perhaps fictitious) equilibrium-statistical-physics system and whose solution requires sampling its probability distribution. As in physical and chemical systems, equilibrium within the computational context usually means that all probability flows vanish. This requirement is enforced by the detailed-balance condition, an essential ingredient of most Markov-chain Monte Carlo methods and notably of the Metropolis algorithm.3 Monte Carlo algorithms usually take much time to approach equilibrium4 and, once in equilibrium, to generate independent samples. This is, in part, due to the fact that detailed balance leads to time-reversible Markov-chain dynamics, which is diffusive and therefore slow.
In recent years, a new class of irreversible “event-chain” Monte Carlo (ECMC) algorithms has been proposed.5,6 ECMC algorithms violate detailed balance but satisfy a weaker global-balance condition. Configurations at large times sample the equilibrium distribution, but the asymptotic steady state comes with non-vanishing probability flows. In particle systems with periodic boundary conditions, for example, atoms may continue to move preferentially in certain directions. In continuous spin systems, likewise, configurations realize the equilibrium distribution even though spins rotate in a preferred way.7–9 ECMC moves (displacements of particles, rotations of spins, etc.) are infinitesimal and persistent: An “active” particle moves directly from one event to the next, that is, it continues to move until a proposed move is vetoed by a unique “target” particle, which in turn becomes the active particle. This passing of the active-particle label is called a lifting,10,11 and this concept overcomes the characteristic rejections of randomly proposed finite moves in the Metropolis algorithm. The ECMC algorithm was instrumental in the solution of the hard-disk melting problem, after decades of debate.12,13 For soft potentials,6 it can decorrelate with a smaller dynamical exponent than the local Metropolis algorithm.7,9 Furthermore, in a one-dimensional particle system, ECMC was demonstrated to mix on shorter time scales than Markov chains that satisfy detailed balance.14,15
In ECMC, the traditional Metropolis acceptance criterion based on the change in potential is replaced by a consensus rule. This is the essence of the factorized Metropolis filter, which applies to translation-invariant systems with pair-wise interactions between particles6 and, more generally, to models whose interactions can be split into sets of independent factors.16 The ECMC algorithm does not compute the total system potential energy. This makes it very appealing for long-range-interacting systems, where this computation is costly. For Coulomb systems, ECMC altogether avoids traditional algorithms for the electrostatic potential,17 the dominant computational bottleneck for long-range-interacting models. Rather, the cell-veto algorithm18 efficiently establishes consensus on the acceptance or the rejection of a proposed move, even if all particles interact with each other. This is the starting point for the present work.
Generally, computations in statistical physics fall into two categories. They either aim at thermodynamic averages (energy, specific heat, spatial correlation functions, etc.) or at dynamic properties (time correlations, nucleation barriers, coarsening, etc.). In principle, the computation of thermodynamic averages is the realm of Markov-chain Monte Carlo, whereas the analysis of dynamical behavior calls on molecular dynamics, as it solves Newton’s equations of motion. Specifically, however, the field of large-scale all-atom computations with long-ranged interactions is today dominated by molecular dynamics for both categories. The dominance of molecular dynamics is rooted in two facts: First, traditional Monte Carlo methods usually update just particles at a time, and the acceptance/rejection step is then followed by the exact computation of the change in potential. The best currently known algorithm19 for the change in potential after such a local update in a Coulomb system is of complexity so that one Monte Carlo sweep (a sequential update of all N particles) requires computations. In molecular dynamics, by contrast, the discretized Newton’s equations update all particle positions simultaneously, and the necessary computation of the forces on all particles comes at a cost of , much less than for a Monte Carlo sweep. Second, Newtonian dynamics conserves momentum and explores phase space more efficiently than the local Metropolis algorithm. This advantage of molecular dynamics over Monte Carlo is, for example, brought out by the different scaling of the velocity auto-correlation functions in the context of long-time tails.20,21
The time evolution of molecular dynamics has physical meaning, but from an algorithmic point of view, it is constrained by the requirement that it must implement Newton’s law. As a result, there is no additional freedom to accelerate the exploration of phase space. By contrast, Monte Carlo dynamics is non-physical and only constrained by the global-balance condition. A well-chosen Monte Carlo dynamics can considerably speed up the sampling of the equilibrium distribution. Those equilibrium samples may also serve as starting configurations for parallel molecular-dynamics calculations that give access to high-precision dynamical correlation functions. Furthermore, if more complex out-of-equilibrium rare-event physical phenomena (such as protein folding) are of interest, the time scales of long-time features can be accessed by the inspection of the rare events produced by parallel simulation on Nproc processors. Similar to the half-life analysis of radioactive substances composed of large numbers of atoms, a rare event that takes place on a time scale τ on a single processor will then take place on a time scale τ/Nproc on one of the Nproc processors.
In this work, we develop the framework for the application of ECMC to classical long-range-interacting all-atom systems. In particular, we demonstrate efficient ECMC methods that rigorously sample the canonical ensemble, without even evaluating the total potential. The factorizations that we implement with the cell-veto algorithm allow us to move a single particle from one event to the next in a computer run time that is independent of the number of point charges in a system. For a local charge-neutral system (for example, collections of charge-neutral many-atom molecules), the mean-free path (the mean distance between events) decreases only logarithmically with the number of point charges in the system. This implies that the computational effort required to move every particle in a simulation a constant distance scales as only , with no approximation and without the demanding interpolation onto the mesh that is introduced in many modern electrostatic simulations.
We validate our algorithm through explicit comparisons with a standard Metropolis algorithm and with molecular-dynamics simulations, each performed with Ewald summations. We focus on two conceptual issues. One is the computation of Coulomb pair-event rates, that is, essentially, the derivatives of the two-particle Coulomb potential with respect to the position of the “active” particle. In the simplest version of ECMC, this corresponds to the probability with which an active particle will stop and induce a lifting to another particle. The other issue concerns the factorization schemes of the system potential in which we lump together different interactions that partially compensate each other so that the ECMC mean-free path between events is much increased. We first apply our ECMC algorithm to a pair of like Coulomb point charges and then to systems of charge-neutral dipoles in a three-dimensional simulation box with periodic boundary conditions. We finally demonstrate the perfect agreement of thermodynamic observables between ECMC and conventional Monte Carlo and molecular dynamics for up to 256 water molecules at the standard density and temperature. The freedom offered by ECMC in choosing dynamics, factor decompositions, and lifting schemes leaves ample room for improvements. We expect it to be widely applicable to all-atom simulations of charged systems.
B. All-atom molecular simulations
Of great importance in soft-matter research, biological physics, and related fields, the all-atom approach projects the full quantum-mechanical many-body system onto the reduced classical degrees of freedom of the atomic positions. The projection yields the potential energy as a function of all the particle positions, and the Monte Carlo method can then, in principle, be applied directly. Molecular dynamics also starts from the atomic potential, as the forces in Newton’s equations are given by its spatial derivatives. Present-day parametrized empirical force-field models22,23 further break up the potentials and make them amenable to practical computations. For example, separate terms in the potential typically describe deviations of chemical bonds from their equilibrium values, with individual contributions for stretching, bending, and torsion. Likewise, distinct intermolecular potentials capture longer-ranged features of the interactions; for example, dispersion forces, hard-core repulsions, and long-ranged charge–charge and dipolar interactions. The all-atom reduction from quantum mechanics to a classical interacting system is approximate and not uniquely defined. Various force-field models are used in a number of code bases,24,25 which are also implemented in other prominent codes.26–28 The parameters in each force-field model are optimized to reproduce thermodynamic and structural features over a reduced range of temperatures and pressures. Different potential functions coexist even for the description of simple molecules such as water.29 We use in this work an all-atom potential for water that features two-body bond stretching, three-body bending as well as long-ranged Coulomb interactions, and a Lennard-Jones (LJ) potential.30
Modern codes generally compute the long-ranged Coulomb potential through variants of the Ewald algorithm applied to a discretized analog of the continuous position space. The Fourier contribution to the potential is evaluated by first interpolating each point charge to multiple points on a mesh and then solving the Poisson equation via fast Fourier transform, which, combined, is of complexity per computation of the potential energy. Numerous formulations of this algorithm have been developed starting with the particle–particle–particle–mesh method.31 More recent generations combine the particle–mesh philosophy with the Ewald formula, to create the particle–mesh–Ewald method32 together with many variants33–35 which, together, remain the workhorse of modern simulation codes. The charge interpolation onto the mesh generally presents the main computational workload. These methods use intricate strategies to maintain a high level of accuracy. Mesh interpolation leads to very large self-energy artifacts which have to be subtracted with great care in order not to modify the physical interactions.
Alternative approaches exist for the computation of the Coulomb potential and the electrostatic forces on particles. The hierarchical multipole-moment expansion,36 for example, expands the interactions of a particle with all the other particles in terms of spherical harmonics, and therefore avoids Fourier transforms and mesh interpolations. However, the expansion converges only with high orders of the multipole moments so that one molecular-dynamics time step, although it is of complexity , comes with a prohibitive prefactor. Local algorithms that propagate electric fields rather than solve the Poisson equation also bypass the fast Fourier transform.37–39 This is an advantage in architectures where the Fourier transform involves large-scale non-local information transfers. In these algorithms, the complexity of a single-particle update is but the use of a background mesh to discretize the electrostatic degrees of freedom again leads to costly interpolations from the continuum charges to the discrete space.40,41 In contrast to well-established methods, ECMC is directly formulated in continuous space, and its successful implementation only relies on translational invariance on all length scales. In essence, ECMC requires no discretization of the simulation box, and the total Coulomb potential and forces may remain unknown throughout the simulation.
All-atom molecular-dynamics simulations must take into account a variety of time scales and lengths. Indeed, the high-precision time integration of intramolecular spring forces requires a discretization time in the femtosecond range. The physics associated with the much longer time scales that one wishes to study include density fluctuations (which relax on the picosecond time scale), Debye-layer equilibration (nanoseconds), and conformation changes (milliseconds). At the same time, the precise rendering of dielectric and screening properties requires high-quality computations, and the long-ranged nature of the interaction calls for large system sizes in order to overcome finite-size effects. In order to efficiently manage both the stiffness (the presence of many relevant time scales) and long-ranged potentials, interactions are often broken up and sophisticated multiple time-step algorithms are implemented.42,43 Use of a thermostat44 is crucial in order to counteract a drift of the system energy and to connect the potential-energy surface with the system temperature. The ECMC algorithm considers the same potentials as its competitors, but it is fundamentally event-driven.45 This is exceptional in the presence of continuous potentials, whereas the event-driven formulation for hard-sphere5 or for stepped potentials46 finds its correspondence in event-driven molecular-dynamics algorithms.47,48 In the absence of discrete-time approximations, the exact Boltzmann distribution is sampled at any given temperature. This renders the thermostat unnecessary. In our application, the triggering of events remains well balanced between intramolecular, short-range intermolecular, and long-ranged intermolecular Coulomb events.
The remainder of this work is split into two parts. Part I corresponds to Sec. II, where we review recent advances in ECMC. We present the literature in a consistent mathematical language, which provides a unified framework for the application of ECMC to Coulomb systems. In Part II (Secs. III–V), we apply this framework to all-atom computations of various systems with Coulomb interactions. We demonstrate both the convergence to the Boltzmann distribution and the algorithmic scaling discussed in Sec. I A. The precise comparison of computer run time with established molecular-dynamics and Monte Carlo algorithms is, however, not presented in this work.
II. ECMC ALGORITHM
ECMC5,6 is an irreversible continuous-time Markov process: Its moves are thus infinitesimal. Analogously, Newton’s differential equations are of course also defined in continuous time. The molecular-dynamics algorithms that solve Newton’s equations must be time-discretized for all systems except for hard spheres2 or for stepwise constant potentials.47,48 By contrast, in ECMC, discretization is generally avoided through the event-driven approach. In the present section, we discuss the essential issues of the algorithm’s setup and implementation as well as its complexity.
A. Factors, factorized Metropolis filter
In ECMC, the interactions in an N-particle system are split into a finite or infinite set of factors , where is the power set of the indices (comprising all indices, pairs of indices, triplets, etc), and is a set of interaction types. We refer to IM as the index set of the factor and to TM as its type. The total potential U, which is a function of all particle positions , is written as a sum over factor potentials UM
where UM only depends on the factor indices IM and is of type TM. In Eq. (1), the set only contains factors that have a non-zero contribution for some values of the positions. In a system with only pair interactions, a non-zero factor may be . The corresponding factor potential would then be , and the total potential in Eq. (1) then becomes , which is normally written as U = ∑i<jUpair(ri, rj).
In this work, we use more general factorizations. The Lennard-Jones factor, that we write as , has a factor potential
where rij = rj − ri is the shortest separation vector from particle i to particle j, possibly corrected for periodic boundary conditions. The Lennard-Jones factor “LJ” in Eq. (2) may be replaced by two types, namely, the type LJ6 (describing the 1/|rij|6 part of the Lennard-Jones interaction) and the type LJ12 (describing its 1/|rij|12 part).6 For two indices i and j, this yields two factors, namely, and . Likewise, the bending energy in a water molecule with particles i, j, k will correspond to a factor index and to a factor type given by the specific function chosen for this interaction. A similar approach was introduced for modeling neighboring beads in a polymer.16 In Secs. IV B and V, we consider factors that lump together all of the Coulomb interactions between the four particles comprising two distinct dipoles and even between the six particles of two water molecules, respectively. The factor corresponding to the latter case is given by . (For simplicity of notation, we do not differentiate in this work the Coulomb types for two, four, and six particles.) As mentioned, the set of factors can be infinite,18 even for finite N. As an example, in a finite periodic system, one can view the three-dimensional Coulomb interaction between particles i and j as a sum of interactions between i and each periodic copy of j indexed by an image index . For the case of the above two-water-molecule Coulomb interaction, we would then have . The type set would then contain all of the separate-image Coulomb interactions,
where the set of Coulomb types may be a proper or an improper subset of . We will treat such factor types in Sec. III.
Given the potential factorization enforced by Eq. (1), the Boltzmann weight of configuration reduces to a product over factor weights ,
where cM is the factor configuration, that is, the configuration c restricted to the indices of factor M. The traditional Metropolis filter,1 which defines the acceptance probability for a move from configuration c to configuration c′ in the Metropolis algorithm, does not factorize in a similar fashion,
where is the factor-potential difference between factor configurations cM and . The recent factorized Metropolis filter6 inverts the order of the product and the minimization and thus casts the acceptance probability of a move into the same factorized form as the Boltzmann weight,
The factorized filter in Eq. (7) and the Boltzmann weight are now written as analogous products. Strictly speaking, M is a generalized index denoting a factor or . It is for simplicity that we refer to M as a “factor” rather than a “generalized index for the Boltzmann factor and the filter factor.”
The factorized Metropolis filter satisfies the detailed-balance condition,
This is evident if there is only a single factor [U = UM in Eq. (1) so that Eqs. (5) and (7) are identical] because the Metropolis algorithm itself is well known to satisfy it,
If there is more than one factor, pFact also satisfies detailed balance because the Boltzmann weight π of Eq. (4) and the factorized Metropolis filter pFact of Eq. (7) factorize (that is, break up) in exactly the same way and Eq. (7), on the level of a single factor, is again equivalent to the Metropolis algorithm.
Applying the Metropolis filter pMet of Eq. (5) is equivalent to drawing a Boolean random variable,
where “True” means that the move from configuration c to configuration c′ is accepted. Similarly, the factorized Metropolis filter pFact could be applied by drawing a single Boolean random variable with pFact replacing pMet in Eq. (10). However, because pFact ≤ pMet, this would yield a less efficient algorithm. We rather view the factorized Metropolis filter as a conjunction of Boolean random variables,
Now, XFact(c → c′) is “True” if the independently drawn factorwise Booleans XM are all “True”,
where the uniform random variables are mutually independent for all M.
The conjunction of Eq. (11) formulates the consensus principle: In order to be accepted, the move c → c′ must be independently accepted by all factors M. For example, for a homogeneous N-particle system with pair factors , the move of a single particle k must be individually accepted by the factors . In other words, the move of particle k must be accepted by all other particles, each through its individual Metropolis filter.
For a continuously varying potential, the acceptance probability of a single factor M has the following infinitesimal limit:
where
is the unit ramp function of a real number x. In this limit, the factorized Metropolis filter becomes
and the total rejection probability for the move becomes a sum over factors
In ECMC, the infinitesimal limit generally corresponds to the continuous-time displacement of a particle k at position rk = (xk, yk, zk) and it is usually along a coordinate axis. Supposing that this displacement is in direction , the differential of the factor potential becomes
where
is the factor derivative with respect to particle k. We then define the factor event rate with respect to particle k as
so that each of the terms becomes
The event rate qM,k yields the probability of an event being triggered by particle k within factor M. The total event rate
with respect to a particle k naturally involves only event rates for factors that contain k in their index set.
B. Lifting and factorization schemes
The lifting concept10 is central to ECMC. It lends persistence to the individual Monte Carlo moves and thereby allows one to take the zero-displacement limit. It is in this limit that the sampling of factors becomes unique. We now describe the implementation of a lifted irreversible Markov chain for the simulation of pair-interacting particles,6 starting with a single pair. We then generalize16 the method to complex multi-particle potentials.
In a standard Markov-chain Monte Carlo algorithm, the rejection of a move of some particle at time s imposes that the state c(s + 1) of the Markov chain at time s + 1 remains unchanged with respect to the state c(s) at time s. A new move is then proposed. For a local Monte Carlo algorithm in a particle system, this new move normally consists in an independently sampled displacement applied to another randomly chosen particle. In order to converge toward the correct stationary distribution π, we recall that the Markov chain must satisfy the global-balance condition,
meaning that the total flow into a configuration c must equal its Boltzmann weight.49 The detailed-balance condition of Eq. (8) is only a special solution of Eq. (22). In addition to the global-balance condition, the Markov chain must also be irreducible and aperiodic. These two conditions are easily satisfied;4 the former guarantees that any configuration will eventually be visited, while the latter guarantees that the large-time limit has no hidden periodicities.
In ECMC, any physical configuration c (that is, any set of particle coordinates) is augmented (or “lifted”11) to include the so-called lifting variable describing which particle is “active”,
In principle, the Boltzmann weight now depends on a, but, for simplicity, we require π[(c, a)] = π(c)/N and absorb the normalization factor 1/N into the zero of the potential and omit it in the following.
In ECMC, furthermore, the particle a (the active particle) remains active for subsequent moves as long as they are accepted, and the displacement (in the case that we will treat) is always the same.50 For simplicity of notation, in the following, the displacement η is applied in the direction for all moves so that the position ra is updated to for accepted moves. When a displacement is rejected by a target particle t, the state of the lifted Markov chain changes in the augmented space as
but the physical configuration c remains unchanged. Liftings thus replace rejections, and the resulting ECMC algorithm is rejection-free on the augmented space. The global-balance condition must be written in terms of the augmented configurations, and the probability flow into each lifted configuration (c, a) is then given by the sum of the mass flow , that is, the flow corresponding to a particle displacement and the lifting flow . This sum must equal the statistical weight of (c, a) that, as discussed, equals π(c),
In order to assure irreducibility of the Markov chain, one may change the direction of motion, most simply by selecting from the set in a way that does not need to be random (see the discussion in Sec. V B). In ECMC, the process in between two changes of direction is the eponymous “event chain.” The length ℓ of an event chain (the cumulative sum of the displacements) and the distribution of ℓ are essential parameters for the performance of the algorithm.
To demonstrate that ECMC satisfies the global balance condition and to study the conditions on the lifting probabilities, we first consider a system of two particles . We may suppose, without restriction, that the active particle is 1 so that, at a given time, the lifted configuration is (c, 1). This lifted configuration can only be reached from two other lifted configurations, one that differs in the configuration variable and the other in the lifting variable (see Fig. 1). The lifted configurations and the corresponding flows are
where , , and . The mass flow of the lifted algorithm from (c″, 1) to (c, 1) equals the total Metropolis flow from the non-lifted configuration c″ to c. Because of detailed balance, the latter equals the (non-lifted) Metropolis flow from c to c″ so that
The lifting flow in Eq. (26) equals the rejection probability of the Metropolis move c → c′. Because of translational invariance (c″ is a translated version of c′), it agrees with the Metropolis rejection probability of the move back from c to c″,
and thus add up to the Boltzmann weight π(c) and global balance is satisfied. The validity of the lifted algorithm (which only satisfies global balance, but breaks detailed balance) hinges on the fact that the underlying Metropolis algorithm satisfies detailed balance and on the translation invariance of the system.
In the infinitesimal limit, for N particles and a particle-pair factorized potential, the total probability flow into a lifted configuration (c, a) has up to N components, namely, N − 1 lifting flows from (c, k) to (c, a) for k ≠ a and one mass move from (c′, a) to (c, a), where c′ is again the non-lifted configuration with xa replaced by xa − dx. This corresponds to one lifting flow equivalent to that in Eq. (26) per target particle k ≠ a and a mass flow that is the infinitesimal analog of that in Eq. (26). Furthermore, a particle-pair potential may be further factorized according to multiple factor types TM; there then exist N − 1 lifting flows for each factor M consisting of two particles (|IM| = 2, with IM the index set of M). Of course, factors that do not contain a in their index set do not contribute to this flow.
Factors M with more than two particles (|IM| > 2) can also be handled within the lifting framework16 because, by translational invariance, the sum over the factor derivatives with respect to particle k satisfies
It is useful to separate the particle indices k ∈ IM of a factor M into two sets (with positive factor derivatives) and (negative factor derivatives) such that
where the factor derivatives satisfy
[see Fig. 2(a)].
The mass flow into a lifted configuration (c, k+) with by itself satisfies global balance,
so that there can be no additional lifting moves into (c, k+). This implies that lifting moves are always as (c, k+) → (c, k−), that is, from an active particle in to a target particle in . By contrast, the mass flow into the configuration (c, k−) is smaller than πM(c),
The total lifting flow into (c, k−) comes from all lifted configurations (c, k+) with ,
where is the lifting probability from k+ to k− once the displacement of k+ has been rejected. In order for global balance to hold, Eqs. (34) and (35) must add up to π(c) for all k− ∈ M−. Therefore, and for the algorithm to be rejection-free, one needs16
Equations (36) and (37) can be visualized as intervals of length placed on the upper row of a two-row table and of intervals of length on the lower row [see Figs. 2(b)–2(e)]. The total lengths of the two rows are equal [see Eq. (32)], and is the fraction of the interval k+ on the upper row that lifts into k− on the lower row. Equation (36) describes a conservation of the interval lengths from the upper row to the lower row.
For a pair factor (|IM| = 2), each row has one element and the lifting is unique [; see Fig. 2(b)]. For a three-particle factor (|IM| = 3), if , again clearly for each one of the particles [see Fig. 2(c)]. If and , then Eq. (36) yields the unique branching probabilities16 from k+ to and ,
which is readily understood from Fig. 2(d). Analogously, for factors with |IM| > 3, the “ratio” lifting corresponds to cutting up each element in the upper row of the table into pieces of length proportional to the elements in the lower row so that
C. Event-driven and cell-veto methods
The implementation of ECMC differs notably from that of the Metropolis algorithm, both because of the continuous-time nature of the Markov chain, which can be simulated without approximations using the event-driven approach,45 and because of the consensus property, which can be checked in operations via the cell-veto method, even for infinite-ranged interactions.18 (This method can be understood as a “thinning” of the underlying nonhomogeneous Poisson process.51) The event-driven formulation of ECMC and the efficient establishment of the consensus are explored in the present section. The intent is to overcome the limitations of time-driven ECMC which considers a finite move of the active particle,
This move is either accepted (and then repeated) or it leads to a rejection (by a factor containing particle a), and it gives rise to a lifting (or possibly to multiple simultaneous liftings). The complexity of time-driven ECMC is per displacement . Time-driven ECMC has a discretization error, as it becomes inconsistent if more than one factor simultaneously rejects the move in Eq. (41). The parameter η must be small enough for multiple rejections to be rare. Time-driven ECMC is thus slow, especially for long-ranged interactions, and inexact. It is useful only for testing.
The finite-move ECMC can be implemented as an event-driven, rather than as a time-driven, algorithm,45,52 and because all factors are independent, we may consider a single one of them. In the above time-driven ECMC, if the move in Eq. (41) (the first move, m = 1) is accepted, another displacement of magnitude η is attempted. The lth move is
After m − 1 acceptances, finally, the mth such move is rejected (and leads to a lifting). The parameter m is itself a random variable distributed with a factor-dependent probability
where is the change corresponding to the lth move in Eq. (42). The variable m can be sampled from Eq. (43) and the move accepted in one step. Although the right-hand side of Eq. (43) gives a probability distribution for the displacement of the active particle a, it only depends on the positive increments of the factor potential. In the continuum limit η → 0, the second term on the right-hand side becomes , that is, the factor event rate of Eq. (20), where ηM is the total displacement before a rejection by factor M takes place. In this limit, the exponent in the first term on the right-hand side contains the integral of the factor event rate for the displacement of ra between 0 and ηM. This gives the probability density45
In Eq. (44), the exponential distribution is sampled by
where
In other words, is the cumulative event rate of Eq. (20). Equation (46) is an implicit relation for the limiting displacement ηM at which the rejection takes place as a function of the sampled value of . For a two-particle factor , the integration of the pair event rate in Eq. (46) consists in the replacement of the potential UM by a related potential which is zero at ra and where all the negative increments are replaced by horizontal lines (see Fig. 3).
As mentioned, the factors are independent and each concerned factor M provides a value ηM. The next event takes place at
and the factor which realizes this minimum (that is, η),
is the one in which the lifting takes place. For a continuous potential, this factor is uniquely defined and possible simultaneous events, due to finite-precision arithmetic, are too rare to play a role.
The integration of the factor event rate in Eq. (46) can be tedious if it cannot be cast into an explicit analytical form. This will, for example, be the case for the Coulomb potential in the merged-image framework of Sec. III C. In addition, the inversion of the factor potential [the computation of ηM in Eq. (46)] can be non-trivial. Finally, this calculation must in principle be redone for all the factors that contain the active particle a. For a long-ranged potential, this requires event-rate integrations and inversions per event. The cell-veto algorithm,18 by use of a comparison function, avoids the integration and the inversion of the event rate, and it moreover reduces the overall complexity of ECMC to per event.
We again first consider a pair factor , with 1 being the active particle. The lifted position is (c, 1) [with c = (r1, r2)] and the displacement is again in direction (as in the situation in Fig. 1). We embed the two particles in disjoint cells and (see Fig. 4). The potentials that we consider here are singular only at r1 = r2 so that the event rate for factor M may be bounded by a constant “cell-event” rate ,
where the right-hand side only depends on the factor type. This factor-type dependence may take into account separate cell schemes that could, for example, correspond to Coulomb interactions between isolated charges, dipole–dipole interactions, or to the Lennard-Jones potential. (We recall that we do not differentiate the different Coulomb types for 2, 4, 6 particles to ease notation.) In this work, the condition is adequate to ensure a reasonable value of the cell-event rate. In other cases,18 one must exclude a local set of cells and treat local neighbors outside the cell-veto framework. Cell-event rates are easily tabulated in advance of the ECMC computation proper.
The probability of the event taking place for an infinitesimal displacement dx equals qM,1(r1, r2)dx. Since
the event can initially be sampled as a “cell event” with the constant infinitesimal probability , before being confirmed with the finite probability . We may suppose that the cell event takes place at a lifted configuration (c′, 1) with
where can be sampled via
Three outcomes are possible for the sampled values of η and the subsequent confirmation step. First, the cell event may correspond to a configuration c′ [in Eq. (51)] that is already outside the active-particle cell (). In this case, the move is (c, 1) → (c″, 1), where c″ is the configuration intersecting the trajectory of particle 1 with the boundary of . Such a cell-boundary event moves the particle, but does not trigger a lifting. Second, the cell event may take place at a configuration but fails to be confirmed as an event (because a uniform random number ) [see the second term on the right-hand side of Eq. (50)]. In this case, the move is (c, 1) → (c′, 1) and no lifting takes place. Third, a cell event may take place at a position and it is confirmed as an event. This event induces a lifting (c′, 1) → (c′, 2) [see Fig. 4(b)]. In this whole process, the factor derivative is evaluated only when a cell event is triggered from the exponential distribution in Eq. (52). The costly integration of the factor event rate in Eq. (46) is thus avoided.
For an N-particle system, the cell-veto algorithm organizes the search of the next lifting in operations. It suffices to choose a regular grid of cells such that, normally, only a single particle belongs to each cell. (Exceptional double-cell occupancies can be handled easily.18) In this case, the total event rate with respect to the factor type TM for an active particle in is bounded by the total cell event rate,
In a translationally invariant system, the total cell event rate does not depend on the active cell so that , a constant that is computed before the ECMC simulation starts from the total number of cells that scales as . The next cell event is obtained from an exponential distribution with parameter . This event corresponds to cell with probability , posing a discrete sampling problem that can be solved in by Walker’s algorithm.18,53
The cell-veto algorithm samples the Boltzmann distribution without performing the event-rate integration in Eq. (46). It requires only factor-potential evaluations per event in an N-particle system. As a consequence, the total potential of Eq. (1) is not updated and the potential remains unknown as the Markov chain evolves. This is what sets ECMC apart from traditional simulation approaches.
III. ECMC COULOMB ALGORITHMS
In a three-dimensional simulation box with periodic boundary conditions, the Coulomb potential is only conditionally convergent for a charge-neutral system, and it is infinite for a system with a net charge. Finiteness of the potential can be recovered in both cases if each point charge is compensated by a background charge distribution. Traditionally, this is chosen as uniform within the simulation box.17 The precise association of each background charge with its point charge is not unique. This leads to different electrostatic boundary conditions, which are linked to the polarization state of the simulation box. Consistency imposes a distinct fluctuation theorem17 for each choice of the boundary condition when computing macroscopic physical properties such as the dielectric constant. Alternatively to the uniform compensating background charge, in ECMC, a line-charge model was introduced.18 In this model, the background charge distribution is one-dimensional and the factor derivatives are absolutely convergent. The potential for different variants of the line-charge model can be absolutely or conditionally convergent.
As discussed in Sec. II A, ECMC allows for different Coulomb factor sets that may influence the convergence properties of the algorithm, although the steady state is invariably given by the Boltzmann distribution. Roughly, there are two inequivalent Coulomb factorizations.18 First, the periodic two-particle problem can be embedded on a three-dimensional torus and the potential merged from all the topologically inequivalent minimal paths between particles [see Fig. 5(a)]. For two particles, , this “merged-image” system has a single factor . For N particles, this gives the factor set
In general, the merged-image factors may comprise more than two particles, but they do not distinguish between the different images of a local configuration (for example, an H2O molecule). Second, we may picture the three-dimensional periodic system as an infinite number of periodic images of the simulation box indexed by an integer vector . For two particles already, this “separate-image” system has an infinite number of factors and for N particles, the factor set is
More generally, an individual “separate-image” factor may describe an image of certain particles inside the simulation box.
The aim of this section is threefold. First, we present the tin-foil and the line-charge Coulomb formulations and then demonstrate that, although the potentials differ, the Coulomb factor derivatives (that for pair factors yield the pair event rates) are identical. Second, we discuss two efficient algorithms for the merged-image Coulomb derivatives of a pair of particles, one algorithm from the tin-foil perspective and the other summing up line-charge derivatives. Third, we set up an ECMC simulation for two particles in a periodic three-dimensional simulation box in order to validate that the merged-image and the separate-image factor sets indeed show indistinguishable equilibrium properties. We then discuss possible applications for both factorizations.
A. Tin-foil electrostatics within ECMC
The traditional treatment of electrostatic interactions with periodic boundary conditions is based17 on a large spherical aggregate of images of the three-dimensional cubic simulation box. The polarization state of the simulation box is expressed through electrostatic boundary conditions. With “tin-foil” boundary conditions, the potential of N particles of charge ci (in units where the Coulomb potential between two point charges in free space is Uij = cicj/|rij|), is17
with the electrostatic potential ψ
where the Fourier-space sum is over q = 2πm/L with . The self-energy contribution Uself(α) is independent of the particle positions and drops out of our considerations, which are only concerned with derivatives of the potential. The left-hand side of Eq. (57) is independent of the convergence factor α > 0, which however influences the speed of evaluation of Eq. (58). Direct evaluation of the sums for N point charges leads to an optimal choice α ∼ N1/6/L, and a scaling in operations . The particle–mesh Ewald method uses an interpolating mesh to approximate the Fourier sum, leading to operations to evaluate the potential. In merged-image ECMC, we only use Eq. (58) for N = 2 with and evaluate the derivative of the Coulomb potential to machine precision with effort.
We continue, as in Sec. II B, with a two-particle factor . The tin-foil factor derivative is given by
with the real-space derivative ,
and the Fourier-space derivative ,
For two particles and, more generally, for pair factors in an N-particle system, the merged-image Coulomb pair-event rate, from Eq. (59), is given by
In Secs. IV and V, we will consider dipole–dipole factors with an index set comprising the four or six particles of two molecules and the “Coulomb” type corresponding to all the Coulomb interactions between the two molecules. The factor potential in this case is the sum over Coulomb pairs within the factor, and the factor derivatives needed in Eq. (36) are the sum of a finite number of pairwise Coulomb derivatives as in Eq. (59). The evaluation of the dipole–dipole factor derivatives remains of complexity because the number of elements in each factor remains finite as N → ∞. In ECMC, at most a single factor has to be evaluated precisely for each move (see Sec. II C), whereas in traditional MCMC or MD computations the Coulomb potential in Eq. (57) or its derivatives are computed for all N particles.
B. Line-charge model
In a large periodically reproduced aggregate of the simulation box, the sum over the Coulomb derivatives between a charged active particle and multiple target images (without neutralizing backgrounds) is ill-defined. However, the compensating uniform volume charge is not the only option to regularize the sum, as the line-charge model18 and its variants provide alternatives to tin-foil electrostatics. Here, straight lines of charges are associated with each copy of the target particle, and aligned with its direction of motion [in our example , see Fig. 5(b)]. Although the merged-image line-charge potential, in its simplest version, is itself not absolutely convergent, its factor derivatives are unequivocally defined and equivalent to those obtained with tin-foil boundary conditions. By itself, the line charge neutralizes the charge of the target particle and (because it is centered) also creates an object with zero dipole moment. Previous work18 used line charges of length L. Here, we consider lengths pL with integer p [see Fig. 5(b)]. The line charges are replicated over a cubic lattice indexed by the lattice vector n. Lines of different images meet [see Fig. 5(b)]. The Coulomb potential of the line-charge model naturally differs from the one of the tin-foil model because the background charge distributions are manifestly different. However, the merged-image Coulomb derivative of the line-charge model, relevant to ECMC, is identical to the tin-foil expression.
Explicitly, the contribution to the Coulomb derivative from an image n [with n = (0, 0, 0) the original simulation box] is
The line charge generates an electrostatic potential at large separations, r = Ln, which varies with a quadrupolar form. Thus, in any given direction the Coulomb derivative decays as 1/|r|4. For this reason, the sum over the images of the Coulomb derivatives of Eq. (63) converges absolutely. The merged-image Coulomb derivative, in the line-charge formulation, is thus
To show this, we first consider the target particle 2 in the simulation box and all its images to be surrounded by a cube of neutralizing charge of volume L3 centered on the particle 2 and its images. This volume-charge model [see Fig. 5(c)] is closely connected to the line-charge model [see Fig. 5(b)]. The point charge and associated volume charge have vanishing charge, dipole, and quadrupole moments (whereas the line-charge model, in its simplest form, has a finite quadrupole moment). We now compare spherical (radius R ≫ L) and cubic aggregates (of side 2R) of target images and study the electrostatic potential within the central simulation box. In this process, the active particle is not replicated, and it remains within the simulation box. Due to the vanishing quadrupole moment of the volume charges, the difference in the electrostatic potential on the particle 1 in the spherical and cubic aggregates decreases at least as fast as 1/R2. However the electrostatic potential in the center of the spherical aggregate corresponds to a zero-polarization state which is identical to the tin-foil expression of Eq. (58).
We now find explicit integral expression for the Coulomb derivative of an aggregate of line charges and volume charges and show that the difference is zero in the limit of a large assembly. We again consider the interaction between an active particle and the cubic aggregate of the (2K + 1)3 copies of the target particle (the central simulation box and its images). (The active particle is placed inside the simulation box.) The Coulomb potential between the active particle and a single target particle is
where ρ2(q) is the structure factor of the target particle and the background. We now sum over the images, separated by a multiple of the simulation box size L along each axis. This requires evaluating the sum
and analogously for qy and qz. With the product
this gives the potential of the active particle in the aggregate of the target particle and its images,
Equation (66) is the Dirichlet kernel which converges, in a weak sense, to a sum of δ-functions in the limit of large K,
and similarly for qy and qz. The width of the central peak of DK scales as 1/K for large K. Integrals over sufficiently well-behaved objects become summations in the limit of large K,
For the volume-charge model, the structure factor is
where the first term on the right-hand side describes the point charge and the product of cardinal sine functions, sinc(qx) = sin(qx)/qx, etc., the uniform background volume charge.
From Eqs. (68) and (71), the potential of a finite cubic array of images of the particle 2, with active particle 1, is
For line charges of length pL, we find
The volume-charge model is equivalent to the tin-foil Coulomb potential. The line-charge model, whose potential is not absolutely convergent, is nevertheless equivalent for ECMC because, as we will see, the integrals in Eqs. (72) and (73) yield uniquely defined and equivalent Coulomb derivatives for large K. The difference between the two is given by
The Dirichlet kernels imply that the integral in this equation is dominated by contributions near q = 2πm/L. However, the function sinc(qiL/2) also has zeros at these same points (except when qi = 0, where the sinc function is equal to one). For large K, the potential differences is thus dominated by a sum over qy, qz, with qx = 0. This implies that the potential on the active particle equals (to within a constant) the tin-foil potential for motion parallel to the line-charges, but the difference of potentials is corrugated in the perpendicular y–z plane. This is a consequence of the fusion of multiple aligned line charges into a single uniform line when p is integer [see Fig. 5(b)].
We examine the derivative of ΔUK to show that the Coulomb derivatives converge to the same value,
which suppresses the contributions which remained for the calculation of the potential, due to the factor qx sin(qxx) near qx = 0.
Finally, we consider explicitly the possible divergence at |q| = 0 in Eq. (74), due to the presence of the term 1/|q|2. We expand all the trigonometric functions in the integrand, ΔIK, to find
Even this contribution is thus driven to zero for large K. We conclude that in a periodic three-dimensional system, the line-charge model becomes equivalent to the volume-charge model, and therefore to tin-foil electrostatics. The line charges must lie parallel to the direction of motion but can of course be switched at will. In contrast, the volume-charge model gives the tin-foil Coulomb derivatives in all directions.
C. Algorithms for Coulomb derivatives
The merged-image Coulomb derivatives are best computed from the tin-foil expressions of Eq. (62). To accelerate the evaluation, we reduce the Fourier-space component of Eq. (61) to a sum over non-negative components (mx, my, mz),
where , and similarly in y and z and where
is a position-independent tensor that can be computed before the simulation starts. In Eq. (75), repeated indices (x, y, z) are summed over non-negative integers (mx, my, mz).
The merged-image Coulomb derivatives can also be computed from the sum of the line-charge derivatives [see the right-hand side of Eq. (64)]. Because of the symmetry of the line charges, the quadrupolar contribution to the derivative is an odd function of x so that forward and backward terms cancel, and that the sum converges as 1/K2 for large K. The convergence may be accelerated using Richardson extrapolation54 (see Fig. 6). Denoting the finite line-charge sum over the range n ∈ [−K, K]3 as SK and assuming that
one may eliminate A as
The sequence ( − S∞) then decays as 1/Kp+1. The transformation of Eq. (78) can be iterated, each time gaining one power in the asymptotic behavior of the sequence. The merged-image line-charge derivatives converge to the tin-foil expression of Eq. (59), confirming that the two algorithms compute the same object and that individual factors in the line-charge model may be used to simulate tin-foil potentials.
As in the line-charge model, one may sum up the associated point charges and their compensating volume charges explicitly, rather than proceeding through Fourier transformation. However, the analytic formulas are difficult to work with. A further possibility consists in compensating each point charge with more than one line charge. Remarkably, four line charges arranged on a square of side in the y–z plane, cancel dipole and quadrupole moments in the multipole expansion and lead to an absolutely converging sum for the electrostatic potential. One may also construct more elaborate sheets and volumes of screening charges to cancel higher orders in the multipole expansion. All of these screening objects presented here regularize the sum of the pair derivatives over images and allow for separate-image factor sets [analogous to Eq. (56); see Sec. III D]. Although the sequence SK decays faster, the Coulomb event rate is not reduced by these different objects.
D. Separate-image ECMC
As we have seen, all the Coulomb interactions in a finite system with periodic boundary conditions can be image-merged into a single Coulomb type that sums over all the inequivalent minimal paths between two points on a torus, and that correspond to images in the rolled-out representation of periodic boundary conditions. For two particles 1 and 2, this is expressed through a single factor . The corresponding factor derivatives can then be computed with the traditional tin-foil expression [Eq. (59)] or within the line-charge framework [Eq. (64)]. The choice of one over the other is a matter of efficiency only (the algorithmic complexity being the same). Each of the formulations suggests other choices for the interaction types. In the line-charge formulation, the choice of an infinite set of types suggests itself. For two particles 1 and 2, the set of separate-image factors is . Within ECMC, these images are statistically independent but only one of them must be computed precisely for each event. This is because, as in Sec. II, we can use a variant of the cell-veto algorithm (supplemented with an asymptotic bounding function18), in order to sample the relevant image index n and to then compute the corresponding factor derivative of Mn.
Separate-image Coulomb factors generally come with larger pair event rates, as the contributions from different images do not compensate (see Fig. 7). On the other hand, evaluating a separate-image Coulomb derivative [as in Eq. (63)] to machine precision requires just a few operations, many fewer than what is required for its merged-image counterpart. Details of the separate-image Coulomb factors can influence the efficiency of the algorithm. As an example, the terminal point of the line charge is a singular point of Eq. (63) and should not approach another point charge in the system. This motivates our choice of length 2L (or multiples thereof), as the terminal point of one line charge then coincides with the position of an image of the original particle. For the Coulomb potential, the nonphysical line-charge singularity, confounded with the singularity of the point charge, no longer disrupts the ECMC dynamics.
The dynamic behavior of the different factor sets for the Coulomb problem has not yet been explored in detail. As a first step, for a system of two like Coulomb charges, merged-image and separate-image ECMC was validated against the regular tin-foil Metropolis algorithm (see Fig. 8). All three methods clearly sample the Boltzmann distribution in the asymptotic steady state.
IV. DIPOLE–DIPOLE FACTORS
In ECMC, one may tailor the factor sets to the problems at hand. In electrostatic systems made up of local dipoles, specific “dipole–dipole” Coulomb factors may thus contain all the atoms distributed over two molecules that can be far apart from each other. These factors yield much smaller event rates than “particle–particle” pair factors. In addition, a special “inside-first” lifting scheme can direct most of the lifting flow from the active particle to a target particle situated on the same molecule. Even for a non-local factor made up of two distant dipoles, the lifting flow will thus mostly be between an active particle and a target particle on the same molecule (the probability of an intramolecular lifting grows like log N, whereas all the intermolecular liftings remain constant). We expect such a local lifting scheme for extended factors to show interesting dynamic properties. In the present section, we explore dipole–dipole factors in a simple model of charge-neutral two-particle molecules before employing them, in Sec. V, to a model of liquid water. We expect dipole–dipole factors and their variants to have useful applications in ECMC.
Concretely, for a simple model of two-particle dipoles in a three-dimensional periodic simulation box, the dipole–dipole factor for the particles is given by
[see Fig. 9(b)], where the corresponding Coulomb factor potential is
The factor of Eq. (79) thus comprises the four Coulomb potentials between these particles, using the Coulomb potential of Eq. (57). The model excludes, as is usual,30 Coulomb interactions within a dipole. For the same four particles, one may also use the “particle–particle” factors
with the “particle–particle” factor potential
[see Fig. 9(a)]. We suppose that the particle 1 is active. The dipole–dipole event rate
then allows the interactions UC(r13) and UC(r14) to compensate each other (and to give the event rate corresponding to a point charge interacting with a dipole), while the particle–particle event rate
remains much larger (corresponding to a point charge separately interacting with two isolated point charges) because the unit-ramp functions are both non-negative [see Eq. (14)] and one of them is usually zero.
A. Event-rate scaling for Coulomb factors
We now consider a homogeneous system of dipoles of size |d| ∼ d small compared to the simulation box (see Fig. 10). For concreteness, we suppose that particle 1 is the active particle. The event rate, whose scaling with system size we compute in the present section, is the result of the interaction between the particle 1 and the distant dimer (in Fig. 9 made up of particles 3 and 4). As there is no Coulomb interaction between particles on the same dipole, the position of particle 2 (the dipole partner of particle 1) does not come into play for the event rate. We will see in Sec. IV B that this is no longer true for the lifting rates, which are influenced both by the distant dimer and by the local dimer of particle 1, that is, by the position of particle 2.
The electrostatic potential at a distance r from a point charge ck, within the merged-image (tin-foil) formulation in a box of side L, is given by the scaling form
which generalizes Coulomb’s law valid in free space. The function fE(x) is smooth and remains for all x ∈ [−1/2, 1/2]3. For separations such that |r|/L ≪ 1, the potential given by Eq. (85) has the expansion55
The nth-order derivatives of fE(r/L) are also smooth and have an amplitude which scale as L−n. The Coulomb derivative between an active particle and a particle k, separated by a vector r ∈ [−L/2, L/2]3, also has the scaling form
Here, we have introduced the characteristic Bjerrum length lB = |e2|β, with e being the elementary charge, the distance at which the Coulomb interaction equals the thermal energy and used as a new scaling function, which again remains . An explicit form for Eq. (87) at small separations can be found from Eq. (86). For a constant number density ρ of particles within the simulation cell, the mean total Coulomb event rate per particle, , is given by the integral
This mean total event rate thus diverges as . The reciprocal of sets the scale for the mean-free path due to charge–charge interactions, and it is of length scale . The result agrees with the naive free-space argument18 based on the bare 1/|r| Coulomb interaction. At constant density, the divergence of Eq. (89) in L ∼ N1/3 implies that the active and target particles are often widely separated from each other. With pair factors, one thus expects a complexity of for an displacement of all particles in the system.
The scaling form of the potential can also be used to determine the event rate for dipole–dipole factors [as in Fig. 9(b)], the interaction of point charges with dipoles, or the interaction of pairs of well-separated dipoles. The potential at a distance r from a dipole in the periodic box is found from Eq. (85) by applying the operator (−d·∇), with d the dipole moment. Using again |d| ∼ d implies that the event rate of the dipole–dipole factor, resulting from the interaction of the active particle 1 with the dipole at a distance r corresponds to a particle–dipole Coulomb interaction. The dipole–dipole event rate, for two dipoles separated by a vector r ∈ [−L/2, L/2]3 is given by
where r denotes the vector from the active particle to the dipole. Equation (90) implies that ECMC with dipole–dipole factors has a much lower mean total Coulomb event rate ,
where is another scaling function. The second integral in Eq. (91) is weakly divergent near the origin (which simply means that in ECMC very nearby dipoles have to be treated individually). Excluding a region of radius , the mean total Coulomb event rate using dipole–dipole factors is
This much reduced total event rate, obtained by limiting the contributions from large distances, is our main motivation for using dipole–dipole factors.
The scaling obtained in Eqs. (90) and (92) is independent of the specific definition of the dipole model. It only relies on the use of dipole–dipole factors connecting two charge-neutral molecules that may be far apart (see Sec. V, where the dipoles are realized by H2O molecules). The scaling is also insensitive to the introduction of screening charge distributions, and it holds both for the merged-image and for the separate-image factor sets. Adapting this factorization framework to systems composed of molecules that behave as approximate higher-order multipoles would further improve the scaling.
B. Dipole–dipole lifting schemes
We now consider lifting schemes for dipole–dipole factors, and for concreteness, we consider a four-particle system of particles , forming a charge-neutral dipole d12 and particles , forming an analogous dipole d34. In this two-dipole system, particle 1, for example, not only interacts with a charge-neutral dipole d34, but is itself inside such a dipole d12. Although the Coulomb lifting rate is oblivious to the position of 2 (as there is no Coulomb interaction between particles 1 and 2), particle 2 is part of the dipole–dipole factor, and its position influences the relative lifting rates.
We obtain the derivatives with respect to particles 1 and 2 for the factor as follows:
The dominant terms in these two equations are equal in magnitude yet opposite in sign, reflecting that particles 1 and 2 interact with the same distant dipole d34, are of opposite sign, and close to each other (on the dipole d12). For the factor derivatives with respect to particles 3 and 4, we find
[For ease of notation, we used here Eq. (86) for small |r|/L rather than the full scaling form.]
The coefficient a (and analogously for ã) reflects the orientation of d34 with respect to the distance vector between the two dipoles (see Fig. 10). Remarkably, the factor derivatives of M with respect to the particles within each dipole ( and ) cancel at order 1/|r|3 and leave a remainder of 1/|r|4. This dipole–dipole compensation to order 1/|r|3 of the factor derivatives is a general feature for pairs of local dipoles (that can be composed of more than two atoms) inside a factor and occurs in the same manner with the full scaling functions in the merged-image potential.
We recall from Eq. (29) that the four factor derivatives exactly sum up to zero. As illustrated in Sec. II B (see Fig. 2), the lifting scheme corresponds to arranging the indices on the upper row of a two-row table and the indices on the lower row. In a factor with large separation |r|, each row contains one element corresponding to each of the two dipoles (see Fig. 10).
The “ratio” lifting scheme is as described in Sec. II B. All elements fall off as [see Eq. (90)], and both rows contain elements representing each dipole. From Eqs. (94) and (96), this leads to comparable proportions of intra- and inter-molecular liftings. Both rates fall off at the same rate, but their coefficients are different reflecting the orientations of the dipoles. The total inter- and intra-dipole lifting rates both scale as log L [see Fig. 10(b) and Table I].
Lifting scheme . | qintra . | qinter . | . | . | Lifting . |
---|---|---|---|---|---|
Particle . | 0 . | 1/|r|2 . | 0 . | L . | inter-dipole . |
Ratio | 1/|r|3 | 1/|r|3 | log L | log L | inter + intra |
Outside-first | 1/|r|3 | 1/|r|3 | log L | log L | inter + intra |
Inside-first | 1/|r|3 | 1/|r|4 | log L | const | inter-dipole |
Lifting scheme . | qintra . | qinter . | . | . | Lifting . |
---|---|---|---|---|---|
Particle . | 0 . | 1/|r|2 . | 0 . | L . | inter-dipole . |
Ratio | 1/|r|3 | 1/|r|3 | log L | log L | inter + intra |
Outside-first | 1/|r|3 | 1/|r|3 | log L | log L | inter + intra |
Inside-first | 1/|r|3 | 1/|r|4 | log L | const | inter-dipole |
In the “inside-first” lifting scheme, the elements corresponding to each dipole are aligned with each other. The two match to order ∼1/|r|3. The mismatch in bar length is in Eqs. (93) and (94). In the full scaling picture, the difference in length of the elements can be computed analogously. Coulomb liftings thus occur mostly within a dipole, and long-ranged inter-dipole liftings remain bounded in number for large system sizes [see Fig. 10(c) and Table I].
Finally, the “outside-first” lifting scheme consists in vertically aligning elements corresponding to different dipoles. Aligned elements are of length ∼|a| and ∼|ã| so that intra- and inter-dipole lifting rates again both fall off as . The situation is analogous to the one for the “ratio” lifting, and the “outside-first” scheme remains strongly non-local [see Fig. 10(d) and Table I].
In contrast to the above dipole–dipole factors, the “particle–particle” factor, as argued in Eqs. (87) and (89), produces events which occur at the scale of the simulation box at a rate which decreases as only 1/|r|2, leading to a total event rate increasing linearly with L. The lifting flow is between one dipole and the other, and the intra-dipole lifting rate is zero (see Table I).
C. Validation of factors and liftings
The dipole–dipole factors and their different lifting schemes can be checked for consistency for two charge-neutral dipoles with a short-ranged vibrational intra-dipole potential, a repulsive potential between oppositely charged particles (needed to keep dipoles apart from each other), and intermolecular Coulomb interactions. With particles numbered as in Fig. 9, the model corresponds to a factor set
with the harmonic bond factor potential,
with kb > 0, a short-range repulsive potential
with k2 > 0, and a scalar separation r0, in addition to the dipole–dipole Coulomb factor potential of Eq. (80).
The dipole–dipole Coulomb factor differs from the particle–particle Coulomb factors in the set,
where the factor potentials corresponding to bond vibrations and the repulsion between unlike charges are as in Eqs. (98) and (99) and the Coulomb factor potentials are those of Eq. (82). In addition, since |IM| = 2 for each particle-factorized factor M, we have no freedom in choosing a lifting scheme (see Sec. IV B).
The “ratio,” “inside-first” and “outside-first” lifting schemes for the dipole–dipole factor are easily implemented and compared to the particle–particle lifting scheme. By construction, they yield identical thermodynamic correlations (see Fig. 11). Although the event rates are fixed by the decomposition of the total potential into factors, the different lifting schemes may differ in their dynamical behavior.
V. LIQUID WATER AND DIPOLE–DIPOLE FACTORS
To explore ECMC in a realistic context, we implement in this section the simple point-charge water model with flexible molecules (SPC/Fw), a well-studied all-atom model for liquid water.30 This model combines the long-ranged Coulomb potential with hydrogen–oxygen bond-length vibrations, a flexible hydrogen–oxygen–hydrogen angle, and a specific oxygen–oxygen interaction of the Lennard-Jones type. The SPC/Fw model is closely related to one used in molecular-dynamics simulations of solvated peptides.43
Naturally, each water molecule is charge-neutral and dipolar so that the dipole–dipole factorization of Sec. IV applies. This realizes a mean-free path for a single particle as ∼1/log N in the thermodynamic limit (an earlier ECMC Coulomb algorithm18 had obtained a mean-free path scaling as ∼1/N1/3).
A. Factors in the SPC/Fw water model
To simulate liquid water with the SPC/Fw potential, we use the following type set:
As an example, the factor set for two water molecules, containing particles and , respectively, [and with 2 and 5 being the oxygens, see Fig. 12(a)] is
This factor set [see Fig. 12(b)] trivially generalizes to more than two H2O molecules.
In Eq. (102), the “bond” factor potential of Eq. (98) describes oxygen–hydrogen bond vibrations with the equilibrium bond distance r0 = 1.012 Å and kb = 1059.162 kcal mol−1 rad−2, that correspond to the SPC/Fw parameters. The “bending” factor potential describes the fluctuations in the bond angle within each H2O molecule,
where and denote the internal angle between the two legs of each H2O molecule (see Fig. 12). We adopt the SPC/Fw parameters: ϕ0 = 113.24° and ka = 75.90 kcal mol−1 Å−2. The specific Lennard-Jones interaction between oxygen atoms corresponds to the “LJ” factor potential
where kLJ = 0.62 kcal mol−1 and σ = 3.165 Å are prescribed in the SPC/Fw model. The Lennard-Jones potential is truncated beyond 9.0 Å. This truncation, however, is unnecessary if the cell-veto algorithm is used. Finally, the dipole–dipole “Coulomb” factor potential, in direct generalization of Eq. (80), is given by
Here, the Coulomb potential of Eq. (57) is used with the SPC/Fw parameters c1 = c3 = c4 = c6 = 0.41e and c2 = c5 = −0.82e (with e the elementary charge).
The type set of Eq. (101) is by no means unique. We could also break up the Lennard-Jones interaction into two types, corresponding to the two components of the Lennard-Jones potential (as discussed in Sec. II A). Also, instead of the merged-image Coulomb type, we could adopt any of the variants of the separate-image type, resulting in a type set,
Finally, it is possible to break up the “bond” and “bending” factors into equal terms in order to construct a unique dipole–dipole factor for each pair of H2O molecules in such a way that the type set only contains a single element. All these choices are correct, but they may differ in the ease of implementation and in the speed with which they approach equilibrium.
B. Intrinsic rotations
Our version of ECMC is formulated in terms of displacements that, for a given event chain, are along one of the directions . Each individual event chain can strain the system, but is unable to rotate it, as the coordinates perpendicular to the direction of motion remain unchanged. The flexible SPC/Fw H2O molecule may itself get strained in a single event chain. Applying strain subsequently in different directions is known to be equivalent to a rotation on all levels, and, in particular, on the level of a single molecule. This guarantees that the algorithm is irreducible and can attain all of configuration space.
The rotation that is induced through subsequent event chains in the three directions can be illustrated in an ECMC simulation of a single H2O molecule, using only the intramolecular factor types in Eq. (101). The rotational dynamics of such a single molecule is easily tracked through the equilibrium autocorrelation function of the dipole moment d = r21 + r23 (see Fig. 12), given by
where the variables s and s + s′ denote the ECMC displacement (proportional to the time of the continuous Markov process). A(s) decays exponentially at large s with a rate that gives the autocorrelation length λ of molecular orientation.
At temperature 300 K, the cumulative chain length it takes to rotate the molecule around itself is about one to two orders of magnitude larger than the H2O molecule itself (see Fig. 13). In the limit of large chain lengths ℓ, the autocorrelation length of the dipole moment is proportional to ℓ. This simply means that lengthening an already long chain does not add to the internal strain of the water molecule, as a local equilibrium is reached.
The sequence of chain directions need not be random: The switching of directions merely renders the Markov chain irreducible, whereas global balance is satisfied for any infinitesimal move (without the return move necessary for detailed balance). As a deterministic, cyclic, sequence avoids repetitions, we find it to decorrelate the dipole moment faster than a uniform random sampling of chain directions (see Fig. 13). The rotations of molecules are thus generated as a byproduct of the switching of event-chain directions. In practical applications, it remains to be seen whether the rotations of molecular ensembles decay particularly slowly. In this case only, the ECMC algorithm will need to be modified in order to explicitly take into account rotations.
C. ECMC for liquid water
The SPC/Fw potential is adapted for liquid water at standard temperature 300 K and density 1 g/cm3. An ECMC simulation at these conditions is easily set up with factors (including the dipole–dipole Coulomb factor) as in Eq. (102) generalized for . The “ratio,” “outside-first,” and “inside-first” lifting schemes are taken over from the dipole case discussed in Sec. IV. However, the dipole is now constructed from three particles. For a far distant pair of H2O molecules, the factor derivatives with respect to the hydrogen positions are usually of the same sign and of opposite sign to that of the oxygen. In the notations of Fig. 12 and using , we thus have that to order 1/r3,
This can again be used in the inside-first lifting scheme to keep most of the lifting flow inside the molecule of the active particle. Care must be exercised in these lifting schemes to arrange the particles in a fixed order that is independent of which particle is active (it is incorrect to place the active particle systematically on the left-most position on the upper row of the table in Fig. 10).
For long simulation times, the ECMC algorithm exactly samples the Boltzmann distribution of this model, and thermodynamic observables can be compared with Metropolis Monte Carlo using the Ewald summation for the Coulomb potential. This can be verified for the oxygen–oxygen distances that agree to very high precision, demonstrating that the irreversible ECMC converges toward the same steady state as reversible Monte Carlo algorithms (see Fig. 14). To make sure that equilibrium is reached, the initial configurations were chosen randomly in a very dilute system and slowly compressed toward the target density.
In the liquid-water simulation for , the factors belong to four different types (that is, and ), into which the ensemble-averaged total event rate [see Eq. (21)] can be split,
agrees with the definition in Sec. III [see Eq. (91)]. The three local factor types naturally give constant scaling of their associated mean event rates , , and with system size, whereas clearly features scaling with the number of H2O molecules (see Fig. 15). The logarithmic scaling of the total Coulomb event rate validates the prediction of Eq. (92). The total event rate increases by 5 Å−1 when doubles.
Finally we study the lifting flows for the dipole–dipole factors under the “ratio,” “inside-first,” and “outside-first” schemes (see Sec. IV B). As discussed in Sec. IV A, the event rates are independent of the lifting schemes for a given factor set. However, the probability distributions of the distance |r| between the active and the target particles are different (see Fig. 16). First, the peak at the oxygen–hydrogen bond length corresponding to a lifting within the molecule increases logarithmically with system size. Second, with increasing system size the distribution of event distances develops a power-law tail. In both the “ratio” and the “outside-first” lifting schemes, the tail of the probability distribution decreases as |r|−1. The “inside-first” scheme decays as |r|−2. These results, corresponding to the evolution of qinter in |r|−3 and |r|−4, are summarized in Table I.
Remarkably, the “inside-first” lifting scheme induces mostly local lifting flows, even for Coulomb factors that associate H2O molecules that are far distant from one another. Most of the liftings are local and the central peak increases as . We expect a local lifting to keep the dynamics of the system coherent and to lead to faster convergence toward equilibrium. It appears also possible to replace the interaction with far-away H2O molecules by the interaction with an effective medium (given that the lifting flow remains local). In the “ratio” and “outside-first” lifting schemes, this would probably not be possible as the lifting flow toward far-away dipoles is of the same order of magnitude as the local flow.
VI. CONCLUSIONS
In this work, we have outlined the ECMC framework for all-atom computations. Our algorithm advances a single particle in the presence of long-ranged electrostatic interactions in operations, with a mean-free path which decreases as . This gives an overall complexity of to advance N particles, each by . This speed can be achieved for locally charge-neutral systems, where particles can be grouped into local dipoles. The algorithm can take into account the presence of free point charges, and its performance worsens only gradually with their number. The algorithm is manifestly translation-invariant and event-driven. It is free of discretization errors and exactly samples the Boltzmann distribution, without needing a thermostat. Its outstanding property is that it neither computes total forces nor determines the system potential.
ECMC breaks with tradition in two ways. First, as a Markov-chain algorithm, it offers the freedom to choose among a variety of moves. Our approach of advancing single particles may be a first step only. Nevertheless, as we have shown, it effectively rotates dipoles and flexible water molecules in three-dimensional space and samples the entire configuration space. We have explored the great freedom to choose factors and liftings that suit the problem at hand. Second, ECMC breaks with tradition in that it is purely particle–particle: It treats electrostatic interactions between point charges, but is oblivious to the electrostatic field. This aspect liberates it from the interpolating mesh that in traditional particle–particle–particle–mesh methods approximates the Coulomb field. Rather, the algorithm is based on the interaction of pairs of particles and, more generally, of factors that may comprise pairs of local dipoles or even more complex objects.
In this work, we have checked that thermodynamic quantities from ECMC agree with those obtained with methods that satisfy detailed balance. As a next step for analyzing ECMC in all-atom systems, it will be important to study its relaxation dynamics in detail. This dynamics will certainly depend on the choice of factors and, for example, for the case of dipole–dipole factors treated here, on the choice of liftings. The inside-first lifting scheme yields mostly local dynamics, and we would expect it to lead to a faster decay of correlation functions. Besides this, we have discussed that the length and the probability distribution of the event-chain parameter ℓ and even the sequence of the directions of the event-chain can significantly influence the ECMC dynamics although, as we have verified extensively, the steady state is always given by the Boltzmann distribution. We would hope that, in addition to the overall favorable algorithmic scaling, the fast decay of density fluctuations carries over from short-range-interacting particle and spin systems. The influence of different factorization and lifting schemes on the dynamics of ECMC will also have to be understood. From an algorithmic implementation point of view, we think that the parallelization of the method56 will have to be dealt with carefully. ECMC simulations of water will permit standardized comparison of run times with the ones of traditional molecular-dynamics algorithms. Other applications, such as solvated peptides43 and polarizable models, appear within reach.
ACKNOWLEDGMENTS
M.F.F. acknowledges financial support from EPSRC Fellowship No. EP/P033830/1 and hospitality at Ecole normale supérieure. This work was initiated at the Aspen Center for Physics, which is supported by the National Science Foundation Grant No. PHY-1066293. We thank Matthew Downton for illuminating discussions and Matthias Staudacher for helpful comments. W.K. acknowledges support from the Alexander von Humboldt Foundation and thanks the Santa Fe Institute for hospitality.
REFERENCES
To simplify, we do not distinguish between the filter, which is, strictly speaking, the acceptance probability of a proposed move c → c′, and the probability to move from c to c′. In our context, the difference between the two is at most a constant factor.
Strictly speaking, the characteristics of the displacement are also to be included among the lifting variables.