Vol. 87 No. 5 April 1996 Section 11 Page 1117

0 downloads 0 Views 963KB Size Report
simulations, are derived for extended systems generating the canonical and ...... Research Fund (ACS-PRF 28968-G6), and D.J.T. support from the National.
M o l e c u l a r P h y s i c s , 1996, V o l . 87, N o . 5, 1117± 1157

Explicit reversible integrators for extended systems dynam ics By GLENN J. M ARTYN A D epartment of Chem istry, Indiana University, Bloom ington, IN 47405- 4001, USA M ARK E. TUCKERM AN, D OUGLAS J. TOBIAS and M ICH AEL L. KLEIN Department of Chemistry, University of Pennsylvan ia, Philadelphia, PA 19104-6323, USA (Recei Š ed 4 May 1995 ; re Š ised Š ersion accepted 4 September 1995) Explicit reversible integrators, suitable for use in large-scale computer simulations, are derived for extended systems generating the canonical and isothermal± isobaric ensem bles. The new methods are compared with the standard implicit (iterative) integrators on some illustrative example problem s. In addition, modi® cation of the proposed algorithms for multiple time step integration is outlined.

1.

Introduction

Recently, explicit reversible multiple tim e step integrators have been developed to handle e ciently problem s involving stiŒvibrations, disparate masses, and long-range forces that occur in large-scale m olecular dynam ics (M D) calculations [1]. The m ethods are based on the Liouville operator form ulation of Ham iltonian mechanics. H owever, it is often useful to perform dynam ical calculations using so-called extended system schemes that generate statistical mechanical ensem bles other than the traditional microcanonical ensemble. For exam ple, it is possible to generate both the canonical and the isotherm al± isobaric ensembles via continuous dynam ics [2± 7]. A lthough non-H am iltonian in nature, the equations of motion possess the fundam ental sym metry of time reversibility. Fortunately, the Liouville operator form alism can be extended to treat these more complicated non-Ham iltonian cases. In this article, explicit reversible integrators for systems yielding the canonical [6] and isobaric± isothermal ensem bles [7] are developed. The resulting algorithms are straightforward to use and can be modi® ed readily to accomm odate the type of reversible multiple time step approaches found to be eŒective in microcanonical simulations [1]. In addition, since reversible integrators are required by the hybrid M onte Carlo algorithm } M D scheme [8], the new algorithms allow extended phase space methods to be used in conjunction with this technique. The reversible integrators, and their multiple time step generalizations, are tested on a variety of model and `real ’ systems and the results com pared with the standard implicit (iterative) integration schemes based on the usual velocity± Verlet scheme.

2.

Equations of m otion

The equations of motion that generate the canonical and isobaric± isothermal ensembles are ® rst reviewed brie¯ y. 0026± 8976 } 96 $12± 00 ’

1996 Taylor & Francis Ltd

1118

G. J. M artyna et al. 2.1. Canonical ensemble

M artyna, Tuckerman and Klein (M TK ), following Nose! [3] and H oover [4], employed a chain of Nose! ± Hoover thermostats to drive a dynam ical system to generate canonically distributed positions r , and m omenta p . The equations of i i m otion M TK proposed are as follows [6] :

i

p i, m

pd ¯



rd ¯

i

i

p

i

pn

n d ¯

i

Q

i,

9

pd n ¯ j

9 Q j "" ®

M

:

p #n

:

kT ®

j

9 Q M "" ® p #n

¯

i,

i

i N p# i ® N kT ® 3 f m i=" i

pd n ¯ "

pd n

pn

iQ

pn

pn jQ

:

M

pn

pn

" Q

# ,

#

j+" ,

j+"

kT .

(1)

There are M thermostats n , with masses Q , and momenta p n . Here, N is the number j j j , where d is the system of particles, N is the number of degrees of freedom (equal to dN f dimension, if there are no constraints), and F ¯ ® ~ u (r) is the force derived from the i i potential u , which is a function of the N-particle position vector r. The conserved quantity for the M TK dynam ics is

N p# M p #n i ­ u (r)­ i ­ 3 2m 2Q i=" i i=" i 3

H« ¯ and the Jacobian [9] is dJ(t) dt

¯

J(t) ¯

®

M dn d i­ dn i=" i M exp N n ­ 3 f " i=#

dpd n

9 0

J(t) 3

9

n

dp n

:.

N kT n ­

1

f

N

i ­

3

i

i="

"

(~

p

M

kT 3

n ,

pd ­ i i

~

r

(2)

i

i=#

:

rd ) , i i (3)

i

The Jacobian is the weight associated with the phase space volum e and is unity for systems that obey Liouville’ s theorem [9]. It represents the transformation to a set of variab les ² sd ¯ N s p n , sd ¯ s p n ´ or, equivalently, ² log s ¯ N n , log s ¯ n ´ for which i i i f " i i " J ¯ f 1." If" the " dynam the Jacobian system studied is ergodic, the ics gives rise to the canonical (NVT ) ensemble, i.e., the partition function is proportional to

&

9

dp n d n dp dr exp N n ­

f "

where H§ ¯

M 3

i=#

n

: d (E®

i

H« )£

&

dp n dp dr exp [®

M p n# i ­ u (r). i ­ 3 2m 2Q i=" i i=" i 3

N p#

b H § ],

(4)

(5)

1119

Extended systems dynam ics 2.2. Isothermal± isobaric ensemble (isotropic cell ¯ uctuations)

In order to produce the isothermal± isobaric ensem ble, the volume V of the simulation cell must be perm itted to undergo only isotropic ¯ uctuations. Following A nderson [2] and Hoover [4], the equations of motion are [7] : p

rd ¯

m

pd ¯



Vd ¯

dV p e

pd e ¯

dV (P ®

n d¯

pn

pd n ¯

3

i

where P

ext

p

e i­ r, W i i

i

0 1­ N f1 W pi® d

i

pn p, Q i

,

W

d N p# i® 3 N m

P )­

int

Q

pe

ext

f i="

pn pe , Q

i

,

p #e N p# ® i­ m W i=" i

(N ­

1) kT,

f

(6)

is the external } applied pressure, P

int

9 i="

1 N p# i­ 3 dV m ¯

3

N

i i="

r[ F®

i

(dV )

i

¦ u (r, V ) ¦ V

:

(7)

is the internal pressure, p e is the momentum associated with the logarithm of the volume, and W is the mass of the `barostat ’ . Note that, in general, the particles and barostat can be coupled to separate chains of thermostats although, for simplicity, they have been coupled to the sam e single thermostat here. The conserved quantity is H« ¯

p #e N p# i ­ ­ 2m 2W i=" i

p #n ­ 2Q

3

u (r, V )­

(N ­

f

1) kT n ­

P

ext

V,

(8)

and the Jacobian of the dynam ics is J¯

exp [(N ­

1) n ].

f

(9)

The isothermal± isobaric partition function,

D £

&

dp n dp e dV

& D(V) dp dr exp 0 ®

H§ , kT

(10)

P

(11)

1

is therefore produced, where H§ ¯

N p# 3

i="

#e ­ i ­ 2W i

2m

p

p #n 2Q

­

u (r, V )­

and D (V ) is the domain de® ned by the volume [7].

ext

V,

1120

G. J. M artyna et al. 2.3. Isothermal± isobaric ensemble ( full cell ¯ uctuations)

If full ¯ uctuations of the simulation cell size and shape are perm itted then, following Parrinello and Rahman [5], the isotherm al± isobaric (NPT ) ensemble with partition function

&

D £

dhZ Y exp [®

b P

ext

det [hZ Y ]] Q(hZ Y ) det [hZ Y ]" d

(12)

is generated (to within a constant) by the following equations of motion [7] : r0 ¯

i­ Z Y g r , m W i i g

p0 ¯



0 hZ Y ¯

pZ Y hZ Y

0 pZ Y ¯

V(PZ Y

p

i

p

ZYgp ® i W i g

i

p

0 N f1 1

Tr [pZ Y ]

p

n gp® p, i Q i

W

g

g , g

W

g

n 0¯

pn

pd n ¯

3

Q

®

int

IZ Y P )­

ext

9 N f 3i=" m#ii: IZ Y ® 1 N p

pn

pZ Y , Q g

,

1 N p# i­ Tr [pZ Y t pZ Y ]® g g m W i=" i g

(N ­

f

d # ) kT,

(13)

where hZ Y is the cell m atrix (V ¯ det [hZ Y ]), IZ Y is the identity matrix, Tr [pZ Y t pZ Y ] is the sum of g g the squares of all the elem ents of pZ Y , the cell variab le momentum matrix, and the g particles and cell variab les have been coupled to a single thermostat. The pressure tensor is de® ned as (P ) a b ¯

int

(u « )a b ¯

9 i="

1 N (p ) a (p ) b i i ­ 3 V m

(F ) a (r ) b ®

i

i

i

( u Z Y « hZ Y t) a b

:,

¦ u (r, hZ Y ) . ¦ (h) a b

(14)

Equations (13) have the conserved quantity H« ¯ and Jacobian

N p# 3

i="

1

i ­ Tr [pZ Y t pZ Y ]­ g g 2W i g

2m



p #n ­ 2Q

u (r, hZ Y )­

det [hZ Y ] " d exp [(N ­

f

P

ext

det [hZ Y ]­

d # ) n ],

(N ­

f

d # ) kT n ,

(15)

(16)

which lead to the desired NPT ensemble [7]. 2.4. Elimination of cell rotations The equations of motion for the case of a ¯ exible simulation cell were derived using the full matrix hZ Y of Cartesian cell param eters. The cell can therefore, in general, rotate in space [10]. This m otion can make data analysis di cult and should be eliminated. The origin of the rotational motion of the cell lies in the pressure tensor Pa b (see

Extended systems dynam ics

1121

equation (14)). If the pressure tensor is asym metric (Pa b 1 Pb a ) at a given instant of time, then there will be a net torque acting on the cell that will cause it to rotate. Cell rotations can be eliminated by using the sym metrized tensor Paa b ¯ (Pa b ­ Pb a ) } 2 in the equations of motion and setting the initial total angular mom entum of the cell to zero (pZ Y ¯ pZ Y t ) [7]. This approach is formally im plemented by constraining gZ Y ¯ gZ Y t, g g where pZ Y ¯ W gZ 0 Y .

g

2.5. Choice of mass for the extended Š ariable s It is generally useful to thermostat the particles and the barostats independently using Nose! ± Hoover chains. It has been shown elsewhere [3, 6] that the masses of the particle thermostats should be Q ¯ N kT } x # , p" f p Q ¯ kT } x # , pi p where x is the frequency at which the particle thermostats ¯ uctuate. Similarly, the p m asses of the barostat } cell param eter thermostats should be : Q ¯ d # kT } x # , b" b Q ¯ kT } x # . bi b Finally, the m asses of the barostat } cell param eters them selves [3, 11] should be W¯ W ¯

