A Molecular Dynamics Method For Simulations in The Canonical Ensemble
A Molecular Dynamics Method For Simulations in The Canonical Ensemble
To cite this article: Shūichi Nosé (1984): A molecular dynamics method for simulations in the
canonical ensemble, Molecular Physics: An International Journal at the Interface Between
Chemistry and Physics, 52:2, 255-268
This article may be used for research, teaching, and private study purposes. Any
substantial or systematic reproduction, redistribution, reselling, loan, sub-licensing,
systematic supply, or distribution in any form to anyone is expressly forbidden.
The publisher does not give any warranty express or implied or make any
representation that the contents will be complete or accurate or up to date. The
accuracy of any instructions, formulae, and drug doses should be independently
verified with primary sources. The publisher shall not be liable for any loss, actions,
claims, proceedings, demand, or costs or damages whatsoever or howsoever
caused arising directly or indirectly in connection with or arising out of the use of
this material.
MOLECULAR PHYSICS,1984, VOL. 52, No. 2, 255-268
1. INTRODUCTION
Th e molecular dynamics ( M D ) method has become an important technique
for the study of fluids and solids. In the standard MD method, the newtonian
equations of motion of the particles in a fixed MD cell of volume V are solved
numerically. T h e total energy E is conserved, and thus the ensemble generated
by the simulation is the microcanonical or (E, V, N) ensemble.
With the MD method, not only the static quantities but also the dynamic
quantities can be obtained. This is one advantage over the Monte Carlo (MC)
method. However, a disadvantage of the M D method is that the conditions of
the simulations are not the same as those normally encountered in experiments
(constant temperature, constant pressure or (T, P, N) conditions).
In this regard, Andersen's introduction of the constant pressure M D method
represented a significant breakthrough [1]. In his modified MD method, the
volume becomes a variable and is allowed to fluctuate. T h e average volume is
determined by the balance between the internal pressure and the externally set
pressure P~x. T h e enthalpy of the system is approximately conserved, so this
method generates the constant enthalpy, constant pressure (H, P, N ) ensemble.
Parrinello and Rahman subsequently extended the method to allow for changes
of the M D cell shape [2, 3 ]. T he usefulness of this latter method has been demon-
strated by numerous applications to structural changes in the solid state [2-7].
To perform M D simulations at constant temperature, one can simply keep
the kinetic energy constant by scaling the velocities at each time step and this
approach is now widely employed [8, 9]. However, there seems to be no
rigorous proof that the latter approach produces configurations belonging to the
canonical ensemble.
t Issued as N.R.C.C. No. 23045.
$ Present address : Department of Physics, Faculty of Science and Technology, Keio
University, 3-14-1 Hiyoshi, Kohoku-ku, Yokohama 223, Japan.
M.P. 1
256 Shfiichi Nos~
s ~i mi
-~- s 3"r~2 - r + Q i~-(I+l)kTo,~lns. (2.2)
= ~A'
where A stands for one of the variables mentioned above.
Downloaded by [Duke University Libraries] at 02:56 03 July 2012
or
1 ~r 2i
i~ = f'i. (2.5)
m i s2 ~r i $
The equation for s is
Qk= ~ misi.i2- ([+ 1)kTeq (2.6)
i $
If we denote the average in the extended system by ( . . . ) , the relation
( ~i9 mis2
s
f'i~) = ( f + l ) h T e q I! 5 (2.7)
is obtained from (2.6) because the time average of a time derivative (e.g. Q+')
vanishes. This suggests that the average of the kinetic energy coincides with the
externally set temperature Teq.
The momenta are given by
p i = ,,.
(7 r i
=m is i"i (2.8)
and
the total m o m e n t u m
P = ~i p i = ~i (m,d2i'), (2.11)
12
258 Shfiichi Nos~
2.2. Proo[ of the equivalence of the present method and the canonical
ensemble
Now we prove that the equations of motion derived from (2.2) produce
configurations in the canonical ensemble at temperature Teq. Our extended
system produces a microcanonical ensemble of (f + 1) degree of freedom. The
partition function of this ensemble is defined by
Z -_ ~
1l dpsI dsl dpl dr ~ ( ~2--~+r
P~ .Ps ~ . ) . (2.13)
Here, ~(x) denotes the Dirac ~ function, and the shortened forms d p =
dpl dp2 . . . dpN , dr = dr I dr 2 . . . dr N are used.
T h e m o m e n t u m Pi is transformed as
Downloaded by [Duke University Libraries] at 02:56 03 July 2012
PJ=p'
$
~, (2.14)
1 1
-q+l)kre~NtldPsldp'Idrexp
[(- p2)/]
a~(p',r)+~QQ-E kr~ .
The integration with respect to p~ can be carried out immediately, so we get
the final result
1(2 e)1,'
Z=([+I ) \kTe J exp ( E / k T e q ) Z e . (2.15)
The average of some static quantity which is an arbitrary function of pJs and
r~ in the extended system is exactly the same as that in the canonical ensemble,
The above result is derived from the assumption that the only conserved
quantity is the total hamiltonian YF1. In fact, the system has other conserved
quantities: total m o m e n t u m and angular momentum. These deviate by an
order O(1/N) from the canonical ensemble averages. A similar result was
already pointed out by Hoover and Alder for the microcanonical ensemble [12].
The correction for total momentum conservation in this method can be
achieved by using f - 3 in place of f in the definition of both the lagrangian and
the instantaneous temperature.
p2 f kT,
~i 2mis
--2 - 2
the average and the fluctuation of T are, respectively
The formula for the heat capacity cv is derived from the fluctuation of the total
energy
,r~ P i 2
ET= .~, ~ + r ;
i Lmis
• [~(P"r)+(P~2/2Q)-E])(f+I)kT~q
• -[#f(p''r)+(p~e/2Q)-(f+l)kTeqE]])
mE f + 1 ~1/2
=exp [if + i)-kTcq] ([ ~- l +m ]
x@xp [---
m r ,
(2.22)
1+1" kTeq])c
( P: \ = l P ' : \ = l l \ f
misa/ \mis/ \'/
+ l kreo.
I
This last equation is identical to (2.7).
The fluctuation of s is
Downloaded by [Duke University Libraries] at 02:56 03 July 2012
((s-<s>?\=55
\ <s> ] / 12 k
(2.24)
dri dr i
Canonical ensemble M D method 261
The length of the time step is unequal in the canonical ensemble M D method.
For calculation of time dependent quantities, it is convenient to sample at intervals
that are integer multiples of a unit time step. This can be done very easily by
interpolation. At equilibrium, the fluctuation of s is of order N -112 (see 2.24)),
so in practice, the differences in the lengths of individual time steps can some-
times be ignored. An averaged real time can be obtained by multiplying the
simulation time with (s-l).
The detailed nature of the dynamics depends upon the value of Q chosen.
However, some dynamic quantities (especially, one body quantities) of the system
are, we believe, less sensitive to the value of Q. If this is the case, we can get
information on both static and dynamic quantities.
The frequency of the s oscillation can be estimated from (2.5),
Downloaded by [Duke University Libraries] at 02:56 03 July 2012
t0=--=2w
(Q<s)2 1 2 (2.30)
o~ \2fkr~q/
A typical value of Q for a 108 particle system, at Teq = 150 K and for t 0= 1 ps
is 20 (kJ mol-X)(ps) 2.
The transformation (2.26) can be used to change the length of time step.
Without this Control, the real time step in the simulations may become too small
or too large. For a small time step, the calculation is inefficient ; for a large
one, the precision of the calculation cannot be maintained.
3. AN APPLICATION
The canonical ensemble M D method was tested on a system of 108 argon
atoms (mass 39.9 g tool-l), interacting with a Lennard-Jones 12-6 potential
(E = 1.039 kJ mo1-1, a = 3.446 A) which was truncated at 8-5 A. The M D cell
was a cube of edge length 17.5 A (or volume 29.88 cm 3 mo1-1) and as usual, the
periodic boundary condition was adopted. A 5th order predictor-corrector
algorithm was employed for integration of the equations of motion. A time step
At=2.5 x 10 .25 s was used, except for the runs with Q = 100 (kJ mol-1)(ps) 2 for
which At=5.0 x 10 -is s. Each run consisted of the calculation of 2500 time
steps, the first 500 steps being discarded from the averaging.
In all applications, differences in the length of individual time steps were
ignored and the real time was calculated by multiplying the time of simulation
by the factor <s-l>.
Downloaded by [Duke University Libraries] at 02:56 03 July 2012
262
r
7
9
9
oo
o~
o~
II
~J
~L
7
~J
1
1
1
1
1
1
Shfiichi Nos6
1
1
1
Canonical ensemble MD method 263
The simulations were carried out by the following scheme. First, starting
from an initial configuration (f.c.c. structure) a standard MD run (No. 1) was
carried out at about 150 K. This was followed by a constant temperature
simulation at Teq=100 K (No. 2). Then, the temperature was reset to
Teq = 150 K (No. 3) and finally the effects of using different Q values 1, 10, and
100 (kJ mol-1)(ps) 2 were compared at 100 K and 150 K (No. 4 9). The results
are listed in the table. The deviationsof the temperature from Teq a r e less than
1 K. The runs with Q = 1 show especially good agreement. The averages of
the potential energy and pressure give almost the same results for different
values. The run No. 9 clearly did not reach equilibrium because the tempera-
ture fluctuation is too large. The sudden increase in the value of ~ at the
beginning of the run gave a huge amount of kinetic energy to the variable s,
which could not relax to equilibrium in the 2500 timesteps.
Downloaded by [Duke University Libraries] at 02:56 03 July 2012
250
Q = l.O ( k J / m o l ) ( p s ) 2
I
200 1. . . . . . . . . . . . .
L
L
t~
lO0 . . . . . . . . . . . . .
50
1250 2500 3750 5000 6250 7500
step
(c,~, heat capacity) shows that the temperature fluctuations in the canonical
ensemble are larger than those in the microcanonical ensemble. We can readily
recognize this in figure 1. The values of AT=(((3T)2)) 1/~, 8-3 K at 100 K
and 12.4 K at 150 K are comparable with those given by (2.19), 7.9 K at 100 K
and 11.8 K at 150 K. As expected, the value of AT, and the heat capacity
which is calculated from AT and the fluctuation of the potential energy, are less
accurate than the energy or pressure results.
264 Shfiichi Nos~
140
Q = 1.o (k#~o0(p,) ~
120
100
80
60
q : too.o (k'J/moO(ps)2
120 ]
,,% /%, ~ 6t
,~, ~,
Downloaded by [Duke University Libraries] at 02:56 03 July 2012
60 ............. '~ . . . . . . . . . .
60
600 1600 2400 stpe 3200 4000
20 /
./~
15
.~
/
dx ..... ~
/..,~ ..........
vo I0
I
v
.~176 /
....~176
V ~....~176 .~j
5 .~176176176176176176
..~
0 I t [ I
0 2 4 6 8 I0
tips
Figure 3. Comparison of the mean square displacements for different Q values at 150 K.
Solid-line Q = 1, dashed line Q = 10, and dotted line Q = 100 (kJ m o l - : ) ( p s ) 2.
Canonical ensemble M D method 265
t~o 6t
The plot of the time evolution of the mean square displacement for different Q
values is given in figure 3. All values for D for a given temperature seem to
agree reasonably well. Even run No. 9 gives almost the same result as the
other Teq = 150 K runs, in spite of the large deviation from a straight line.
4. CONCLUSION
An MD method for constant temperature simulations has been presented.
One can see from the derivation in w2 that different kinds of constant tempera-
ture simulation methods can be constructed by changing the functional form of
the potential for the variable s. However, the equilibrium distribution function
thus obtained is related to the inverse function of the potential for s, so that any
other choice but a logarithmic form, results in an ensemble different from the
canonical one. Therefore, a constant temperature method does not always
imply that the calculation samples from the canonical ensemble.
The present method gives static quantities in the canonical ensemble. If
w e employ the interpretation that s is a scaling factor of time and that the real
unit time At' is related to the simulation unit time At by At'= At~s, calculation
of dynamical quantities also seems to be possible. Of course, we have rigorously
proved nothing concerning with the dynamic quantities, but it will be worth
trying to determine under what conditions can one obtain the dynamical
quantities reasonably well.
Main features of the present method are
(1) The extended system of the particles and the variable s conserves the total
hamiltonian. This gives a powerful error checking method in the process
of programming and a useful precision control method in the simulations
[7].
(2) Since the present method employs a similar technique as the constant
pressure MD method, it can readily be extended to the constant tempera-
ture constant pressure ensemble.
(3) The scaling of the velocities can be interpreted as a scaling of the time
variable. At the same time, the constant pressure MD method is
derived by scaling the coordinates. The extension of the MD method
266 Shfiichi Nos6
The author thanks Mike Klein, Ian McDonald, Bart de Raedt, Ray Somorjai,
and Michiel Sprik for their interest and helpful discussions.
APPENDIX
Pox is the externally set pressure. The kinetic energy term for the volume is
89 The equations of motion are
(A 7)
With the momenta
Pi=miss V2/3x~:, pv= WV, and P s = Q i ,
the hamiltonian becomes
pv 2
~2= ~i 2m,zspi~V
2 2/a~-(~(V1/ax)+Ps2+(t+ l)hTeqlns+2-W . (AS)
Downloaded by [Duke University Libraries] at 02:56 03 July 2012
Z ---~v.
1 S dpsS ds~ dpv~ dV~ dp ~ dx (~aff2-E) ( a 9)
1 ((27r)2QW)l/2exp
Z - ( I + 1)
[ ~ E ] ~.l1 ~dV~dp'~dr
9 p, 2+ P~xV)/kT~q ]
REFERENCES
[1] ANDERSEN,H. C., 1980, ft. chem. Phys., 72, 2384.
[2] PARmNELLO,M., and RAHMAN,A., 1980, Phys. Rev. Lett., 45, 1196.
[3] PARRINELLO,M., and RAHMAN,A., 1981,ff. appl. Phys., 52, 7182.
[4] PARRINELLO,M., RAHMAN, A., and VASHZSHTA,P., 1983, Phys. Rev. Lett., 50, 1073.
[5] Nos~, S., and KLEIN, M. L., 1983, Phys. Rev. Lett., 50, 1207.
[6] Nos~, S., and KLEIN, M. L., 1983, ft. chem. Phys., 78, 6928.
[7] Nos~, S., and KLEIN, M. L., 1983, Molec. Phys., 50, 1055.
[8] WOODCOCK,L. V., 1971, Chem. Phys. Lett., 10, 257.
[9] ABRAHAM,F. F., KOCH, S. W., and DESAI, R. C., 1982, Phys. Rev. Lett., 49, 923.
[10] HOOVER,W. G., LADD, A. J. C., and MORAN, B., 1982, Phys. Rev. Lett., 48, 1818.
[11] TANAKA,H., NAKANISHI, K., and WATANABE,N., 1983, J. chem. Phys., 78, 2626.
268 Shfiichi Nos6
[12] HOOVER,W. G., and ALDER, B. J., 1967, ft. chem. Phys., 46, 686.
[13] LEBOWZTZ,J. L., PERCtSS,J. K., and VERLET,L., 1967, Phys. Rev., 153, 250.
[14] CHgUNG,P. S. Y., 1977, Molec. Phys., 33, 519.
[15] EVANS,D. J., 1983, ft. chem. Phys., 78, 3297.
[16] EVANS,D. J., and MORRZSS,G. P., 1983, Chem. Phys., 77, 63.
[17] HAZLE,J. M., and GUPTA, S., 1983, J. chem. Phys., 79, 3067.
Downloaded by [Duke University Libraries] at 02:56 03 July 2012