(See equation 2.) Let us assume, for the moment that <strong>immobilized</strong> <strong>atoms</strong>are not rescaled during pressure equilibration. This means that:d⃗r IdL = d⃗r JdL = 0 <strong>and</strong> thus d⃗r I,⃗mdL = d⃗r J,⃗mdL= ⃗m (8)After substituting equations 7 <strong>and</strong> 8 into 6, <strong>and</strong> some additional simplification(appendix A) we find that the following terms (denoted ∆W im ) are leftout of the virial:∆W im = ∑ I⃗r I · ∑⃗m∈Z 3 ⎛⎝ ∑ j⃗f j,⃗m→I + ∑ J>I⃗f J,⃗m→I⎞⎠ (9)These terms would otherwise be present if the <strong>immobilized</strong> <strong>atoms</strong> (withindices I, <strong>and</strong> J) were scaled with the box-size during pressure equilibration.Simulation programs typically include all of these pairwise force terms.To correct the virial, one could subtract these terms (∆W im ) from the virialas∑calculated by the simulation program. We can recognize the sum over⃗m∈Z 3 as the net pairwise force acting on atom I. Hence we can calculatethis correction to the virial knowing only the net force acting on each atom.Alternately, one can apply the restraint forces which negate these beforecalculatingthevirial. (Thisisreallythesamething, becausetheseconstraintforces would have contributed −∆W im to the virial.) For completeness, anexpression for the full virial is given in equation 10 in appendix A.Appendices:A Simplifying the virialI skipped a few steps when deriving equation 9. The are included here.Substituting equations 7 <strong>and</strong> 8 into equation 6 completely eliminates termscontaining ⃗ f j,⃗m→I , ⃗ fJ,⃗m→I , <strong>and</strong> reduces the number of terms containing⃗f i→J,⃗m , <strong>and</strong> ⃗ f I→J,⃗m . We are left with:W = 1 2∑⃗m∈Z 3 ( ∑i≠j(⃗r i · ⃗f j,⃗m→i +(⃗r j +L⃗m)· ⃗f)i→j,⃗m + ∑ ((⃗r j +L⃗m)· ⃗f)I→j,⃗mI,j+ ∑ (⃗r i · ⃗f J,⃗m→i +L⃗m· ⃗f)i→J,⃗m + ∑ (L⃗m· ⃗f) )I→J,⃗m (10)i,JI≠JThis expression for the virial can be written in multiple equivalent ways.Note that: ⃗ fi → j,⃗m (the force from atom i acting on the image of atom j inunit cell ⃗m) is identical to ⃗ f i,−⃗m → j (the force acting on <strong>immobilized</strong> atomj, coming from the image of atom i in unit cell −⃗m).The terms which (as a result of immobilizing of some of the <strong>atoms</strong>), are4
absent from this summation (denoted ∆W im ), are:∆W im = 1 2(∑ ∑⃗r I · ⃗f j,⃗m→I + ∑ ⃗r J · ⃗f i→J,⃗m⃗m∈Z 3 I,j i,J+ ∑ (⃗r I · ⃗f J,⃗m→I +⃗r J · ⃗f) )I→J,⃗m (11)I≠JByusingtheidentities: f ⃗ i → J,⃗m = f ⃗ i,−⃗m → J <strong>and</strong>f ⃗ I → J,⃗m = f ⃗ I,−⃗m → J , <strong>and</strong>replacing ⃗m by −⃗m, in the sum ∑ ⃗m∈Z 3 (since we are summing over bothpositive <strong>and</strong> negative x,y,z components of ⃗m), <strong>and</strong> combining <strong>and</strong> eliminatingredundant terms (<strong>and</strong> eliminating the factor of 1 2), we can justifyequation 9.References[1] Louis, A., “Computer Simulation Methods in Chemistry <strong>and</strong>Physics, Part III”, Section 5.3, 94-95, (2005)http://www-thphys.physics.ox.ac.uk/people/ArdLouis/teaching.shtml[2] Thompson, A.P., Plimpton, S.J., Mattson, W., “General formulationof pressure <strong>and</strong> stress tensor for arbitrary many-body interactionpotentials under periodic boundary conditions” J. Chem.Phys., 131, 154107, (2009)5