g

3.

(N ­

d ) kT } x

#b, (N ­ d ) kT } d x # . f b f

Iterative velocity± Verlet based integrators

The standard velocity± Verlet integration [12] is based on the equations x( D t) ¯

x(0)­

xd (0) D t­

xd ( D t) ¯

xd (0)­

[xX (0)­

xX (0)

D t#

xX ( D t)]

D t

2

2

­

­

/ ( D t $ ), / ( D t $ ).

(17)

If the second time derivative directly depends on the ® rst derivative, then xd ( D t) must, in general, be determined iteratively, thus sacri® cing reversibility and forming an implicit method. Iterative velocity± Verlet integration of the equations of motion presented in the previous section has been described elsewhere [7]. 4.

Explicit reversible integrators

The purpose of this paper is to develop schemes for integrating the equations of m otion presented in section 2 with explicit reversible integrators derived from the appropriate classical propagato rs using operator factorization techniques [13, 1]. This approach yields manifestly reversible integrators that weight the phase space correctly [13, 1]. W e mention again that the phase space volum e is conserved only for systems that obey Liouville’ s theorem , and the equations of motion given in section 2 do not necessarily have this property. Explicit reversible integrators are now presented that integrate the equations of m otion for the diŒerent ensembles in order of increasing

1122

G. J. M artyna et al.

complexity : NVE, NVT, NPT with isotropic sim ulation cell ¯ uctuations, and NPT with full simulation cell ¯ uctuations. It will be shown that the new integrators can be m odi® ed easily to accommodate reversible multiple tim e step m ethods useful for studying systems involving stiŒ vibrations, long-range forces, and other problems involving a separation of tim e scales [1]. 4.1. The e Š olution ope rator t¯

A system of coupled, ® rst order diŒerential equations can be evolved from time 0 to time t by applying the evolution operator

C (t) ¯

exp (iLt) C (0),

C 0[ ~

iL ¯

(18)

, C

where iL is the Liouville operator and C is the multidimensional vector of independent variab les (coordinates and velocities). In general, the action of the evolution operator on the coordinates cannot be perform ed analytically. Therefore, a short-time approxim ation to the true operator, accurate at time D t ¯ t } P, is applied P times in succession to evolve the system :

0 exp (iL D t) C 0 s 1 i=" s 0

C (t) ¯

P

(0),

(19)

which, for an nth order factorization, carries an overall error t n} P n " . 4.2. M icrocanonica l ensemble (NVE ) In the NVE ensemble, the dynam ics is Ham iltonian, and the Liouville operator is written as

N 3

iL ¯

v[ ~

i

i="

r

­ i

9

:

N F (r) i [ ~ v. m i i=" i 3

(20)

A short-time approxim ation to the evolution operator can be generated via the Trotter form ula [14]

0

exp (iL D t) ¯

N

exp iL

exp (iL D t) exp iL 0 " 21 ­ 21 #

"

D t

D t

/ ( D t $ ),

(21)

"

3

[F (r) } m ] [ ~

N

and iL ¯ 3 v [ ~ r . i # i= i i i=" " As outlined earlier, the approxim ate evolution operator can be used to generate the positions and velocities at time D t : with iL ¯

i

i

v

r( D t) ¯

r(0)­

v( D t) ¯

v(0)­

D tv(0)­ D t 2m

D t# 2m

(F[r(0)]­

F[r(0)],

F[r( D t)]),

(22)

where the identity exp [a( ¦ } ¦ g (x))] x ¯ g " [g (x)­ a] has been used. The result is just the fam iliar velocity± Verlet integration scheme (section 3) [12], derived in an unfam iliar but powerful way [13, 1].

1123

Extended systems dynam ics

Another feature of the operator form alism is the ease with which a product of operators in a factorized expression such as equation (21) can be translated directly into computer code. The operators can be applied sequentially, thus bypassing the need to calculate analytically the phase space vector C ( D t) in term s of the initial conditions C (0). This will be referred to as the direct translation technique. For exam ple, the three operators that appear in equation (21) can be translated into three sets of instructions which update ® rst the velocities, next the positions and ® nally the velocities. A pseudocode for perform ing these operations would appear as : v¯







D t 2m

D tn v

CALL v¯

n F

FORCE

D t



2m

n F

(23)

where loops over the number of atoms are assumed. Here, the closed form expression for C ( D t) is simple (cf. equation (22)). In the more complex cases discussed below, such expressions rapidly become cumbersome, and the direct translation technique is the preferable approach.

4.3. Canonic al (N VT ) ensemble An integration scheme for the NVT ensemble can be formulated also using the approach described above. The Liouville operator for the equations of motion, equation (1), is

N

9

:

N F (r) i [ ~ v m i i=" i=" i ¦ ¦ ¦ N M M " ® 3 Š n v[ ~ v­ 3 Š n ­ 3 ­ G (G ® Š n Š n ) , i M¦ Š n i i¦ n i i+" ¦ Š n " i i=" i=" i i=" i M 3

iL ¯

v[ ~

i

r

­ i

3

(24)

where a chain of Nose! ± Hoover therm ostats of length M has been coupled to an N particle system [6] and G ¯

"

3 m v# ® i i Q 0 " i="

N kT

G ¯

1 (Q Š #n ® i" i" Q

kT )

N

i

1

f

1 i"

1.

(25)

i

U sing a simple generalization of the Trotter formula, the evolution operator can be written as

0

exp (iL D t) ¯ ­

exp iL

1

0

1

0

1

0

D t D t D t D t exp iL exp (iL D t) exp iL exp iL NHC 2 NHC 2 " 2 # " 2

/ ( D t $ ),

1 (26)

1124

G. J. M artyna et al.

¯ iL® iL ® iL consists where L and L retain their previous de® nitions, and iL NHC " of term # s in iL. The Nose! ± Hoover chain (NH # of the rest C) part of" the evolution operator, exp (iL D t} 2), is simpli® ed as follows :

NHC

0

1

D t ¯ NHC 2

exp iL

0

exp iL

1c ¯

D t

NHC 2n

exp

¦

0 4nc G M " ¦ Š " 1 exp 0 ® n

¬

8n

M

0

0

8n

D t

exp ®

1

c i=" D t

exp ® ¼

D t Š

n

c

M

Š

8n

Š n

c

Š n

c M

Š

M

Š

0

¦ M " ¦ Š n

n

M

¦ n

M " ¦ Š

c i="

M "

¦

M " ¦ Š n

n

M "

1

1

i ¦

1" exp 0 4nc G M " ¦ Š " 1 D t

n

M

¦

1 exp 0 4nc G M ¦ Š 1 , D t

n

1

M "

D t N D t M ¦ 3 Š n v [ ~ v exp 3 Š n i 2n 2n i¦ n " i

0

exp ® ¬

c

M

D t

(27)

D t ¦ Š n Š n 8n M M " ¦ Š n

0 4nc G M ¦ Š 1 exp 0 ®

exp

¬

1

D t NHC 2n c

exp iL

i="

¦

D t

n

¬

0

nc 0

n

(28)

M

where a m ultiple time step, n " 1, approach has been used. For typical simulations, c n can be taken to be one. However, if the frequency associated with the Nose! ± Hoover c chain is high (Q ¯ NkT } x # ), n must be taken rather large to generate accurate c trajectories. Substantial reduction can be obtained by using a higher order algorithm to apply the NHC part of the evolution operator, e.g.,

0

exp iL

¯ NHC 2 1

D t

w D t nc nys j 0 exp iL NHC 2n i=" j=" c

9

0

0

1:,

(29)

where the w are chosen such that when exp (iL D t } 2n ) is approxim ated as in j NHC c equation (28), the error is / ( D t } 2n ) & [15, 16]. The values of the ² n , w ´ are ² n ¯ 3, c ys j ys w ¯ w ¯ 1 } (2® 2 " /$ ), w ¯ 1® 2w ´ [15] or, alternatively, ² n ¯ 5, w ¯ w ¯ w ¯ ys " $ # " " # % w ¯ 1 } (4® 4 " /$ ), w ¯ 1® 4w ´ [16]. Higher order m ethods involving more time steps & $ " are also possible [15, 16]. In the multiple time step procedure (equation (27)), the seem ingly unnecessary factorization

(

Š

exp t« [®

n

Š

n

k k"

0

C

exp ®

­

G

¦

]

k" ¦ Š n

k"

t« ¦ Š n Š n 2 k k" ¦ Š n

* ¦

k

1" exp 0 t« G k " ¦ Š " 1 exp 0 ® n

k

t« ¦ Š n Š n 2 k k" ¦ Š n

has been em ployed. The action of the unfactorized operator on Š

Š

A

n

k"

U Š

n

k"

exp (®

Š n

k

t« )­

t« G

k"

0

exp ®

Š

21

t« n

k

B

n

k"

0

2

1

n

k

(30)

gives

t« sinh Š n 2 k t«

Š

k

1 "

C

, D

(31)

1125

Extended systems dynam ics while the factorized operator yields

Š n

k"

U Š

n

k"

Š

exp (®

n

k

t« )­

t« G

k"

0

exp ®

Š n

1

t« . k2

(32)

The potentially singular hyberbolic sine function that appears in the unfactorized result, equation (31), can be expanded in a M aclaurin series to arbitrarily high order without loss of generality. This is equivalent to building progressively higher order Trotter formula solutions [17] to the operator. In fact, no degradation of accuracy was found to result from the use of the factorized version (i.e., the ® rst term in the M aclaurin series expansion of the hyperbolic sine). The approach described above appears to be rather complicated. H owever, it is actually straightforward and com putationally inexpensive to implem ent. O ne ® rst applies the operator exp (iL D t } 2) to update the ² n , v n , v´ (the operator alters only NHC these variab les). N ext, one uses the updated velocities as input to the usual velocity± Verlet step, equation (22), and then applies exp (iL D t } 2) to the output of NHC this velocity± Verlet step. The procedure can be summarized as follows :

D vV 9

0 21 : D t

r( D t) ¯

r

v( D t) ¯

v

D t D t ; v« ( D t), v n NHC 2 2

n ( D t) ¯ n

D t ;n NHC 2

v n ( D t) ¯

vn

t ; r(0), v

9

0 1:

9

0 2 1 , v« (D D t

9 2 ; v« (D D t

NHC

t), v n

t), v n

0 21 : D t

0 21 : , D t

(33)

where

0 21 ¯

v

v« ( D t) ¯

v

n

0 21 ¯ n

vn

0 21 ¯

vn

v

D t

D t

D t

NHC 9 vV

D t 2

9D

; v(0), v n (0)

t ; r(0), v

:

0 21 : D t

9

D t ; n (0), v(0), v n (0) NHC 2

9

D t

NHC 2

:

; v(0), v n (0) ,

: (34)

and ² r (t« ; r« , v« ), v (t« ; r« , v« )] represents the output of a single velocity Verlet step of vV vV time increm ent t« using the initial conditions ² r« , v« ´ . A sim ilar structure is used to indicate the action of the NH C part of the evolution operator. The direct translation technique can be used to convert the operator exp (iL w D t } 2n ) into a set of instructions analogous to equation (27) :

NHC j

c

1126

G. J. M artyna et al. CALL ATOM IC j KE(AKIN) SCALE ¯

1.0



1, n

DO



DO

c

1, n

ys

D t ¯

w D t} n

G ¯

® kT ) } Q M " n# M " M D t sn G Š n ­ M 4 M

s

j

M

Š n

Š n

M

¯ ¯

Š

M "

G

Š n

M "

Š n

M "

n

0

D t

n exp ®

M "

8

1

sŠ n

M

® kT ) } Q Š M # n# M # M " D t ­ sn G Š n M " 4 M " ¯

M "

c

Š

(Q

(Q

¯ ¯

Š n

0

D t

n exp ®

M "

8

sŠ n

1

M

¼

Š

¯

n

Š

"

G ¯ n

Š n

"

¯

Š n

¯

Š n

" "

D t ­

4

"

1

n

#

sn G

M "

" D t 8



1

n

#

0

D t

SCALE n exp ® AKIN n exp (®

AKIN ¯ i¯

1, M

n ­

i



f

0

"

n ¯

8

n exp ®

SCALE ¯

DO

D t

N kT ) } Q

(A KIN®

"

Š

0

n exp ®

n

D t

i

2

sn Š n

2

D t Š

s xi"

i

EN DDO

Š

¯

n

"

Š

G ¯

Š n

¼

n

¯

Š n

¯

Š n

" "

"

D t

­ " "

D t 4

8



1

n

#

N kT ) } Q

(A KIN®

"

Š

0

n exp ®

n

f

sn G

0

n exp ®

" D t 8

sŠ n

#

1



M "

xi" )

1

1127

Extended systems dynam ics

Š n

G

Š n

Š n

Š

M

n

M

¯

¯

M "

0

n exp ®

D t 8

1

sŠ n

M

® kT ) } Q Š M # n# M # M " D t ­ sn G Š n M " 4 M " (Q

¯

M " M "

n

¯

M "

G ¯

Š

¯

M "

Š n

M "

0

n exp ®

D t 8

sŠ n

1

M

® kT ) } Q Š M " n# M " M D t sn G Š n ­ M 4 M (Q

EN DDO ENDDO v¯

v n SCA LE

(35)

N ote, a tim e-saving feature has been em ployed. The eŒect of the operator exp (iL w D t } 2n ) is to scale the particle velocities by the factor exp (® Š n w D t } 2n ). NHC j c c " j through The only coupling of the particle velocities to the thermostat variab les occurs the total atom ic kinetic energy (AK IN), which appears in the force on the ® rst thermostat G . Therefore, a velocity scaling factor can be accum ulated and applied to the velocities " at the end of the procedure. In addition, the total particle kinetic energy can be evolved by multiplying by the factor exp (® Š n w D t } 2n ) at each step in the j c iteration. The entire propagato r may be im plemented" by perform ing the procedure de® ned in equation (35) before and after performing the procedure de® ned in equation (23). A ® fty line Fortran code based on this algorithm is presented in appendix A. The reversible NVT integration method is not altered signi® cantly if an arbitrary set of constraints is placed on the particle degrees of freedom. The operator exp (iL D t} 2n ) acts by scaling the particle velocities by factors of exp (® Š n w D t } 2n ) NHC c j c at each step in the NHC multiple time step procedure (exp [ax( ¦ } ¦ x)] x ¯ " x exp [a]). This scaling does not eŒect a given constraint if it is initially satis® ed (d r } dt ¯ k 3 v [ ~ r r ¯ 0). Therefore, the new integration algorithm can be m ade consistent i i i k with a set of constraints by adding the iterative Shake } Rattle algorithm to the velocity± Verlet step in the usual way [18, 19]. Alternatively, the equations of motion generated by Gauss’ principle of least constraint can be integrated reversibly in some cases by methods similar to those described earlier [20]. Note that, in a system with constraints and m ultiple chains of therm ostats on the particle degrees of freedom (for exam ple, all atom s of type X thermostatted with one chain and all atoms of type Y with another), atoms involved in a com mon constraint m ust be thermostatted by the sam e chain, independent of integration algorithm. If this is not the case, the number of degrees of freedom (N ) associated with each individual chain becomes a complicated f function of the particle positions.

1128

G. J. M artyna et al. 4.4. Isothermal± isobaric (N PT ) ensemble : isotropic cell ¯ uctuations

The Liouville operator for equations of motion, equation (6), is

iL ¯

iL

­ where v ¯

i

i

NHC

¦ e

N 3

­

Š e r ][ ~

[v ­

i

i="

v

i

r

i

­ i

[G e ®

Š e Š n]

9

:

dV

¦ u (r, V ) ® ¦ V

¦ ¦ Š e

N F (r) i [ ~ v, m i i=" i 3

­ i

(36)

9 0 1­ N f1 3i=" m i v#i ­ N

d

N 3

r [ F (r)®

i

i="

i

dP

ext

:

V ,

1 log V, d

e ¯ and iL

¦ e

v[ ~ e

i

1 W

Ge ¯

Š

N

d

r0 ,

p} m 1

i

0 1­ N f1 3i=" Š

®

NHC

(37)

retains its previous de® nition except that

3 m v# ­ i i Q9 i="

N

1

G ¯

"

W Š #e ®

(N ­

f

:

1) kT .

(38)

The equations of motion can be integrated using the approxim ate evolution operator,

0

exp (iL D t) ¯ ­

exp iL

1

0

1

0

1

0

D t D t D t D t exp iL exp (iL D t) exp iL exp iL NHCP 2 NHCP 2 " 2 # " 2

/ ( D t $ ),

1

(39)

where iL

¯

NHCP iL ¯

P

iL

iL ,

P

0 1­ N f1 3i=" Š N

d

®

9

e

v[ ~

v

i

­ i

[G e ®

Š e Š n

¦ , ¦ " Š e ]

3

:

iL ¯

3

N F (r) i [ ~ v, m i i=" i

iL ¯

" #

­

NHC

N i="

[v ­

i

Š e r ][ ~

i

r

­ i

Š e

¦ . ¦ e

(40)

This integrator can be implemented readily by analogy with the results of the previous section. The operator, exp (iL D t } 2), is decomposed in the manner of

NHCP

1129

Extended systems dynam ics

equation (29), and the operator exp (iL w D t } 2n ) is factorized sim ilarly to NHCP j c equation (28) :

0

exp iL

1

w D t ¯ j NHCP 2n c

exp

¬

0

w D t ¦ j G M¦ Š n 4n

c

0

w D t j G M 4n

exp

¬

c

¬

¬

M

w D t j Š n ­ 2n "

0

w D t ¦ j Š n Š e 8n ¦ Š "

9 c

e

1 exp 0

w D t ¦ j Š n Š n 8n M M " ¦ Š n

0

exp ®

w D t ¦ j Ge 4n ¦ Š

c

w D t ¦ j Š n Š n 8n M M " ¦ Š n

c

M

e

v[ ~ v

i

w D t ¦ j Ge 4n ¦ Š

c

M

1" exp 0

1 exp 0

i

w D t M ¦ j 3 Š n 2n i¦ n

c i="

c

c

c

e

1

e

1

1

i

w D t ¦ j Š n Š e 8n ¦ Š "

w D t j G M 4n

w D t ¦ j G M¦ Š 4n

1 exp 0 "

M "

c

1 exp 0 ® e

1 ¼

w D t ¦ j Š n Š e 8n ¦ Š "

1 exp 0 ®

c

e

e

1

c

d

1 exp 0

M "

w D t ¦ j Š n Š n 8n M M " ¦ Š n

1" exp 0 ®

0 1­ N f1 Š :

c

0

¬

n

0

exp ® ¼

Š

c

exp ®

¬

¦

" ¦

w D t ¦ j Š n Š e 8n ¦ Š "

exp ®

c

M

0

exp ®

w D t ¦ j vn vn 8n M M " ¦ Š n

1 exp 0 ®

n

¦

" ¦ Š

1.

n

M "

1 (41)

M

The direct translation of this operator into com puter code can be carried out by analogy with equation (35). The full propagato r, equation (41), is applied to the full phase space by ® rst acting with the operator exp (iL D t } 2) to update ² n , v n , Š e , v´ , NHCP then performing a m odi® ed velocity± Verlet (M VV) step r ( D t) ¯

r (0) exp [D t Š e (0)]

i

­

i

exp

e ( D t) ¯

e (0)­

v ( D t) ¯

v i(0)­

i

9 2 Š (0): 0 vi(0) D t­ D t

e

D t # F (r)

i i

2m

1

sinh

9

D t

D t 2

2

Š e (0)

:

Š e (0)

D t Š e (0) D t 2m

[F (0)­

i

F ( D t)]

i

(42)

to update ² e , Š e , v, r´ , and ® nally, again acting with the operator exp (iL D t } 2) this NHCP time to update the output of the m odi® ed velocity± Verlet procedure. A s stated previously, the potentially singular term, sinh (x) } x, can be expanded in a M aclaurin series to arbitrarily high order (e.g., eighth in practice). The explicit integration method, can be written as

1130

G. J. M artyna et al.

9 D t ; r(0), e (0), v 0 2 1 , Š 0 2 1 : D t D t D t v ; v« ( D t), v 0 2 1 ,Š 0 2 1 : NHCP 9 2 D t D t e D t ; r(0), e (0), v 0 2 1 ,Š 0 2 1 : MVV 9 D t D t D t Š 9 2 ; v« (D t), v 0 2 1 , Š 0 2 1 : D t D t D t D t ;n n 0 2 1 , v« (D t), v 0 2 1 , Š 0 2 1 ,: NHC 9 2 D t D t D t v 9 2 ; v« (D t), v 0 2 1 , Š 0 2 1 : ,

r( D t) ¯

r

v( D t) ¯

D t

D t

e

MVV

n

e ( D t) ¯

e

e

Š e ( D t) ¯

e

n ( D t) ¯

n

NHCP

e

n

v n ( D t) ¯

n

e

n

NHCP

e

(43)

where v

0 21 D t

¯

9

v

D t

NHCP 2

:

0 21 0 21 0 21 : D t D t ¯ Š Š 0 21 9 2 ; v(0), v (0), Š (0): D t D t ¯ n n 0 2 1 NHCP 9 2 ; n (0), v(0), v (0), Š (0): D t D t v 0 2 1 ¯ v 9 2 ; v(0), v (0), Š (0): . v« ( D t) ¯

v

e

MVV e

9

; v(0), v n (0), Š e (0)

D t

D t ; r(0), e (0), v

n

NHCP

n

n

NHCP



D t

e

e

n

n

D t

, vn

e

e

(44)

The notation is analogous to that of the previous section, equation (33). The label M VV refers to the modi® ed velocity± Verlet step equation (42). Equation (43) can be bypassed using the direct translation technique discussed in the previous sections. In appendix B a short Fortran code is given that implements the isotropic constant pressure integrator. The method and the code can be m odi® ed easily to place an independent chain of thermostats on the barostat ( e ).

4.5. Isothermal± isobaric (N PT ) ensemble : full cell ¯ uctuations The equations of m otion, equation (13), have the associated Liouville operator, iL ¯

iL

vZ Y ­ 9 0 g i="

3

®

NHC

[(GZ Y ) a b ®

3 ­

g

a b

­

N

(vZ Y hZ Y ) a

3 a b

g

b

1 :

Tr[vZ Y ] g IZ Y v [ ~ i N

f

i

¦

(vZ Y )a b Š n

g

¦ ­ ¦ (hZ Y ) a b

v

] " ¦ (vZ Y ) a

g

N 3

i="

[v ­

i

b

vZ Y r ] [ ~

g i

r

­ i

9

:

N F (r) i [ ~ v, m i i=" i 3

(45)

1131

Extended systems dynam ics where v ¯

i

p} m 1

rd ,

(GZ Y ) a b ¯

1 N 3 m (v ) a (v ) b i i i W

i

i

i

g

g i=" 1

­ and iL

NHC

9g 0 N f 3i=" m i v#i ® 1 N

P

ext

W

1

V d

a b

N 3

­

( u Z Y « hZ Y t) a

(F ) a (r ) b ®

i

i="

i

b

:,

(46)

retains its previous de® nition except that 1

G ¯

i

Q

9" 3i=" m i v#i ­ N

(N ­

W Tr [vZ Y t vZ Y ]®

g

g g

f

:

d # ) kT .

(47)

The equations of motion can be integrated using the approxim ate evolution operator,

0

exp (iL D t) ¯

exp iL ­

1

0

1

0

1

0

D t D t D t D t exp iL exp (iL D t) exp iL exp iL NHCP 2 NHCP 2 " 2 # " 2

/ ( D t$ ),

1

(48)

where iL

¯

­

iL ,

iL

NHC

P

3

[(GZ Y )a b ®

iL ¯

3

NHCP iL ¯

"

iL ¯

#

P

(vZ Y ) a b Š

g

a b

9

g

n

]

¦

" ¦ (vZ Y )a

g

9 0 vZ Y g­ i=" 3

® b

:

N

Tr[vZ Y ] N

f

1 :

g IZ Y v [ ~ v , i i

N F (r) i [ ~ v, m i i=" i N ¦ . 3 [v ­ vZ Y r ] [ ~ r ­ 3 (vZ Y hZ Y ) a b i g i g i ab ¦ (hZ Y ) a b i="

(49)

The procedure used to apply this evolution operator is not very diŒerent from that used in the isotropic method. However, a m atrix (vZ Y ) appears in the operators that g generate the particle positions r rather than a single variab le ( Š e ), and a matrix of cell i param eters (hZ Y ) is introduced rather than a scalar variab le ( e ). Fortunately, vZ Y is g constrained to be a sym m etric matrix (see section 4.4). Therefore, the modi® ed velocity± Verlet part of the procedure becomes cZ Y t (0) IZ Y

hZ Y ( D t) ¯

cZ Y t (0) IZ Y

¯ i0 2 1

v(0)­

v ( D t) ¯

v (0)­

i

v

( e 0 2 1 cZ Y g(0) ri(0)­

r ( D t) ¯

D t

i

g g

i

D t

D t IZ Y

0 1

0 1*

D t D t c (0) v s 2 ZYg i 2

( e 0 2 1 cZ Y g(0) hZ Y (0)* D t

D t 2m

[F (0)]

i

D t 2m

i

[F (0)­

i

i

F ( D t)],

i

(50)

1132

G. J. M artyna et al.

where

9 IZ Y e 0 2 1 : D t

9 s0 2 1 : IZ Y

¯

exp ( k

D t) d a

a b

a b

D t

0

¯

exp k

a b

D t a

2

0

D t

1

sinh k

k

a

2

D t a

1d

a b

,

(51)

2

the k are the eigenvalues of vZ Y ( D t } 2), and cZ Y (0) is the associated matrix of eigenvectors g g (cZ Y t vZ Y cZ Y ¯ k Z Y ) . (Note, for 3¬ 3 m atrices the eigenvalues and eigenvectors can be g g g determined analytically.) A sim ilar scheme is used to apply the operator OW ¯

(

9 0 vZ Y g­ 9 i="

t« 3

exp ®

N

Tr (vZ Y ) N

g­ Š

n

f

: IZ Y 1 vi: [ ~ * v

that appears in the multiple time step factorization of exp (iL v (t« ) ¯ where

i

cZ Y t (0) IZ Y (0) cZ Y (0) v (0),

[IZ Y (0)]a b ¯

g

e

e

exp (®

k

g a

i

t« ) d

a b

,

(52)

i

NHCP

t). That is, (53) (54)

the k are the eigenvalues of the matrix (vZ Y (0)­ [Tr[vZ Y (0)] } N ­ Š n (0)] IZ Y ), and cZ Y (0) is the g g f g associated matrix of eigenvectors. Again, the factors of sinh (x) } x can be expanded in a M aclaurin series to arbitrarily high order without loss of generality. N ote that accumulation of the velocity scaling factor, as in equation (35), cannot be used in conjunction with the application of the operator exp (iL D t } 2) because the NHCP velocities are both rotated and scaled (see appendix C). As before, the use of the direct translation technique is recomm ended over closedform expressions for the phase space vector. Fortran code to apply this integrator is presented in appendix C. N ote that the isotropic part (i.e., the volume) is calculated in exac tly the sam e way as in the Andersen± H oover method. It is often useful to introduce a set of constraints on the particle degrees of freedom into isothermal± isobaric calculations [10]. This is com monly accomplished through the use of one of two methods [10]. The ® rst scheme divides the system into small groups of atoms that share com mon constraints and couples the barostat ( Š e or vZ Y ) only g to the centre-of-mass of each such group, and a centre-of-m ass pressure virial replaces the full atomic result in the equations of motion. It can be shown that the ensemble average pressure generated by the centre-of-mass virial at constant volume and temperature is given correctly, provided the size of the groups is small in comparison with the size of the simulation cell. If, however, the groups are not rigid bodies, the isobaric ensem ble de® ned by centre-of-mass volume scaling diŒers from the standard de® nition. The numerical implementation of the centre-of-m ass NPT m ethod can be carried out straightforwardly. The centres-of-mass of the groups are evolved by reversible N PT integration (isotropic or ¯ exible), while the relative coordinates are evolved by reversible NVT integration in conjunction with Shake } Rattle algorithms. The second NPT scheme is form ulated by coupling all the atom s in the system to the barostat. The constraints then make a non-trivial contribution to the pressure virial because V ¯ ® 3 k r is a part of the total potential energy and contributes to c i i i the virial. N umerical integration of this latter NPT method requires the iteration of a m odi® ed procedure, Shake } Rattle plus Roll (appendix D ), through the ® rst } second

1133

Extended systems dynam ics

application of the exp (iL D t } 2) operator (see equation (39)). The integration NHCP scheme and the Roll algorithm are described in detail in appendix D. Alternatively, the Shake } R attle plus Roll procedure can be replaced in some cases by a reversible G aussian dynam ics algorithm [20] to form a fully reversible explicit integrator. In contrast to the NVT m ethod, the volum e and the atoms involved in all sets of constraints formally must be coupled to the sam e thermostat. This restriction is generally relaxed as the volume is assumed to be approxim ately dynam ically decoupled (large W ). 5.

M ultiple time step integration

It is relatively straightforward to modify the preceding integrators to perform the type of m ultiple time step integration useful for treating problem s involving longrange forces, high frequency vibrations and general problems involving separation of time scales. These integrators, called reference system propagato r algorithms (RESPA s ; to indicate explicit reversibility, the designation r-RESPA has also been used in the literature [21]) [1], are now de® ned. 5.1. NVE-RESPA For com pleteness, the N VE-RESPA algorithm [1] is reviewed ® rst. In NVER ESPA, the evolution operator is broken up into several parts

0

exp iL 0 " 2 1 exp (iL # d t) $ 21 9 d t n D t exp iL 0 " 2 1 : exp 0 iL $ 2 1 ­ (D t$ ),

exp (iL D t) ¯

exp iL ¬

D t

d t

/

where iL ¯

"

iL ¯

#

iL ¯

$

9

(55)

:

N F ref(r) i [ ~ v, m i i=" i N 3 v[ ~ r, i i i=" N F (r)® F ref(r) i i 3 [ ~ v, m i i=" i 3

9

:

(56)

and d t ¯ D t } n. This factorization naturally give s rise to a process wherein the system is propagated using velocity± Verlet integration at sm all tim e step d t for n steps under the in¯ uence of an arbitrary refernce force F ref. The error induced by this approxim ation is corrected by applying exp (iL D t } 2) at both the beginning and end $ of the large tim e interval D t. Thus, the presumably computationally expensive true force F, is evaluated only every n steps (m ultiple time step integration). In practice, the integrator is applied as follows :

9

r( D t) ¯

r ref r(0), v(0)­

v( D t) ¯

v ref r(0), v(0)­

VV

­

VV

2

2

9

9

D t F(D t)®

9

D t F(0)®

9

D t F(0)® 2

F ref( D t) m

:

:

F ref(0)

: ; n, d t:

F ref(0) ; n, d t m m

:.

(57)

1134

G. J. M artyna et al.

That is, the aforem entioned n-step velocity± Verlet (VV) integration procedure is performed starting with a velocity initial condition modi® ed by the diŒerence between the true force and the reference force at the beginning of each large step. Also, the velocities obtained from the n-step velocity± Verlet procedure must be modi® ed by the diŒerence between the reference force and the true force evaluated at the end of the large time step. The direct translation technique can be used to develop a conceptually simple R ESPA integration procedure. For exam ple, the operator, equation (55), can be rendered into pseudocode as v¯

D t n (F® 2m

v­ i¯

DO v¯







1, n

d t 2m

n F ref

d tn v REF j FO RCE

CALL v¯

F ref)

d t



2m

n F ref

END DO CALL v¯ or

FORCE

D t



2m i¯

DO

n (F®

F ref)

1, n





d t n F now 2m





d tn v REF j FO RCE

CALL F now ¯

(58)

F ref

IF(i.EQ.n) CA LL F now ¯

TH EN

FORCE F ref­

n n (F®

F ref)

EN DIF v¯



d t n F now 2m

END DO.

(59)

The latter formulation, equation (59), is particularly useful when combining RESPA integration with holonom ic constraints. The standard holonom ic constraint algorithms, Shake [18] and Rattle [2], can be simply inserted in equation (59) in the usual places (Shake before the calls to the forces, and Rattle before the EN DDO ; see code in appendix E). In order to handle problems involving high frequency vibrations, it is generally su cient to take F ref ¯ F vib. Thus, the system can be evolved under the action of the

1135

Extended systems dynam ics

large vibrational forces for a sm all time step d t and the other softer forces applied only for the large time step D t [1]. This, of course, saves many evaluations of the softer forces which usually take much more CPU time to evaluate than F vib. In problems involving long-range forces, strong short-range interactions are also present. These can be separated out and placed in the reference force. For a system of particles interacting via a pair potential consisting of both a short-range repulsive and a long-range attractive interaction (as, for instance, in a Lennard-Jones ¯ uid), it is useful to write the force on each particle as [1]

3

f (r ) ¯ 3 f (r ) S(r )­ ij ij ij ij ij j j F short­ F long. i i

F ¯

i

F ¯

i

3

f (r ) [1®

S(r )],

ij ij

j

ij

(60)

If S(r) is chosen to change slowly from one to zero as r increases from r ® c exam ple [1], S(r) ¯ 1 r! r ® k , ¯

1­ ¯

0

c ¯



c # (2 c ® (r ®

c

k

3)

k )

c

r ®

k &

r"

r ,

c

r%

k to r , for

c

r,

c

c

,

(61)

then the short-range repulsive force is separated from the long-range attractive part as desired. Com puter time is saved because the com putation of the reference force, F ref ¯ F short, requires fewer interparticle distance evaluations than a computation of i i the full force (due to the sm all cutoŒdistance, r ). The full force, which includes the c long-range component, needs to be evaluated only for the large time step. 5.2. Extended system RESPA The approxim ate evolution operators that generate integrators for the extended systems methods presented in the previous section are of the form

0

exp (iL D t) ¯

exp iL ­

exp iL 0 " 2 1 exp (iL # D NHCx 2 1

D t

D t

0

t) exp iL

exp iL 0 NHCx 2 1 21

"

D t

D t

/ ( D t $ ),

(62)

where iL denotes either iL or iL . In addition, the inner sequence of three NHCx NHC NHCP operators in equation (62) leads to a velocity± Verlet or modi® ed velocity± Verlet integration. This realization makes it straightforward to de® ne an appropriate R ESPA. The ® rst varian t of RESPA presented here, is useful when the evolution prescribed by the operator exp (iL D t } 2) is slow compared with the time scale associated with NHCx the reference force. It is formed by writing

0

exp (iL D t) ¯

1 9 exp 0 iL" 2 1 exp (iL # d t) exp 0 iL" 2 1 : D t D t exp iL (63) 0 $ 2 1 exp 0 iL NHCx 2 1 ­ (D t$ ),

¬

exp iL

1

0

D t D t exp iL NHCx 2 $ 2

d t

d t

n

/

and is nam ed XO-RESPA (extended system outside-reference system propagato r algorithm). In general, XO-RESPA can be applied in systems that have fast vibrations as the time scale associated with the extended system variab les is usually chosen to be

1136

G. J. M artyna et al.

slow com pared with these motions (i.e., through the masses Q and W ). Two exceptions are in path integral molecular dynam ics where it is m ost e cient to have the extended system variab les (the therm ostats) evolve on the sam e time scale as the vibrations of the path integral chain polym er [22] and in N PT simulations of systems with stiŒ bonds (atomic virial) that give rise to a strong coupling between the system and the baro } therm ostat velocities. The XO-RESPA factorization m ay also be applied to the long-range force problem. However, it m ay be the case that the extended system variab les have been chosen to evolve on a time scale close to that of the short-range forces. Such systems require a diŒerent RESPA factorization. If the motion prescribed by exp (iL t« ) occurs on the sam e time scale as that NHCx generated by the reference force, then a useful R ESPA must include the application of this operator for the sm all tim e step d t : exp (iL D t) ¯

9 exp 0 iLNHCx 2 1 exp 0 iL $ 2 1 exp 0 ® iL NHCx 2 1 : d t d t d t d t n ¬ 9 exp 0 iL NHCx 2 1 exp 0 iL " 2 1 exp (iL # d t) exp 0 iL " 2 1 exp 0 iL NHCx 2 1 : d t D t d t ¬ (64) 9 exp 0 ® iL NHCx 2 1 exp 0 iL $ 2 1 exp 0 iL NHCx 2 1 : ­ (D t$ ). d t

D t

d t

/

The resulting integrator, XI-RESPA (extended system inside-reference system propagato r algorithm), is constructed so that when n ¯ 1 the original extended system algorithm (equation (62)) is recovered. Also, the operator exp (® iL d t } 2) is never NHCx really applied, as can be seen by rewriting XI-RESPA as exp iL D t ¯

¬

9 exp 0 iL NHCx 2 1 exp 0 iL $ 2 1 exp 0 iL " 2 1 exp (iL# d t) exp 0 iL " 2 1 d t d t d t ¬ exp iL 0 NHCx 2 1 : 9 exp 0 iL NHCx 2 1 exp 0 iL " 2 1 exp (iL # d t) d t d t n d t d t ¬ exp iL 0 " 2 1 exp 0 iL NHCx 2 1 : # 9 exp 0 iL NHCx 2 1 exp 0 iL " 2 1 d t D t d t ­ exp (iL d t) exp iL exp iL exp iL ( D t $ ). 0 1 0 1 0 NHCx 2 1 : # " 2 $ 2 d t

D t

d t

/

d t

(65)

M ore speci® c information on the formulation of X O-RESPA and XI-RESPA for each type of the extended system method is provided in the following subsections. 5.3. NVT-RESPA In the case of NVT-RESPA, the operators, iL , iL and iL , retain exactly the sam e " NVT-XO-RESPA # $ de® nitions as for the NVE-RESPA case. Therefore, is simply NVER ESPA modi® ed by the application of the extended system operator exp (iL D t } 2) NHC at the beginning and the end of each large tim e interval D t. NVT-XI-RESPA is only slightly diŒerent. It can be de® ned as an n tim e step, reversible, NVT integration of the reference system wherein the particle velocities are modi® ed by the diŒerence between the true force and reference force (as in NVE-RESPA ) after } before the ® rst } ® nal (2nth) application of exp (iL d t } 2). A Fortran implementation of N VT -XO-RESPA NHC and N VT-XI-RESPA is provided in appendix E.

1137

Extended systems dynam ics 5.4. NPT-RESPA

The NPT-RESPA case is somewhat m ore di cult to form ulate than the NVT case. H ere, the operator factorizations de® ned in equations (64) and (65) generate an n-step, m odi® ed, velocity± Verlet procedure that depends on the degrees of freedom associated with the cell volume (A ndersen± Hoover) and cell shape (Parrinello± Rahm an). In addition, under N PT-XI-RESPA the last } ® rst exp (iL d t) operator in the NHCP factorization, equation (65), contains diŒerent volum e or cell shape related forces from the others in the sequence. For isotropic constant pressure, the operators iL , iL , " # and iL are $ N F ref(r) iL ¯ 3 i [ ~ v, m i "

9

i=" N 3

iL ¯

#

:

i

r ][ ~

[v ­

i

i

r

­ i

Š e

¦ , ¦ e

i=" N F (r)® F ref(r) i i 3 [ ~ v, m i i=" i

9

iL ¯

$

:

(66)

and in XI-RESPA the operator iL alw ays contains the reference force on the NHCP logarithm of the volume (the reference virial)

0 1­ N f1 3i=" m i v#i ­ N

d

¯ G ref e

N 3

r [ F ref(r)®

i

i="

dP ref V,

i

(67)

ext

but the ® rst and last operator in the break up, equation (65), also contain n times the diŒerence virial ¯ G eff e where n d t ¯

( i=" ri[ [Fi®

n 3

G ref e ­

N

F ref(r)]®

i

d(P ®

*

P ref) V ,

ext

ext

(68)

D t. For fully ¯ exible constant pressure, the required operators are

9

:

N F ref(r) i [ ~ v, m i i=" i ¦ N , 3 [v ­ vZ Y r ][ ~ r ­ 3 (vZ Y hZ Y ) a b i g i g i ab ¦ (hZ Y ) a b i=" N F ® F ref(r) i i 3 [ ~ v, m i i=" i 3

iL ¯

"

iL ¯

#

9

iL ¯

$

:

(69)

and in XI-RESPA the operator iL alw ays contains the force on the unit cell (the NHCP reference tensorial virial) (FZ Y ref) a b ¯

N 3

g

m (v ref) a (v ) b

i i

i="

N 3

­

i

(F ref) a (r ) b ®

i="

i

i

P ref V d

a b

ext

,

(70)

but the ® rst operator and last operator in the break up, equation (65), also contain n times the diŒerence virial, (FZ Y eff) a b ¯

g

(FZ Y ref) a b ­

g

( i=" (Fi®

n 3

N

F ref)a (r ) b ®

i

i

[(P ®

ext

P ref) V] d

ext

a b

*.

(71)

1138

G. J. M artyna et al.

D espite these complications, NPT-XO-REPSA and NPT-XI-RESPA are applied in an analogous m anner to their NVT counterparts.

6.

Stability of integrators

Newtonian or Ham iltonian (NVE ) dynam ics obey Liouville’ s theorem and thus preserve the phase space volume. An integrator or m ap derived from a (symm etric) Trotter breakup of the evolution operator is also phase space volume preserving. Therefore, the dynam ics generated by such an integrator or m ap will conserve not the true Ham iltonian, but rather a modi® ed, tim e-step dependent Ham iltonian, Hh ( D t) [23]. This occurs because, in one dimension, phase space volume preservation im plies H am iltonian ¯ ow. For exam ple, velocity± Verlet integration of H ¯ p # } 2m­ m x # x # } 2 conserves Hh ¯ p # } (2m[1® ( x D t } 2) # ])­ m x # x # } 2. This guarantees that for all time t, the instantaneous energy H (t) generated by the map will only ¯ uctuate about H(0) and not drift aw ay, thus preserving the integrity of the energy shell over a trajectory. It also indicates that, in the region of stable evolution (x D t ! 2 for the oscillator), the m ap can possess closed orbits (d ¯ 1) ; the orbits diŒer from those of the true Ham iltonian. In addition, the m ap does not generate the exact dynam ics of the modi® ed H am iltonian Hh , but only conserves it (phase errors accum ulate). N onetheless, any Trotter factorization of the evolution operator will, in one dimension, possess, by construction, a desirable level of accuracy. In higher dim ensional problem s, velocity± Verlet integration (one class of these maps), has at least been observed em pirically to produce long trajectories with well behave d energy conservation in m any applications [24]. O ther factorizations of m ore recent origin [1] seem to exhibit this sam e property. Extended system m ethods are not Ham iltonian and alw ays have a greater than one-dimensional phase space. It is, therefore, unclear from the standpoint of analytical theory whether or not integrators which correctly weight the phase space (have the correct J ) will possess any special properties relative to the conserved quantity H « (which is not a Ham iltonian). It will be demonstrated empirically (see section 7) that Trotter factorizations of the evolution operator with the form

0

exp (iL D t) ¯

D t

­

exp iL

NHCx 2

1

0

exp iL

"

D t 2

1

0

exp (iL D t) exp iL

#

D t

"

2

1

0

exp iL

1

D t

NHCx 2

/ (D t$ )

(72)

generate dynam ics that conserve H « to good tolerance, while factorizations such as

0

exp (iL D t) ¯ ­

exp iL

D t

"

2

1 exp 0 iL NHCx 2 1 exp (iL # D D t

0

t) exp iL

1

0

D t D t exp iL NHCx 2 " 2

/ (D t$ )

1

(73)

behave less satisfactorily. One possible explanation of this observation is that applying the quasi-Ham iltonian portion of the evolution operator, exp (iL D t } 2) exp (iL D t) exp (iL D t } 2),

"

#

"

and modifying the result with a high accuracy, multiple tim e-step treatment of the extended variab les (therm ostat, barostats, etc.) preserves som e of the features of H am iltonian ¯ ow described above. The iterative velocity± Verlet algorithms which are

Extended systems dynam ics

1139

used comm only in extended systems simulations [24] are form ulated in a sim ilar way. The salient diŒerence between the two types of method, i.e., the reversible algorithms described here and iterative velocity± Verlet, is that a multiple time-step treatm ent of the extended system degrees of freedom is used in place of an iterative self-consistent scheme. The observed diŒerences in the ability of the two Trotter factorizations, equations (72) and (73), to conserve H « have important ram i® cations for the m ultiple step m ethods de® ned in the previous section. In general, XO-REPSA give good energy conservation for all choices of n, the number of inner tim e steps. That is, given a reference force and a ® xed value of D t, the improvem ent in energy conservation will saturate at large n, as is observed in N VE-RESPA (propagatio n using only the reference force has a ® nite level of accuracy). The XI-RESPA algorithm, however, will be shown (numerically) to behave diŒerently (see section 7). Energy conservation improves with increasing n, and then degrades. A m ore accurate reference force (F ref a better description of F ) increases the critical value of n. This phenomenon is observed because as n increases, XI-RESPA approaches the less desirable integrator, equation (73) (i.e., d t U 0 but D t ® nite). Despite theses di culties, some level of XI-RESPA is often desirable or necessary. Path integral M D sim ulations [22], for instance, utilize high frequency thermostats to promote the e cient sam pling of phase space. N VT-XI-RESPA is therefore employed to generate accurate trajectories. Sim ilarly, N PT-XI-RESPA integration is required to produce the correct equilibrium volum e distribution in system s which contain molecules with stiŒ intramolecular bonds. Basically, XI-RESPA m ust be used with a number n of inner RESPA steps commensurate with the quality of the reference force. 7.

Results

Applications of the integrators developed in the previous sections to instructive m odel problem s and more realistic atom ic as well as molecular systems are presented in this section. 7.1 M odel proble ms In order to illustrate some of the general properties of the reversible integrators, a one-dimensional harm onic oscillator (m ¯ 1, x ¯ 1, kT ¯ 1, Q ¯ 1, Q ¯ 1, M ¯ 2, i x(0) ¯ 1, Š (0) ¯ 1, D t ¯ 0± 03) is studied under canonical dynam ics (NVT ). Although this is a simple one-dimensional problem , it nonetheless contains su cient complexity to be of pedagogical value. In addition, very long trajectories (many oscillator `periods ’ ) can be generated, allowing one to determine unam biguously the relative e ciency of var ious algorithms. First, the ability the m ultiple tim e step Yoshida } Suzuki m ethod [15, 16] de® ned in equation 29 to reduce the computational overhead associated with the application of the N ose! ± Hoover chain (NH C) operator exp (iL D t } 2) is dem onstrated. In ® gure 1, NHC the deviation of the conserved quantity from its initial value, [E(t)® E(0)]} [E(0)], is plotted versus time as a function of the number of inner steps n used in the NH C c m ultiple tim e step procedure, equation (29). Y oshida } Suzuki intetgration, denoted as n ¬ n for a n step algorithm, is observed to reduce the total number of steps (n n ) c ys ys c ys necessary to achieve converged results relative to the simple algorithm (n equal length c steps, n ¯ 1) by a factor of from seven to fourteen. (N ote, the baseline on the 48¬ 1 ys result is not ¯ at ; it becomes ¯ at at 96¬ 1.)

1140

G. J. M artyna et al.

Figure 1. The deviation of the conserved quantity from its initial value, D E(t) ¯ [E(t)® E(0)]} [E(0)], for a harmonic oscillator undergoing Nose! ± Hoover chain dynam ics (m ¯ 1, x ¯ 1, Q ¯ 1), plotted versus time as a function of the number of inner steps n used in the k c NHC multiple time step procedure, equation (29). Yoshida } Suzuki integration is denoted ¬ ¬ by n n for a total of n n inner steps.

c

ys

c

ys

The new reversible N VT integrator has been tested again st the standard iterative m ethod described in reference [7]. The quantity,

D E( D t) ¯

0 N 1 k=3 " ) 1

N E(k D t)® E(0)

E(0)

),

(74)

the average deviation of the conserved quantity, is used to assess the accuracy of the trajectories. In ® gure 2, results for the two NVT m ethods, again for the harm onic oscillator, are presented as a function of time step D t, for two diŒerent values of the N HC param eter Q ¯ kT s # . The NVE results are shown as a reference. As the NH C time scale s decreases ( s " 1), the energy conservation of the iterative method degrades while that of the reversible method rem ains the sam e. Therefore, when s ¯ 1 } x ¯ 1, the reversible method achieves the sam e relative energy conservation as the iterative m ethod with about twice the sam e step.

1141

Extended systems dynam ics

(a)

(b)

Figure 2. The deviation of the conserved quantity versus time step for a harmonic oscillator undergoing Nose! ± Hoover chain dynam ics (m ¯ 1, x ¯ 1) for two diŒerent values of the Nose! ± Hoover chain parameter Q . The squares are the results of iterative velocity± Verlet, k the triangles are the results of the new explicit method, and the circles are the results of an NVE calculation performed using velocity± Verlet. (a) Q ¯ 1 ; (b) Q ¯ 10.

k

k

The alternative breakup of the Liouville operator, equation (73), has also been investigated. In ® gure 3, the deviation of the conserved quantity as a function of time, generated by the alternative scheme, is presented. A s stated in the previous section, the m ethod is not nearly as well behave d as the recomm ended formulation (see ® gure 1). NVT-XI-RESPA (extended system inside-reference system propagatio n algorithm) integration of the oscillator system under NVT dynam ics (Q ¯ 1) has been exam ined in order to illustrate the care that is necessary in the use of the algorithm. The trivial reference force F ¯ ® k x # x is em ployed for this purpose. In ® gure 4, the ref average deviation of the conserved quantity is presented versus the num ber n of inner time steps used to integrate the reference system. Standard N VE-RESPA is included as a benchm ark. As discussed in the previous section, NVT-XI-RESPA begins to approach the less stable breakup, equation (73), in the large n limit. Hence, there is a critical value of n above which the stability of the algorithm degrades. The critical value of n increases as a reference system becomes more accurate (here, as k U 1). This is in contrast to the NVE-RESPA and NVT-XO -R ESPA methods, which give good

1142

G. J. M artyna et al.

Figure 3. The deviation of the conserved quantity from its initial value, D E(t) ¯ [E(t)® E(0)] } [E(0)], for a harmonic oscillator undergoing Nose! ± Hoover chain dynamics (m ¯ 1, x ¯ 1, Q ¯ 1) using decom position equation (73).

k

energy conservation for all values of n (i.e., the average deviation of the conserved quantity reaches a plateau). The critical value of n in XI-RESPA is within the plateau region of N VE-RESPA. It is, therefore, a useful algorithm. Again, however, n must not be taken larger than warranted by the reference force. The results described above are not peculiar to this simple model and have been observed in many diŒerent systems. 7.2. Lennard -Jones ¯ uid A somewhat more realistic system, Lennard-Jones argon ( e ¯ 119± 8 K , r ¯ 3± 405 A/ , T * ¯ 0± 75, q * ¯ 0± 8, N ¯ 864, R ¯ 3 r ), has been studied under NVE, and cut both `massive ’ NVT and NPT dynam ics. In a `massive ’ calculation [7, 25], an independent NHC is placed on every degree of freedom (including the volume) for a total of 3N chains in NVT dynam ics or 3N­ 1 chains in NPT dynam ics. This represents a stringent test of the reversible method. The extended system time scale param eter used in the calculations was taken to be s ¯ 2500 fs for both the barostat and thermostats. In ® gure 5(a), the average deviation of the conserved quantity as a function of time step is presented. The behaviour of the conserved quantity is essentially the sam e for N VE, NVT and N PT dynam ics. The iterative integrators give similar results (not shown). However, the reversible formalism does allow m ultiple time step integration to be formally developed (a m ore ad hoc iterative schem e has been presented elsewhere [22]). Accordingly, the results of long-range forces XI-RESPA calculations are

1143

Extended systems dynam ics

(a)

(b)

Figure 4. The average deviation of the conserved quantity for a harmonic oscillator undergoing Nose! ± Hoover chain (m ¯ 1, x ¯ 1, Q ¯ 1), and Newtonian dynam ics, k plotted versus the num ber of inner time steps n used to integrate the reference system ref (F ¯ ® k x # x, D t ¯ 0 ± 01). The circles are Newtonian dynam ics, and the triangles are ref Nose! ± Hoover dynamics. (a) k ¯ 0 ± 5 ; (b) k ¯ 0 ± 9.

presented in ® gure 5(b) for r ¯ 2 r , k ¯ 0± 3 r , d t ¯ 25 fs, and n , the number of c ref m ultiple tim e steps. The energy conservation is essentially unchanged with n ranging ref from 1 to 4. 7.3 Liquid all-atom butane A ¯ exible all-atom butane model [26] has been exam ined in the liquid phase (T ¯ 267 K, V ¯ 159 A/ $ } m olecule, N ¯ 64 m olecules) under NVE, and both `m assive ’ N VT and NPT dynam ics. The average deviation of the conserved quantity D E at the typical tim e step D t ¯ 0± 5 fs is the sam e for the three types of dynam ics and is independent of integrator. Table 1 shows D E from a series of butane simulations using reversible NVT and Andersen± H oover NPT integration with no RESPA (n ¯ 1), and N VT-XO-RESPA and NPT-XI-RESPA (n " 1). The number n of multiple time steps was chosen to give a constant value for the inner time step d t ¯ 0± 25 fs in all of the R ESPA calculations. The data in table 1 show that the reversible multiple time step m ethod, NVT-X O-RESPA, can be employed to integrate the system to the sam e level of accuracy as the small tim e step (0± 5 fs) using a 3 fs tim e step and n ¯ 12 RESPA

1144

G. J. M artyna et al.

Table 1. Average deviation of the conserved quantity D E from liquid all-atom butane simulations with reversible NVT and Andersen± Hoover NPT integration with no RESPA (n ¯ 1), and NVT-XO-RESPA and NPT-XI-RESPA (n " 1). 10 % D E

D t (fs)

n

NVT

NPT

0 ± 25 0± 5

1 1

0 ± 426 1 ± 616

0 ± 344 1 ± 624

1± 0 2± 0 3± 0 4± 0

4 8 12 16

0 ± 473 0 ± 898 1 ± 753 3 ± 838

0 ± 489 0 ± 739 1 ± 606 3 ± 322

(a)

(b)

Figure 5. The average deviation of the conserved quantity for a Lennard-Jones system ( e ¯ 119 ± 8 K, r ¯ 3 ± 405 A/ , T * ¯ 0 ± 75, q * ¯ 0± 8, N ¯ 864, R ¯ 3 r ) undergoing NVE (circcut les), NVT (triangles), and NPT (squares) dynam ics : (a) plotted versus the time step (no RESPA ) ; (b) plotted versus the num ber n of RESPA steps under RESPA with ref R (ref) ¯ 2 r , D t ¯ (n 25) fs.

cut

ref

1145

Extended systems dynam ics

Table 2. Average deviation of the conserved quantity D E from liquid pseudoatom tetradecane ¯ 1), simulations with Andersen± Hoover NPT integration with no RESPA (n ¯ n lrf intra " 1). and NPT-XI-RESPA (n ¯ 2, n

lrf

D t (fs)

intra

n

lrf

n

intra

10 % D E

0± 5 1± 0

1 1

1 1

0 ± 153 0 ± 641

2± 0 4± 0 6± 0 8± 0 10 ± 0 12 ± 0 14 ± 0

2 2 2 2 2 2 2

2 4 6 8 10 12 14

0 ± 161 0 ± 169 0 ± 234 0 ± 372 0 ± 549 0 ± 697 0 ± 962

steps (all intram olecular interactions in the reference force but no intermolecular terms). Similar results have been reported elsewhere for NVE-R ESPA [21]. The A ndersen± Hoover equations can be integrated at the sam e level of accuracy by using N PT-XI-RESPA (see table 1). Note that, in constant pressure simulations, NPT-XO R ESPA is inappropriate as NPT-XI-RESPA integration with a su cient number of N HC multiple time steps ² n ¯ 3, n ¯ 3´ is required to give the correct ave rage c ys volume (the volum e generated by the sm all tim e step calculations).

7.4. Solid cholesterol acetate Cholesterol acetate is a molecular solid of space group P111 at the state point ² T ¯ 123 K, P ¯ 0´ [27]. A s in the butane exam ple above, NVT-XO -R ESPA integraext tion allows a tim e step of 3 fs (n ¯ 10) to be used without degradation of energy conservation in sim ulations of an all-atom model [28] of cholesterol acetate. Reversible Parrinello± Rahm an± H oover NPT sim ulations under NPT-XI-RESPA were found to perform similarly well. Both the NVT-XO-RESPA and N PT-XI-RESPA methods gave results in agr eement with all facets of the corresponding small time step calculations. In contrast, NPT-XO -R ESPA is not su ciently accurate to yield the correct average volume (i.e., the volume generated by the standard method (no R ESPA) using a small time step of 0± 5 fs).

7.5. Liquid pseudoatom tetradecane A ¯ exible pseudoatom model [29] of tetradecane has been simulated in the liquid phase (T ¯ 323 K , V ¯ 444 A/ $ } m olecule, N ¯ 48 molecules) to illustrate the utility of using a double RESPA factorization. Here, the reference force consists of all the intramolecular contributions F as well as the short-ranged part F of the vib short Lennard-Jones potential (r ¯ 1± 8 r , k ¯ 0± 25 r ). The F are evaluated at each inner c vib time step d t, the F each n inner time steps, and the full force each n ¬ n short intra lrf intra inner time steps. Table 2 shows D E from a series of tetradecane simulations using ¯ 1) and reversible Andersen± Hoover NPT integration with no RESPA (n ¯ n lrf intra " 1). The number of multiple time steps, n ¬ n N PT-XI-RESPA (n ¯ 2, n , lrf intra lrf intra was chosen to give a constant value for the inner time step d t ¯ 0± 5 fs in all of the

1146

G. J. M artyna et al.

R ESPA calculations. The data in table 2 show that the reversible multiple time step m ethod, NPT-XI-RESPA, can be employed to integrate the equations of motion to the sam e level of accuracy as the typical, sm all tim e step (1 fs) using a time step as large ¯ 2¬ 12 RESPA steps. as 12 fs with n ¬ n

lrf

intra

8.

Conc lusion

New reversible integrators for extended system dynam ics have been derived and applied to both realistic and model problems. The performance of the new methods was found to be as good as, or better than, the standard iterative schem es [24]. The m ost signi® cant advantage of the reversible integrators is that their m ultiple time step generalizations (RESPA), which can deliver large savings in CPU time, are easy to de® ne and implement. In addition, the new schemes can be used in conjunction with other methods, such as hybrid M onte Carlo [8], that require reversible evolution. The research described herein was supported by the National Science Foundation under CHE-92-23546 and the National Institutes of Health under R01 G M 40712. G . J. M . acknowledges startup funds from Indiana University and the Petroleum R esearch Fund (ACS-PRF 28968- G6), and D. J. T. support from the National Institutes of H ealth (F32 GM 14463) . The authors thank Chris M undy for a critical reading of the manuscript and Preston M oore for help with the code.

Extended systems dynam ics

1147

1148

G. J. M artyna et al.

minus velocity-dependent part

Extended systems dynam ics

1149

1150

G. J. M artyna et al.

Extended systems dynam ics

1151

1152

G. J. M artyna et al.

1153

Extended systems dynam ics

Appendix D The standard Shake and Rattle constraint method is designed to work in conjunction with the velocity± Verlet integration algorithm (NVE ) [18]. It also can be used in conjunction with the explicit NVT integration scheme as described in section 4.3. However, if constraints are desired in NPT simulations, the Shake and Rattle algorithms m ust be modi® ed. The modi® cation is given the sobriquet `Roll ’ for reasons that will be come clear in the derivation. In the following derivation, it is assum ed, as in the NVT case, that common thermostats are assigned to variab les involved in common sets of constraints. It is not assumed that a single thermostat is assigned to the volume and all the constrained degrees of freedom. The explicit N PT integration algorithm can be thought of as evolving the system from t ¯ 0 to t ¯ D t } 2 through the action of exp (iL D t) exp (iL D t } 2) exp (iL D t } 2) on the initial conditions (t ¯ 0) and then NHCP from t ¯ # D t } 2 to t " ¯ D t through the action of exp (iL D t } 2) exp (iL D t } 2) on the NHCP conditions generated at t ¯ D t} 2. The particle positions at t ¯ D t and" velocities at t ¯ D t } 2 can be written in the form RZ Y ( k , 0) r (0)

r ( D t) ¯

i

x

0 1

D t ¯ i 2

0

D t#

RZ Y ( k , 0) D tv (NHCP)( k , 0)­ ­

v

i

v

v (NHCP)( k , 0)­

i

i

D t 2m

9 Fi(0)­

2m

3 k

k

9 Fi(0)­ 3

k

k

:

F (k)(0) , k ci

F (k)(0) k ci

:1 (D 1)

where v NHCP( k , 0) indicates the action of exp (iL D t} 2) on v(0), k are the Lagran ge NHCP m ultipliers and k F (k)(0) are the constraint forces (F (k)(0) ¯ ® ~ r r (r(0))). The k ci ci i(! ) k tensors RZ Y ( k , 0) and RZ Y ( k , 0) (see equation (51)) revert to scalars under isotropic v x A ndersen± Hoover dynam ics. The dependence of v (NHCP)( k , 0) on the multipliers is induced by the operator exp (iL D t } 2), which depends directly on the multipliers NHCP through the position-dependent part of the pressure tensor (P (r)) a b ¯

int

3

9i Fi­ 3

k

k

:

F (k) (r ) . k ci a i b

(D 2)

1154

G. J. M artyna et al.

The velocities at time t ¯ v ( D t) ¯

i

vZ Y ( D t) ¯

g

D t can be written exactly as

9 i0 2 1 ­

v

i

D t

vZ Y (! )( D t)­

g

S ( k , D t) 3

V

2W

g

9

D t

RZ Y ( k , D t) S ( k , D t) v

D t F (D t)­ 2m i 3

k

k

F (k)( D t) k ci

k (F (k)( D t))a (r ( D t)) b .

k ci

k

i

:: (D 3)

H ere, the tensor RZ Y ( k , D t), and the scalars S ( k , D t) and S ( k , D t) are generated by the v i V action of the evolution operator exp (iL D t } 2) on the particle and cell velocities NHCP obtained by applying exp (iL D t } 2) to the conditions at t ¯ D t } 2. " is designed to determine the Lagran ge multipliers such The Shake } Roll procedure that the r( D t) satisfy the constraints r (r( D t)) ¯ 0, for all k, to within a desired k tolerance. In order to accomplish this, the initial values of the entire phase space ² hZ Y (0), vZ Y (0), n (0), v n (0), v(0), r(0)´ are ® rst stored. The evolution operator g i exp (iL D t) exp (iL D t } 2) exp (iL (D 4) D t } 2)

NHCP

#

"

is then applied to these initial conditions to take the system to time t ¯ D t } 2. The m ultipliers required in equations (D 1) and (D 2) are taken from the Rattle } Roll procedure of the previous tim e step. Next, the particle positions, velocities, and position dependent part of the pressure tensor (i.e., the multipliers) are re® ned iteratively by assum ing that the ² v ( k , 0), RZ Y ( k , 0), RZ Y ( k , 0)´ are approxim ately NHCP v x independent of the multipliers, the constraints are approxim ately independent of each other and that it is su cient to solve a linearized equation for the increment to each of the multipliers. For the NPT integration schem e outlined were, equation (D 1), the result is ® 2 r ( D t) k , d k ¯ k D t# 3 m " [RZ Y ( k , 0) F (k)(0)] [ F (k)( D t) i v ci ci

i

v (new)

0 21 ¯ D t

r (new)( D t) ¯ ¯ (P (r)(0)) (new) a b

int

k (new) ¯

k

v (old)

0 21 ­ D t

D t 2m

D t#

r (old)( D t)­

2m

­ (P (r)(0)) (old) a b

int

k (old)­

k

d k

F (k)(0), k c

RZ Y ( k , 0) d k

v

1 V(0)

d k 3

k

i

F (k)(0), k c (F (k)(0)) a (r (0))b , ci i

d k ,

(D 5)

k

where F (k)( D t) is evaluated using r (old)( D t). The only diŒerence between this procedure c and the standard Shake method is the insertion of the rotation matrix } tensor RZ Y ( k , 0), and hence `roll ’ . A fter iterating Shake } Roll, equation (D 5), to convergence v by cycling through the constraints a num ber of tim es, holding ² v ( k , 0), NHCP RZ Y ( k , 0), RZ Y ( k , 0)´ ® xed, new ² v ( k , 0), RZ Y ( k , 0), RZ Y ( k , 0)´ are generated by applying v x NHCP v x exp (iL D t) exp (iL D t } 2) exp (iL D t } 2) to the initial conditions. This time, NHCP # " however, the re® ned multipliers (i.e., the re® ned constraint forces and position dependent part of the pressure tensor) are inserted in the evolution operator. The Shake } R oll procedure is then applied to the new input. This process of generating ²v ( k , 0), RZ Y (k , 0), RZ Y (k , 0)´ , followed by Shake } Roll re® nement of the multipliers NHCP v x is continued until ® nal convergence. Here, ® nal convergence means that the action of the operator exp (iL D t) exp (iL D t } 2) exp (iL D t } 2)

#

"

NHCP

1155

Extended systems dynam ics

on the initial conditions results in r( D t) that satisfy the constraints to the desired tolerance. Although, in principle, it may take many cycles through the algorithm to attain ® nal convergence, in practice, the approxim ations are su ciently good that usually only two iterations are necessary. Note, the implem entation of the m ethod is simpli® ed if the multipliers are stored. This poses no particular problem s on modern computers because the number of multipliers scales linearly with the num ber of particles. In contrast to Shake } Roll, the R attle } R oll scheme is designed to determine the Lagran ge multipliers such that the ® rst time derivative of each constraint is zero,

r 0 ( D t) ¯ 3

k

[v ( D t)­

i

i

vZ Y ( D t) r ( D t)] [ ~

g

r (r( D t)) ¯ i( t) k

r D

i

0,

(D 6)

within a given tolerance. A s in Shake } Roll, the initial conditions ² vZ Y ( D t } 2), n ( D t } 2), g v n ( D t} 2), v( D t } 2)´ are ® rst stored. The multipliers from the Shake } Roll procedure are i then used as input to exp (iL D t } 2) exp (iL D t } 2) and the initial conditions evolved NHCP to t ¯ D t. This produces a ® rst guess to ² RZ Y ( k , D " t), S ( k , D t), S ( k , D t)´ . The Rattle } Roll v i V procedure iteratively re® nes the particle and cell velocities assuming that the ² RZ Y ( k , D t) S ( k , D t), S ( k , D t)´ are constant, the constraints are independent of each v i V other, and that it is su cient to solve a linearized equation for the increm ent to each of the multipliers :

d k

¯

k

i v (new)( D t) ¯

i

¯ (P (r)( D t)) (new) a b

int

vZ Y (new)( D t) ¯

g

k (new) ¯

k

2 r d ( D t) ®

D t3

k

m " [RZ Y ( k , D t) S ( k , D t) F ( D t)][ F ( D t) i v i ci ci

D t

v (old)( D t)­

i

2m

k (old)­

k

V( D t)

D t

g

k v 1

int

vZ Y (old)( D t)­

RZ Y ( k , D t) S ( k , D t) F (k)( D t), i ci

d k

­ (P (r)( D t)) (old) a b

2W

g

,

d k (F (k)( D t)) a (r ( D t)) b ,

k ci

i

S ( k , D t) d k 3

V

k

i

(F (k)( D t)) a (r ( D t)) b , ci i

d k ,

(D 7)

k

where the contribution of the pressure tensor to d k has been neglected as W is k g generally large. A fter iterating Rattle } Roll, equation (D 7), to convergence by cycling through the constraints a num ber of times, holding ² RZ Y ( k , D t), S ( k , D t), S ( k , D t)´ v i V ® xed, new ² RZ Y ( k , D t), S ( k , D t), S (k , D t)´ are generated using the re® ned constraint v i V forces and position dependent part of the pressure tensor in exp (iL

NHCP

D t } 2) exp (iL D t } 2).

"

The Rattle } Roll re® nement is then repeated. N ote, these subsequent R attle } R oll calculations require very few iterations to converge as the multipliers are already fairly accurate. The full algorithm, which consists of generating the ² RZ Y ( k , D t), S ( k , D t) S ( k , D t)´ followed by a Rattle } Roll re® nem ent, converges rapidly v i V (in about three iterations). As in Shake } Roll, convergence is de® ned to mean that the action of the operator

D t } 2) exp (iL D t } 2) NHCP " on the initial conditions generates ² v(D t), vZ Y ( D t)´ that satisfy the condition on the time g exp (iL

derivatives of the constraints to within the desired tolerance.

1156

G. J. M artyna et al. Appendix E

In this appendix, Fortran code that implements NVT-XO-RESPA and NVT-X IR ESPA is presented. A system of N particles is assumed to be coupled to a single N ose! ± Hoover chain. Continuation cards have been eliminated for clarity. See the comments in the code presented in the previous appendices for a com plete de® nition of the variab les.

Extended systems dynam ics

1157

References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29]

T u c k e r m a n , M., M a r t y n a , G. J., and B e r n e , B. J., 1992, J. chem. Phys., 97, 1990. A n d e r s e n , H. C., 1980, J. chem. Phys., 72, 2384. N o s e ! , S., 1984, J. chem. Phys., 81, 511. H o o v e r , W. G., 1985, Phys. Re Š . A, 31, 1695. P a r r i n e l l o , M., and R a h m a n , A., 1980, Phys. Re Š . Lett., 45, 1196. M a r t y n a , G. J., T u c k e r m a n , M. E., and K l e i n , M. L., 1992, J. chem. Phys., 97, 2635. M a r t y n a , G. J., T o b i a s , D. J., and K l e i n , M . L., 1994, J. chem. Phys., 101, 4177. D u a n e , S., K e n n e d y , A. D., P e n d l e t o n , B. J., and R o w e t h , D., 1987, Phys. Lett. B, 195, 216. A r n o l d , V. I., 1978, Mathematical Methods of Classical Mechanics (New York : SpringerVerlag). N o s e ! , S., and K l e i n , M . L., 1983, Molec. Phys., 50, 1055. M e l c h i o n n a , S., C i c c o t t i , G., and H o l i a n , B. L., 1993, Molec. Phys., 78, 533. S w o p e , W. C., A n d e r s e n , H. C., B e r e n s , P. H., and W i l s o n , K. R., 1982, J. chem. Phys., 76, 637. C r e u t z , M., and G o k s c h , A., 1989, Phys. Re Š . Lett., 63, 9. T r o t t e r , H. F., 1959, Proc. Amer. math. Soc., 10, 545. Y o s h i d a , H., 1990, Phys. Lett. A, 150, 262. S u z u k i , M ., 1991, J. math. Phys., 32, 400. R a e d t , H. D., and R a e d t , B. D., 1983, Phys. Re Š . A, 28, 3575. R y c k a e r t , J. P., C i c c o t t i , G., and B e r e n d s e n , H. J. C., 1977, J. comput. Phys., 23, 327. A n d e r s e n , H. C., 1983, J. comput. Phys., 52, 24. T u c k e r m a n , M., and P a r r i n e l l o , M ., 1994, J. chem. Phys., 101, 1302. W a t a n a b e , M., and K a r p l u s , M., 1993, J. chem. Phys., 99, 8063. T u c k e r m a n , M. E., B e r n e , B. J., M a r t y n a , G. J., and K l e i n , M. L., 1993, J. chem. Phys., 99, 2796. A u e r b a c h , S., and F r i e d m a n , A., 1991, J. comput. Phys., 93, 189. A l l e n , M. P., and T i l d e s l e y , D. J., 1989, Computer Simulation of Liquids (Oxford : Clarendon Press). T o b i a s , D. J., M a r t y n a , G. J., and K l e i n , M . L., 1993, J. phys. Chem., 97, 12959. T o b i a s , D. J., T u , K., and K l e i n , M. L., 1996, J. phys. Chem., in press. W e b e r , H. P., C r a v e n , B. M., S a w z i k , P., and M c M u l l a n , R. K., 1991, Acta crystallo gr. B, 47, 116. T u , K., T o b i a s , D. J., and K l e i n , M. L., unpublished. S i e p m a n n , J. L., K a r a b o r n i , S., and S m i t , B., 1993, Nature (Lond.), 365, 330.