You are on page 1of 806

1

Statistical Mechanics
and
Molecular Simulation
M. P. Allen
H. H. Wills Physics Laboratory
University of Bristol

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

Preface
This course is an overview of computer simulation methods and
their relationship with microscopic theories of liquids and experimental studies of liquids, covering both dynamical and structural
properties.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

Synopsis
Subjects to be covered include
Statistical ensembles and finite-size effects
Study of phase transitions
Structural distribution functions
The Ornstein-Zernike equation and integral equations
Thermodynamic perturbation theory
Time correlation functions, linear response theory
Transport coefficients and hydrodynamics

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

Links with spectroscopy and scattering experiments will be


mentioned. The intention is not to discuss in great detail theoretical methods applied to these problems, except to give essential
background to the course. Rather, we shall investigate the essential statistical mechanical background, explore the use of the
computer as a research tool, and approach these problems from
the practical simulation viewpoint.
The course will mix together elements of computer programming with static and time-dependent statistical mechanics. Examples will be given using Fortran-90 programs, for numerical
applications, and, to an extent, Maple for symbolic algebra. The
Adobe Acrobat form of this course will remain available on this
home page: it will grow and probably change in form as the course
progresses. The document will include material that could not be
covered in depth during the lectures.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

These notes are intended only for students taking the course:
please do not distribute them elsewhere. It is not recommended
to try printing the notes, they are best viewed electronically.
Suggestions for improvements to these notes are always welcome.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

References
The bibliography will grow as the course progresses. However,
it is worth mentioning some standard references at the outset.
Most of this course will be directed at the properties of simple
liquids, and the standard text on the theory of these systems is
Hansen and McDonald [1986]. Extensive material, particularly relevant for molecular rather than atomic systems, may be found in
Gray and Gubbins [1984]. There are many good books on statistical mechanics: Chandler [1987] is an excellent, and fairly short,
all-round book; Friedman [1985] is good on many aspects. I am
also fond of two older books McQuarrie [1976] and Berne and Pecora
[1976], and the classic review Barker and Henderson [1976]. Many
more books on statistical mechanics can be recommended: Hill
[1960], Huang [1963], Kubo [1965], Becker [1967], Ma [1985], Privman
[1990]. For a more general introduction to the area of liquids, in-

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

cluding experimental background, start with Rowlinson and Swinton


[1982].
For background information on simulation, I cannot resist recommending Allen and Tildesley [1987], also Frenkel and Smit [1996],
and the annotated reprint collection Ciccotti et al. [1987]. There
are many Summer School proceedings, of which Binder and Ciccotti
[1996] is probably the most comprehensive. Monte Carlo simulations are described in Binder and Stauffer [1987], Binder and Heermann
[1988], Binder [1984, 1986, 1992]. The following references may
also be useful: Kalos and Whitlock [1986], Allen and Tildesley [1993].
Other books and articles will be mentioned during the course.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

List of Problems
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem

1.1
1.2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
3.1
3.2
3.3
3.4
4.1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem

4.2
4.3
4.4
5.1
6.1
6.2
7.1
7.2
8.1
8.2
8.3
8.4
8.5
8.6
8.7
9.1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem

10

9.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
9.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
9.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
10.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
10.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
10.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
10.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
10.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
10.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
10.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
11.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
11.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
11.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
11.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
11.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
11.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

PREFACE

Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem
Problem

12.1
12.2
12.3
12.4
12.5
12.6
12.7
12.8
12.9
15.1

11

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

12

1 Introduction
1.1 Computer Simulation
Here we discuss the why and how of computer simulation.
1.1.1 Why Simulate?
We carry out computer simulations in the hope of understanding bulk, macroscopic properties in terms of the microscopic details of molecular structure and interactions. However, there is no
point in trying to compete with conventional experiments; turning
on a tap is cheaper and more realistic than simulating water. We
must be aiming to learn something new, something that cannot
be found out in other ways.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

13

1.1.2 Microscopic and macroscopic


Computer simulations act as a bridge between microscopic length
and time scales and the macroscopic world of the laboratory.
We provide a guess at the interactions between molecules.
We obtain exact predictions of bulk properties.
The predictions are exact in the sense that they can be made
as accurate as we like, subject to the limitations imposed by our
computer budget. At the same time, the hidden detail behind bulk
measurements can be revealed. Examples are the link between the
diffusion coefficient and velocity autocorrelation function (the former easy to measure experimentally, the latter much harder); and
the connection between equations of state and structural correlation functions.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

14

Figure 1.1 Simulations as a bridge between microscopic and macroscopic.


r
P

Phase diagrams

l
g

v(r)

T
r

Structure

g(r)
Intermolecular
pair potential

r
c(t)

Dynamics

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

15

1.1.3 Theory and experiment


Simulations act as a bridge in another sense: between theory and
experiment.
We can test a theory using idealized models.
We can conduct thought experiments.
We can perform ab initio computer simulations.
A well-focused simulation can help us understand what we measure in the laboratory, and test a postulated explanation at a fundamental level. Further clarification may result from carrying out
thought experiments on the computer that are difficult or impossible in the laboratory (for example, working at extremes of
temperature or pressure).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

16

Figure 1.2 Simulation as a bridge between theory and experiment.

Perform experiment

Complex Fluid
(real system)

Experimental Results
(real system)

Test model

Make model
Perform simulation

Complex Fluid
(model system)

Simulation Results
(model system)

Test theory

Construct theory

Theoretical Predictions
(model system)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

17

Ultimately we may want to make direct comparisons with particular experimental measurements made on real materials, in
which case a good model of molecular interactions is essential.
The ultimate aim of so-called ab initio molecular dynamics is to
reduce the amount of fitting and guesswork in this process to
a minimum [for an introduction see Galli and Pasquarello, 1993].
On the other hand, we may be interested in phenomena of a rather
generic nature, or we may simply want to discriminate between
good and bad theories. When it comes to aims of this kind, it is
not necessary to have a perfectly realistic molecular model; one
that contains the essential physics may be quite suitable.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

18

1.1.4 Simulation techniques


The two main families of simulation technique are molecular dynamics (MD) and Monte Carlo (MC). Additionally, there is a whole
range of hybrid techniques which combine features from both MC
and MD.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

19

1.1.5 Molecular dynamics


Molecular dynamics consists of the brute-force solution of Newtons equations of motion. It is necessary to encode in the program the potential energy and force law of interaction between
molecules; the equations of motion are solved step-by-step. Advantages of the technique:
It corresponds closely to what happens in real life.
We may calculate dynamical properties, as well as thermodynamic and structural functions.
The technique allows efficient relaxation of collective modes.
For a range of molecular models, packaged routines are available.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

20

1.1.6 Monte Carlo


Monte Carlo can be thought of as a prescription for sampling configurations from a statistical ensemble. The interaction potential
energy is coded into the program, and a procedure adopted to
go from one state of the system to the next, as will be described
shortly. Advantages of the technique:
It is a robust technique (easy to program reliably).
We may calculate thermodynamic and structural properties,
but not dynamics.
It is relatively simple to specify external conditions (constant
temperature, pressure etc.).
Many tricks may be devised to improve the efficiency of the
sampling.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

21

1.1.7 Common features


These simulation techniques have some important features in common, governing the typical timescales and length scales that can
be investigated, and the methods we adopt to avoid unwanted
surface effects.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

22

1.1.8 Simulation time scales


Simulation runs are typically short (t 103 106 MD steps or
MC sweeps, corresponding to perhaps a few nanoseconds of real
time) compared with the time allowed in laboratory experiments.
This means that we need to test whether or not a simulation has
reached equilibrium before we can trust the averages calculated
in it. Moreover, there is a clear need to subject the simulation
averages to a statistical analysis, designed to make a realistic assessment of the error bars.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

23

How long should we run? This depends on the system and the
physical properties of interest. Suppose you are interested in a
variable a, defined such that hai = 0. Define a time correlation
function ha(0)a(t)i relating values calculated at different times t
apart.
D E
For t 0, ha(0)a(t)i a2 .
For t , ha(0)a(t)i ha(0)i ha(t)i 0.
This decay of correlation occurs over a characteristic time
a .
The simulation run should be significantly longer than a .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

24

Figure 1.3 Correlations in time.

Time correlations

a(0)

c(t) = <a(0)a(t)>
a(t)

c(t)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

25

The correlation time is formally defined


Z
dt ha(0)a(t)i /ha2 i.
a =
0

Alternatively, if time correlations decay exponentially at long time,


a may be identified from the limiting form
ha(0)a(t)i exp{t/a } .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

26

1.1.9 Simulation length scales


The samples involved are typically quite small on the laboratory
scale: most fall in the range N 103 106 particles, thus imposing a restriction on the length scales of the phenomena that may
be investigated: nanometre - submicron range. Indeed, in many
cases, there is an overriding need to do a system-size analysis of
simulation results, to quantify these effects.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

27

How large a simulation do we need? Once more this depends


on the system and properties of interest. Define a spatial correlation function ha(0)a(r )i relating values computed at different
points r apart.
D E
For r 0, ha(0)a(r )i a2 .
For r , ha(0)a(r )i ha(0)i ha(r )i 0.
This decay occurs over a characteristic distance a .
The simulation box should be significantly larger than a .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

28

Figure 1.4 Correlations in space.

Space correlations

a(0)

c(r) = <a(0)a(r)>
r

a(r)

c(r)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

29

The correlation length is formally defined


Z
dr ha(0)a(r )i /ha2 i.
a =
0

Alternatively, if spatial correlations decay exponentially at large


distance, a may be identified from the limiting form
ha(0)a(r )i exp{r /a } .
(Actually, in 3D, there are also some weakly r -dependent prefactors, but this is not crucial here.)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

30

It is almost essential for simulation box sizes L to be large


compared with a (for all properties of interest a), and for simulation run lengths t to be large compared with a . Only then
can we guarantee that reliably-sampled statistical properties are
obtained. Near critical points, special care must be taken, in that
these inequalities will almost certainly not be satisfied, and indeed
one may see the onset of non-exponential decay of the correlation
functions. In these circumstances a quantitative investigation of
finite size effects and correlation times, with some consideration
of the appropriate scaling laws, must be undertaken.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

31

1.1.10 Periodic boundary conditions


Small sample size means that, unless surface effects are of particular interest, periodic boundary conditions need to be used.
Consider 1000 atoms arranged in a 10 10 10 cube. Nearly half
the atoms are on the outer faces!
Surrounding the cube with replicas of itself takes care of this
problem. Provided the potential range is not too long, we can
adopt the minimum image convention that each atom interacts
with the nearest atom or image in the periodic array. In the course
of the simulation, if an atom leaves the basic simulation box, attention can be switched to the incoming image.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

32

Figure 1.5 Periodic boundary conditions and the minimum image


convention.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

33

1.2 Atoms, molecules, spins


Let us denote a state of the system by . This might refer to systems with continuous degrees of freedom (atoms and molecules,
plus some spin models) or to systems with discrete degrees of
freedom (like the Ising and Potts models).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

34

1.2.1 Atomic and molecular coordinates


For a classical atomic system let represent a set of continuous
variables, i.e. the complete set of coordinates and momenta.
r {ri } = (r1 , r2 , . . . rN )
p {pi } = (p1 , p2 , . . . pN )
Energy E = K(p) + V (r )
Frequently we shall abbreviate {ri } as r , and {pi } as p, pretending
that they are 1-dimensional quantities to simplify the notation.
We shall revert to the full form where necessary, but bear in mind
P
that p 2 or p 2 stands for a contraction of all the 3N components
P
P
2
i pi . Likewise, r p means
i ri pi .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

35

Figure 1.6 A system of atoms.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

36

1.2.2 Interaction potentials


General intention: microscopic macroscopic, i.e. to proceed
from a knowledge of the interactions between atoms and molecules
to a prediction of the structure and properties of liquids. We stick
with the classical approximation and we begin by dividing the
hamiltonian H of a system of atoms into kinetic and potential
contributions. The kinetic energy
K(p1 , p2 , . . . pN ) =

N
X
i=1

pi2 /2mi

is easily handled and gives ideal-gas contributions to macroscopic


properties. The potential energy V (r1 , r2 , . . . rN ) is not so easy to
handle.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

37

Traditionally V is split into 1-body, 2-body, 3-body terms:


X
v (1) (ri )
V (r1 , r2 , . . . rN ) =
i

XX

v (2) (ri , rj )

i j>i

XX X

v (3) (ri , rj , rk )

i j>i k>j

+ ...
Usually we drop the v (1) term, neglect v (3) and higher terms
(which in reality probably contribute 10% of the total energy in
liquids) and concentrate on v (2) . For brevity henceforth we just
call it v(r ). There is no time here to say much about the way
these potentials are determined experimentally, or modelled theoretically [see e.g. Maitland et al., 1981, Gray and Gubbins, 1984,
Sprik, 1993].
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

38

We shall use, where appropriate, the simplest models that represent the essential physics: the hard-sphere, square-well, and
Lennard-Jones potentials. The latter has the functional form
( 
 6 )
12

.
(1-1)
v LJ (r ) = 4
r
r
The parameters (the diameter) and (the well depth) are used
to define reduced variables for temperature T = kB T /, density
= 3 = N 3 /V , volume V = V / 3 , pressure P = P 3 /
etc.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

39

Figure 1.7 Lennard-Jones potential with attractive and repulsive


contributions.
4
LennardJones
12
repulsive r
6
attractive r

v(r)/

r/

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

40

Figure 1.8 Hard sphere and square well potentials.


4
Hard sphere
Square well
3

v(r)/

r/

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

41

For molecular systems, we simply build the molecules out of


site-site potentials of this form. If electrostatic charges are present,
we add the appropriate Coulomb potentials
v Coulomb (r ) =

Q1 Q2
.
4 0 r

(1-2)

We may also use rigid-body potentials which depend on centre of


mass positions and orientations , associating angular momenta
with the latter. Occasionally we shall use generalized (i.e. nonCartesian) coordinates, distinguishing them by the symbol q.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

42

1.2.3 Lattice spin systems


For a lattice system, the state is specified by a set of discrete or
continuous spin values.
s {si } = (s1 , s2 , . . . sN )
si = 1 (or other values)
P
E = J hiji si sj
P
QNV T = s eE(s)
P

J is a coupling constant.

means sum over nearest neighbour spins i, j. The standard Ising model of theoretical physics falls into this category,
and there is a menagerie of other models, with varying degrees of
relevance to the real world.
hiji

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

43

Figure 1.9 The Ising model.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

44

Our interest in spin models will be peripheral: they are useful


to get an idea of the total number of states accessible to a given
system, to describe (and simulate) behaviour around phase transitions and, in a few cases, to actually predict the properties of
magnetic systems or solids and liquids with orientational degrees
of freedom.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

45

1.3 Statistical Mechanics


Enables us to calculate bulk properties from microscopic details exactly or approximately.
Enables us to design correct simulation methods when exact
calculations are impossible.
Enables us to analyze the results and compare with theory
or experiment.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

46

1.3.1 Microcanonical ensemble


The microcanonical ensemble is supposed to correspond to an
isolated system, with specified NV E.
S
NV E

= kB ln NV E
Z
=
d [E( ) E]

[E( ) E]
%NV E ( ) = 1
Z NV E
d %NV E A( )
hAiNV E =

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

47

Figure 1.10 Macroscopic system modelled by microcanonical ensemble.


System

Surroundings

adiabatic rigid wall

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

48

1.3.2 Canonical ensemble


The canonical ensemble corresponds to a system able to exchange
energy with a thermal bath, representing the effects of the surroundings at specified NV T .
F
QNV T

= E T S = kB T ln QNV T
Z
Z
=
d eE( ) = dE NV E eE

1
E( )
%NV T ( ) = QNV
T e
Z
hAiNV T =
d %NV T A( )

In a real system this would happen at the surface; in simulations


we avoid surface effects by allowing this to occur homogeneously.
The state of the surroundings defines the temperature T of the
ensemble.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

49

Figure 1.11 Macroscopic system modelled by canonical ensemble.


System

Surroundings

Temperature T
isothermal rigid wall

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

50

1.3.3 Isothermal-isobaric ensemble


The isothermal-isobaric ensemble corresponds to a system whose
volume and energy can fluctuate, in exchange with its surroundings at specified NP T .
G = F + P V = kB T ln QNP T
Z
Z
Z
(E( )+P V )
QNP T =
dV d e
=
dV QNV T eP V
%NP T ( , V ) =
hAiNP T

0
1
QNP
T
Z
0

dV

(E( )+P V )

e
Z

d %NP T A( )

In a real system, some kind of piston might act at the surface, but
this is avoided in a simulation by scaling all positions homogeneously. The state of the surroundings defines T and P .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

51

Figure 1.12 Macroscopic system modelled by isothermal-isobaric


ensemble.
System

Surroundings

Temperature T
Pressure P
isothermal
moveable wall

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

52

1.3.4 Grand canonical ensemble


The grand canonical ensemble corresponds to a system whose
number of particles and energy can fluctuate, in exchange with its
surroundings at specified V T .
= F N = kB T ln QV T
XZ
X
QV T =
QNV T e+N
d e(E( )N) =
N

1
(E( )N)
%V T ( , N) = QV
T e
XZ
hAiV T =
d %V T A( )
N

In a real system, the particle exchanges would act at the surface;


in a simulation we add and remove particles at randomly selected
positions. The surroundings define and T .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

53

Figure 1.13 Macroscopic system modelled by grand canonical ensemble.


System

Surroundings

Temperature T
Chemical potential

isothermal
permeable wall

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

54

1.4 Canonical Ensemble Manipulations


Here we look at some typical formulae involving ensemble averages and conversion between ensembles. A general point, which
will come out of the discussion, is the equivalence of ensembles:
this means that, for most averages, differences between ensembles disappear in the thermodynamic limit.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

55

1.4.1 Temperature derivatives


Differentiate with respect to = 1/kB T :
!
!
ln QNV T
F
=
E =

1
d eE( )
= QNV
T

Z
1
= QNV T d E eE( ) = hEi

(1-3)

Differentiate again:
E
D
kB T 2 CV = hE 2 i hEi2 = E 2

Statistical Mechanics and Molecular Simulation

(1-4)

M. P. Allen 1999

INTRODUCTION

56

1.4.2 Volume derivatives


Differentiate with respect to volume
Z
 


ln QNV T

F
1
=
= QNV
d eE( )
P =
T
V
V
V
Z




E
E
1
eE( ) =
= QNV T d
V +
V
*
X
X
1
(1-5)
P V = NkB T
wij
3
i ji
Here we assumed pairwise additivity V =
dv(r )
w(r ) = r
dr

V
V

P P
i

1
=
3V

ji vij , and defined

XX

wij

(1-6)

i ji

which is easily shown using scaled coordinates ri Lsi , V = L3 .


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

57

1.4.3 Number derivatives


Differentiate with respect to number (looking at the excess, nonideal, part):
!
!


ex
ex
QN+1
ln QNV
F ex
T
ex
=
ln
=
ex
N
N
QN
Separate the terms in the potential energy which involve the extra
particle VN+1 = VN + VN+1 . This gives the Widom [1963] testparticle formula
Z
D
E
ex
= kB T ln dsN+1 eVN+1

DD
EE
(1-7)
= kB T ln eVN+1
Once more we use scaled coordinates sN+1 for the extra particle
and the double average is over the ensemble and the inserted particle coordinates.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

58

Figure 1.14 Widoms test-particle method for calculating the chemical potential.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

59

1.4.4 Virial-like formulae


The general form, where q may be any coordinate or momentum,
is
*
+
+
*
A
H
= kB T
(1-8)
A
q
q
is easily derived by partial integration. Examples:
* +
p2
= kB T
Equipartition of energy
m
+
*
H
Virial theorem
= kB T
q
q

(1-9)
(1-10)

This last equation can also be recast into the form given earlier
for the pressure, eqn (1-5). Note: often we use H for hamiltonian
interchangeably with E for energy function.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

60

Problem 1.1 In this question we explore a hypervirial theorem.


For the classical canonical ensemble
%NV T exp(H /kB T )
show that
kB T hA/qi = hAH /qi
and that
kB T hA/pi = hAH /pi.
You will have to do an integration by parts, and you will need to
assume that some functions vanish at the limits
q, p .
What happens if we set A = q or A = p or A = H /q ? (You
can take H = p 2 /2m + V (q)). Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

61

1.4.5 Energy distributions


Canonical partition function Q(T ) QNV T , F = kB T ln Q,
Z
Z
E( )/kB T
= dE (E) eE/kB T
Q(T ) = d e
Microcanonical phase-space volume (E) NV E , S = kB ln ,
Z
Z
(E) = d %NV E ( ) = C d (E E( ))
Canonical energy distribution function P(E) PNV T (E),
P(E) = h(E( ) E)iNV T = C (E) eE/kB T
=

(E) eE/kB T
(E) eE/kB T
=
Q(T )
dE (E) eE/kB T

Statistical Mechanics and Molecular Simulation

(1-11)

M. P. Allen 1999

INTRODUCTION

62

1.5 Ensemble conversion


These last formulae provide a way of seeing how the equivalence
of ensembles arises. The idea is that the distribution of energies
in the canonical ensemble is very sharp, and may related to the
delta-function distribution of the microcanonical ensemble.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

63

Figure 1.15 Energy distributions.

P(E)

(E)

exp(- E )

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

64

1.5.1 Relating thermodynamic functions


represents the area of the constant-energy hypersurface defined by E. This rises extremely rapidly with E: for an ideal gas,
for example, (E) E dN/21 ; but this is cut off by the eE/kB T
factor.
P(E) is extremely sharply peaked around the average value.
Q(T ) (E)eE/kB T
E is defined to be where the integrand has its peak.
Take logarithms:
F = kB T ln Q = E T S

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

65

1.5.2 Expansions and thermodynamics


It is informative to expand about the peak value of E. Expand
(E) E N (for illustration).

E N
1+
(E + E) E
E
)
(




1
E 2
E
N
+ N(N 1)
= E
+ ...
1+N
E
2
E
N

Successive terms are not getting smaller! This is useless.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

66

Instead, expand the logarithm ln N ln E.




E
ln (E + E) N ln E + N ln 1 +
E




1 E 2
E
+
+ ...
= N ln E + N
E
2 E
Now the series converges rapidly. So it should, since


S
= 1/T .
and
S = kB ln
E

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

67

1.5.3 Peak and width of the distribution


Abbreviate = 1/kB T and locate the peak in P(E).
P(E) (E) exp{E} = eS(E)/kB eE
defined by
Let the maximum be at E

S(E)/kB E

=0
E
E=E


S(E)/kB

=
E
E=E

thus establishing the link S/E = 1/T mentioned above.


The width will be determined by the double derivative

1
2 S/kB
= 2 (kB /CV ) =
=
.
2
E
E
kB T 2 CV
This is negative, involves CV = E/T , and is of O(N 1 ).
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

68

1.5.4 Ensemble conversion: corrections


Now we have
S(E)/kB

P(E) e

P(E) exp

E 2
2kB T 2 CV

The partition function is


where E = E E.
Z
Q(T ) = eF = dE (E)eE
(
Z

(E)e
dE exp

Statistical Mechanics and Molecular Simulation

E 2
2kB T 2 CV

(1-12)

)
.

M. P. Allen 1999

INTRODUCTION

69

p
The Gaussian integral gives 2 kB T 2 CV so (dropping the hats)
q
Q(T ) = (E)eE 2 kB T 2 CV
q
F = S/kB E + ln 2 kB T 2 CV .
(1-13)
The corrections are small. The last term is only O(ln N), so it can
be neglected in comparison with the others, which are O(N).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

70

Problem 1.2 Here is an exercise in the technique outlined above,


essentially a simple form of the saddle-point method [see e.g.
Mathews and Walker, 1973]. Suppose we wish to evaluate an integral of the form
Z

dx x n ex (n + 1)

where n is a large number. This is actually the definition of the


factorial or gamma function (n + 1) n!. The integrand has a
(sharp) peak; first show that the maximum value of the integrand
is at xmax = n. You might like to plot the function, for various
values of n, using Maple.
Write the integrand as exp{n ln xx} exp f (x) and do an expansion of f (x) about xmax to the term involving d2 f /dx 2 . Evaluate the integral by extending the lower limit to (this involves
only a small error provided n is not too low). Look closely at your
answer: you have derived a famous result. Answer provided.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

71

1.5.5 Converting averages and fluctuations


From the approach just outlined we can easily obtain
!
1 2A D 2E
E
hAiT = hAiE +
T
2 E 2
!
1 2A
= hAiE +
kB T 2 CV
2 E 2

(1-14)

The subscript indicates the ensemble: constant-E or constant-T .


If A is extensive, O(N), the correction term is O(1), i.e. small compared with hAi. This quantifies the equivalence of ensembles.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

INTRODUCTION

72

An example of the corresponding formulae for fluctuations is


D

A2

E
T



D
E
kB T 2 A 2
= A2 +
.
E
CV
T

(1-15)

If A is extensive, O(N), the correction


E is also O(N), but this
D term
2
is the same order of magnitude as A itself. Quite generally,
we see that fluctuations are larger in the canonical ensemble than
in the microcanonical ensemble. A particular case of this formula
is


E
D
kB T 2 E 2
2
=
= kB T 2 CV
(1-16)
E
T
CV
T V
since the energy fluctuations in the microcanonical ensemble are
zero. This is the same result seen before in eqn (1-4).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

73

2 Time-dependent statistical mechanics


2.1 Time-dependent classical statistical mechanics
The aim of this section is to introduce the Liouville equation which
dictates how the classical statistical mechanical distribution function %( , t) or %(q, p, t) evolves in time, and also to introduce the
classical Schrdinger and Heisenberg pictures of statistical mechanics. Before doing that, however, we consider briefly what is
meant by an ensemble.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

74

2.1.1 What is an ensemble?


An ensemble may be regarded as a collection of N points in the
multi-dimensional phase space .
Each point represents a complete N-particle system.
Density of points is proportional to the distribution function
%( ).
Imagine the density of points to be very high indeed.
Ensemble average of a quantity A is obtained by summing
the values for each representative point, and normalizing by
the number of such points:
Z
N
1 X
A(n ) = d %( ) A( )
hAi =
N n=1
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

75

Note the meaning of N: it is not actually the total number of


possible states, which (as we saw) might be infinite. It is supposed
to be the number of representative states. Some state points might
occur more than once, some not at all, in our selection, as determined by %.
As time evolves each state point moves independently according to a prescribed equation of motion. For an equilibrium ensemble, the overall density in any region of phase space does not
change with time; in a given region, the same number of representative systems are flowing in as are flowing out. For this reason,
the equilibrium ensemble average hAi is constant.
Typically, an initial nonequilibrium distribution will evolve with
time into such an equilibrium distribution (unless external forces
are applied to maintain a nonequilibrium state).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

76

2.1.2 Ergodicity
The equivalence of time- and ensemble-averages relies on the idea
that a single representative system would, eventually, trace a path
through the entire phase space, returning to its starting point, having spent longer in regions of high density than low, and thereby
having sampled %.
One such trajectory is just as good as (in fact identical to) any
other, in this limit. However, for any realistic system, the time for
this circuit to be completed would be extremely long (the Poincar
recurrence time).
In any real case we will be interested in the much weaker question of whether or not a given system visits a representative selection of phase-space points in a reasonable time. If this is true, the
two forms of averaging should give the same results.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

77

2.1.3 Classical mechanics


For more details on classical mechanics see, e.g., Goldstein [1980].
The general prescription for obtaining the equations of motion of
a classical system is as follows. We start with generalized coordi. Recall, in our condensed notation
nates q and time derivatives q
q {qi } {q1 , q2 , . . .}
p

{pi } {p1 , p2 , . . .}

Write down the kinetic energy K and potential energy V


(often K(
q) and V (q) but not always).
) = K V .
Write down the lagrangian L = L(q, q

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

78

.
Define conjugate momenta p = L/ q
Write down the hamiltonian
L(q, q
)
H = H (q, p) = p q
in favour
making it a function of q and p by eliminating q
of p on the right.
Hamiltons equations are
!
H
=
and
q
p

=
p

H
q

!
(2-1)

From Hamiltons equations we can obtain Lagranges equation


!
!
L
d L
=
.
(2-2)

dt q
q

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

79

Problem 2.1 Prove from Hamiltons equations that


dA
= (A, H )
=A
dt
where A = A(q, p), and the classical Poisson bracket is defined
!
A B A B

.
(A, B) =
q p
p q
= 0, and that, in fact, the time derivative of
Hence show that H
any function of H is zero. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

80

2.1.4 Ensembles and flow: the Liouville equation


An ensemble of N systems is represented by a set of N points in
(q, p)-space (phase space). The number density of such points
anywhere, anytime, is given by N%(q, p, t). A small volume element qp contains N = N%(q, p, t)qp points. Consider the
flow of points into and out of such a region.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

81

Figure 2.1 Flow in phase space.

q
p
q

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

inflow at q1

outflow at q1 + q1

%q1 q1 +q1 q0 p

82


N%q1 q1 q0 p q0 p

0
N%q1
0 q p
q1 +q1 q p


(%q1 )
= %q1 q1 q0 p + q1
q1
(%q1 )
net inflow in q1 direction = N
qp
q1
N
t
%
t

) +
qp
= N
(%q
(%p)
q
p
!

) +

=
(%q
(%p)
q
p
!
!

p
%
%
q

+
q
+p
= %
q p
q
p

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

83

This is occasionally called the non-Liouville equation. The first


bracket vanishes because of Hamiltons equations. So
!
%
%
%

= q
+p
.
(2-3)
t
q
p
This is the Liouville equation. It may also be written
%
%
%
d%

=
+q
+p
=0
dt
t
q
p

(2-4)

%
= (%, H ) = (H , %)
(2-5)
t
There is an analogy with the flow of an incompressible fluid. Contrast this equation for % with the time evolution equation for a
dynamical variable A seen in Problem 2.1:
= (A, H )
A
Statistical Mechanics and Molecular Simulation

(2-6)
M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

84

2.2 Time-dependent quantum statistical mechanics


This is mainly standard time-dependent quantum mechanics. We
develop the statistical mechanical part to emphasize the formal
similarities with the classical case.
2.2.1 Isolated quantum system
Start with a time-dependent wavefunction (q, t) normalized such
that
Z
dq (q, t) (q, t) = 1

The Hamiltonian operator is H (q). The expectation value of any


operator A is
Z
A(t) = dq (q, t)A(q) (q, t).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

85

We may expand in a static orthonormal basis {n (q)}, defined


so that
Z

(q)n (q) = mn
dq m

using time dependent expansion coefficients cn (t):


X
cn (t)n (q) .
(q, t) =
n

P
To guarantee normalization we must have m |cm |2 = 1. This
gives a matrix representation of operators
Z

(q)A(q)n (q)
Amn = dq m
and an expression for the expectation value
XX

A(t) =
cn (t)cm
(t)Amn .
m n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

86

2.2.2 Ensembles and the density matrix


For an ensemble of systems define

(t)i
%nm (t) = hcn (t)cm

(2-7)

where h. . .i is an ensemble average. Now we can write


XX
%nm Amn = Tr%A = TrA%
hAi =
m n

P
where Tr is the usual matrix trace operation TrX = m Xmm , and
of course Tr% = 1.
We can define the coordinate representation of %
XX

n (q)%nm m
(q0 ).
(2-8)
%(q, q0 ) =
m n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

87

Problem 2.2 By writing this in terms of (q, t), show that this
coordinate representation is, in fact, independent of the original
choice of basis set n (q). Answer provided.
This allows us to write
A(q, q0 ) =
so

Z
hAi =

Z
dq

XX
m n

m (q)Amn n
(q0 ).

dq0 A(q, q0 )%(q0 , q) = Tr%A = TrA%

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

88

2.2.3 Quantum Liouville equation


From the Schrdinger equation i /t = H we obtain in the
chosen basis set
X
cn
Hnl cl .
=
i
t
l

= Hlm )
Hence (recalling that H is Hermitian, Hml

i

)
X
(cn cm

Hnl cl cm
cn cl Hlm .
=
t
l

Now ensemble-average
i

X
%nm
Hnl %lm %nl Hlm .
=
t
l

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

89

In operator form this becomes


1
1
%
=
(H % %H ) =
[H , %]
t
i
i
where [A, B] = ABBA is the commutator. Define the quantum
1
Poisson bracket (A, B) i [A, B] so as to write
%
= (H , %) = (%, H ) .
t

(2-9)

Contrast this with the Heisenberg equation of motion for an operator


= 1 [A, H ] = (A, H ) .
(2-10)
A
i

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

90

2.2.4 The Liouville operator


In both the quantum and classical cases it is useful to define a
Liouville operator (or superoperator) iLA (A, H ) so the formal
solutions of the time evolution equations are
%/t = iL% = %(t) = eiLt %(0) = U (t)%(0)
and

= iLA = A(t) = eiLt A(0) = U(t)A(0)


A

(2-11)
(2-12)

Problem 2.3 From the definition of the quantum Liouville operator, iLA (i)1 [A, H ], show that we can write
i

eiLt A = e  H t Ae  H t .
(Start by time-differentiating this expression). Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

91

2.2.5 Some manipulations


Permutation under trace: TrABC = TrBCA = TrCAB. Most
easily proved by adopting the matrix representation.
Hermitian nature of L: Tr(A LB) = Tr(B LA) . This follows from the definition of L, the fact that H is a Hermitian
operator, and use of cyclic permutation.
Switching time displacement operator
TrA(eiLt B) = Tr(eiLt A)B .
Equivalence of Heisenberg and Schrdinger pictures
hA(t)i = Tr%A(t) = Tr%eiLt A
= Tr%(t)A = Tr(eiLt %)A

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

In the classical Schrdinger picture we mean


Z
Z
hA(t)i = dq dp %(q, p, t)A(q, p)

92

(2-13)

In other words:
sit at a point in phase space;
at time t calculate (q, p, t);
average using this density.
This is analogous to the Eulerian formulation of fluid mechanics;
mass points with different probability flow through the box dqdp.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

93

Figure 2.2 The Schrdinger picture.

dqdp

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

In the classical Heisenberg picture we mean


Z
Z
hA(t)i = dq0 dp0 %(q0 , p0 , 0)A(qt , pt ).

94

(2-14)

In other words:
follow the representative points as they move;
at t = 0 calculate (q, p, 0);
average the properties at time t using this initial density.
This is analogous to the Lagrangian formulation of fluid mechanics; the points we follow keep their initial probability but the
phase-space position (and hence the properties we are averaging)
change with time.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

95

Figure 2.3 The Heisenberg picture.

p
dqdp(t)

dqdp(0)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

96

Problem 2.4 We have seen the quantum classical correspondences


ZZ
Tr(. . .)
dqdp . . .
(i)1 [A, B] (A, B)
Show that Tr(A LB) = Tr(B LA) in the classical case, just
as we have seen in the quantum case. (Hint: youll need to
integrate by parts, and you can assume that functions vanish
whenever q or p .)

= hABi,
Use this result to show that hABi
no matter
whether we are in the quantum or classical case.
Also verify that hA(t)i = Tr(%A(t)) = Tr(%(t)A) .
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

97

2.3 Equilibrium ensembles


The Liouville equation applies to any ensemble, equilibrium or
not. Here we discuss the special properties of equilibrium ensembles.
2.3.1 The equilibrium condition
Equilibrium means that % should be stationary, i.e. that
%/t = 0 .

(2-15)

In other words, if we look at a phase-space volume element, the


rate of incoming state points should equal the rate of outflow.
This requires that % be a function of the constants of the motion,
and especially % = %(H ), since then (%, H ) = 0. Equilibrium also
implies dhAi/dt = 0 for any A.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

TIME-DEPENDENT STATISTICAL MECHANICS

98

Problem 2.5 Prove dhAi/dt = 0 for any A(q, p) from the equilibrium condition %/t = 0. Answer provided.
Problem 2.6 In this question we explore the virial theorem. The
equilibrium condition is that dhAi/dt = 0. Use this to show that,
at equilibrium, in classical systems,
hqH /qi = hpH /pi = kB T
where the second equality follows from equipartition. Answer provided.
Problem 2.7 For the classical canonical ensemble % exp(H )
where (. . . , . . .) is the classical Poisson
prove that (%, A) = %A
bracket. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

99

3 Molecular dynamics
In this section we concentrate on the methods actually used to
solve Newtons or Hamiltons equations on the computer. This is
intrinsically a simple task: many methods exist to perform stepby-step numerical integration of systems of coupled ordinary differential equations. Characteristics of these equations are:
they are stiff, i.e. there may be short and long timescales,
and the algorithm must cope with both;
calculating the forces is expensive, and should be performed
as infrequently as possible.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

100

Also we must bear in mind that the advancement of the coordinates fulfils two functions:
accurate calculation of dynamical properties, especially over
times shorter than dynamical variable correlation times a ;
accurately staying on the constant-energy hypersurface, for
much longer times, over the entire length of the run.
Exact time reversibility is highly desirable (since the original equations are exactly reversible). To ensure rapid sampling of phase
space, we make the timestep as large as possible consistent with
these requirements. For these reasons, simulation algorithms have
tended to be of low order (i.e. they do not involve storing high
derivatives of positions, velocities etc.): this allows the time step
to be increased as much as possible without jeopardizing energy
conservation.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

101

This is unlike methods used in computing the trajectories of


astronomical bodies, where very accurate high-order methods are
preferred. Notice that it is unrealistic to expect the numerical
method to accurately follow the true trajectory for very long times
(e.g. over the whole simulation run). The ergodic and mixing
properties of classical trajectories, i.e. that nearby trajectories diverge from each other exponentially quickly, make this impossible
to achieve.
All these observations tend to favour the Verlet algorithm in
one form or another, and we look closely at this in the following
sections.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

102

3.1 The Verlet algorithm


Recall that we are solving

r=v

and

=a
v

(or

= f)
p

(3-1)

where v = p/m is the velocity and a = f/m the acceleration.


Alternatively we can combine the equations to give

r=a

(3-2)

These equations are more specific than the general system of


second-order ordinary differential equations, in the sense that the
accelerations a depend on r but not v. This allows a simple approach originally employed by Verlet [1967, 1968] in his investigations of the properties of the Lennard-Jones fluid.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

103

3.1.1 The original form


It is easy to derive the Verlet algorithm from forward and backward Taylor expansions of the function r(t) and use of Newtons
equation
r = a, leads to
1
1
r(t + t) = r(t) + tv(t) + 2 t 2 a(t) + 6 t 3 b(t) + O(t 4 )

r(t t) = r(t) tv(t) + 12 t 2 a(t) 16 t 3 b(t) + O(t 4 )


where b =
a. From this we get, by adding and subtracting,
r(t + t) = 2r(t) r(t t) + t 2 a(t) + O(t 4 )
3

v(t) = [r(t + t) r(t t)] /2t + O(t )

(3-3)
(3-4)

It is possible to advance the positions using the first of these equations alone; the velocities are calculated from the second equation,
but they are always one step behind: v(t) cannot be evaluated
until r(t + t) is known.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

104

Here is some Fortran-like pseudo-code to illustrate the method;


r stands for the current positions, r_old for the positions at the
previous timestep, and r_new stores, temporarily, the new positions. The forces and potential energy are calculated from the
current positions in a routine forces. The kinetic energy is calculated from the current velocities in a routine kinetic.
call forces ( r, f, poteng )
a = f/m
r_new = 2*r - r_old + (delta_t**2) * a
v = (r_new-r_old)/(2*delta_t)
call kinetic ( v, kineng )
eng = kineng + poteng
r_old = r
r = r_new

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

105

3.1.2 The leapfrog form


Identical trajectories are generated by the so-called leapfrog algorithm [see e.g. Hockney and Eastwood, 1988]. Here the velocities
are stored at in-between times.
1
r(t + t) = r(t) + tv(t + 2 t)

1
1
v(t + 2 t) = v(t 2 t) + ta(t)

(3-5)
(3-6)

1
Starting from r(t) and v(t 2 t), the current forces f(t) are calculated, whence a(t), and the second equation is implemented to
leap the velocities over the positions; then the first equation is
used to put the positions in front once more. The velocities appear in this algorithm, but they are not contemporaneous with the
positions. If v(t) is wanted it can be obtained from

v(t) =

1
[v(t + 12 t) + v(t 12 t)] = v(t 12 t) + 12 ta(t) .
2

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

106

In the following pseudo-code we use this to calculate the energy.


call forces ( r, f, poteng )
a = f/m
v = v + (delta_t/2) * a
call kinetic ( v, kineng )
eng = poteng + kineng
v = v + (delta_t/2) * a
r = r + delta_t * v

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

107

3.1.3 The velocity form


Identical trajectories are also generated by the so-called velocity
Verlet algorithm [proposed by Swope et al., 1982]. Here a comparison of forward and reverse Taylor expansions leads to
1
r(t + t) = r(t) + tv(t) + 2 t 2 a(t)

1
v(t + t) = v(t) + 2 t [a(t) + a(t + t)]

(3-7)
(3-8)

The first equation is implemented to advance the positions, and


the new forces f(t + t) calculated, whence a(t + t); these are
then used in the second equation to update the velocities. This is
probably the most convenient form of Verlets method, since the
velocities appear, and they are evaluated at the same time points
as the positions. Moreover, as we shall see shortly there is an
interesting theoretical derivation of this version.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

108

Here is some pseudo-code to illustrate the method.


r = r + delta_t * v + ((delta_t**2)/2) * a
v = v + (delta_t/2) * a
call forces ( r, f, poteng )
a = f/m
v = v + (delta_t/2) * a
call kinetic ( v, kineng )
Problem 3.1 Prove that identical trajectories r(t) will be generated by the original, leapfrog, and velocity forms of the Verlet
algorithm, given consistent initial conditions. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

109

3.1.4 Comments
Important features of the Verlet algorithm are
It is exactly time reversible (as can be seen by substituting
t t and rearranging). This is important, as the original
equations of motion are also time reversible.
It is low order in time. This means that it behaves in a robust fashion as the timestep t is increased; in fact it can be
shown that the root-mean-squared fluctuations in the total
energy are proportional to t 2 .
It is easy to program.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

110

Problem 3.2 Consider the simple 1D harmonic oscillator


potential energy

kinetic energy

1
m2 x 2
2
1
mv 2 ,
2

hence acceleration a = 2 x. Obtain an algebraic expression for


the change in total energy over a timestep t, in terms of x(t) and
v(t), using the velocity Verlet method. What is the lowest-order
term? Compare with the very simple Euler method which is
x(t + t) = x(t) + tv(t)
v(t + t) = v(t) + ta(t)
Can you foresee a systematic problem with the Euler method?
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

111

Problem 3.3 A Maple exercise. Download the Maple worksheet


for this problem from the course Web page. This worksheet solves,
approximately, the dynamics of the simple harmonic oscillator,
for given initial conditions, using the simple Euler method. It also
shows the exact solution for comparison. Add a procedure to use
the velocity Verlet algorithm, and do a similar comparison. Experiment with the time step; what do you see? Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

112

3.2 Predictor-corrector methods


We mention predictor-corrector methods briefly, mainly for historical reasons: further details are available elsewhere [see e.g.
Allen and Tildesley, 1987]. We store, at any time, r(t), v(t), a(t)
and b(t)
a(t); more derivatives appear in higher-order methods.
3.2.1 Predictor stage
Taylor expansion is used to predict new positions:
1
1
rp (t + t) = r(t) + tv(t) + 2 t 2 a(t) + 6 t 3 b(t)

vp (t + t) = v(t) + ta(t) + 12 t 2 b(t)


ap (t + t) = a(t) + tb(t)

bp (t + t) = b(t)

(3-9)

These need to be corrected.


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

113

3.2.2 Corrector stage


The new (correct) forces ac (t + t) are calculated from the positions rp (t + t), using the force routine, and a correction factor
a ac (t + t) ap (t + t) obtained. Then the corrected values
are obtained as follows:
rc (t + t) = rp (t + t) + c0 a
vc (t + t) = vp (t + t) + c1 a
ac (t + t) = ap (t + t) + c2 a
bc (t + t) = bp (t + t) + c3 a

(3-10)

where the coefficients are chosen to optimize stability and accuracy [as discussed by Gear, 1966, 1971]. For the usual equations
1
5
1
of motion, c0 = 6 (t 2 /2), c1 = 6 t, c2 = 1, c3 = 3 (3/t).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

114

3.2.3 Comments
In principle the evaluation of forces and the correction step
could be iterated, to further refine the new values, but this
would be expensive.
The approach is very general, and has been incorporated into
standard packages for solving ordinary differential equations.
The method is not time reversible.
Accuracy is high, especially for short timesteps.
Stability, as measured by energy conservation, degrades rapidly
as the timestep increases.
These last two points are almost synonymous with being a highorder method.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

115

3.3 Propagators and the Verlet algorithm


The velocity Verlet algorithm may be derived by considering a
standard approximate decomposition of the Liouville operator
which preserves reversibility and is symplectic (which implies that
volume in phase space is conserved - a good thing).
3.3.1 Trotter decomposition
Begin with the formal propagation of positions and momenta
!
!
!
q(0)
q(t)
q(0)
iLt
(3-11)
= U(t)
=e
p(0)
p(t)
p(0)
where the Liouville operator iL d/dt is (recall eqn (2-12))

iL = q

Statistical Mechanics and Molecular Simulation

+p
q
p

(3-12)

M. P. Allen 1999

MOLECULAR DYNAMICS

116

U is unitary, i.e. U1 (t) = U(t), which means that it is reversible. It is an exact result for any operator that

P
eiLt = lim eiLt
P

where

t = t/P

In molecular dynamics we seek to use this equation, but with finite


P , and using an approximation to eiLt which becomes good in the
limit of small timestep t.
!
!
!



q(0)
q(0)
q(t)
q
p
q
t
+p
iLt
=e
. (3-13)
=e
p(0)
p(0)
p(t)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

117

The approximation will involve splitting L into two parts


L = L1 + L2 .
The Trotter formula

P
e(iL1 +iL2 )t = lim eiL1 t eiL2 t
P

(3-14)

suggests that we use the approximation


e(iL1 +iL2 )t eiL1 t eiL2 t + O(t 2 ) .
This is an approximation, not exact, because in general L1 and L2
do not commute. Unfortunately this is not quite what we want
because it is not reversible. In other words propagation forward
by t then back again does not regenerate the original q(0) and
p(0).
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

118

Instead use
(t) .
e(iL1 +iL2 )t eiL1 t/2 eiL2 t eiL1 t/2 + O(t 3 ) U

(3-15)

This is evidently a unitary (i.e. reversible) propagator because when


we propagate forward and then back we get



eiL1 t/2 eiL2 t eiL1 t/2 eiL1 t/2 eiL2 t eiL1 t/2
and the terms cancel (starting from the middle and working out).
has all the desired properties and approximates
The propagator U
the true propagator U. Making a suitable choice of L1 and L2 we
may break it down into an algorithm in which each molecular dynamics timestep consists of a simple succession of operations,
each involving either L1 or L2 .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

119

3.3.2 Velocity Verlet Propagator


Tuckerman et al. [1992] consider
iL1
iL2

=f
= ma
p
p
p

= q
= (p/m)
q
q

= p

(3-16)
(3-17)

To see the effect of the operators on q and p, use an operator


identity
ec/q (q) = (q + c)
valid for any function of q, provided that c doesnt depend on q,
and similarly
ec/p (p) = (p + c) .
These are just Taylor series, written in a concise way.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

120
1

The first step, with eiL1 t/2 = e 2 t p/p is


!
!
1
q(0)
q(0)

t
p/p
=
e2
(0)
q
(0) + 12 ta(0)
q
!
q(0)
.

( 12 t)
q

(3-18)

How does this work? L1 just differentiates with respect to p, so


(0) = p(0)/m
has no effect on the coordinate q(0). Its effect on q
is straightforward since this is a linear function of p; here the
1
so we just get q
(0)+ 12 ta(0). We have simply
constant c is 2 t p
given a name to this in the last step. So this corresponds to the
computer step (see the pseudo-code given previously)
v = v + (delta_t/2) * a

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

121

t q

The second step with eiL2 t = e q is


!
!

q(0)
( 12 t)
q(0) + t q
q
t q
=
e
( 12 t)
q
( 12 t)
q
!
q(t)
.

( 12 t)
q

(3-19)

. Its effect on q(0) is straightforL2 has no effect on the velocity q


so we just get q(0) + t q
( 12 t). Notice that the
ward: c is t q
1

( 2 t)
operator acts on the quantity provided to it, which is why q
(0). This is, in terms of
appears in this result rather than, say, q
(0) + 12 ta(0) so multiplying in the extra
( 12 t) = q
t = 0 values, q
factor of t we see that this corresponds to the computer step
(see the pseudo-code given previously)
r = r + delta_t * v + ((delta_t**2)/2) * a

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

122
1

The third step with eiL1 t/2 = e 2 t p/p is


!
!
1
q(t)
q(t)

t
p/p
=
e2
( 12 t) + 12 ta(t)
( 12 t)
q
q
!
q(t)

(3-20)
(t)
q
1
and
This goes very like step 1, with the constant c being 2 t p
being the force corresponding to the current coordinates. So
p
this corresponds to the final computer step (see the pseudo-code
given previously)

v = v + (delta_t/2) * a
and the combined effect of all three steps is the velocity Verlet
algorithm
(t)[q(0), q
(0)] = [q(t), q
(t)] .
U
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

123

3.4 The force loop


The other essential element of a molecular dynamics program is
the calculation of forces. The first step is the correct differentiation of the potential energy function.
3.4.1 The basic expressions
For simplicity we assume an atom-atom (or site-site) pairwise adP P
ditive potential V (r1 , r2 , . . . rN ) = i j>i v(ri rj ) as discussed
in section 1.2.2. Denoting the force on atom i due to atom j by
fij :
fji = rj v(rij ) = fij .
fij = ri v(rij )

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

124

Usually the easiest way to express this is to apply the chain


rule




dv
dv r
r r =
r v(r ) =
dr
dr r
where we used the identity
q

x 2 + y 2 + z2
x
r
=
=
x
x
r
and similarly for y and z. The bottom line is that we can express
the force as
!
1 dv
(3-21)
rij = fji
fij = rij
drij
Note the possibility of using Newtons Third Law: having calculated fij we do not need to calculate fji afresh.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

125

3.4.2 Code optimization


The calculation of forces is performed for every distinct pair of
atoms, and is therefore the most time-consuming part of any molecular dynamics program. Accordingly, it is in the force loop that
we must pay some attention to program efficiency.
Computer chips still are very inefficient at computing square
roots and divisions, compared with additions, subtractions and
multiplications. For the Lennard-Jones potential, note that we can
completely avoid square roots:


dv
= 48r 14 24r 8
v(r ) = 4r 12 4r 6 r 1
dr
which can be expressed in terms of 1/r 2 . Note how we have already slipped into reduced units, in which the Lennard-Jones
and are set to unity. If a square root or division (as here) is
unavoidable, it is best to do it just once.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

126

This translates into Fortran-like code as


rijsq = rxij**2 + ryij**2 + rzij**2
r2ij = 1.0/rijsq
r6ij = r2ij*r2ij*r2ij
r12ij = r6ij*r6ij
vij = r12ij - r6ij
fij = (vij + r12ij)*r2ij
pot = pot + vij
fxij = fij*rxij
fyij = fij*ryij
fzij = fij*rzij

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

127

Then the individual atomic forces are updated as follows.


fx(i)
fy(i)
fz(i)
fx(j)
fy(j)
fz(j)

=
=
=
=
=
=

fx(i)
fy(i)
fz(i)
fx(j)
fy(j)
fz(j)

+
+
+
-

fxij
fyij
fzij
fxij
fyij
fzij

Within the loop, we often leave numerical factors (4 and 24 above)


to be multiplied into the total potential energy and the forces later.
For more realistic and general potentials, some potential parameters inevitably appear inside the loop.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

128

3.4.3 Minimum image and cutoff


Before the forces are calculated, the periodic boundary conditions
must be taken into account. A simple way of applying the minimum image convention to the atom-atom vector is
rxij
ryij
rzij
rxij
ryij
rzij

=
=
=
=
=
=

rx(i) - rx(j)
ry(i) - ry(j)
rz(i) - rz(j)
rxij - anint(rxij/box)*box
ryij - anint(ryij/box)*box
rzij - anint(rzij/box)*box

The anint function in Fortran returns the nearest integer (positive


or negative), so this operation returns coordinates all in the range
1
1
2 L . . . 2 L where L is the box length. This will work no matter
how many box lengths apart the particle coordinates are.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

129

Different compilers and computer architectures vary enormously


in the efficiency with which they implement this function. On
some machines it is better to use
if ( abs(rxij) .gt. box2 )
rxij = rxij - sign(box,rxij)

:
or even

if ( rxij .gt. box2) rxij = rxij - box


if ( rxij .lt. -box2) rxij = rxij + box
1
where box2 is 2 L. The sign function returns a number having the
magnitude of its first argument and the sign of its second. Both
of these operations will only work if the coordinates are not too
far apart, as they only subtract one box length (or none).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

130

Therefore, to be sure that they will work, particle coordinates


must always be reset into the periodic box whenever they stray
outside, i.e. a check must be made whenever the atoms are moved.
This check has a similar form to the minimum image convention:
rx(i) = rx(i) - anint(rx(i)/box)*box
ry(i) = ry(i) - anint(ry(i)/box)*box
rz(i) = rz(i) - anint(rz(i)/box)*box

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS

131

Problem 3.4 Download the Fortran code for this problem from
the course home page. You will need: (a) a Fortran-77 program
md.f for Lennard-Jones atoms; (b) An include file md.inc; (c) A
starting configuration md.old.
Compile and run the program; it will ask you to type in a few
values for the run (or you could give them in a small input file). Do
a run of 20 blocks, each of 100 steps, with a time-step t = 0.005
and a potential cutoff rc = 2.5 (both in reduced units). The program should work, but it is not as efficient as it could be and the
calculated pressure is wrong. Fix both these problems by changing
the force subroutine. Avoid the taking of a square root, use Newtons third law to avoid considering ij and ji separately, avoid
storing the forces in a two-dimensional array, and experiment with
different forms of the minimum image correction. Then fix the
virial expression for the pressure; you should get hP i 5.5 in
reduced units. Answer provided.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

132

4 Monte Carlo
In this section we consider in some detail how ensemble averages
might be calculated, why the most straightforward approach is
impractical, and how we may design a practical Monte Carlo technique.

4.1 Crude sampling


How might we evaluate a partition function (or ensemble average)
using a computer? We consider this here, and then see why we
need to modify this approach in practice.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

133

4.1.1 Sum over states: spin systems


Consider calculating by brute force the sum over states. The
cheapest case is for a lattice spin system having nearest neighbour interactions.
X
exp{E( )}
QNV T =

where each state represents a set of N spins si = 1. Assume


that one spins interactions with its neighbours can be computed
in a few floating-point operations, taking 106 s, so the energy E
of the whole system will take N 106 s. The above sum contains
2N terms.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

134

If N = 1000, we take about a millisecond to compute the state


energy, but the total number of states is 2N = 21000 10300 . The
estimated time for the sum will be 10297 s. There is no hope
whatever of summing over all these states. Frustratingly, almost
all the terms will be vanishingly small, because E( ) will be extremely high, corresponding to very unlikely spin configurations
in a Boltzmann-weighted average.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

135

4.1.2 Life is too short


Really, a 1000-spin or 1000-atom system is quite small: 10 molecular lengths across. Even a 106 -spin system is not enormous. Lets
turn the problem around. If we want an answer in about two weeks
(say 106 seconds) then
2N N 106 106

N 35 .

We see that we may only tackle a rather small system in this brute
force way. The factor N on the left of this equation does not
affect the answer very much, so N will only increase logarithmically quickly as the available computer power goes up. If someone
gives us a computer next year that is twice as powerful as our current model, we will be able to tackle N = 36 instead of N = 35:
not very encouraging. Looked at the other way, our needs grow
exponentially with N if we approach the problem this way.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

136

Problem 4.1 This is not to say that direct counting is useless; results for small systems can be informative. Download the Maple
worksheet for this problem from the course home page. This
worksheet sets up a direct calculation of the partition function
and related quantities for a three-spin system. Experiment with
this, increasing the number of spins and noting the form of the
various functions. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

137

4.1.3 Sum over states: atomic systems


For systems with continuous degrees of freedom things are even
worse. Suppose we coarse-grained the atomic coordinates and
momenta to have just 10 values each; (this is very crude indeed,
and 1000 might be a more reasonable value). The number of states
will be 106N , which is huge for any reasonable value of N. The
overwhelming proportion of these states will have very high values of E( ), corresponding to atoms that overlap each other.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

138

4.1.4 A cheap and nasty method


Return to the spin system mentioned above. We can only afford,
say, 106 calculations of the energy, i.e. we can only look at 106
states of the system out of the total 10300 . One approach is
to do a random selection of states, assuming that they are a representative sample of the whole set. We could then proportionately scale up the results. This is rather like doing a Monte Carlo
integration of a multi-dimensional integral instead of using the
trapezoidal rule.
Now for the bad news. We would be outstandingly fortunate
to pick a random state which did not have an unphysically high
value of E. There is essentially no hope that our sample will be
representative. This method will give the wrong answer (zero,
most likely).
We need a new method: importance sampling.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

139

4.2 Importance sampling


Now we consider a smarter approach: one based on selecting the
states in a non-random way. We concentrate on the important
states, the ones with high exp{E( )}. The technique is called
importance sampling. We note immediately that this will mean
giving up on the calculation of QNV T (for which the full sum is
unavoidable); the method will just be good for averages.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

140

4.2.1 The general scheme


The most obvious way of choosing states is such that the probability of selecting a state is proportional to %( ) = exp{E( )}.
This is easier than it sounds, and we shall see how to do it shortly.
Then, if we have conducted Nt observations or steps in the process, the ensemble average becomes an average over steps
hAiNV T =

Nt
1 X
%( )A( ) =
At .
Nt t=1

The Boltzmann weight appears implicitly in the way the states


are chosen. This is like a time average as calculated in molecular
dynamics.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

141

4.2.2 The transition matrix


Our method will involve designing a stochastic algorithm for stepping from one state of the system to the next, generating a trajectory. This will take the form of a Markov chain, specified by
transition probabilities which are independent of the prior history of the system.
Let m and n be short for m and n , and abbreviate
%(m ) %m .
This may then be treated as a component of a (very large) column
vector %. We are hoping that we can devise a scheme that will
produce, as an equilibrium, steady-state, ensemble, the canonical
distribution
%m exp{E(m )} .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

142

Consider an ensemble of systems all evolving at once.


Specify a matrix whose elements nm give the probability of going to state n from state m , for every m, n.
P
must satisfy n nm = 1 for all m, since a state must
go somewhere.
At each step, implement jumps with this transition matrix.
This generates a Markov chain of states.
Fellers theorem: subject to some reasonable conditions, there
exists a limiting (equilibrium) distribution of states and the
system will tend towards this limiting distribution.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

143

The matrix element nm is the conditional probability, given


the current state m, of going to state n. (Note that sometimes,
for example in Allen and Tildesley [1987], this matrix is defined
with the order of indices interchanged). This definition allows us
to write the effect of the transitions on an initial distribution %(0)
as a matrix equation
X
(1)
(0)
nm %m
%n =
m

or, more concisely,

%(1) = %(0) .

Here %(t) represents the distribution after t steps.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

144

4.2.3 The limiting distribution


Fellers theorem [Feller, 1957] states that, given and subject to
some reasonable conditions, there exists a limiting (equilibrium)
distribution of states and that the system will tend towards this
limiting distribution. We want to design an algorithm, that is specify a matrix , for which this is the canonical distribution.
Turning now to the details, consider what happens to an initial,
arbitrary, nonequilibrium ensemble %(0) , Repeated application of
the transition matrix will produce, after t steps, a distribution
%(t) = %(t1) = t %(0) .
Clearly, if we reach a limiting distribution %(t) % it will satisfy
% = % ,
an eigenvector equation, with eigenvalue 1, independent of %(0) .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

145

This equation has a simple physical interpretation. Writing the


eigenvalue equation out in full,
X
X
mn %n = %m =
nm %m
n

we see that the left side represents the rate of arrival of systems
at state m from everywhere, and the right side is the rate of departure from m to everywhere.
Problem 4.2 Download the Maple worksheet for this problem
from the course home page. This worksheet sets up a typical transition matrix for a three-spin system (eight states), and defines an
initial distribution. Calculate the distribution after one step, then
iterate for many steps. Compare the final distribution with the
eigenvector calculated directly from the eigenvects command
in Maple, corresponding to eigenvalue 1. Make a note of the other
eigenvalues. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

146

4.2.4 Microscopic reversibility


How shall we choose the transition matrix? A useful (but not essential) restriction that we may impose on ourselves, so as to guarantee the truth of the last equation, is microscopic reversibility
mn %n = nm %m .
An immediate consequence of this is that the ratio of probabilities %n /%m is equal to the ratio of transition matrix elements
nm /mn . This relation should be familiar to those with a
chemistry background: it expresses the equilibrium constant for
a chemical reaction as the ratio of forward and backward rate constants. What we are doing here is choosing the rate constants (and
we only need to fix the ratio) in order to guarantee a desired equilibrium constant.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

147

4.2.5 The Metropolis prescription


There are still many ways to choose . If our choice of satisfies
%n /%m = nm /mn with, in our case, the Boltzmann distribution for %, we will have succeeded in devising a suitable Monte
Carlo algorithm. One such prescription is due to Metropolis et al.
[1953]. The elements of are written as follows:
nm

= nm

if

%n %m

mn

nm
mm

= nm (%n /%m )
if
P
= 1 nm nm .

%n < %m

mn

Here, is an underlying matrix, essentially dictating the probability of attempting a move like n m, and the other factors give
the probability of accepting such a move.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

148

is symmetrical, nm = mn , i.e. the probability for attempting a move to state n (given that you are currently in state
m) should be the same as the probability for attempting a move
to state m (if you are in state n).
Problem 4.3 Show that the Metropolis prescription is microscopically reversible. Hint: suppose (without loss of generality) that
%n %m . Answer provided.
This scheme only requires a knowledge of the ratio %n /%m , which
equals
exp{(E(n ) E(m ))}
in our case. It does not require knowledge of the factor normalizing the %s, i.e. the partition function.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

149

4.2.6 The symmetrical scheme


Another scheme, much less frequently used, has a more symmetrical choice of :
!
%n
nm = nm
%n + %m
which again satisfies microscopic reversibility and requires only
the ratio %n /%m .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

150

Problem 4.4 One of the eigenvalues of is always unity; earlier on, for the three-spin example, you were asked to make a
note of the other eigenvalues of the transition matrix. What relevance, if any, do you think these have to the choice between,
say, the Metropolis prescription and the symmetrical scheme?
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

151

4.3 Selecting moves


We have a great deal of freedom in the way in which we select
moves. This also gives us the opportunity to get it wrong. Later we
shall consider how to bias the selection process, and then correct
for the bias in the way we accept the moves, or in the way we
calculate ensemble averages. For now, the priority is to select
moves in an unbiased way.
In the following, we may choose a spin, atom, or molecule randomly, meaning with equal probability from the complete set, using a random number generator. It has recently been shown that
it is also generates the correct limiting distribution if we choose
them sequentially - although this has been assumed true for many
years, it is not immediately obvious, because the process is not a
Markov process.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

152

4.3.1 Move selection for lattice spin system


Typical move for constant-T Monte Carlo:
Pick a spin at random.
Flip it, generating new state n.
A large number of such states exists.
The value of nm is correspondingly small. We dont need
to know it. All we need is that it be equal to mn
Consider the reverse move m n, in the context of all possible moves out of state n.
Think! Evidently nm = mn as required.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

153

Figure 4.1 Forward and reverse moves for a spin system.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

154

4.4 Move selection for atomic system


Typical move for constant-NV T Monte Carlo:
Pick an atom at random.
Choose trial displacement uniformly within small cube
around the atom, generating new state n
A very large number of such states exists.
The value of nm is correspondingly small. We dont need
to know it. All we need is that it be equal to mn
Consider the reverse move m n, in the context of all possible moves out of state n.
Think! Evidently nm = mn as required.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

155

Figure 4.2 Forward and reverse moves for an atomic system.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

156

4.5 Move selection for molecular system


Example: for rigid linear molecules we translate and rotate.
Suppose we represent orientation with polar angles , .
Angular configuration space has a weighting factor:
d = sin dd .
Must include the sin factors in nm
Equivalent to uniform sampling of cos and .
Think! Uniform sampling of and is wrong and will generate biased distributions!

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

157

Figure 4.3 Forward and reverse moves for a molecular system.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

158

4.6 Accepting and rejecting


Having selected a move randomly, and computed the change in
energy (or potential energy), we must accept or reject it. The
Metropolis prescription then becomes the following.
If En Em the move is downhill; having chosen it (with
probability nm ) we should accept it unconditionally so
nm = nm as required.
If En > Em the move is uphill; having chosen it (with probability nm ) we should accept it only with probability
%n /%m = exp{Enm }

where

Enm = En Em

so nm = nm (%n /%m ) as required.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

159

To do this, we generate a random number uniformly between


0 and 1. If the Boltzmann factor is greater than this number, we
accept the move; otherwise we reject it. If the move is rejected,
the current state is counted again in the calculation of averages.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO

160

For atomic and molecular systems, the partition function is


split into a product of ideal (exactly calculable) and excess terms:
id
ex
QNV T = QNV
T QNV T . The positional and momentum distributions also factorize, and we wish to sample
%NV T (r ) exp{V (r )} .
The prescription for accepting or rejecting moves is exactly as
written before, but with V replacing E.
Unlike the spin case, we have some decisions to make about the
size of particle translation and rotation moves to be attempted.
The size of the cube used in selecting trial moves is chosen to
give a reasonable acceptance rate (traditionally 50% or so). There
is no special reason for this. Ideally, for every study, one would investigate which choice gives the most efficient sampling of phase
space.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

161

5 Monte Carlo: details


Firstly we consider some practical details of writing and running a
Monte Carlo simulation program. Then we recap some of the ideas
relating to Monte Carlo simulation in the canonical ensemble and
see how to generalize them to other ensembles.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

162

5.1 Practical details


Monte Carlo programs have more in common with molecular dynamics than you might expect. There is the same overall program
organization: conducting a succession of moves advancing a trajectory, computing trajectory averages, input and output of configurations and data. Consider, for simplicity, an atomic system;
we just need to read in the atomic coordinates (no need for velocities). As we will be attempting to move one atom at a time,
it is convenient to consider N such attempts as being analogous
to a molecular dynamics step: we call this a Monte Carlo sweep.
Typically, we select the atoms randomly for moving, and accept
or reject each attempt in turn, independently of what has gone
before.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

163

5.1.1 Potential energy change


Similar to the force routine in MD, the calculation of the potential
energy change accompanying a move is the crucial part of the MC
program. Assuming that the interaction potential is short ranged,
we dont need to do a complete recalculation of V every time we
move an atom: just the part involving that atom! This must be optimized as much as possible - it is called many times. Suppose we
are attempting to move atom i. The core of the potential routine
will look like this, schematically:

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

164

subroutine potone(i, poti)


poti = 0.0
c

** Loop over all atoms except i **


do j = 1, n
if (i .ne. j) then
:
poti = poti + vij
endif
enddo
** End loop over atoms **

The innermost part is, for example, the calculation of the LennardJones pair potential for atoms i and j. We do this twice: once
before the attempted move and once after. So outside this part of
the code, we have
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

165

** Save current position **


rxold(i) = rx(i)
ryold(i) = ry(i)
rzold(i) = rz(i)

** Calculate current energy of i **


call potone(i, potold )

** Move i **
rx(i) = rx(i) + (2.0*ran1(seed) - 1.0)*drmax
ry(i) = ry(i) + (2.0*ran1(seed) - 1.0)*drmax
rz(i) = rz(i) + (2.0*ran1(seed) - 1.0)*drmax

** Calculate new energy of i **


call potone(i, potnew )

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

166

5.1.2 Acceptance or rejction


Then we test the potential energy change and accept or reject
c

** Check for acceptance **


delta = potnew - potold
if ( exp(-delta/temp) .gt. ran1(seed) ) then
** ... accept **
pot = pot + ( potnew - potold )
else
** ... reject and replace **
rx(i) = rxold(i)
ry(i) = ryold(i)
rz(i) = rzold(i)
endif

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

167

Notice the way that we update the current total potential energy if
we accept; also note the way we put the atom back where it was if
we reject. It is quite important to realize that, if we reject a move,
the new configuration is the same as the old configuration, and is
counted again in the accumulation of run averages. Rejecting a
move does not mean that we keep trying until we accept it!

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

168

5.2 The canonical ensemble


5.2.1 Selecting and accepting particle displacements
Consider once more the selection of trial states. Typically a very
large number of trial states exists: any of the N atoms could have
been chosen, and for each there is a very large number of possible
nearby positions. This is shown in Fig. 5.1.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

169

Figure 5.1 Selecting a particle displacement (forward move). The


forward move selection probability, nm , is inversely proportional to the number of atoms, N, and the volume of the yellow
region.

State m

State n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

170

We need to be sure that nm = mn . Consider the situation


that would prevail should we accept this move, and arrive in state
n. Now we would choose from a large number of possible moves,
one of which will lead back to state m. We must ensure that the
likelihood mn of choosing to try and return to m is equal to
equal to nm . This is shown in Fig. 5.2.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

171

Figure 5.2 Selecting a particle displacement (reverse move). The


reverse move selection probability mn is inversely proportional
to the number of atoms N and the volume of the yellow region V .

State m

State n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

172

Provided the selection of which atom to move, and the selection of displacement coordinates for that atom, are unbiased, this
will be true: nm = mn as required.
Suppose our prescription for choosing moves were not unbiased in the sense described above. There are two ways we can fix
the situation. One is to include an extra factor in the accept/reject
criterion above, to correct the sampling, so that each %m is indeed
proportional to exp{Vm }. The other way is to include a correction factor in the calculation of the average, to compensate for
the fact that each %m is not actually proportional to exp{Vm }.
Both approaches find uses.
A crucial point is that the selection probability is completely
under our control, and we should be able to calculate precisely
the ratio nm /mn .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

173

5.3 Isothermal-isobaric Monte Carlo


Isothermal-isobaric, or NP T ensemble, Monte Carlo may be regarded as a combination of a satisfactory technique for sampling
at constant NV T , plus a satisfactory method of converting from
one value of V to another, consistent with the prescribed pressure.
The particles are typically moved around exactly as for constantNV T Monte Carlo; at intervals, we also attempt to scale the volume of the simulation box, together with the coordinates of all
the particles in it. As a rule of thumb, a typical MC sweep consists
of N attempted single-particle moves followed by one attempted
volume move.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

174

5.3.1 Configurational averages


In the constant-pressure ensemble, configurational averages are
conveniently written
Z
Z
1
N P V
dV V e
ds eV (s) A(s)
hAiNP T = ZNP T
0
Z
Z
N P V
dV V e
ds eV
ZNP T =
0

%NP T (s, V ) V N eP V eV .
where we defined the configurational integral ZNP T and the distribution %NP T (s, V ). Here we have introduced scaled coordinates
s = L1 r where L is the box length (assumed cubic). In the following, we take V N exp{P V } to be the weighting factor, and
the underlying
sampling of volumes is represented by a simple
R
integral 0 dV .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

175

5.3.2 Selecting volume changes


To sample the above distribution, one prescription for selecting
the volume move is to attempt to change V by an amount uniformly sampled from an interval [Vmax . . . Vmax ], as shown in
Fig. 5.3.
1/3
The new box length Ln = Vn is computed, and all the particle
coordinates scaled by a factor corresponding to the ratio Ln /Lm .
It is necessary to and use the rescaled coordinates to evaluate the
new potential energy.
The value of nm is determined by the range of volumes considered: actually it is infinitesimally small, but constant for V
within that range. We need to be sure that it is equal to mn .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

176

Figure 5.3 Selecting a volume change (forward move). The forward move selection probability nm per unit volume V is a constant within the limits defined by the yellow region V V . . . V +
V .

State m

State n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

177

Consider the situation that would prevail should we accept this


move, and arrive in state n. Now we would choose from a large
number of possible moves, one of which will lead back to state m.
We must ensure that the likelihood mn of choosing to try and
return to m is equal to equal to nm . This is shown in Fig. 5.4.
Provided the selection V is unbiased (i.e. +V and V are
equally likely to be chosen), this will be true: nm = mn as
required.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

178

Figure 5.4 Selecting a volume change (reverse move). The reverse


move selection probability mn per unit volume V is a constant
within the limits defined by the yellow region V V . . . V + V .

State m

State n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

179

Accordingly, the probability ratio to use in the Metropolis prescription is just the ratio of the two ensemble densities
%NP T (Vn )
%NP T (Vm )

VnN exp{P Vn } exp{Vn }

N
Vm
exp{P Vm } exp{Vm }
= exp { [Vnm + P Vnm NkB T ln(Vn /Vm )]}

= exp {Wnm }
Wnm

= Vnm + P Vnm NkB T ln(Vn /Vm )

where Vnm = Vn Vm and Vnm = Vn Vm . This expression is employed in the Metropolis prescription exactly as was
exp{Vnm } in the constant-NV T case. Once more, the maximum attempted volume change is chosen to give a reasonable acceptance rate (traditionally 3550% or so). (And once more, there
is no firm reason for this choice).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

180

The above prescription for selecting volume changes is not


unique. It may seem more natural to make random changes in
the box length L by sampling L uniformly on a symmetric range;
some people prefer to sample ln V uniformly. These choices are
not precisely consistent with the accept/reject procedure described
above. They can be regarded as unbiased sampling of a variable
different from V (in which case a simple transformation of variables is needed to convert %NP T into the new form, and additional
powers of V will appear in it) or as biased sampling in V -space, in
which case a small correction factor (the same extra powers of V )
will appear in the accept/reject procedure.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

181

Consider uniform sampling of the box length L. An easy way


to see what we should do is to change variables in the expression
for the configurational average:
Z
Z
3
dL L3N+2 eP L
ds eV (s) A(s)
hAiNP T
0
3N+2 P L3 V

%NP T (s, L) L

Then the probability ratio to use in the Metropolis prescription


becomes the ratio of the ensemble probability densities in the new
variable L:
n
h
%NP T (Ln )
= exp Vnm + P (L3n L3m )
%NP T (Lm )
(3N + 2)kB T ln(Ln /Lm )]}
= exp { [Vnm + P Vnm
io
(N + 23 )kB T ln(Vn /Vm )
.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

182

The factor NkB T has become (N + 23 )kB T . An equivalent way of


looking at this is to say that, in terms of the original variable V ,
the sampling is biased, i.e. nm mn . The extra term in the
acceptance probability corrects for this bias.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

183

In Woods original article [Wood, 1968b] he describes uniform


sampling of the inverse box length. Setting = L1 it is easy to
derive
o
n
%NP T (s, ) (3N+4) exp {V } exp P 3
n
h
%NP T (n )
3
3
= exp Vnm + P (n
m
)
%NP T (m )

+(3N + 4)kB T ln(n /m )]
=

exp { [Vnm + P Vnm


io
(N + 43 )kB T ln(Vn /Vm )
.
4

Now the factor NkB T has become (N + 3 )kB T . Once more, we


can consider instead the original variable V instead of , note
that the sampling of this variable is biased, and include the extra
correction factor in the acceptance probability.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

184

Finally, Eppenga and Frenkel [1984] consider sampling


ln V rather than V uniformly. In this case one can show
%NP T (n )
%NP T (m )

= exp { [Vnm + P Vnm


(N + 1)kB T ln(Vn /Vm )]} .

Now the factor NkB T has become (N + 1)kB T .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

185

Problem 5.1 Download the Fortran code for this problem from
the course home page. You will need: (a) a Fortran-77 program
mc0501.f for Lennard-Jones atoms; (b) An include file mc0501.inc;
(c) A starting configuration mc.old. (d) An additional program
ljeos.f which calculates an approximate equation of state for
the Lennard-Jones fluid.
Compile and run the program; it will ask you to type in a few
values for the run (or you could give them in a small input file). Do
a run of 10 blocks, each of 100 steps, any integer number for the
random seed, temperature T = 2.75, pressure P = 5.0, potential
cutoff rc = 2.5, rmax = 0.2, Vmax = 10.0. The program should
run and should exhibit reasonable behaviour, i.e. the internally
calculated pressure (from the virial theorem) should agree with
the input pressure, the density should not change very much (because we have chosen an initial density which is approximately
right, and you can check this by compiling and running ljeos)
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

186

and the particle moves and volume moves are accepted with reasonable probabilities.
Experiment with this program by running it with different values of input pressure, and comparing with the approximate equation of state.
Also experiment by replacing the uniform sampling of V with
uniform sampling of ln V .
Finally, you will have noticed that a quantity, the measured
temperature in the variable tmp is not actually calculated. This
is an interesting point: how can we do this in Monte Carlo? It
would be a useful check that the program is working correctly.
(In MD it is easy, because we can calculate the kinetic energy from
the momenta). There is a clue in the answer to an earlier problem.
Calculate the curvature of the potential and the mean-square force
(in the potall routine). Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

187

5.4 Grand canonical Monte Carlo


Metropolis sampling in the grand canonical, or V T ensemble may
be regarded as a combination of a satisfactory technique for sampling at constant NV T , plus a satisfactory method of converting
from one value of N to another, consistent with the prescribed
chemical potential. The particles are typically moved around exactly as for constant-NV T Monte Carlo; at intervals, we also attempt to change the number of particles in the simulation box, by
creating a new one at a random position, or destroying a randomly
selected one.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

188

As a rule of thumb, a typical MC sweep consists of N attempted


moves each of which is chosen randomly to be a displacement
(handled exactly as in constant-NV T MC), a creation or a destruction. The probabilities for choosing creation and destruction must
be equal (for consistency with what follows) but they need not be
equal to the probability for displacement (although they often are).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

189

5.4.1 Configurational averages


In the grand canonical ensemble, configurational averages are conveniently written
Z
X
1
1 N N
ds exp{V (s)} A(s)
hAiV T = QV T (N!) V z
N

QV T

Z
X
1 N N
(N!) V z
ds exp{V (s)}
N

%V T (s, N) (N!)1 V N zN exp{V } .


where we have defined the partition function QV T and the distribution %V T (s, N).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

190

Here again we have introduced scaled coordinates s = L1 r


3
where L is the box length
p (assumed cubic), z = exp{/ } is
the activity, and = h/ 2 mkB T is the thermal de Broglie wavelength. Note also that it is necessary to work with the full partition function (albeit with the integrals over momenta already
performed) rather than the excess or configurational part.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

191

5.4.2 Selecting creation/destruction moves


For a creation attempt, a position is chosen uniformly at random
within the box, and an attempt made to create a new particle there,
as shown in Fig. 5.5. The value of nm is dictated by the number
of positions available (i.e. it is infinitesimally small, but one can
think of it as being inversely proportional to the box volume).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

192

Figure 5.5 Selecting a particle creation (forward move). The forward move selection probability nm is inversely proportional
to the volume of the box.
create

State m

State n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

193

How about the reverse move? Consider the situation that would
prevail should we accept this move, and arrive in state n. To revert to state m we would choose a destruction move, and then
pick the appropriate particle out of the N + 1 available. This is
shown in Fig. 5.6. The acceptance probability accompanying these
selection probabilities is
%V T (N + 1)
zV
=
exp{Vnm }
%V T (N)
N +1

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

194

Figure 5.6 Selecting a particle creation (reverse move). The reverse move selection probability nm is inversely proportional
to the number of atoms N + 1.
destroy

State m

State n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

195

For a destruction attempt, one of the existing N particles is


selected at random, and an attempt made to destroy it, as shown
in Fig. 5.7. The value of nm is dictated by the number of atoms
(i.e. it is inversely proportional to N).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

196

Figure 5.7 Selecting a particle destruction (forward move). The


forward move selection probability nm is inversely proportional
to the number of atoms N.
destroy

State m

State n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

197

Consider the situation that would prevail should we accept


this move, and arrive in state n. To revert to state m we would
choose a creation move, and then choose a new particle position
randomly within the box. This is shown in Fig. 5.8.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

198

Figure 5.8 Selecting a particle destruction (reverse move). The


reverse move selection probability mn is inversely proportional
to the volume of the box.
create

State m

State n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

199

The acceptance probability accompanying these selection probabilities is


%V T (N 1)
N
=
exp{Vnm }
%V T (N)
zV
It is not immediately obvious that nm = mn for this
prescription: to show this requires consideration of the particle
equilibrium between the system of interest and a reservoir, or alternatively a discussion of the potential distribution theorem of
statistical mechanics.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

200

5.4.3 Accepting creation/destruction moves


For single-particle moves the accept/reject criterion is exactly as
in the constant-NV T case. For creation moves, i.e. N particles in
state m but N + 1 particles in state n, the probability ratio to use
is
%V T (N + 1)
%V T (N)

=
=

[(N + 1)!]1 V N+1 zN+1 exp{Vn }


[N!]1 V N zN exp{Vm }
zV
exp{Vnm }
N +1

where Vnm = Vn Vm is the potential energy change associated


with inserting the new particle.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MONTE CARLO: DETAILS

201

For destruction moves i.e. N particles in state m but N 1


particles in state n, the probability ratio to use is
%V T (N 1)
%V T (N)

=
=

([N 1]!)1 V N1 zN1 exp{Vn }


[N!]1 V N zN exp{Vm }
N
exp{Vnm }
zV

where Vnm is the potential energy change associated with removing the particle. In either case, this expression is used in
the Metropolis prescription exactly as was exp{Vnm } in the
constant-NV T case.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

202

6 Molecular dynamics: details


6.1 Neighbour lists
In the inner loops of the MD and MC programs, we consider an
atom i and loop over all atoms j to calculate the minimum image
separations. If rij > rc , the potential cutoff, the program skips
to the end of the inner loop, avoiding expensive calculations, and
considers the next neighbour. In this method, the time to examine
all pair separations is proportional to N 2 ; for every pair, one must
2
; this still consumes a lot of time.
compute at least rij
Here we discuss two commonly used methods for cutting down
on the work. The aim is to construct lists of nearby pairs of atoms.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

203

6.1.1 The Verlet neighbour list


Verlet [1967] suggested a technique for improving the speed of
a program by maintaining a list of the neighbours of a particular molecule, which is updated at intervals. Between updates of
the neighbour list, the program does not check through all the
molecules, but just those appearing on the list. The number of
pair separations explicitly considered is reduced. Obviously, there
is no change in the time actually spent calculating the energy and
forces arising from neighbours within the potential cutoff. In this
section, we describe some useful time-saving neighbour list methods. These methods are equally applicable to MC and MD simulations, with only minor differences.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

204

In the original Verlet method, the potential cutoff sphere, of


radius rc , around a particular molecule is surrounded by a skin,
to give a larger sphere of radius rlist as shown in Fig 6.1. At the
first step in a simulation, a list is constructed of all the neighbours
of each molecule, for which the pair separation is within rlist .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

205

Figure 6.1 The Verlet list on its construction, later, and too late.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

206

The simplest way to store this is in a two-dimensional array


nablst(maxnab,n) where maxnab is the maximum number of
neighbours any atom is likely to have, and n is the number of
atoms. It is also helpful to have an array nnab(n) storing the actual number of neighbours of each atom. Before constructing the
list we set this array to zero
do i = 1, n
rx0(i) = rx(i)
ry0(i) = ry(i)
rz0(i) = rz(i)
nnab(i) = 0
enddo
At the same time, we make a note of where each atom is at this
instant: well see why later.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

207

Then, setting up the lists requires a standard double-loop over


distinct pairs, within which we put the following:
rijsq = rxij**2 + ryij**2 + rzij**2
if (rijsq .lt. rlistsq ) then
nnab(i) = nnab(i) + 1
if ( nnab(i).gt.maxnab ) stop
nablst(nnab(i),i) = j
nnab(j) = nnab(j) + 1
if ( nnab(j).gt.maxnab ) stop
nablst(nnab(j),j) = i
endif
Notice the comparison with the square of the list cutoff (avoiding
those dreaded square roots) and the checks agains overflowing
the list dimensions.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

208

Here is a small difference between MC and MD: for MC we need


to store separately the information that i is a neighbour of j, and
that j is a neighbour of i, since we will be moving i and j separately. In MD, we always do a loop over distinct pairs, so we only
need to store this information once; there are more compact ways
of storing the information.
Over the next few MD time steps or MC sweeps, the list is used
in the force/energy evaluation routine. The inner loop over atom
j is replaced by:
do jnab = 1, nnab(i)
j = nablst(jnab,i)
:
enddo
Within the loop we calculate pair interactions as usual. This way,
we only examine pairs that we know to be close.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

209

The less frequently we need to reconstruct the list, the faster


the program will be; eventually, though, the list will become stale,
as shown in Fig 6.1, and we will need to reconstruct it. We could
simply guess how often this will be needed, but it is better to
trigger the list reconstruction automatically, and this is why we
stored the atom positions at the moment the list was constructed.
We can keep track of how far each atom has moved, quite cheaply,
and we can find the furthest distance travelled.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

210

dsqmax = 0.0
do i = 1, n
dx = rx(i)-rx0(i)
dy = ry(i)-ry0(i)
dz = rz(i)-rz0(i)
dx=dx-anint(dx/box)*box
dy=dy-anint(dy/box)*box
dz=dz-anint(dz/box)*box
dsq = dx**2 + dy**2 + dz**2
if ( dsq .gt. dsqmax ) dsqmax = dsq
enddo
dmax = sqrt(dsqmax)
If dmax is less than half the width of the safety zone around each
1
atom, 2 (rlist rc ), then we can be sure that no unlisted pair of
atoms can have approached each other within the potential cutoff
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

211

distance. Actually we must allow a little extra in MC, because we


will be calculating potential energies for atoms which are undergoing trial moves, i.e. having an extra small displacement. In any
case, as soon as dmax exceeds the trigger value, the list should be
reconstructed.
The choice of list cutoff distance rlist is a compromise: larger
lists will need to be reconstructed less frequently, but will not give
as much of a saving on cpu time as smaller lists. This choice can
easily be made by experimentation.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

212

6.1.2 Cell structures and linked lists


For larger systems (N 1000 or so, depending on the potential
range) another technique becomes preferable. The cubic simulation box (extension to non-cubic cases is possible) is divided into
a regular lattice of nc nc nc cells; see Fig 6.2.
These cells are chosen so that the side of the cell rcell = L/nc is
greater than the potential cutoff distance rc . If there is a separate
list of molecules in each of those cells, then searching through the
neighbours is a rapid process: it is only necessary to look at atoms
in the same cell as the atom of interest, and in nearest neighbour
cells.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

213

Figure 6.2 The cell structure.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

214

The cell structure may be set up and used by the method of


linked lists The first part of the method involves sorting all the
molecules into their appropriate cells. This sorting is rapid, and
may be performed every step. Two arrays are created during the
sorting process. The head-of-chain array (head) has one element
for each cell. This element contains the identification number of
one of the atoms belonging to that cell. This number is used to
address the element of a linked-list array (list), which contains
the number of the next atom in that cell. In turn, the list array
element for that atom is the index of the next atom in the cell,
and so on. If we follow the trail of link-list references, we will
eventually reach an element of list which is zero, indicating that
there are no more atoms in the cell.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

215

nc = int(box/rlist)
c

** Initialize head-of-chain **
do czi = 1, nc
do cyi = 1, nc
do cxi = 1, nc
head(cxi,cyi,czi) = 0
enddo
enddo
enddo

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

216

** Allocate to cells **
do i = 1, n
cxi = 1+int((0.5+rx(i)/box)*real(nc))
cyi = 1+int((0.5+ry(i)/box)*real(nc))
czi = 1+int((0.5+rz(i)/box)*real(nc))
cellx(i) = cxi
celly(i) = cyi
cellz(i) = czi
list(i) = head(cxi,cyi,czi)
head(cxi,cyi,czi) = i
enddo

In a practical implementation it would be advisable to guard against


the effects of roundoff errors in calculating the cell indices cxi,
cyi, czi from the atomic positions. Also note that we have as1
1
sumed that the atom coordinates lie in the range 2 L . . . 2 i.e. that
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

217

periodic boundary corrections have been applied. Note the way in


which the latest atom discovered to belong to a cell is placed in
the head array, and whatever used to be there is moved over into
list.
How is this used in a force loop or potential energy routine?
Instead of looping over atoms, we loop over cells:
c

** Loop over molecule i cells **


do czi = 1, nc
do cyi = 1, nc
do cxi = 1, nc
:
enddo
enddo
enddo
** End loop over molecule i cells **

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

218

and then within this, we loop over the cell contents


c
100

** Get first i atom in this cell, if any **


i = head(cxi,cyi,czi)
if ( i .gt. 0 ) then
:
:
** Next atom in i cell **
i = list(i)
goto 100
endif
** End test on i>0 **

In the heart of this loop, we would select j atoms from the same
cell and from neighbouring cells. This means looping over cell
indices cxj,cyj,czj which differ from cxi,cyi,czi by at most
one. Some care needs to be taken with the box periodic boundary
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

219

conditions. Having selected the j-cell, each atom j within it is


picked out in a similar way to the i-cell.
This approach is about as efficient as one can get, for large
systems with short-range forces. The cell structure is constructed
afresh at each step or sweep. For Monte Carlo, it is necessary to
make the cells a little larger than the potential cutoff, to allow
for particle displacements during the sweep. A certain amount of
unnecessary work is done because the search region is cubic, not
(as for the Verlet list) spherical. It is possible to improve the speed
slightly by using non-cubic cell structures, but the cubic one has
the advantage of simplicity.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

220

6.2 Multiple timesteps


An important extension of the MD method allows it to tackle systems with multiple time scales: for example, molecules which
have very strong internal springs representing the bonds, while
interacting externally through softer potentials. A simple MD algorithm will have to adopt a timestep short enough to handle the
fast-varying internal motions. Another possibility is to split the
interatomic forces into short-range and long-range components;
the short-range ones change rapidly with time and require a short
time step, but advantage can be taken of the much slower time
variation of the long-range forces, by using a longer time step and
less frequent evaluation for these.
Tuckerman et al. [1992] set out methods for generating timereversible Verlet-like algorithms using the formal Liouville operator formalism seen earlier in section 3.3. Here we supose that

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

221

there are two types of force in the system: slow-moving external


forces F and fast-moving internal forces f . The momentum satis = f + F . Then we break up the Liouville operator (compare
fies p
eqns (3-16,3-17)) as follows:
iL1
iL2

+f
= q
q
p

(6-1)

= F

(6-2)

Then the propagator approximately factorizes


1

eiLt eiL1 t/2 eiL2 t eiL1 t/2 = ei 2 tF /p eiL2 t ei 2 tF /p


where t represents a long time step.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

222

The middle part is then split again, using the conventional


separation, and iterating over small time steps t = t/P :
"
#P
1

eiL2 t ei 2 tf /p eit q/q ei 2 tf /p

So the fast-varying forces must be computed many times at short


intervals; just before and just after this stage, the slow-varying
forces are used, and they only need be calculated once per long
timestep.
This actually translates into a fairly simple algorithm, based
closely on the standard velocity Verlet method. Written in a Fortranlike pseudo-code, it is as follows. At the start of the run we calculate both rapidly-varying (f) and slowly-varying (F) forces
call force(r,f)
call FORCE(r,F)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

223

Then, in the main loop:


do STEP = 1, NSTEP
v = v + 0.5*DT*F
do step = 1, nstep
r = r + dt*v + (0.5*dt**2)*f
v = v + 0.5*dt*f
call force(r,f)
v = v + 0.5*dt*f
enddo
call FORCE(r,F)
v = v + 0.5*DT*F
enddo
The entire simulation run consists of NSTEP long steps; each step
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

224

consists of nstep shorter sub-steps. DT and dt are the corresponding timesteps, DT = nstep*dt.
Problem 6.1 Download the Fortran code for this problem from
the course home page. You will need: (a) a Fortran-77 program
md0601.f; (b) an include file md0601.inc; (c) a starting configuration md0601.old. This simulates a system of 128 atoms, interacting by the repulsive part of the Lennard-Jones potential, and
held together in pairs by strong springs. Compile and run the
program: 20 blocks, each of 1 step, with a time-step t = 0.01
(in reduced units). You should see (by eye) that the energy conservation is bad, because the springs are so strong. They are calculated in routine force2; the LJ forces are computed in force1.
You can improve the energy conservation by running 200 steps
each of length t = 0.001, but this starts to get more expensive.
Amend the velocity Verlet algorithm so that you may use t for

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

225

the springs and t for the interatomic Lennard-Jones forces. You


will see in the program that variable names dtshort and nshort
have been provided. Use dtshort for the shorter time step, and
let nshort be the number of short steps in one long step; so in
the start routine you may input dtshort and nshort, and then
calculate dt=dtshort*nshort. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

226

6.3 Constant-NV T molecular dynamics


In the remainder of this section, we consider extending molecular dynamics to simulate other ensembles than the conventional
constant-NV E ensemble. This inevitably means that the dynamics
will not be the (energy-conserving) true dynamics discussed earlier. We must have some way of moving between constant-energy
hypersurfaces.
One approach, simple to implement and reliable, is to periodically reselect atomic velocities at random from the MaxwellBoltzmann distribution. This is rather like an occasional random
coupling with a thermal bath.
The other two methods are to introduce extra variables into
the deterministic equations to represent a thermal reservoir, and
to constrain the system kinetic energy to be a constant of the
motion.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

227

6.3.1 Extended system method


Noss approach [Nos, 1984a] to simulating the canonical ensemble is to define a Lagrangian in terms of the coordinates r , an extra
variable s, and their time derivatives:
P
s 2 /2 gkB T ln s .
L ms 2 r2 /2 V (r ) + Q

(6-3)

As usual, r represents a supervector of all the atomic coordinates,


P
and r2 is sum of the squares of all the velocity components r.
g is yet to be defined, but turns out to be the number of degrees
of freedom (g 3N) and Q is a kind of thermal inertia parameter
governing the flow of energy between the atomic system and a
reservoir. T is a parameter defining, as it turns out, the temperature.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

228

Nos then wrote down the Hamiltonian associated with the


above Lagrangian
H =

p 2 /2ms 2 + V (r ) + ps2 /2Q + gkB T ln s

(6-4)

and the associated equations of motion


r = p/ms 2
s = ps /Q

=f
p
X
s =
p
p 2 /ms 3 gkB T /s

(6-5)

where ps is the momentum conjugate to s. He then proved that


the microcanonical ensemble probed by solving these equations
was equivalent to a canonical distribution of the variables (r , p/s)
at the desired temperature T .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

229

6.3.2 Extended system: Hoover reformulation


Rather than follow this derivation through, it is instructive to examine the reformulation of this approach due to Hoover [1985].
Redefining the time and momentum variables t/s t and p/s
= s/s leads to the new equations of
p, letting = ln s and
motion
= f p
r = p/m
p
P 2
p /m gkB T
=
=

Q
#
"P


2
/m
p
2
2 T
1 = T
1
T
gkB T
T

(6-6)

where T stands for the instantaneous mechanical temperature,


and we have defined a relaxation rate T for thermal fluctuations.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

230

6.3.3 Extended system: Hamiltonians


It is interesting to answer two questions: do these equations conserve anything like an energy, and do they generate a canonical
distribution based on some energy? We define three Hamiltonians and calculate their time derivatives using the equations of
motion. The first of these is the energy of the system:
X
p 2 /2m + V (r )
H0 =
X
X
X
0 =

p p/m

f r =
p 2 /m

H
This evidently is not conserved. The next function is obtained by
adding the kinetic energy of the thermal reservoir:

H1
1
H

= H0 + 12 3NkB T 2 /T2
2 = 3NkB T
0 + 3NkB T /
= H

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

231

and so this is also not conserved. Finally we add the potential


energy of the reservoir

H2
2
H

= H1 + 3NkB T
=0
1 + 3NkB T
= H

and we see that this is, in fact, is conserved. Nonetheless, the


equations of motion are not derived from this hamiltonian in the
standard way; in fact they are non-Hamiltonian, and so the Liouville equation is also not obeyed.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

232

6.3.4 Extended system: distribution function


The hamiltonian corresponding to the canonical distribution turns
out to be H1 , as can be seen in the following way. Consider the
distribution % that must satisfy the non-Liouville equation seen
in section 2.1.4:
!
"
#


r p

= %
= %
+
+
%

r
p

= % [0 3N + 0] = 3N%
Now compare with % exp{H1 }. The time derivative of this
1 % = 3N%. So this canonical distribution is a
= H
is just %
stationary ensemble satisfying the continuity equation, and (assuming ergodicity) it must be unique.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

233

6.3.5 Extended system: physical interpretation


We can see clearly from the equations of motion what the action
of the extra terms is. If T > T , i.e. the system is too hot, then the
1 will be negative,
friction coefficient is positive. Therefore H
and the system will be cooled. If the system is too cold, the reverse
happens.
Problem 6.2 Download the Maple worksheet associated with this
problem from the course home page. This worksheet carries out
Nos-Hoover dynamics of the simple harmonic oscillator at constant temperature for given initial conditions. Experiment with
the damping rate parameter; what do you see? Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

234

6.3.6 Constrained system method


As an alternative to sampling the canonical distribution, it is possible to devise equations of motion for which the mechanical
temperature is constrained to a constant value. This approach is
due to Hoover et al. [1982], Ladd and Hoover [1983], Evans [1983].
The equations of motion are
= f p
r = p/m
p
X
X
=
f p/ p 2

(6-7)

Here the friction coefficient is completely determined by the


instantaneous values of the coordinates and momenta. It is easy
to see that the kinetic energy is now a constant of the motion:
X
K =
p 2 /2m
P
P
P
=

K
p p/m
= pf /m p 2 /m = 0 .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

235

6.3.7 Constrained system: distribution function


The stationary ensemble is % (K K0 ) exp{V (r )} where
= (3N 1)/2K0 , as can be seen by checking the non-Liouville
equation.
" P
#

fp

= %
= %
pP 2
%

p
p
p
= % [3N + 2] = (3N 1)% .
Compare with directly differentiating the proposed %:
P
P
% = % rf = % pf /m
= V
%
P
= % p 2 /m = 2%K0 .
Provided 2K0 = (3N 1), this agrees with the previous equation.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

MOLECULAR DYNAMICS: DETAILS

236

6.4 Constant-NP T molecular dynamics


Here we simply comment that it is possible to devise extendedsystem methods [Andersen, 1980, Nos, 1984b] and constrainedsystem methods [Evans and Morriss, 1983] to simulate the constantNP T ensemble using molecular dynamics. The general methodology is similar to that employed for constant-NV T , and in the
course of the simulation the volume V of the simulation box is
allowed to vary, according to the new equations of motion.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

237

7 Distributions and all that


7.1 Fluctuations, correlations and errors
Here we examine the size of the fluctuations that we may expect to
see in quantities measured by simulation, and the related question
of statistical errors. Some of the discussions of finite-size effects
can be found in Binder [1981], Milchev et al. [1986].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

238

7.1.1 Fluctuations
Consider a, an intensive mechanical variable, which might take
the form of an average over particles or over the simulation box
volume:
Z
A
1
1 X
a=
ai ( ) =
(7-1)
=
dr a(r) .
N
N i
V
If we define

a(r) = (V /N)

ai (r ri )

(7-2)

we see that the definitions are equivalent. It is not necessary for ai


to depend only on the coordinates of particle i: just that it depend
on particles in the locality of i. For example, we could write the
potential energy this way, dividing pairwise terms (assumed short
in range) equally between the participating atoms.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

239

Typically a and the ensemble average a = hai will be of O(1).


The corresponding extensive variables A and A = hAi will be of
O(N). We define the fluctuation value
D

a( ) = a( ) a

so hai = 0; a2 is a measure of the fluctuations observed in a


simulation.
q


a2 , the root-mean-square fluctuation.
Define rms (a) =
E
D
We may expect a2 O(N 1 ) and rms (a) O(N 1/2 ). We
shall shortly be examining these relations in more detail.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

240

7.1.2 Correlations
Recall that we already defined the time correlation function (see
section 1.1.8) and the spatial correlation function (see section 1.1.9),
together with the corresponding correlation time a and correlation length a . Here we repeat the definitions, but explicitly write
them in terms of a
Z
a =
dt ha(0)a(t)i /ha2 i
0
Z
dr ha(0)a(r )i /ha2 i
a =
0

so as to ensure that the correlations decay to zero at large times


and distances.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

241

7.1.3 Statistical errors: time averaging


Define an average computed over some finite time t: at or at for
short. We can assume that a = a, but in general at at a
will be nonzero. Imagine conducting a very large number of runs
of this length: this gives an underlying distribution from which
we sample at .
If t  a , it turns out that
E
D
E
D
=
a2
a2t
rms (at ) = rms (a)

(7-3)

i.e. averaging over a very short time makes no difference.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

242

If t  a we get, asymptotically,
D
E
D
E
a2t
=
a2 2a /t
rms (at ) =

rms (a)
p
.
t/2a

(7-4)

Thus the statistical error on a simulation-determined ensemble


average of some property is inversely proportional to the squareroot of the run time, and will also depend on the correlation time
of the property. We can understand this if we realize that the
average over time t is essentially a sum of t/2a independent
quantities, each an average over time a . The background to the
above expressions is explored in more detail in this note.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

243

7.1.4 Statistical errors: spatial averaging


We can regard a as a spatially self-averaged quantity in a similar
way: it has the form of a spatial average, over the box volume
V = Ld (where d is the dimensionality), even before any time or
ensemble averaging has taken place. We highlight this by writing
it as aL , or simply as aL for short. Write
Z
(7-5)
aL = aL = Ld dr a(r) .
Consider these finite-size, instantaneous, averages as sampled
from an ensemble in the usual way. Assume that haL i is of O(1),
and is equal (within O(Ld )) to the thermodynamic limiting value
a. We have the idea that aL is the sum of (L/a )d almost independent contributions from different regions (of size a ) of the
fluid.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

244

These ideas lead us to


E D
E
D
a2L a2 (a /L)d .
or, in other words,
rms (a)
.
rms (aL ) q
(L/a )d

(7-6)

Collective, system-wide properties deviate by only a relatively small


amount from their thermodynamic, large-system, limiting values;
the deviation becomes smaller as the averaging volume increases,
and is also determined by the correlation length,
The background to the above expressions is explored in more
detail in this note.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

245

7.2 Estimating errors

D
E
We need to estimate a2t , hence rms (at ), where t is the full
run length. We cannot calculate this directly, as we have only
one measurement of at . Empirical estimates of sample variance
rely on making many measurements. Divide the run down into n
blocks or sub-runs i = 1 . . . n each of length t = t/n. Then we can
estimate mean-squared block averages
E
a2t

n
2
1 X  (i)
.
at at
n 1 i=1

The factor is n 1 rather than n because the same data is used to


calculate at
n
1 X (i)
at =
a .
n i=1 t

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

246

The sub-runs will be independent if t  a . Then we may


write
D
D
E
E
E
D
a2t
a2t
=
.
(7-7)
a2t =
t/t
n
Eqn (7-7) is the usual formula for estimating the error from n independent measurements. It is safest to confirm the above formula
for various t. One method is to check that the right hand side is
approximately constant for a range of sub-run lengths t, or to put
it another way, to check the following equation for several values
of t:
D
E
D
E
(7-8)
lim a2t t = constant = a2t t .
t

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

247

Another way to check this is to measure the correlation time


a from the correlation function. These should give equivalent
results, recalling the analysis of Eqn (7-4). The limiting quantity
D
E
a2t
(7-9)
lim
2 t = 2a s
t
a
is sometimes called the statistical inefficiency. Then the estimated
error in at can be expressed in terms of the instantaneous or shorttime fluctuations
E 2 D
E sD
E
a
a2 =
a2 .
a2t =
t
t

Statistical Mechanics and Molecular Simulation

(7-10)

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

248

7.3 Distribution functions


Here we discuss the form of distribution functions, and how they
are related to thermodynamic properties.
7.3.1 Calculating distribution functions
Making a histogram of the frequency of occurrence of all values
of a is equivalent (to the accuracy of the histogram bin width) to
determining the distribution function:
P(a) = C h(a( ) a)i .
The constant is determined by normalization. This is easily done
in the course of a simulation. Suppose we define a sensibly narrow
bin width a.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

249

At the start, zero the histogram Pi = 0 for all i.


At each step
calculate a;
convert to a bin number i = nint(a/a) or similar;
increment bin Pi := Pi + 1.
At the end of the simulation, normalize to ensure
Z
X
P(a)da a Pi = 1
i

which means calculate N =


and by a.

Statistical Mechanics and Molecular Simulation

i Pi

and divide each bin by N

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

250

7.3.2 Energy distributions


We already noted (see eqn (1-11)) that the energy distribution function in the canonical ensemble is simply the weighted density of
states in the microcanonical ensemble
PNV T (E) = C h(E( ) E)iNV T = CNV E exp{E/kB T }
NV E exp{E/kB T }
= R
dE 0 NV E 0 exp{E 0 /kB T }
NV E exp{E/kB T }
.
(7-11)
=
QNV T
Since S = kB ln NV E and T 1 = (S/E), this suggests that the entire equation of state T (E) could be obtained from a single canonical ensemble distribution. Clearly, it would be easy to obtain the
distribution PNV T (E) by reweighting a distribution obtained at a
reference temperature PNV T0 (E) as illustrated in figure 7.1.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

251

Figure 7.1 Energy distributions at neighbouring temperatures.

(E)
exp(- E)
1
exp(- 0 E)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

252

7.3.3 Neighbouring temperatures


Suppose that we have conducted a simulation at temperature T0 ,
and accumulated PNV T0 (E). We define FNV T0 (E) by
0 FNV T0 (E) = ln PNV T0 (E) = 0 E S(E)/kB 0 F0
where 0 = 1/kB T0 and F0 is the Helmholtz free energy. The constant necessary to determine F0 cannot be obtained from PNV T0 (E),
but if we differentiate with respect to E we obtain
ln PNV T0 (E)
PNV T0 (E)/E
(0 FNV T0 (E))
=
=
= (E) 0
E
E
PNV T0 (E)
(7-12)
where (E) = 1/kB T (E), the equation of state in the neighbourhood of T0 . This is shown in figure 7.2.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

253

Figure 7.2 Energy distributions and equation of state (schematic).


P(E)

E
-log
F(E)

differentiate

(E)
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

254

We can see that this makes sense. FNV T0 (E) clearly is the
Helmholtz free energy, relative to F0 , associated with energy fluctuations, and it varies thermodynamically according to the above
expression. Differentiating one more time gives
2 ln PNV T0 (E)
2 (FNV T0 (E))
(E)
1
=
=
=
2
2
E
E
E
kB T 2 CV
If we truncate at this point, effectively doing a (familiar-looking)
we obTaylor expansion of ln PNV T0 (E) about its peak value E,
tain the
D usual
E Gaussian form for PNV T0 (E), with a mean-squared

value E 2

NV T0

= kB T02 CV as seen before (see Eqn (1-12)). Fur-

ther expansion of the probability distribution would yield nonGaussian corrections, and higher-order derivatives of the equation
of state.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

255

7.3.4 Volume distributions


Similar observations apply, for example, to volume fluctuations in
a constant-pressure ensemble, or indeed to a whole variety of variables. The volume distribution in the isobaric ensemble [Wood,
1968b], is easily accumulated in a histogram,
PNP T (V ) = C h(V ( ) V )iNP T = CQNV T exp{P V }
QNV T exp{P V }
= R
dV 0 QNV 0 T exp{P V 0 }
QNV T exp{P V }
.
(7-13)
=
QNP T
Since F = kB T ln QNV T and P = (F /V ), one might obtain
P (V ) completely from a single determination of PNP T (V ). Clearly,
it would be easy to obtain the distribution PNP T (V ) by reweighting
a distribution obtained at a reference pressure PNP0 T (V )
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

256

7.3.5 Neighbouring pressures


Define FNP0 T (V ) by
FNP0 T (V ) = ln PNP0 T (V ) = P0 V + F (V ) G0 .
Again, our histogram cannot give us G0 , but differentiation with
respect to V gives
(FNP0 T (V ))
V

ln PNP0 T (V )
PNP0 T (V )/V
=
V
PNP0 T (V )
= P (V ) P0 .
=

Hence the equation of state in the neighbourhood of V as shown


in figure 7.3.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

257

Figure 7.3 Volume distributions and equation of state (schematic).


P(V)

V
-log
F(V)

differentiate

P(V)
P0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

258

We can see that this makes sense. FNP0 T (V ) is the Gibbs free
energy for volume fluctuations, relative to G, and it varies thermodynamically according to the above expression. Differentiating
one more time gives
2 ln PNP0 T (V )
2 (FNP0 T (V ))
P (V )
1
=
=
=
2
V
V 2
V
V kB T T
where T is the isothermal compressibility: V T = (V /P ).
Truncating gives the Gaussian form
V 2
constant
2V kB T T
(
)
V 2
PNP0 T (V ) exp
2V kB T T
E
D
= V kB T T .
with a mean-squared value V 2
ln PNP0 T (V )

NP T

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

259

7.3.6 General distributions


The same approach applies to any variable A. We define the free
energy function by
P(A) = C h(A( ) A)i exp{F (A)} .
There will be a thermodynamic variable conjugate to A, defined
by
 


ln P(A)
(F (A))
=
fA
A
A
driving the system towards the minimum free energy (maximum
probability). These functions govern fluctuations of A. [see e.g.
Lifshitz and Pitaevskii, 1980].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

260

Even in their application to simulations, these ideas are very


old [Wood, 1968b] and are still being developed today. We return to them below. Suffice it to say now that, from what we
know already, our determination of these distribution functions
will be statistically very poor outside the very narrow range (
O(N 1 )) over which they adopt significant values. To proceed
beyond the lowest (Gaussian) approximation will mean accurate
measurements out in the wings, and this may not be so easy.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

261

7.4 Distributions and finite size


Here we extend the discussion of spatial fluctuations and correlations. For background material see Binder [1981], Milchev et al.
[1986], Allen [1993]. Once more (see Eqn (7-5)) we write
Z
aL = aL = Ld dr a(r).
These finite-size averages are sampled from an ensemble: denote
ensemble averages h. . .i. We may be considering a subsystem, size
Ld , of an infinite system, or a complete system simulated in the
grand canonical or some other ensemble, with prescribed boundary conditions. There will be differences between these cases in
general, but we neglect these for simplicity here.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

262

7.4.1 Fluctuations
Assume that the mean value haL i is of O(1), and is equal (within
O(Ld )) to the thermodynamic limiting value a. The static fluctuations will scale with Ld , but when this factor is divided out
we are left with a thermodynamic quantity (like the specific heat).
Call this a :
E D E
D
(7-14)
a2L = a2L haL i2 Ld a .
a can be regarded as independent of L. This is consistent with
an approximately Gaussian probability distribution function,
P(aL ) = Ld/2 (2 a )1/2 exp{Ld a2L /2a }
which holds if L  a , the correlation length for the variable a.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

263

7.4.2 Cumulants

n
We shall need to
discuss
higher
moments
aL , n = 1, 2, 3, . . .,

c
of
the
distribution.
The
latter are more useand cumulants an
L
ful because they vanish for a Gaussian distribution (see any text
on probability theory and also Kubo [1962]).
Cumulants are defined by the following expansion which, apart
from a factor i omitted from the exponent, is the characteristic
function:

n
n
n
X
X


ha i

n c
exp
a
.
hexp{ a}i =

n!
n!
n=0

n=1

Note that we are expanding an exponent, which, as we have seen,


is a good idea.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

264

The first few cumulants are


haL ic
D Ec
a2L
D Ec
a3L
D Ec
a4L
D Ec
a5L
D Ec
a6L

= haL i
E
D
=
a2L
E
D
=
a3L
D
E
D
E2
=
a4L 3 a2L
E
D
ED
E
D
=
a5L 10 a3L a2L
D
D
E
D
ED
E
D
E2
E3
=
a6L 15 a4L a2L 10 a3L + 30 a2L

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

265

The first term, haL ic , is of O(1), and the second is

D Ec
a2L

1
d
we E
have seen earlier. It turns out that
O(N
D Ec ) O(L ), as D
c
3
O(L2d ) and a4L
O(L3d ). The important point
aL

is that an extra power of Ld comes in with each higher-order


cumulant: in general

n c
aL O(N (n1) ) O(Ld(n1) ).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

266

7.4.3 Microscopic background


The decreasing order of magnitude of the cumulants can be understood as follows. Write aL as a volume integral,
Z
1
dr a(r)
aL = V
where a(r) = a(r) hai. The general approach is essentially the
same as the derivation of the virial expansion in terms of cluster
integrals; here we consider the approximate length scale of correlations. In the following sections we consider the length scale over
which correlations decay, without making detailed assumptions
about the form of the two- three- four-body correlation functions
etc.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

267

7.4.4 Pair correlations


D
E
a2L has two factors of V 1 in it, and two integrations over the
spatial coordinates. One of these can be eliminated using translation invariance: it simply cancels one power of V in the denominator. The other integration is over a separation between two regions
of space. Contributions to this integral only arise if there is some
correlation between these regions. This is measured by a pair
correlation function, which we now write c (2) (r) = c (2) (r1 r2 ).
It will be zero if the separation greatly exceeds a , the correlation
length, so integrating will produce a volume of the order of ad
This is illustrated in figure 7.4. Thus
D
E
a2L (a /L)d
The background to the above expressions is explored in more detail in this note.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

268

Figure 7.4 Pair correlations and the correlation volume.

L
pair within a

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

269

7.4.5 Triplet correlations


For the third-order cumulant, the argument is similar. Triplet correlations will be associated with a function c (3) (r1 , r2 , r3 ). This will
vanish whenever one of the regions is much further than a from
the other two. This is illustrated in figure 7.5.
The result is
E
D
a3L (a /L)2d .
The background to the above expressions is explored in more detail in this note.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

270

Figure 7.5 Triplet correlations.

L
triplet all within a

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

271

7.4.6 Quadruplet correlations


For the fourth-order cumulant, the argument is similar, but one
more twist arises (and this also applies
E to the higher-order ones).
D
4
Nonvanishing contributions to aL arise not just from situations in which four regions are all close together, and hence
highly correlated. There will also be correlations from situations
in which there are two well-separated pairs of regions, with high
correlation between the members of each pair. This is illustrated
in figure 7.6.
D E
c

It is for this reason that we use the cumulant a4L not the moE
D
ment a4L : the cumulant is defined with these pair correlations
subtracted off. The result is
D Ec
a4L (a /L)3d .
The background to the above expressions is explored in more deStatistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

272

tail in this note.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

273

Figure 7.6 Quadruplet correlations and pair correlations.

two pairs
each within a

L
quartet, all within a

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

274

7.5 Distributions: practical points


There are some practical consequences of these observations about
the relative sizes of higher order cumulants. Firstly we discuss the
estimation of errors for simulation averages, fluctuation expressions etc. Then we look at the possibility of extending simulation
results to nearby state points.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

275

7.5.1 Statistical errors in averages


Given double the computer time, is it better to run for twice as long
or to increase the system size? Most simulation algorithms are,
optimally, of O(N) or O(Ld ). In other words, cpu consumption
Ld t. We have just seen that the estimated error depends on
run length as rms (at ) t 1/2 while it depends on system size
as rms (aL ) Ld/2 . Hence, given a fixed cpu budget, it makes
no difference whether we do longer runs or increase the system
size. Of course, if the simulation algorithm efficiency is worse
than O(N), it is best to keep the system size small and to run for
longer.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

276

7.5.2 Statistical errors in fluctuations


D
E
Consider the fluctuations in a2L , as used to estimate a thermodynamic coefficient such as a (a heat capacity or compressibility).
We can write
*
 + D
E D
E2 
t 2
2
4
2
/n
aL
=
aL aL
where n t/2a is the number of independent samples in a run of
length t. Neglecting non-Gaussian corrections, we can set ha4L i
3ha2L i2 , so
r
E2
D
2
rms
(aL ) = 2 a2L /n
p
or rms (a )/a = 2/n.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

277

Now there is no point in increasing the system size: it will have


no effect on the relative error in a . It is best to use the smallest
system for which L is safely larger than all the a , and then run
for as long as possible.
It might even be better to calculate quantities like a by numerical differentiation of averages rather than from fluctuation expressions [Milchev et al., 1986, Binder
E and Heermann, 1988]. Static
D
2
to the response of a to an
linear response theory relates a
extra term in the hamiltonian coupling to a. This amounts to
changing the state point in some way; the change in hai will be
measurable, and provides an alternative route to a . The effect
must be small enough to lie within the linear regime. If it is too
small, statistical errors on hai will wash out the response and the
fluctuation method will be superior.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

278

7.5.3 Statistical errors in higher cumulants


Relative errors in the higher cumulants become progressively worse.
For example, we can write
*
 + D
E D
E2 
t 2
3
6
3
aL
=
aL aL
/n
and again make the Gaussian approximation giving
r
D
E3
3
rms
(aL ) = 15 a2L /n
q
or rms (a0 )/a0 Ld /n, and increasing the system size is positively to be avoided!

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

279

7.6 Converting between state points


It has been well-known for many years [McDonald and Singer, 1967]
that it is possible to use simulation results obtained at one state
point to calculate properties at another. Recently this approach
has been rediscovered [Ferrenberg and Swendsen, 1988, Lee and Kosterlitz,
1990] and applied to the precise determination of phase transitions, and refined Phillpot and Rickman [1991], Rickman and Phillpot
[1991], Phillpot and Rickman [1992] by expanding in cumulants.
Here we set out the definitions and make some general comments.
We return to phase transitions themselves later.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

280

7.6.1 Neighbouring temperatures


We start from the relation linking averages at different temperatures
R
R
d eE a
d e0 E eE a
R
=
haiNV T = R
d eE
d e0 E eE
where = 0 , = 1/kB T and 0 = 1/kB T0 . The simulations
have been conducted at temperature T0 , and the temperature of
interest is T . This may be written
D
E
aeE
NV T0
haiNV T =
E
e
NV T0
This gives a direct way of re-weighting the results obtained at one
temperature to obtain values at another.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

281

Choose a = (E( ) E) to recover the equations of sec 7.3.2,


relating probability distributions at two different temperatures:
PNV T (E) h(E( ) E)iNV T = PNV T0 (E)

exp{E}
.
hexp{E}iNV T0

Quantities of interest (functions of energy) can be obtained by


completing the integration over E:
Z


f (E) NV T = dE PNV T (E)f (E).
We can sample PNV T0 (E) by constructing a histogram in the simulation. We already know that it will be sharply peaked and approximately Gaussian; high order cumulants (or behaviour in the
wings of the distribution) will be subject to poor statistics. However, in principle, we could use it to estimate PNV T (E) and hence
any hf (E)iNV T .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

282

It has been suggested [see e.g. Phillpot and Rickman, 1992, and
references therein] that we calculate the cumulants of the distribution directly, rather than constructing a histogram, to facilitate conversion from one state point to another. Note that, with
(F ) = F 0 F0 ,
QNV T
= hexp{E}iNV T0
QNV T0


()
c
E n NV T0
exp

n!

exp{(F )} =

n=1

(F ) =

()n
n c
E NV T0
n!
n=1

(7-15)

This very nicely relates cumulants to thermodynamic quantities.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

283

We simply relate higher energy cumulants to successive derivatives of the Helmholtz free energy, and hence successive derivatives of the energy E or the energy per particle e = E/N:
!

n c
n (F )
E NV T0 =
()n 0
!
n

n c
n (F )
e NV T0 = (1/N)
()n 0
!
n1 e
n1
= (1/N)
.
()n1 0
The decreasing system-size dependence is obvious.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

284

7.6.2 Neighbouring pressures


In a similar way, for a small pressure change P , we write, with
G = G G0 ,
QNP T
= hexp{P V }iNP0 T
QNP0 T

(P )n
n c
V NP0 T
exp

n!

exp{G} =

n=1

X
(P )n
n c
V NP0 T
G =
n!
n=1

Statistical Mechanics and Molecular Simulation

(7-16)

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

285

We then obtain expressions for cumulants of the volume V , or


volume per particle v = V /N
!

n c
n (G)
V NP0 T =
(P )n 0
!
n

n c
n (G)
v NP0 T = (1/N)
(P )n 0
!
n1 v

= (1/N)n1
.
(P )n1 0
The decreasing system size dependence is again explicit.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

286

7.6.3 Critique
Is this technique going to work? That is, can we calculate the
cumulants directly in a simulation (instead of building up a histogram) and then use them to work out properties at other state
points? Essentially we are fitting our distribution function using
its first few cumulants. It may well be true that it can be represented quite accurately this way, and it appears that only a small
error results from truncating the expansion at some point. The
cumulants decrease in magnitude very rapidly as the order n goes
up. However this is bad news, not good news! The decrease is due
to the powers of N above: the crucial thermodynamic derivatives
are multiplied by these factors. There are two basic sources of
error in the method to consider: systematic and statistical errors.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

287

The systematic error comes simply from truncating the cumulant expansion. Phillpot and Rickman [1992] truncated at the
third term; statistics on the fourth cumulant were so poor that
they could not even determine its sign, and this is likely to be a
common problem. Even if the first three cumulants are computed
exactly, this amounts to approximating the equation of state e()
or v(P ), locally, by a quadratic equation, setting to zero all higher
derivatives. This is analogous to truncating the gas phase virial
expansion at B3 , a fairly limited approximation. We can estimate
the likely errors immediately for some test cases.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

288

Problem 7.1 Download the Maple worksheet for this problem


from the course home page. The Johnson et al. [1993] equation
of state for the Lennard-Jones fluid, e(), is provided. Consider
a density at about the triple-point value, = 0.85 (in the usual
reduced units) and a temperature kB T = 1.0 approximately midway between the triple and critical-point values (kB Tt 0.75 and
kB Tc 1.35). Compare this with the cumulant expansion truncated at various levels, for temperatures over the entire liquid
range. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

289

Problem 7.2 Download the Maple worksheet for this problem


from the course home page. The Carnahan and Starling [1969]
equation of state, v(P ), for hard spheres is provided. Consider
a pressure P = 1.6 ( = 1, formally) corresponding to a density
roughly half that at which freezing begins. Compare with the cumulant expansion truncated at various levels, for pressures in the
immediate neighbourhood of P = 1.6, and then for the entire
fluid range. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

DISTRIBUTIONS AND ALL THAT

290

The second drawback is that statistical errors will be very high


on the higher cumulants. The effect of this can be calculated using the techniques described earlier. Clearly, problems of poor
sampling in the wings of the underlying distribution will affect
whatever extrapolation is attempted, whether the cumulant approach is used or not.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

291

8 Liquid structure
In this section we look at the structure of liquids, especially concentrating on pair correlations, and beginning with atomic systems. Here we stop using our condensed notation that r represents the coordinates of all the atoms. In this section, and the
next, r represents an arbitrary position in space; we shall represent coordinates of atom i as ri .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

292

8.1 Averages and distributions


We begin by considering the average of properties that may be
expressed as sums of single-particle quantities, or of quantities
depending only on pairs of atoms.
Here is a reminder that the canonical ensemble average of a
configurational property A may be written
Z
1
N
V
dr1 . . . rN eV (r1 ...rN ) A
hAi =
ex
QNV
T
Z
1
(8-1)
dr1 . . . rN eV (r1 ...rN ) A
=
ZNV T
where we have defined the configurational integral
ex
ZNV T = V N QNV
T .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

293

8.1.1 Single-particle properties


PN
For properties which may be written A =
i=1 a(ri ) we have
hAi = N ha(r1 )i and we may write
Z
Z


1
V
dr1 a(r1 )
ha(r1 )i =
dr2 . . . rN eV (r1 ...rN )
V
ZNV T
Z
1
dr1 a(r1 ) g (1) (r1 ) .
(8-2)

V
We have defined a function g (1) (r1 ); notice that the coordinate
r1 appears within the {. . .} above, while the other coordinates are
integrated out.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

294

The relevance of this becomes more clear if we define the instantaneous single-particle density
X
(ri r)
(r; r1 . . . rN ) =
i

When this is averaged we get


(1) (r) h(r; r1 . . . rN )i = N h(r1 r)i
Z


V
N
=
dr2 . . . rN eV (r,r2 ...rN )
V ZNV T
= g (1) (r)

(8-3)

In a homogeneous fluid, g (1) (r) = 1 and (1) (r) = . In the following, we restrict attention to homogeneous fluids. Then, the
interest switches to pair functions.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

295

8.2 Pair properties

P P
For properties which may be written A = i ji a(ri , rj ) we have
hAi = N(N 1) ha(r1 , r2 )i and
Z
Z
1
dr
dr2 a(r1 , r2 )
ha(r1 , r2 )i =
1
V 2(
)
Z
V2
dr3 . . . rN eV (r1 ...rN )

ZNV T
Z
Z
1
dr1 dr2 a(r1 , r2 ) g (2) (r1 , r2 ) . (8-4)

V2
Here we have defined a function g (2) (r1 , r2 ); the meaning of this
becomes more clear if we define the instantaneous, distinct (i.e.
i j) two-particle density
XX
(ri r)(rj r0 ) .
(r, r0 ; r1 . . . rN ) =
i ji
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

296

When this is averaged we get


(2) (r, r0 ) (r, r0 ; r1 . . . rN ) = N(N 1) (r1 r)(r2 r0 )
(
)
Z
N(N 1)
V2
V (r,r0 ,r3 ...rN )
dr3 . . . rN e
=
V2
ZNV T
= 2 g (2) (r, r0 )

(8-5)

Henceforth, we drop the superscript on g. Translational invariance and rotational isotropy allow us to write
g(R, R + r) = g(r) = g(r )

(8-6)

for any coordinate origin R. At large separations, r , we have


g(r ) 1. We find it convenient to define
h(r ) = g(r ) 1

(8-7)

so that as r , we have h(r ) 0.


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

297

8.2.1 Pair function averages


Averages of pair functions can be written
Z
1
dr 4 r 2 a(r )g(r )
hai =
V 0

(8-8)

and examples of this, for pairwise additive potentials (see eqn (1-5)),
are
Z
3
NkB T + 2 N
dr r 2 v(r )g(r )
(8-9)
E =
2
0
Z
2
dv(r )
dr r 3
g(r ) .
(8-10)
P V = NkB T N
3
dr
0
So, if we know g(r ) and the pair potential, we can calculate the
total energy and the pressure.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

298

8.2.2 Density correlations and the structure factor


Neutrons and X-rays scatter from density fluctuations. From the
expressions given earlier, handling carefully the self (i = j) and
distinct (i j) parts, the density-density correlation function is

(r)(r0 )

= (2) (r, r0 ) + (1) (r)(r r0 )


= 2 g(r, r0 ) + (r r0 ) .

(8-11)

These correlations may be related to the structure factor S(k) as


measured in a scattering experiment if we define Fourier components of the (instantaneous) density
Z
X

eikri .
(8-12)
(k;
r1 . . . rN ) = dr eikr (r) =
i

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

299

The structure factor may then be written

(k)i
S(k) = N 1 h(k)
*
+
X
X
1
ikrij
e
=
N
i j
Z
= 1 + dreikr g(r)
Z
sin kr
.
dr r 2 g(r )
= 1 + 4
kr
0

(8-13)

Note that S depends on the magnitude of k in a rotationally isotropic


fluid, S(k) = S(k). This equation may also be written

S(k) = 1 + h(k)
+ (2 )3 (k) .

(8-14)

The relation between g(r ) and S(k) is illustrated schematically in


Fig. 8.1.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

300

Figure 8.1 The structure factor and the pair distribution function.
3

S(k)

2
1
0
0
3

10

20

r/

g(r)

2
1
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

301

g(r ) measures the probability of occurrence of pairs of atoms


at specified distances, relative to the same quantity for an ideal gas
of the same density. Equivalently, g(r ) measures the probability
of finding an atom a distance r from the origin, given that there
is another atom at the origin. At low density, g(r ) is determined
by the Boltzmann distribution for the pair potential:
g(r ) ev(r ) .
At liquid densities this neglects the effects of other particles. Still,
it is sometimes convenient to consider a so-called potential of
mean force w(r ) which is defined such that
g(r ) = ew(r ) .
This is the pair potential that one might deduce from the distribution of a pair of atoms, if all the other atoms were invisible.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

302

8.2.3 Measuring g(r )


To measure g(r ) we need to accumulate a frequency histogram
of pair distances. If we are only interested in close separations,
for example closer than the potential cutoff, this examination of
pairs may be speeded up in the same way as we optimize the
force/energy loop, with neighbour lists. Frequently, however, we
wish to study longer-range correlations, so the example given here
will not use neighbour lists. Because successive sweeps or steps
of a simulation are highly correlated, it makes sense to carry out
the accumulation infrequently, perhaps every 20 or 50 steps.
Let delr store the interval r between points in the g(r ) histogram, and suppose that we are examining pairs out to a separation rmax , whose squared value is stored in rmaxsq. Then in a
double loop over i and j, having calculated the atom-atom vector
and applied the minimum image correction, we do the following.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

303

rijsq = rxij ** 2 + ryij ** 2 + rzij ** 2


if ( rijsq .lt. rmaxsq ) then
rij = sqrt(rxij**2+ryij**2+rzij**2)
k = int(rij/delr) + 1
if ( k .le. nk ) then
gr(k) = gr(k) + 2.0
endif
endif
We add 2, not 1, so as to count ij as well as ji. Also, to be safe, we
include a check that the histogram bin number k does not exceed
the size nk of the gr array. Now, bin k will hold all the counts for
pairs lying in the range (k 1)r . . . kr . Lastly, every time we
call the routine that executes the double loop over i, j, we should
increment a counter grnorm = grnorm + 1.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

304

At the end of the simulation this histogram must be normalized. The clearest way to do this is to explicitly calculate how
many pairs would be expected to fall into each histogram, were
the system to be a uniformly distributed set of N points, i.e. an
ideal gas. This is how it goes (pi stores the value of and vol is
V , the system volume):
const = (n*(n-1))*grnorm*4.0*pi/3.0/vol
do k = 1, nk
r_lo = (k-1)*delr
r_hi = k*delr
gr_ideal = const * ( r_hi**3 - r_lo**3 )
gr(k) = gr(k)/gr_ideal
enddo

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

305

Problem 8.1 Download a Lennard-Jones Monte Carlo program


from the course home page, along with its initial configuration
and include file. The system contains 500 atoms (large enough to
allow calculation of the structure out to a reasonable distance),
and should be an equilibrated liquid at = 0.85, T = 0.8. Add
a routine to compute the pair distribution function at intervals
r = 0.02 out to half of the box length. The necessary extra
variables are declared in the include file. Run the program, calling this routine every 50 steps, for 2000 steps and examine the
results. This run will take some time, as the system is larger than
usual, and no special tricks are used to speed up the calculation.
As a check, use your computed g(r ), and the known pair potential, and a trapezoidal rule integration, to calculate the average
energy and pressure from eqns (8-9,8-10), comparing with the direct output of your simulation Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

306

8.3 Structure and the Ornstein-Zernike equation


Here we make our first attempt to describe the structure of a dense
fluid. To do this we introduce the direct correlation function c(r )
through the Ornstein-Zernike equation. Approximate relations
between c(r ) and g(r ) are then introduced on physical grounds;
these yield the hypernetted chain (HNC) and Percus-Yevick (PY)
approximations. In a later section we return to these approximations, trying to justify them in a more formal way.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

307

In the following we introduce a whole menagerie of symbols. It


is convenient to call the pair Boltzmann factor e(r ). Just as h(r ) =
g(r ) 1, we define f (r ) = e(r ) 1, which has the advantage of
tending to zero rather than 1 at large r . This last function is
called the Mayer f -function. The ratio g(r )/e(r ) is the so-called
background correlation function y(r ): it describes the effect of
the environment (over and above the direct pair potential v(r )) on
the structure of g(r ). It turns out that y(r ) is nice and smooth
even when g(r ) is not: for example it continues smoothly into
the region r < for the hard sphere potential. Finally, and most
mysteriously, we introduce the direct correlation function c(r ).
This is the subject of the next section.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

308

Problem 8.2 Use the low-density approximation g(r ) ev(r ) ,


and eqn (8-10), to show that the second virial coefficient B2 in the
expansion P V /NkB T = 1 + B2 + . . . is
Z


dr r 2 ev(r ) 1 .
B2 = 2
0

Hint: note that




dv
d  v(r )
e
ev(r )
1 =
dr
dr

Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

309

8.3.1 The Ornstein-Zernike equation


The low-density approximation can be written in three equivalent
ways:
g(r ) e(r )

(8-15)

h(r ) f (r )

(8-16)

w(r ) v(r )

(8-17)

Clearly, from the form of g(r ), this is not good enough in a dense
liquid. e(r ) typically has a single maximum, around the nearestneighbour distance, while g(r ) has subsidiary peaks, representing
neighbours of neighbours etc. e(r ) has only the range of the pair
potential, whereas g(r ) is long-ranged, thanks to this knock-on
effect. The next step is to introduce a function to represent the
direct effects, and produce the total correlation by iterating it.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

310

The Ornstein-Zernike equation defines a function c(r ) which,


it might be hoped, is short-ranged.
Z
h(r12 ) = c(r12 ) + dr3 c(r13 )h(r32 )
Z
= c(r12 ) + dr3 c(r13 )c(r32 )
Z
Z
2
dr3 dr4 c(r13 )c(r34 )c(r42 ) + . . . . (8-18)
+
The second form is the iterated form of the integral in the first
form. This can be written in a nice diagrammatic way:
1

=
=

Statistical Mechanics and Molecular Simulation

+
1 2

+
1 2

....
1

(8-19)

M. P. Allen 1999

LIQUID STRUCTURE

311

Some conventions have been applied here. Each point stands


for an atom; we have distinguished between the fixed (and labelled) atoms which are represented by white circles , and the
atoms whose coordinates are integrated over, which do not need
to be labelled, and are represented by black circles . With each
we formally associated a factor . Each line represents the appropriately colored pair function.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

312

In Fourier-transformed variables we have

h(k)
=

c(k)
1 c(k)

or

c(k) =

h(k)

1 + h(k)

(8-20)

This still leaves us with c(r ) unknown, except as a function derived from h(r ). In order to concoct a theory for h(r ) we need to
take another step: we need a closure relation.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

313

8.3.2 Closure relations


An improvement over h(r ) f (r ) is to set c(r ) f (r ). This
is called the chain approximation. For most purposes it is not
good enough. However a version of it is used in the Debye-Huckel
theory of electrolytes and plasmas.
Problem 8.3 Making the linearized chain approximation
c(r ) v(r )

and

h(r ) w(r )

obtain an equation linking v with w. Solve this for w(r ) and h(r ),
given that v(r ) is the Coulomb potential v(r ) = a/r . Hint: you
will need to do a Fourier transform. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

314

The Percus-Yevick (PY) approximation is


c(r ) g(r ) y(r ) = f (r )y(r ) .

(8-21)

Roughly, the argument for this expression goes as follows. Let


c(r ) = h(r ) hindirect (r ) = g(r ) g indirect (r ) .
Then set g(r ) = ew(r ) by definition and suppose g indirect (r )
e[w(r )v(r )] . It would then follow that
c(r ) ew(r ) e[w(r )v(r )] = g(r ) e+v(r ) g(r )
= g(r ) y(r ) = e(r )y(r ) y(r ) = f (r )y(r ) (8-22)
.
Because f (r ) occurs as a factor in this, it follows that c(r ) must
be short-ranged in the PY approximation. Within PY, the OrnsteinZernike equation is conveniently rewritten
Z
(8-23)
y(r12 ) = 1 + dr3 f (r13 )y(r13 )h(r32 ) .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

315

The hypernetted chain (HNC) approximation is


c(r ) g(r ) 1 ln y(r )
= f (r )y(r ) + (y(r ) 1 ln y(r )) .

(8-24)

The argument is similar to the PY case, but here we expand


g indirect (r ) 1 [w(r ) v(r )]
to give
c(r ) ew(r ) 1 + [w(r ) v(r )] = g(r ) 1 ln y(r )
= f (r )y(r ) + [y(r ) 1 ln y(r )] .

(8-25)

This again is short ranged. The bracketted term is small when r


is large.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

316

Problem 8.4 Assume that it is possible to expand c(k) at low k


c(k) = c0 + c2 k2 + . . .
where higher terms are neglected. Write down the corresponding forms of S(k) and h(r ). You might find it useful to define a
characteristic length R by
Z
2
dr r 4 c(r )
R = c2 = (2 /3)
0

and another length by


R 2 / 2 = 1 c0 .
Hint: You will need to start from the Ornstein-Zernike equation
in Fourier space. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

317

8.4 Expansions and diagrams


Here we look at the expansion of the configurational part of the
partition function in terms of Mayer f -functions. This is the origin of the virial expansion of thermodynamic properties and distribution functions. Introducing a graphical notation makes the
equations more compact (see the glossary at the end of this section).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

318

8.4.1 The f expansion


We expand the Boltzmann factor into pair terms

XX
vij
eV ({ri }) = exp

i j>i
YY
YY
eij =
(1 + fij )
=
i j>i

i j>i

= 1 + f12 + f13 + . . . + f12 f13 + . . .

(8-26)

Some observations. Each fij is nonzero over the distance scale of


a molecular diameter, so integrals over fij are of the order of a
molecular volume v 3 . Integrals involving fij fkl decompose
into squares of molecular volumes (two pairs) while integrals involving fij fik have contributions from three molecules close together, etc. This is the beginning of a virial expansion, in v/V .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

319

We illustrate the diagrammatic approach for an example system of three particles N = 3,


Z
Z
Z

1
ex
dr1 dr2 dr3 1 + f12 + f23 + f13
QNV T =
3
V

+f12 f13 + f12 f23 + f13 f23 + f12 f13 f23

3
3
3
1 3
+
+
+
=
33
1 2
1 2
1 2
1 2

3
3
3
3
+
+
+
+

1 2

1 2

1 2

1 2

The 1/33 prefactor is just 1/V 3 divided by 3 , since a factor of


is implied by each in the diagram.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

320

Note that there is considerable redundancy in the labelling:


several graphs give the same integral. We really want to group
them into equivalent sets, dropping the labels, such that each
symbol represents the sum of all graphs of this kind, or some
known numerical factor times this. When we do this, the previous
formula will become

3!
ex
=
+
+
+
.
QNV
T

33
The factor 3! is present because there are this number of ways of
labelling each graph.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

321

But wait: we never meant to include all of those! Some of these


distinct labellings actually correspond to the same integrand, but
we only include distinct terms in the original equation. For example,
this

1 2

and this

2 1

do not both occur in the original equation. We only need one. Either of them equally well stands for the integral we want, while
the unlabelled diagram is conveniently, and conventionally, defined to be the same quantity divided by the symmetry number
which is two in this case.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

322

1 2

3
2

Z
dr1

Z
dr3 f13 f23

dr2
Z

dr1

Z
dr2

dr3 f13 f23

which leads to
3
1 2

3
1 2

= 3!

1 2

There are 3 diagrams on the left; 3 = 3!/2.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

323

8.4.2 Symmetry numbers


The symmetry number is defined such that
unlabelled diagram =
=

1
{labelled diagram}

1
{corresponding integral}.

As an example, take
Z
Z
Z
Z
4
dr1 dr2 dr3 dr4 f12 f23 f34 f13 f14
=
4
which has = 4. The following page has all possible labellings.
Labellings in the same column are equivalent to one another. There
are 6 (= N!/ ) distinguishable ways of labelling the diagram but
whichever way it is done there are 4 symmetry-related possibilities, all in the same column. The symmetry number is 4.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

324

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

325

Problem 8.5 Give the symmetry numbers of the following graphs:

Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

326

8.4.3 Reducible and irreducible diagrams


Note how some of the diagrams are disconnected diagrams, and
hence correspond to products of independent integrals. Of the
remaining connected diagrams, some have a connecting point defined such that when it is removed the diagram falls into disconnected parts. This corresponds to factorizing the integral by effectively shifting the origin of coordinates to the connecting point.
Such diagrams are called reducible. Reducible diagrams may be
expressed as products of other diagrams.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

327

Example:
1
=
2

1 2

=
=
=
=
=

Statistical Mechanics and Molecular Simulation

3
2

Z
dr1

Z
dr2

dr3 f13 f23

Z
Z
Z
3
dr13 dr23 dr3 f13 f23
2
Z
 Z

V 3
dr13 f13
dr23 f23
2
Z
Z

2
3
dr1 dr2 f12
2V
!2
Z
Z
2 2
dr1 dr2 f12
N
2

2
2

N
M. P. Allen 1999

LIQUID STRUCTURE

328

In a similar way any diagram can be expressed in terms of connected irreducible diagrams and products thereof. An irreducible
diagram is at least doubly connected, i.e. there are at least two
independent paths (in the sense of having no intermediate points
in common) between each and every pair of vertices. They are the
prime numbers of diagrammatic methods.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

329

8.5 Partition function and thermodynamics


ex
Now we return to the expression for QNV
T which we write
ex
QNV
T =1+

+ {all irreducible graphs}


+ {all products of these graphs}.

Now we use the exponentiation theorem, which we shall not prove,


but just state in a vague way. More details can be found in the
references [e.g. Hansen and McDonald, 1986]. The idea is this.
Consider a basic set of diagrams, none of which are products,
and a super set consisting of all the basic set diagrams, and all
possible products, to all orders, of these diagrams. Then
{super set} = exp{basic set} 1 .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

330

This seems reasonable (considering an expansion of the exponential) provided that the combinatorial factors all work out corex
rectly, and in fact they do. In this case we are identifying QNV
T 1
as the super set built out of a basic set of all irreducible graphs.
ex
Therefore F ex = ln QNV
T is equal to the basic set:
F ex

= {all irreducible graphs}


=

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

331

Restoring the factors of ,


F ex = 2

+ 3

+ 4

Hence
P ex V = 2 2

3 3

4 4

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

332

We compare with the virial expansion to identify the virial coefficients:


P ex V /N = P V /NkB T 1 = B2 + B3 2 + B4 3 + . . .


=
P ex V = V B2 2 + B3 3 + B4 4 + . . .
B2

2
V

B3

3
V

B4
..
.

Statistical Mechanics and Molecular Simulation

4
=
V
..
.

..
.

M. P. Allen 1999

LIQUID STRUCTURE

333

Recalling that f (r ) is a negative quantity of the order of 1


for r less than a molecular diameter, and f (r ) 0 for larger
r , we can estimate the sign and magnitude of these diagrams.
The sign basically depends on the number of f -bonds. B2 and B3
are typically positive, while the higher virial coefficients may be
positive or negative, having contributions of both signs.
Problem 8.6 Draw all the graphs having five vertices that contribute to the excess Helmholtz free energy. (There are ten of
them.) Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

334

8.6 Functional calculus


The real power of diagrammatic methods comes when we use
them in combination with functional calculus. Here we introduce
the concepts and show how they are used to derive diagrammatic
expansions of the correlation functions.
8.6.1 Functional derivatives
A functional F [(x)] depends on the form of a function (x)
over its full range of x. Use the analogy with functions of many
variables F ({i }) where {i } = 1 , 2 , . . ..

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

Function F ({i })
Small changes i .
Change in F :
dF

= F ({i + di })
F ({i })
X
Di di

Partial derivatives:
!
F
Di =
i

Statistical Mechanics and Molecular Simulation

335

Functional F [(x)]
Small change (x).
Change in F :
F

= F [(x) + (x)]
F [(x)]
Z

dx D[; x](x)

Functional derivative:
D[; x] =

F
(x)

M. P. Allen 1999

LIQUID STRUCTURE

336

For a linear function


X
Ci i
F =
i

dF

Ci di

F
i

= Ci .

For a linear functional


Z
F =
dx C(x)(x)
Z
F =
dx C(x)(x)
F
(x)

= C(x) .

Note that need not be a function of just one variable. If


= (x1 , x2 ) then
!
Z
Z
F
(x1 , x2 ).
F = dx1 dx2

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

337

8.6.2 Diagrams with roots


To deal with pair functions like h(r ) and c(r ) we need to introduce root points corresponding to coordinates which are not
integrated over. The root points are always considered to be labelled and distinguishable: they are never involved in calculating
symmetry numbers. For example
=2

but

=1
1 2

and similarly
=1
1

Statistical Mechanics and Molecular Simulation

and

=2.
1

M. P. Allen 1999

LIQUID STRUCTURE

338

Multiplying such diagrams is straightforward, e.g.

1 2

Our considerations of reducibility need to be extended. We define two special kinds of connection point whose removal splits
the diagram into two or more disconnected parts. If one removes
a nodal point the two root points end up in different parts; evidently all paths between the two roots must pass through any
nodal point. If one removes an articulation point, at least one of
the resulting parts does not contain a root point, and hence is just
an integral giving a numerical factor. A diagram containing no articulation points is said to be irreducible. Also note that a vertex
can be both a nodal point and an articulation point.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

339

8.6.3 Functional integrals and diagrams


Example:
Z

Z
F

dx1
dx1

Z
dx2
dx2

dx3 (x1 , x2 )(x2 , x3 )(x1 , x3 )


dx3 (x1 , x2 )(x2 , x3 )(x1 , x3 )

+two equivalent terms


Hence
F
(x1 , x2 )
F
(x1 , x2 )
(x1 , x2 )

Z
= 3

dx3 (x2 , x3 )(x1 , x3 )


Z

= 3

Statistical Mechanics and Molecular Simulation

dx3 (x1 , x2 )(x2 , x3 )(x1 , x3 )

M. P. Allen 1999

LIQUID STRUCTURE

340

In diagrammatic form, with = and = :


F
F + F

=
=

1 2
3
1 2

= 3

3
1 2

1 2

= 3

1 2

Z
=3

+
Z
dx1

dx2

1 23

1 2

1 2

1 2

3
1 2

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

341

For unlabelled diagrams, recalling


=

1
6

and

1 2

=
1 2

1 2

we see that
F=

1
F
=

1 2

The general rule is: the functional derivative is half the sum of
all the distinct diagrams obtained by erasing a bond, turning the
associated circles white, and labelling them.
To obtain (F /) we simply add a bond between the root
points.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

342

Problem 8.7 The diagram


where stands for
represents F []. Write down a diagram for the change F resulting from + (use a dotted or coloured bond for )
and express F / in diagrammatic form. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

343

8.6.4 Functional derivative of the free energy


F=

ex
QNV
T

=V

V ({ri })

d{ri } e

=V

Z
d{ri }

YY

e(ri , rj ) .

i j>i

This is a product of pair functions, as seen earlier.


Z
ex
YY
QNV
1
T
e(ri , rj )
= N(N 1)V N dr3 . . . rN
e(r1 , r2 )
e(r1 , r2 )
2
i j>i
Recall that
g(r1 , r2 ) =
so
e(r1 , r2 )

ex
V N2 QNV
T

dr3 . . . rN eV ({ri })

ex
QNV
1 ex
T
2
= QNV
T g(r1 , r2 ) .
e(r1 , r2 )
2

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

344

Rearranging,
2 g(r1 , r2 ) = 2e(r1 , r2 )
2 y(r1 , r2 ) = 2

ex
ex
ln QNV
ln QNV
T
T
= 2e(r1 , r2 )
e(r1 , r2 )
f (r1 , r2 )

ex
ln QNV
T
f (r1 , r2 )

Note that we are using f = e 1 so that f = e. Note also


that the simplest result is the one for y = g/e, obtained from the
ex
functional derivative of ln QNV
T.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

345

Now see these results in diagrammatic form. The factors of


disappear if we adopt the convention that carries a factor of
ex
with it, but does not. We start from ln QNV
T (all irreducible
graphs) and follow the prescription for functional differentiation
with respect to f (or e): erase a bond, whiten and label the associated vertices, repeat until all distinct diagrams have been generated. The factor of 1/2 in the prescription cancels the factor
of 2 in the above equation for y. The resulting diagrams for y
have no f12 bond (by construction). This ensures that it is a continuous function of r even when the potential v(r ), and the pair
correlation function g(r ) are discontinuous. This is true for hard
spheres, for example.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

ex
ln QNV
T

346

= all irreducible graphs with no root points


y(r1 , r2 ) =

+
1 2

+
1

+
2

+
1

+
1

all irreducible graphs with two root


= 1+
points and no f12 bond

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

347

Finally note that g12 = e12 y12 = (1 + f12 )y12 , so to get g we


simply add to y all the diagrams obtained by drawing in the f12
bond.
g(r1 , r2 ) =

+
1 2

+
1

2
2

1 2

+
1

+
1

+
1

+
1

(8-27)

all irreducible graphs with two root


(8-28)
= 1+
points and at most one f12 bond

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

348

8.7 Glossary
8.7.1 Glossary of pair functions
pair potential v(r ).
pair Boltzmann factor e(r ) = ev(r ) .
Mayer f function f (r ) = e(r ) 1.
pair distribution function g(r ).
pair correlation function h(r ) = g(r ) 1.
potential of mean force w(r ) = kB T ln g(r ).
background correlation function y(r ) = g(r )/e(r ).
direct correlation function c(r ).
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

349

8.7.2 Glossary of graphical terms


a vertex or atom position which is integrated over; sometimes
a factor is conventionally included.
a vertex or atom position which is fixed (not integrated over).
a pair function between atoms, often f (r ).
symmetry number, i.e. total number of labellings which leave
the diagram topologically unchanged.
connected diagram one in which a path of bonds exists between
any two vertices.
disconnected diagram one that isnt connected.
connecting point a vertex whose removal converts a connected
diagram into a disconnected one.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

LIQUID STRUCTURE

350

reducible diagram one containing a connecting point.


irreducible diagram one without a connecting point, i.e. with two
or more paths between any two vertices.
Connection point: a point whose removal causes the diagram to
split into two or more disconnected parts. For graphs with
two root points we have the following kinds of connection
point
Articulation point: at least one of the disconnected parts
has no root point.
Nodal point: the root points are in two different parts.
For a diagram with two root points, every connection point
must be a node or an articulation point, or both.
Irreducible diagram: one with no articulation points.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

351

9 Thermodynamic Perturbation Theory


In this section we discuss the way in which the thermodynamics
and structure of liquids may be predicted by theory. This has
been an area in which computer simulation has played a crucial
role. Simulation has shown that the structure is primarily determined by atomic packing, i.e. by the strong repulsive forces acting
between atoms. These can be approximately modelled by hard
sphere potentials. Then suitable perturbation approaches may be
used to handle the additional effects that (a) the repulsions are
not completely hard, and (b) there are attractive forces.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

352

9.1 The hard sphere reference system


The hard sphere fluid is very well understood. The PY approximation can be solved analytically; better approximations can be
solved numerically. Given the hard sphere liquid as a reference
system, thermodynamic perturbation theory gives results for more
realistic potentials.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

353

9.1.1 The PY solution


For hard spheres, functions of r must be considered over the two
ranges r < (within the core) and r > (outside the core). Here
is a table, useful for discussing the PY approximation.
Function
v(r )
e(r )
f (r )
g(r )
c(r )
y(r )

r <

0
1
0
y(r )
c(r )

r >
0
1
0
y(r )
0
g(r )

Statistical Mechanics and Molecular Simulation

Comments
e(r ) = ev(r )
f (r ) = e(r ) 1
g(r ) = y(r )/e(r )
c(r ) f (r )y(r ) (PY)
y(r ) is continuous at r =

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

354

Inserting c = f y (the PY approximation) and h = g 1 =


ey 1 = (f + 1)y 1 (which is exact) into the OZ equation gives
Z
Z
y12 = 1 + dr3 f13 y13 e23 y23 dr3 f13 y13 .
In tackling the first integral we can use
(
(
1 r13 <
1 r23 >
e23 =
f13 =
0 r13 >
0 r23 <
so

Z
y12 = 1

Z
r13 <
r23 >

dr3 y13 y23 +

r13 <

dr3 y13 .

This may be solved by Laplace transformation (Wertheim and Thiele)


or by factorization (Baxter); see Hansen and McDonald [1986] for
details.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

355

The results are as follows. Within the core region r < , c(r )
has the form
c(r ) = A B(r / )

1
A(r / )3
2

0r

with = 3 /6,
A =
B

(1 + 2)2
(1 )4

= 6

(1 + 12 )2
(1 )4

y(r ) is piecewise analytic over each range of r : 0 < r < , <


r < 2 , . Within the core it is given by y(r ) = c(r ); in each
subsequent region it can be determined from the integral equation
above.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

356

Figure 9.1 The hard sphere PY y(r ) which is equal to g(r ) outside the core and to c(r ) inside the core.
8

g(r)
y(r) inside the core

y(r) 1/10 scale

2
r/

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

357

Problem 9.1 In the limit 0 show that c(r ) reduces to 1


within the core and 0 outside, and work out the next term in the
density expansion. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

358

Problem 9.2 The simple chain approximation is c(r ) f (r ).


In this question we apply it to the case of hard-sphere atoms of
diameter .
1. Insert this into the Ornstein-Zernike equation to obtain a
relation between h(r ) and f (r ). Express your result as an
integral equation and in diagrammatic form. What diagrams
are missing in the density expansion of h(r ) to order 2 in
this approximation?
2. Solve this equation analytically for the hard sphere system,

obtaining expressions for h(k)


and S(k),
3. Plot the function S(k) as a function of k = k , for values
of the density = 3 = 0.1, 0.5, 0.8.
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

359

9.1.2 PY thermodynamics and CS improved thermodynamics


Pressure is calculated from the PY g(r ) by either of two routes.
The virial equation (see eqn (8-10)) becomes
Z
2
de(r )
y(r )
dr r 3
P /kB T = 1 +
3
dr
0
Z
2
dr r 3 (r )y(r )
= 1+
3
0
2 3
y( + ) = 1 + 4y( + )
= 1+
3
1 + 2 + 32
(9-1)
=
(1 )2

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

360

The compressibility equation is via





1
=
kB T
P
1 c(0)
which gives
P /kB T =

Statistical Mechanics and Molecular Simulation

1 + + 2
.
(1 )3

(9-2)

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

361

An empirical fit to the virial coefficients due to Carnahan and Starling


[1969] is extremely accurate, and has a very simple form:
P /kB T =

1 + + 2 3
.
(1 )3

(9-3)

Compare virial expansion coefficients:


P /kB T

= 1 + 4 + 102 + 183
+284 + 405 + 546 . . .
2

(Carnahan-Starling)
3

= 1 + 4 + 10 + 18.365

+28.244 + 39.55 + 56.56 . . .

(exact) .

The CS free energy is


F ex /NkB T =

Statistical Mechanics and Molecular Simulation

4 32
.
(1 )2

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

362

Problem 9.3 Show that the Carnahan-Starling formula for P may


be obtained by combining virial and compressibility formulae in
proportions (1/3) and (2/3) respectively. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

363

9.1.3 Improved structure


The PY g(r ) is slightly too low at contact r = , the oscillations have slightly the wrong phase and do not die away sufficiently quickly with increasing r . Empirical corrections are due to
Verlet and Weis [1972]:
g(r / ; ) gPY (r / 0 ; 0 ) + g(r )
with 0 = 2 /16, 0 = (0 /)1/3 and
g(r ) =

A
exp((r )) cos((r ))
r

A and being constants.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

364

9.2 Thermodynamic perturbation theory


Now we can work the machinery of perturbation theory, knowing
that we have a good reference system. The simplest and most
obvious thing to try is an approximation valid at high temperature,
when the effects of the potential will be weak. However, this will
not be enough: the effects of the repulsive cores are essentially
never weak, and a different approach must be used.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

365

9.2.1 Basics and high-T expansions


Consider a reference potential energy V0 ({ri }), suppose that our
system of interest has potential energy V1 ({ri }), and set V =
V1 V0 . Then
Z
Z
V1 ({ri })
= d{ri } eV0 ({ri }) eV ({ri }) .
Z1 = d{ri } e
Hence Z1 /Z0 = heV ({ri }) i0 , or
F1ex = F0ex kB T lnheV ({ri }) i0 .
Here an average in the reference system ensemble is denoted h. . .i0 ;
one in the perturbed ensemble would be h. . .i1 . To lowest order
hexp xi exphxi so F1ex F0ex + hV i0 . It is easy to show that
the desired free energy may be bracketted
F0ex + hV i1 F1ex F0ex + hV i0 .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

366

A similar approach is to write V = V0 +V and differentiate


Z with respect to .

F ex

2
F ex
2

= hV i


= 2 hV 2 i hV i2 .

We can formally integrate


F1ex = F0ex +

Z1
0

d hV i

or use a Taylor series


F1ex = F0ex + hV i0


1 2
hV 2 i0 hV i20 + . . . .
2

These high-T expansions are discussed by Zwanzig [1954].


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

367

To calculate first-order free energies we only need zero-order


structure. For pairwise potentials
Z
dr r 2 g0 (r )v(r )
hV i0 = 2 N
0

The higher-order terms invariably involve 3-body etc. distribution


functions. The van der Waals equation results
taking v(r )
R from
2
to be a weak attractive tail and setting 2 0 dr r g0 (r )v(r ) =
a, a constant. For a hard-sphere reference fluid, g0 (r ) and hence
a will be independent of temperature.
This general approach is useful for treating weak, long-range
perturbations. It is useless when v(r ) refers to differences in the
repulsive region of the potential. We need a method of relating
a more accurate repulsive-core reference potential to some wellknown system like hard spheres.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

368

9.2.2 Blip-function theory


The function e(r ) = ev(r ) is much better behaved than v(r ).
Define e(r ) = e1 (r )e0 (r ) = f (r ), where e0 (r ) corresponds to
our reference system (e.g. hard spheres). This difference function
will exhibit a blip over a short range of separations. Now consider
the free energy difference between the two systems. This is easily handled using the functional calculus we have been practising
earlier.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

369

Figure 9.2 The soft repulsive part of the pair potential, a reference hard sphere potential, and the blip function.
3

v(r)

soft
hard

e(r)

soft
hard

0.5
0

e(r)

0.5
0
0.5
0

1
r/

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

370

We start from
1
(F ex )
= 2 y(r1 , r2 )
f (r1 , r2 )
2
and do a functional integration:
Z
Z
1 2
ex

dr1 dr2 y(r1 , r2 )f (r1 , r2 )


(F ) =
2
Z
1 2
V dr y(r)f (r)
=
2
Z
= 2 N
dr r 2 y(r )f (r ) .
0

This will be valid provided f (r ) is small.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

371

In diagrams, we get
F0ex

+ ...

F1ex

+ ...

F ex

+ ...

1 2

Z
dr1

dr2

In practice this becomes


F1ex

F0ex

+ 2 N

Statistical Mechanics and Molecular Simulation

Z
0

+
1 2

+ ... .

dr r 2 y0 (r )f (r )

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

372

If we use a reference y0 (r ) for a hard sphere fluid, we are free


to choose the hard sphere diameter in some optimal way: it
turns out to be very advantageous to choose it to make the firstorder term in the above free energy correction vanish
Z
dr r 2 y0 (r )f (r ) = 0 = (, T )
0

Then it emerges that y1 (r ) y0 (r ) and


g1 (r ) = ev1 (r ) y1 (r ) ev1 (r ) y0 (r ) .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

373

9.2.3 Putting it all together


The one remaining decision is how to divide the pair potential in
the system of interest into a repulsive core and an attractive tail.
For Lennard-Jones (as a test example) this has been done at least
three ways. McQuarrie and Katz [1966] made the r 12 term the
repulsive part and the r 6 term the attractive part. However the
repulsive part is not truly short ranged. Barker and Henderson
[1967] called v(r ), r the repulsive part and v(r ), r >
the attractive part. However, the atoms actually respond to the
forces acting between them, not to the absolute value of the potential energy. At the changeover point, r = , the forces change
discontinuously, and this clearly leaves some of the structuredetermining effect mixed in with the attractive part of the potential.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

374

Figure 9.3 Dividing the Lennard-Jones potential into contributions


from r 12 and r 6 terms.
2

v(r)

repulsive
attractive

1
100

f(r)

repulsive

50

1
r/

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

375

Figure 9.4 Dividing the Lennard-Jones potential into contributions


from v(r ) > 0 and v(r ) < 0.
2

repulsive
attractive

v(r)

1
100

f(r)

repulsive

50

1
r/

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

376

On these grounds, Weeks et al. [1971] divided the potential at


the position of the minimum, where the forces are zero. This is
now the commonly accepted best choice.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

377

Figure 9.5 Dividing the Lennard-Jones potential into contributions


from f (r ) > 0 and f (r ) < 0.
2

v(r)

repulsive
attractive

1
100

f(r)

repulsive

50

1
r/

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

378

The final prescription, given a pair potential v(r ) and the values of and T , is therefore:

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

379

1. Split v(r ) by the WCA method into vR (r ) and vA (r );


2. Determine
an equivalent hard-sphere diameter HS by solvR
ing 0 dr r 2 yHS (r )f (r ) = 0 with f (r ) = fR (r ) fHS (r ),
and yHS (r ) yHS (r ; , HS ) given by the PY formula plus
empirical corrections;
3. Express repulsive reference system properties as follows:
ex
FRex FHS

gR (r ) evR (r ) yHS (r )

4. Use long-range perturbation theory to incorporate effects of


attractive part of potential, e.g.
Z
ex
ex
FR 2 NkB T
dr r 2 gR (r )vA (r )
F
g(r ) gR (r )
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

THERMODYNAMIC PERTURBATION THEORY

380

Problem 9.4 Download a Lennard-Jones Monte Carlo program


from the course home page, along with its initial configuration
and include file. This contains a routine to compute the pair distribution function at intervals r = 0.02 out to half of the box
length. The routine is called every 50 steps. Run the program just
to equilibrate the system, for 2000 steps, using a potential cutoff
rc = 2.5 , T = 0.8 (the density is = 0.85, this is near the triple
point). Then take the output configuration mc0904.new, rename
it mc0904.old, and do a run of 5000 to obtain (hopefully) equilibrium results. Rename the output files, so they wont get overwritten, and repeat the whole process again, but choosing a cutoff
rc = 21/6 which just selects the repulsive WCA part of the potential. Compare the results of the two simulations. Is it reasonable
to approximate g(r ) by gR (r )? Can you calculate thermodynamic
properties (E and P ) of the full Lennard-Jones potential from the
measured gR (r )? Answer provided.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

381

10 Linear response theory


In this section we look at the formalism of linear response theory.
There is a close analogy between this, static thermodynamic perturbation theory, and both static and time-dependent perturbation theory in quantum mechanics. For example, when an electric
field is applied to an atom, the magnitude of the resultant dipole
is proportional to the polarizability; this same quantity may be
related to expectation values of dipole fluctuations in the unperturbed atom.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

382

10.1 Linear response theory


We consider applying a perturbation to the system and relate
the non-equilibrium response to equilibrium properties, assuming that nonlinear terms may be dropped. This is sometimes
called Green-Kubo theory. Then we obtain an expression for the
nonequilibrium ensemble averages. More detail may be found in
the texts Evans and Morriss [1990], Hansen and McDonald [1986]
and Frenkel and Smit [1996].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

383

10.1.1 Time evolution in the perturbed system


Introduce an extra term in the hamiltonian
HA = H0 + HA = H0 A(q, p)FA (t) .

(10-1)

Then also write


%A (q, p, t) = %0 (q, p) + %A (q, p, t)

(10-2)

with something similar in the quantum case. From this we see


(referring to eqn (2-5) or eqn (2-9))
%A
t

= (HA , %A )
= (H0 , %0 ) + (H0 , %A ) + (HA , %0 ) + (HA , %A ).

The first term is zero, for an equilibrium ensemble, eqn (2-15).


The last term is of second order, and we drop it, assuming a weak
perturbation.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

384

Introduce the equilibrium Liouville operator


(H0 , %A ) = iL0 %A
and write (HA , %0 ) = FA (t)(A, %0 ) so that
%A (t)
= iL0 %A FA (t)(A, %0 ).
t
If we switch on the perturbation at time t = 0 the formal solution
of this is
Zt
0
iL0 t
dt 0 eiL0 t FA (t 0 )(A, %0 )
%A (t) = e
0
Zt
0
dt 0 eiL0 (tt ) FA (t 0 )(A, %0 ) .
(10-3)
=
0

The easiest way to see this is to differentiate both sides with respect to t and recover the previous equation.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

385

10.1.2 Nonequilibrium ensemble averages


A nonequilibrium ensemble average of a quantity B, written hBiA
may now be written down; without loss of generality we take
hBi0 = 0.
hB(t)iA

= TrB%A (t)
Zt
0
dt 0 FA (t 0 ) TrBeiL0 (tt ) (A, %0 )
=
0
Zt
0
dt 0 FA (t 0 ) TrBeiL0 (tt ) (%0 , A)
=
0
Zt


0
dt 0 FA (t 0 ) Tr eiL0 (tt ) B (%0 , A)
=
0
Zt
dt 0 FA (t 0 ) TrB(t t 0 )(%0 , A)
=
0

(10-4)

Here we used the Hermitian property of L0 (see section 2.2.5).


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

386

Equation (10-4) is useful when we specialize to the classical


case (next section). Taking this further:
hB(t)iA

=
=
=

Zt
0
Zt
0
Zt
0

dt 0 FA (t 0 ) Tr%0 (A, B(t t 0 ))


dt 0 FA (t 0 ) h(A, B(t t 0 ))i0
dt 00 FA (t t 00 ) h(A, B(t 00 ))i0 .

(10-5)

To get this, we used cyclic permutation under the trace, section 2.2.5,
applied to each component of the Poisson bracket. The last two
equations are just different ways of writing this result, interconverted by changing the time integration variable.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

387

It is useful to define the response function


BA (t) = h(A, B(t))i0

(10-6)

so these results become


hB(t)iA

=
=

Zt
0
Zt
0

dt 0 FA (t 0 )BA (t t 0 )

(10-7)

dt 0 FA (t t 0 )BA (t 0 )

(10-8)

Assuming that A, B and FA are real, then the response function,


which involves a Poisson bracket of two variables evaluated at
different times, must also be real. Note also that eqns (10-7, 10-8)
have the form of convolutions in time.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

388

10.1.3 Classical case


Now we specialize to the classical canonical ensemble for which
(see problem 2.7). We can see (eqn (10-4)) that
(%0 , A) = %0 A
hB(t)iA

=
=

Zt
0
Zt
0

dt 0 FA (t 0 ) Tr%0 B(t t 0 )A
0.
dt 0 FA (t 0 ) hB(t t 0 )Ai

Again this takes the form hB(t)iA =


the response function given by

Rt
0

(10-9)

dt 0 FA (t 0 )BA (t t 0 ) with

0.
BA (t) = hB(t)Ai

(10-10)

Note that we have here a classical equilibrium time correlation


function.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

389

10.2 Time correlation functions


Evidently, time correlation functions will play a central role in our
discussions of dynamical properties. Time correlation functions
are important because:
they dictate the response of the system to a perturbation;
they dictate the form of spectra;
they are related to transport coefficients;
they give a picture of the dynamics.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

390

Here we summarize some basic properties of classical time


correlation functions. We assume throughout that variables are
chosen such that their equilibrium ensemble averages vanish, i.e.
hAi = 0, hBi = 0 and so on. Also we drop the superscript 0 from
the angle brackets: here h. . .i means an equilibrium average. We
adopt the notation that CAB (t) is an un-normalized function while
cAB (t) is normalized:
CAB (t) = hAB(t)i

hAB(t)i
cAB (t) = p
hA2 ihB2 i

The normalized function satisfies 1 cAB (t) 1 by a CauchySchwarz inequality. When A and B are the same, we refer to
CAA (t) as an autocorrelation function. Finally, when a variable A
appears without an explicit time argument, we understand A(0).
The detailed proofs of some of the following properties are left as
problems.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

391

10.2.1 Long-time behaviour


In the long-time limit
hAB(t )i = hAihBi = 0

(10-11)

because we have chosen the individual ensemble averages to be


zero.
10.2.2 Short-time behaviour
At short times we get the static correlation
hAB(t 0)i = hABi .

Statistical Mechanics and Molecular Simulation

(10-12)

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

392

10.2.3 Stationary property


hA(0)B(t)i = hA(t0 )B(t0 + t)i

(10-13)

for all time origins t0 . This follows from the equilibrium nature
of the ensemble.
10.2.4 Time differentiation
Taking the time derivative of the function is equivalent to calculating the correlation with the time-differentiated variable:
d

hA(0)B(t)i = hA(0)B(t)i
.
dt

Statistical Mechanics and Molecular Simulation

(10-14)

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

393

10.2.5 Time reversal symmetry


An autocorrelation function is even in time
hA(0)A(t)i = hA(0)A(t)i

(10-15)

For variables A and B which have a definite symmetry under time


reversal, it is always possible to show that the correlation function
CAB (t) is even or odd in time [see e.g. Berne and Pecora, 1976,
Hansen and McDonald, 1986].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

394

10.2.6 Dot shifting


We have seen the dot-shifting property before (problem 2.4) but
it is worth repeating here:

hA(0)B(t)i
= hA(0)B(t)i

(10-16)

A special case of this, which could also be deduced from the evenness of the autocorrelation function, is

hAAi
=0.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

395

10.2.7 Infinite time integrals


The time integral of a correlation function involving a time-derivative
may be evaluated (by parts) in terms of static quantities :
Z

dthA(0)B(t)i
= hABi
(10-17)
0
Z

dthA(0)
A(t)i
= hAAi
=0.
(10-18)
0

The last equation is a special case for autocorrelations. Later, we


are going to discover thatRall transport coefficients can be written

A(t)i
with some choice of
as being proportional to 0 dt hA(0)
A (for example, in the case of diffusion, A = v, the velocity of a
particle). This appears to violate the equation we just proved, and
shows that we must take special care when considering transport
coefficients.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

396

Problem 10.1 Prove the following results for classical time correlation functions.
1. Use stationarity to show that
hA(0)A(t)i = hA(0)A(t)i .
2. Use stationarity to show that

hA(0)B(t)i
= hA(0)B(t)i
.
3. Use an integration by parts to show
Z

dthA(0)B(t)i
= hABi .
0

Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

397

10.3 Fourier and Fourier-Laplace transforms


This section simply summarizes properties of Fourier and FourierLaplace transforms, and may be skipped by those who are familiar
with them.
10.3.1 Basic definitions
Fourier transform FT:

C()
=

dt eit C(t) .

Inverse Fourier transform FT1 :


Z
1

.
d eit C()
C(t) =
2

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

398

Fourier-Laplace transform FLT:


Z

dt eit C(t) .
C()
=
0

Inverse Fourier-Laplace transform FLT1 :


Z
1

d eit C()
C(t) =
2
Z
1

d eit C()
0 =
2

Statistical Mechanics and Molecular Simulation

t>0
t<0

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

399

10.3.2 Real and even property of classical spectra


The FT of a classical autocorrelation function is real and even
() = C
AA () .
AA () = C
C
AA

(10-19)

10.3.3 Fourier transforms of time derivatives


The FT of single and double time derivatives may easily be related
to the spectrum of the original autocorrelation function
AA ()
AA() = iC
C
AA() = 2 C
AA ()
C
AA()
= C

Statistical Mechanics and Molecular Simulation

(10-20)
(10-21)
(10-22)

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

400

10.3.4 Fourier-Laplace transforms of time derivatives


The FLT of single and double time derivatives may also be related
to the spectrum of the original autocorrelation function, along
with some static correlations.
AA ()
AA() = CAA (0) + iC
C
AA ()
AA() = iCAA (0) 2 C
C
AA()
= C

Statistical Mechanics and Molecular Simulation

(10-23)
(10-24)
(10-25)

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

401

10.3.5 Low-frequency expansion


At zero frequency we get just the time integral of the associated
time correlation function. At low frequencies it is possible to generate an expansion based on moments of the correlation function,
provided the appropriate integrals converge.
Z

AA () =
dt CAA (t)
C


Z
2
dt t 2 CAA (t) + . . .
(10-26)

Z

Z

AA () =
dt CAA (t) i
dt tCAA (t)
C
0
0
Z

2

dt t 2 CAA (t) + . . . .
(10-27)

2
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

402

10.3.6 Short-time expansion


In a similar way, it is possible to express the short-time behaviour
of autocorrelation functions in terms of moments of the spectrum.
CAA (t) =

Z



Z
t2
2

dCAA ()
d CAA () + . . . .
2

(10-28)

10.3.7 High-frequency expansion


It is possible to deduce asymptotic expansions of spectra based
on short-time values of the original correlation functions
AA (0)/i3 + . . . .
AA () = CAA (0)/i C
C

Statistical Mechanics and Molecular Simulation

(10-29)

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

403

10.3.8 Convolution theorem


It is a well-known property of Fourier and Laplace transforms that
they resolve convolutions into products, for example
Z
dt 0 C1 (t 0 )C2 (t t 0 )
(10-30)
C(t) =
0

2 ()

1 ()C
C()
= C

Statistical Mechanics and Molecular Simulation

(10-31)

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

404

Problem 10.2 Prove the following relations for classical time correlation functions.
() = C
AA ().
AA () = C
1. C
AA
AA ().
AA() = iC
2. C
AA ().
AA() = 2 C
3. C
AA ().
AA() = CAA (0) + iC
4. C
AA ().
AA() = iCAA (0) 2 C
5. C
6. At low ,
AA () =
C

Z


2
2
dt CAA (t)
dt t CAA (t) + . . . .
2

Z

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

7. At low ,
AA () =
C

405

Z


Z

dt CAA (t) i
dt tCAA (t)
0
0
Z

2
dt t 2 CAA (t) + . . . .

2
0

8. At short t,
Z
 2 Z

t
2

dCAA ()
d CAA () +. . . .
CAA (t) =
2

9. At high (hint: let = it),


AA (0)/i3 + . . . .
AA () = CAA (0)/i C
C
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

406

10.4 Response and susceptibility functions


We found that our linear response theory gave us quite generally
hB(t)iA =

Zt
0

dt 0 BA (t t 0 )FA (t 0 ).

Assuming that A, B and FA are real, then the response function


BA (t) must also be real, whether we are in the classical or quan BA (); BA
tum case. We also define the susceptibility BA () =
is the FLT of BA (t) even though we dont usually put a tilde over
it. This is useful because
applied field
FA (t) = FA eit
FA (t) = FA cos t

=
=
=

long-time response
hB(t)iA = BA ()FA eit
hB(t)iA = Re BA ()FA eit

(Re means real part of).


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

407

In the following, for simplicity, we drop the subscripts. Since


(t) is real, we can write
() = 0 () i 00 ()
Z
0
() =
dt (t) cos t
Z0
dt (t) sin t .
00 () =
0

(10-32)
(10-33)
(10-34)

Both 0 and 00 are real. Moreover


Z
Z
2
2
d 0 () cos t =
d 00 () sin t .
(t) =
0
0
(10-35)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

408

0 and 00 are thus linked, by the Kramers-Kronig relations:


Z
2
0 00 (0 )
0
d0
(10-36)
() =
0
02 2
Z
2
0 (0 )
d0 2
(10-37)
00 () =
0
02
Also it is easy to see that 0 () = 0 (), 00 () = 00 (),
and () = (). All the above equations apply to both classical and quantum cases.
The classical and quantum formulations differ when we attempt to relate and to the equilibrium time correlation func

= hAB(t)i.
We
tions. In the classical case, BA (t) = hAB(t)i
shall see some quantum analogues of this later in the course.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

409

10.5 Conductivity, mobility and diffusion


This is the simplest application of linear response theory, and
indeed it is Kubos original one.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

410

10.5.1 Conductivity
We consider a dilute solution of ions, and focus on one ion. Choose
A in our linear response theory to be Qrx where Q is the charge
and rx is the x component of the position of the chosen particle.
is Qvx . Choose FA to be Ex , an electric
This means that A
field applied in the x direction, applied at time t = 0 and constant thereafter. Then HA = Qrx Ex . Measure, as B, the x
component of the induced current I(t) = Q
rx (t) = Qvx (t). So
Z
Q2 E t 0
dt hvx vx (t 0 )i
(10-38)
hI(t)iinduced =
kB T 0
and at long times t the steady-state current is
Z
Q2 E
dt hvx vx (t)i .
hI()iinduced =
kB T 0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

411

We can identify the conductivity


current
Conductivity =
field

Q2
=
kB T

Z
0

dt hvx vx (t)i .

However the charge and the field just provide a convenient physical handle on the chosen particle. We have equally well calculated
its mobility
Z
1
drift velocity
=
=
dt hvx vx (t)i .
Mobility =
force
kB T 0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

412

In a real system of ions at high concentration the total current


would involve all of them, the applied field would couple to all of
them, and the correlation function would involve self- and crossterms.
Mobility is related to diffusion = D/kB T . In one we apply a
force to get a drift, in the other random thermal forces operate.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

413

Problem 10.3 Investigate the connection between diffusion and


mobility. At long times, the mean-square displacement of an atom
increases linearly in time, according to Einsteins law of diffusion.
lim h|r(t) r(0)|2 i = 6Dt

or

lim h(rx (t) rx (0))2 i = 2Dt .

So we can define the diffusion coefficient by


D=

d
1
lim
h(rx (t) rx (0))2 i .
2 t dt

Rt
Using rx (t) = rx (0) + 0 dt 0 vx (t 0 ) relate D to the velocity autocorrelation function hvx (0)vx (t)i and hence the mobility. (Hint:
Rt
R t 0 R t 0 00
0
00
0 dt 0 dt f (t t ) = t 0 d(1/t)f () for any f .) Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

414

10.5.2 The velocity autocorrelation function


What can we say about the velocity autocorrelation function? A
short-time expansion gives
x it +
hvx vx (t)i = hvx vx i + hvx v
= hvx2 i + zero
= hvx2 i

1
x it 2 + . . .
hvx v
2

1 2 2
it + . . .
hv
2 x

1
hf 2 it 2 + . . . .
2m2 x

(10-39)

This shows that the initial downturn of the vacf is dictated by


the mean-squared force. Subsequent decay depends on particle
interactions.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

415

In a gas, memory is lost only slowly, at a rate determined by


the collision rate between atoms.
In a liquid, there is more rapid decay and, at high density,
rebound from the cage of nearest neighbours.
In a solid, there will be large-scale quasi-harmonic oscillations.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

416

Figure 10.1 Typical velocity autocorrelation functions in gas (red),


liquid (blue) and solid (black) phases, along with associated meansquare displacements.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

417

10.5.3 Measuring a time correlation function


The autocorrelation function is relatively straightforward to calculate, given a set of data points at regular time intervals. A simple
approach is (after zeroing the array c):
do dt = 0, nt-1
do t0 = 1, nt-dt
t = t0 + dt
c(dt) = c(dt) + x(t0)*x(t)
enddo
enddo
do dt = 0, nt-1
c(dt) = c(dt) / real(nt-dt)
enddo

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

418

Note that c(0) will store correlations between functions at the


same time, c(1) is for functions one time step apart and so on.
The main loop is over time differences and time origins; it is necessary to calculate the upper limit of the inner loop to ensure that
we do not run beyond the end of the data. Because of this, the
normalizing constant (the number of time origins) is different for
each c(dt), and this is handled in the last loop.
All this assumes that we need to calculate the correlation function out to the longest possible time, almost the whole run length.
This is highly unlikely to be the case, and anyway the long-time
values will be subject to very poor statistics. A great improvement in efficiency can be obtained by reducing the upper limit of
the outer loop.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

419

Problem 10.4 Download from the course home page the programs and starting configurations for this problem. You are given
a Lennard-Jones molecular dynamics program which writes out all
the velocities of all the atoms to a binary file at each step. Also
provided are starting configurations for systems believed to be
in the solid ( = 1.1, T 0.7), liquid ( = 0.85, T 0.8), and
supercritical fluid ( = 0.3, T 2.0) states. Lastly, a program is
provided to compute the velocity autocorrelation function from
the binary file of atom velocities.
Run the MD program, starting from each configuration in turn,
for 2048 steps, with t = 0.01, rc = 2.25, and obtain the vacf for
each system. You should only need to plot it over the first 100
steps. Check that your results match, qualitatively, the sketches
in Fig. 10.1. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

420

10.6 Impulsive perturbations


To calculate the mobility, we used a force applied to one atom
continuously from t = 0. Consider instead an impulsive force
FA = v(t) where v is a constant; it is easy to see that the
response in the atomic velocity will then be
hvx (t)iinduced

v
hvx vx (t)i
kB T
= vcvv (t)
=

where cvv (t) is the normalized correlation function and we used


the fact that hvx2 i = kB T . (We take m = 1 throughout). So the
velocity response actually is proportional to the velocity autocorrelation function. We can see that the (average) initial velocity is
v, as we would expect, and it decays away to zero as t .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

421

Problem 10.5 Adapt the program supplied in problem 10.4 to


demonstrate this effect. Remove the parts of the runner routine
which write out all the particle velocities to a binary file. Add
a statement which gives particle #1 a kick v at the start of
each block (and give each other particle a kick of v/(N 1)
so as to conserve momentum). Then store the velocity of particle
#1 as a function of step number within the block, obtaining the
time-resolved velocity response. Average this function over all
the blocks, and print it out. Run this program, starting from each
of the starting configurations supplied in the previous problem,
running for (say) 50 blocks of 100 steps each. Compare with the
equilibrium velocity correlation function calculated previously in
each case. Hint: you will need to experiment with the size of v: it
should be large enough to give an acceptable signal-to-noise ratio
when averaged over 50 blocks, but small enough to cause only a
little heating up of the system. Answer provided.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

422

10.7 Measuring the diffusion coefficient


We saw earlier the link between the diffusion coefficient, the meansquare displacement, and the velocity
autocorrelation function.
Rt
Because rx (t) = rx (t) rx (0) = 0 dt 0 vx (t 0 ), There are several
equivalent ways of writing the results.
D

=
=

E
d D
1
lim
(rx (t) rx (0))2
2 t dt
E
d D
1
lim
rx (t)2
2 t dt
lim hvx (0) (rx (t) rx (0))i

lim hvx (0)rx (t)i


t
Z
dt hvx (0)vx (t)i
=

=
D

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

423

Figure 10.2 Three different ways of calculating the diffusion coefficient.

Statistical Mechanics and Molecular Simulation

0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111
0000000000000
1111111111111

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

424

Problem 10.6 Adapt the programs supplied in problem 10.4 to


calculate the diffusion coefficient in these three different ways.
You will need to change the MD program so that it writes out to
the binary file all the coordinates as well as the velocities. Then the
basic structure of the analysis is the same, whether you are computing h(rx (t)rx (0))2 i, hvx (0)(rx (t)rx (0))i or hvx (0)vx (t)i.
There is one thing to beware of in calculating rx (t) = rx (t)
rx (0): you must eliminate all the jumps due to minimum-imaging
the coordinates! One way to do this is to calculate each difference
between successive time steps, rx = rx (t +t)rx (t), minimum
image it, and add it back on to rx (t) to obtain the new rx (t + t),
sweeping forwards in time through the whole trajectory.
Run for the same systems supplied in problem 10.4, check that
your results match, qualitatively, the sketches in Fig. 10.2, and
that the different methods agree with each other. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

425

10.7.1 Frequency-dependent conductivity


Suppose we apply an electric field E(t) = E cos t and measure
the current.
Z
Q2 E t 0
dt cos (t t 0 )hvx vx (t 0 )i
hI(t)iinduced =
kB T 0
Zt
Q2 E
dt 0 cos t 0 Cvv (t 0 )
cos t
=
kB T
0
!
Z
+ sin t

dt 0 sin t 0 Cvv (t 0 )

If we allow t the integrals take their limiting values.


Z

Q2 E
dt 0 cos t 0 Cvv (t 0 )
cos t
hI(t)iinduced =
kB T
0
Z

0
0
0
dt sin t Cvv (t ) .
+ sin t
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

426

In a more compact notation E(t) = Eeit


Z
Q2 E it 0 it 0
e
hI(t)iinduced =
dt e
Cvv (t 0 ) .
kB T
0
If we write this as Ieit then I = ()E with
Z
Q2
Q2
C() .
dt eit Cvv (t) =
() =
kB T 0
kB T
Both real and imaginary parts of () are relevant in real experiments! We write () = 0 () i 00 () so
Z
Q2
dt cos t Cvv (t)
0 () =
kB T 0
Z
Q2
00
dt sin t Cvv (t) .
() =
kB T 0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

427

Then reverting to E(t) = E cos t


hI(t)iinduced /E = 0 () cos t + 00 () sin t .
In the general case () becomes a generalized susceptibility BA ()
which is related to the response function BA (t):
hB(t)iA

Zt
0

dt 0 BA (t t 0 )FA (t 0 )

= BA ()FA eit

(10-40)

if we have FA (t) = FA eit . We have set


Z
BA () =
dt eit BA (t) .
BA () =
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

428

10.8 Dipolar systems and dielectric response


Consider now a dilute system of polar molecules. Here we look
at the static and dynamic dielectric response to an electric field
Ex (t). This is another test-bed for our methods, and it leads us
naturally into spectroscopy. Assume, for simplicity, that the local field Eloc (the field the molecules actually experience) and the
applied field E are the same.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

429

Problem 10.7 The field couples to the total dipole moment of the
system, the x-component of which is the sum over all molecules
P
x =
i ix . Specifically the extra term in the hamiltonian is
x Ex (t).
Obtain the dipole hx (t)i as a function of time, if the field
is switched on at time t = 0, remaining constant thereafter.
Write down the t limit of this, noting that all timedependent quantities disappear. Obtain an expression for
the polarizability (or the electric susceptibility or relative
permittivity) of the system in terms of static fluctuations
in .
Now consider applying an oscillatory field Ex (t) = E cos t.
Obtain the long-time response in hx (t)i: this will also oscillate at frequency , and we may define a frequency-dependent
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

430

susceptibility or relative permittivity. How does this vary


when 0 or when ?
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

431

Note that, as in the case of conductivity, we have oversimplified the model. Dipole fluctuations may be due to rotating or
vibrating molecules, and involve intermolecular correlations, as
illustrated in the accompanying figure.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

432

Figure 10.3 Sources of dipole fluctuations in liquids. From left


to right: rotating polar molecules; vibrating molecules; collisions
between atoms.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

433

Here we calculate the rate of change of energy of a system


subject to a perturbation. Consider a classical system with HA =
H0 (q, p) FA (t)A(q, p). Write
d
d
A (t) .
hHA (t)iA =
Tr%A HA (t) = Tr%A H
dt
dt
HA (t) depends on time both through the evolution of the coordinates and through the explicit time dependence of FA (t). The
former is handled in the usual Poisson bracket way, and vanishes:
A (t) = Tr%A (HA , HA ) + Tr%A
Tr%A H
=

HA
t

dFA
dFA
Tr%A A =
Tr%A A .
dt
dt

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

434

If FA (t) = FA cos t we can calculate the mean rate of change


of energy, averaged over each cycle. From the usual linear-response
formula for hAiA ,
Z
FA (t) t 0
d

dt FA (t t 0 )hA(t 0 )Ai
hHA i =
dt
kB T 0
and with FA (t) = FA cos t, FA (t) = FA sin t,
FA (t t 0 ) = FA cos t cos t 0 + FA sin t sin t 0
we have, at long times,
d
hHA i =
dt
+

Z

FA2

sin t cos t
dt 0 cos t 0 hA(t 0 )Ai
kB T
0
Z

2
0
0
0
dt sin t hA(t )Ai .
sin t
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

435

Averaging over a cycle destroys the first term, while the second
1
term is easy to calculate: hsin2 ticycle = 2 , so
d
hHA icycle
dt

FA2
2kB T

Z
0

dt 0 sin t 0 hA(t 0 )Ai

Z
FA2 0
0 )i
dt sin t 0 hAA(t
=
2kB T 0
Z
2 FA2 0
dt cos t 0 hAA(t 0 )i
=
2kB T 0
=

2 FA2
AA () .
C
4kB T

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

10

LINEAR RESPONSE THEORY

436

Note that, in the language of response functions and susceptibilities,

AA (t) = (kB T )1 hA(t)Ai


AA () AA () 0 () i 00 ()

AA
AA
it is the imaginary (out-of-phase) part of the response which governs the dissipation of energy
FA2
d
hHA i =
dt
2kB T

Z
0

=
dt 0 sin t 0 hA(t 0 )Ai

FA2 00
AA
2

This result is quite general; in our case we simply take A = to


relate dielectric absorption to the dipole correlation function.
In the quantum-mechanical case, a very similar result may be
obtained; the form of the prefactor is a little different.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

437

11 Spectroscopy, correlation and relaxation


In this section we discuss the relationship between adsorption
spectroscopy experiments and the correlation functions introduced
earlier.

11.1 Spectroscopy
A typical spectroscopy experiment measures the absorption of
electromagnetic radiation as a function of frequency. Here we
look at dipole absorption as a simple example, but the derivation
is very general.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

438

11.1.1 The absorption coefficient


As light passes through a sample its intensity decreases according
to the Beer-Lambert law
I(z) = I(0) exp{z} .
The physically relevant quantity is the absorption coefficient .
We can see that
dI
dS
= S 1
= I 1
dz
dz
where S is the energy flux (energy per unit time per unit area).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

439

S is related to the refractive index n and the electric field am1


plitude F : S = 2 nc0 F 2 , but well ignore those factors. The important thing is that it dictates the rate of absorption of energy in
a volume V . Specifically
dE
dt
dE/dt
VS

= (Sin Sout ) A =
=

dS/dz
=
S

dS
dS
Az =
V
dz
dz

so is essentially proportional to dE/dt.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

440

Figure 11.1 Energy flux through an absorbing medium.

Sin

Sout
z

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

441

11.1.2 Classical spectroscopy


For classical dipole absorption we have already calculated this:

2 FA2
dE
().
=
C
dt
4kB T

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

442

11.1.3 Quantum spectroscopy


There will be many subscripts here, so let the equilibrium hamiltonian and density matrix be denoted H and % rather than H0
and %0 respectively. We apply an oscillatory perturbation to the
system, and for notational simplicity absorb the amplitude of the
applied field into the dynamical variable to which it couples, i.e.
we set HA = H A cos t. Then we adopt a basis set n in
which H , and hence %, are diagonal, i.e.
Hmn
%mn
(eiH t/ )mn

= (m |H
| n) = En mn ,


H
n = eEn mn
=
m e




=
m eiH t/ n = eiEn t/ mn .

Note that, for economy,R we have slipped into Dirac notation where
. . . . As a further help, we get rid
(m| . . . |n) is short for drm
n
of the  factors by defining n = En / and let nm = n m .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

443

The derivation starts with Fermis Golden Rule, a standard result of quantum mechanics. This gives the probability per unit
time, Pmn , that the applied perturbation induces transitions between a given pair of states m and n:
Pmn =

|Anm |2 {(nm ) + (nm + )} .


22

1
There are two delta functions because cos t = 2 (eit + eit ).
The square modulus of the matrix element can be written



|Anm |2 = |(n |A| m)|2 = m A n (n |A| m)
and it is the transition moment. It must be nonzero for any transition to occur between these two states, and its vanishing (by
symmetry for example) is the source of spectroscopic selection
rules.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

444

The rate of change of energy of the system may be straightforwardly written as a sum over pairs of states, each term being the
product of Pmn , the energy involved in the transition, nm ,
and the population of the initial state %mm :
dE
dt

=
=

XX
n m

XX
n m

%mm nm Pmn


%mm

nm |Anm |2 ((nm ) + (nm + )) .


2

Switching indices n m in the terms involving (nm + ), and


noting that mn = nm gives
XX

dE
=
nm |Anm |2 (nm ).
(%mm %nn )
dt
2
n m

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

445

Now we note that %nn = enm %mm , so



XX

dE
=
nm |Anm |2 (nm ) .
1 enm %mm
dt
2
n m
We can intoduce the Fourier representation of the delta function
Z
1
dt eit
() =
2
to give us


dE
= 1 e
dt
4

dt eit

XX
n m

%mm einm t |Anm |2 .

On the right we see the Fourier transform of a statistical average


of some kind. At this point it is worth sneaking a look at the
final answer, eqn (11-1). The integral is the Fourier transform of
a correlation function.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

446

To complete the derivation, we expand the matrix elements,


and slip the einm t factor into one of them, noting that it is actually
eiEn t/ eiEm t/ . Then it is almost automatic:
XX
%mm einm t |Anm |2 =
n m

=
=
=
=
=

XX
n m

XX
n m

XX
n m

XX
n m

X
m



%mm einm t m A n (n |A| m)





%mm m A n n eiEn t/ AeiEm t/ m





%mm m A n n eiH t/ AeiH t/ m


%mm m A n (n |A(t)| m)



%mm m A A(t) m = A A(t)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

447

So our final result is not too complicated after all:




dE
AA () .
= 1 e
C
dt
4

(11-1)

On the right we have the Fourier transform of a (quantum) time


correlation function. A and A(t) do not commute in general, so
we mustnt try to slip them past each other. In the classical limit
 0 the factor in front of the integral becomes 2 /4kB T , which
is what we obtained from the purely classical derivation.
It is possible to repeat the above derivation, but eliminate %mm
in favour of %nn instead of vice versa. This leads to
 Z


dE

1
dt eit A (t)A
=
e
dt
4



AA () .
C
1
(11-2)
=
e
4

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

448

Combining our results we can also write


Z


dE
dt eit A A(t) A (t)A
=
dt
4
Z



dt eit [A , A(t)] .
(11-3)
=
4
The complex conjugation can, of course, be dropped if A is real.
The commutator here has a familiar look, and translates over into
the Poisson bracket when we take the classical limit. All these
Fourier transforms of quantum time autocorrelation functions are
manifestly real and positive, because of this link with energy dissipation.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

449

Another consequence of these last expressions is that, if we


write
Z

dt eit hAA(t)i
CAA () =

dt eit hAA(t)i
CAA () =

Z
dt eit hAA(t)i
=

then it follows that


AA ().
AA () = e C
C

(11-4)

This condition is called detailed balance. The physical reason for it


is obvious: states of lower energy are more heavily populated than
high energy states, so corresponding upward and downward transitions ( ) will be weighted accordingly. Thus we see that,
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

450

although quantum spectra are real and positive, like their classical counterparts, they are not even. The odd part, responsible
for asymmetry in the spectra, means that the quantum one-sided
time correlation function hAA(t)i is complex.
In the following problems we consider quantum correlation
functions, and the prospect of quantum-correcting classical results. The analogy between = 1/kB T and an imaginary time it/
starts to appear. Indeed, the analogy between the canonical distribution eH and the time-displacement operator eitH / may
already have been noticed, and there is a similarity between the
time-dependent Schrodinger equation
i/t = H
and the Bloch equation satisfied by the density matrix
%/ = H % .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

451

Let
CAB (t) = hAB(t)i
and
AB () =
C

dt eit hAB(t)i .

In the following, A and B(t) do not commute, CAB (t) is not real,
AB () is not even (or odd for that matter).
and C

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

452

Problem 11.1 Prove


Z
Z
it

dt e
hAB(t)i = e
dt eit hB(t)Ai

(where = 1/kB T ). Hint: introduce the time-displacement operator and aim to change variables to = t i. Answer provided.

(t). Hint: start from the fact


Problem 11.2 Prove CAA (t) = CAA
AA () is real, which is easy to show, for example in the
that C
representation which diagonalizes the density matrix:
XX
AA () =
%mm |(m|A|n)|2 ( nm ) .
C
n m

Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

453

Problem 11.3 If A and B correspond to observables, i.e. they are


Hermitian, then the response function BA (t) should be real. If
BA (t) = (i)1 h[A, B(t)]i, prove that BA (t) is real, and that
BA (t) = AB (t). Hence show that AA (t) is real and odd.
Hints: prove that it is real from the fact that A and B are Hermitian; prove the symmetry under time reversal from the stationarity
condition. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

454

Finally we turn our attention to quantum corrections. Suppose


cl
(t), real and
we have a model classical correlation function CAA
even, which we wish to compare with actual (quantum-mechanically
correct) data. Specifically, we want to satisfy the detailed balance
AA (); obviously C cl (t) doesnt satAA () = e C
condition C
AA
isfy this. Egelstaff and Schofield suggested, respectively, replacing
1
t by where = t 2 i or 2 = t 2 it to achieve this.
1

cl
(), with = t 2 i
Problem 11.4 Show that the function CAA
cl
(t) is real
satisfies detailed balance. Hint: you may assume CAA
cl

and even, as is CAA (). Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

455

11.2 Correlation and relaxation


Here we establish the link between equilibrium time correlation
functions and relaxation from an initial condition. We motivate
this through magnetic resonance experiments, although the approach is very widely applicable.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

456

11.2.1 The experimental connection


The prototype equations turn up in magnetic resonance. In these
experiments, a magnetic field is applied in the z direction, and
the magnetic vector of radiation interacts with the overall magnetization. The measured spectra can be related to the Fourier
transforms of the transverse correlation function
C (t) = hMx Mx (t)i = hMy My (t)i
and the longitudinal correlation function
C k (t) = hMz Mz (t)i.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

457

However, pulse experiments allow studies to be carried out in


the time domain, and these are usually analyzed in terms of the
macroscopic Bloch equations
dhMx i
dt
dhMy i
dt
dhMz i
dt

hMx i
T2
hMy i
= 0 hMx i
T2
0
hMz i hMz i
=
T1
= 0 hMy i

(11-5)

where T1 and T2 are longitudinal and transverse relaxation times


respectively, hM0z i is the static magnetization in the applied field,
and 0 is the Larmor precession frequency. Clearly the variables
here are macroscopic, nonequilibrium averages. They decay exponentially (with 0 oscillations).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

458

Intuitively we see that this must be associated with exponential


decay of the equilibrium correlation functions C (t) and Ck (t),
and hence Lorentzian spectra (which are in fact observed). Can we
establish the connection? Another interesting point about magnetic resonance in liquids: the lines are motionally narrowed. The
lower the viscosity, the more mobile the atoms, the narrower the
lines in the spectrum. Lines in the solid are very broad (and not
Lorentzian). Why is this?

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

459

11.2.2 The relaxation function


Here we investigate the link between the response function BA (t),
and the law governing relaxation of a macroscopic perturbation
to equilibrium. Assuming a perturbation of the form
HA = H0 FA (t)A(q, p)
applied from a time t = 0, recall that BA (t) is defined by
hB(t)iA =

Zt
0

Statistical Mechanics and Molecular Simulation

dt 0 FA (t t 0 )BA (t 0 ).

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

460

Suppose now that a constant perturbation FA has been switched


on for ages, producing a steady non-equilibrium value hBiA , and
it is switched off again at time t = 0. This can be thought of as
superimposing the effects of a perturbation FA acting since time
immemorial
Z
hBiA = FA

dt 0 BA (t 0 )

onto those of a perturbation FA switched on at time t = 0


hB(t)iA = FA

Zt
0

dt BA (t t ) = FA

to obtain
hB(t)iA = FA

Statistical Mechanics and Molecular Simulation

Z
t

Zt
0

dt 0 BA (t 0 )

dt 0 BA (t 0 ).

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

461

So we can write this in terms of a relaxation function defined


by
hB(t)iA = FA BA (t)

with

BA (t) =

Z
t

dt 0 BA (t 0 ) .

(11-6)
There are other ways of treating this, notably by letting FA (t) =
FA exp(t)(t) where (t) = 1 for t < 0, (t) = 0 for t > 0, and 
is a small parameter ( 0 at some point). However, this gets a
little more complicated. In the classical case

AB (t)
= C
BA (t) = hAB(t)i

(11-7)

BA (t) = CAB (t)

(11-8)

a nice result. Relaxation and correlation are directly connected.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

462

If the correlation function CAA (t) decays exponentially


CAA (t) = CAA (0)et/tA
we see directly:
hA(t)iA = FA CAA (t) = FA CAA (0)et/tA
so

hA(t)iA
d
hA(t)iA = FA CAA (0)et/tA /tA =
.
dt
tA

So we see where the Bloch equations come from.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

463

11.2.3 The Langevin equation


Suppose that a dynamical variable approximately obeys the equation

(11-9)
A(t)
= A(t)/tA + A(t)

represents a random
where tA is the relaxation time and A(t)
process. We can assume that

hA(t)i
= 0

A(t
t0 )i

hA(t0 )A(t)i = hA

hAA(t)i
= 0
(t > 0)

(zero mean)
(stationarity)
(uncorrelated with A)

Eqn (11-9) is called the Langevin equation. A formal solution is


Zt
0
t/tA
t/tA
0 ).
+e
dt 0 et /tA A(t
A(t) = A(0)e
0

If we accept the Langevin equation, it follows that the correlation


function of A decays exponentially.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

464

Problem 11.5 Show that hAA(t)i = hA2 iet/tA for this model.
Hint: start with the formal solution, multiply by A(0) and average.
Answer provided.
R
1

= hA2 i1 0 dt et/tA hA(0)


A(t)i
Problem 11.6 Show that tA
for this model. Hint: start by squaring both sides of the formal
solution, and then average. Then, one approach is to change variables to t = t 00 t 0 and t+ = t 00 + t 0 . Answer provided.

We can define a correlation time tA


for the random variable A
2

i1
tA
= hA

Statistical Mechanics and Molecular Simulation

Z
0

dt hA(0)
A(t)i.

M. P. Allen 1999

11

SPECTROSCOPY, CORRELATION AND RELAXATION

465

If tA
A(t)i
will decay to zero quickly and we
 tA , then hA(0)
can set exp(t/tA ) = 1 to obtain
1
tA

2 1

= hA i

Z
0

i
hA

t
dt hA(0)
A(t)i
=
hA2 i A

So, the two correlation times are inversely related. As the random
motions become faster (representing the effects of the surroundings), so the motions of the variable of interest, A, become slower,
and the spectrum becomes narrower. Now we know where the
motional narrowing comes from.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

466

12 Transport coefficients
12.1 The projection operator formalism
A more formal approach to the Langevin equation. Here we establish the importance of timescale separation.
12.1.1 Projection operators
We use two operators to split the dynamical variables into two
categories: a set A of direct interest, and the others. Of course
A can be a single variable, but the formalism applies to a set
or vector A {Ai }, and products AB are then dyadic matrices
{Ai Bj }. Here we just treat A as a single variable.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

467

The operators are called P and Q, and they obey P + Q = 1. We


define P such that
PB hA2 i1 hABiA

(12-1)

where B is anything; h. . .i stands for the usual ensemble average.


P and Q are Hermitian, and idempotent, i.e. P2 = P and Q 2 = Q.
This is sufficient to allow us to call P and Q projection operators.
Problem 12.1 Prove these last two equations. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

468

12.1.2 The generalized Langevin equation

We start with the Liouville equation in the form A(t)


= eiLt iLA.
Inserting P + Q = 1 gives

A(t)
= eiLt PiLA + eiLt QiLA .
The first term is easy: we can write

iA(t).
eiLt PiLA = hAAi1 hAAiA(t)
i is called the frequency matrix; it corresponds to the Larmor
frequency in the Bloch equations.
Problem 12.2 It is easy to see that i = 0 in the single-variable
case. Why is this? Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

469

To tackle the other term we need an operator relation.


iLt

QiLt

=e

Zt

dt 0 eiL(tt ) PiLeQiLt

which holds for any two operators P and Q satisfying P + Q = 1.


Problem 12.3 Prove this. The easiest way is (a) check that it is
true at t = 0 and (b) time differentiate. Answer provided.
Accepting the above relation, we operate on QiLA, giving
= iA(t) +
A

Zt
0

dt 0 eiL(tt ) PiLeQiLt QiLA

+ eQiLt QiLA .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

470

which
At this point it is useful to define the random force A,
evolves in a slightly unusual way:
QiLA Q A

A
.

A(t)
eQiLt A

Note that A(t)


= Q A(t)
since eQiLt Q = QeQiLt Q. This tells us

that hAA(t)i
= 0, i.e. the random force (at later times) is un always
correlated with A. Another way of saying this is that A
evolves in the space of variables orthogonal to A. Incorporating
these definitions the equation of motion becomes
= iA(t) +
A

Zt
0

0 ) + A(t)

dt 0 eiL(tt ) PiLA(t
.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

471

Spot the projection operator P in the integral. This is bound


to give us something proportional to A. What can it be?
0 ) = hAAi1 hAiLQ A(t
0 )iA
0 ) = PiLQ A(t
PiLA(t
0 )iA
= hAAi1 h(QiLA)A(t
A(t
0 )iA
= hAAi1 hA
M(t 0 )A
M(t) is called the memory function (in general a matrix). An optimist would regard this as an impressive transformation of our
original equation of motion. A cynic would say that we have simply given a name to our pain.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

472

Lets summarize our result, the generalized Langevin equation

A(t)
= iA(t)

Zt
0

dt 0 M(t 0 )A(t t 0 ) + A(t)


.

(12-2)

The memory function and the correlation function are easily related by multiplying by A and ensemble averaging:
AA (t) = iCAA (t)
C

Zt
0

dt 0 M(t 0 )CAA (t t 0 )

and a Fourier-Laplace transform gives


AA () =
C

Statistical Mechanics and Molecular Simulation

CAA (0)
.

i i + M()

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

473

12.1.3 Short memories


Happiness is ours if we postulate that M(t) decays rapidly with
time, say M(t) 2 (t), where is some constant, given by
Z

dt M(t) = M(0)
.
=
0

Then the convolution integral can be performed immediately, converting the generalized Langevin equation into the strict Langevin
equation

A(t)
= (i )A(t) + A(t)
.
(12-3)
This gives the exponential (in general, oscillatory) decay of CAA (t)
AA (t) = (i )CAA (t)
C
seen, for example, in the Bloch equations. The key assumption
M(t) (t) is built into the Bloch equations.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

474

The Fourier-Laplace transform of M(t) is just a constant M()


=
, so
AA () = CAA (0) .
C
i i +
The combination i is sometimes just called the transport
matrix, and its eigenvalues are the decay rates and oscillation frequencies. The spectra are combinations of Lorentzians.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

475

12.1.4 Timescale separation


correlaConsider for simplicity one variable only. Suppose the A
tions decay exponentially on a fast, molecular time scale tA
. Then
Ai
exp(t/tA
M(t) = hAAi1 hA
)
and the correlation time for A is just given by
1
Ait
A
= = hAAi1 hA
tA
.

This is the motional narrowing, seen earlier.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

476

and A
in more
Its worth considering the difference between A

detail. Fig. 12.1 compares hAA(t)i and hAA(t)i. The idea is


that, if correlations of the variable of interest decay slowly com A(t)i

pared with the random force, the time integrals of hA


and

hAA(t)i are almost the same, as far as the typical observation


time, where it is expected that a plateau value will be seen. Then,
A(t)i

the integral of hA
decays slowly back to zero, while that of
the random force does not.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

477

A(t)i

A(t)i;

Figure 12.1 (a) hAA(t)i; (b) hA


and hA
(c) the time

integrals of hAA(t)i and hAA(t)i.


1
0.9

(a)

(b)

0.8
0.7
0.6

0.5
(c)

0.4
0.3

plateau
0.2
0.1
0

observation time
0

2
t

Statistical Mechanics and Molecular Simulation

2
t

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

478

12.2 Single-particle motion


Here we discuss the translational motion of atoms, with incoherent neutron scattering as the experimental motivation. Our discussion is entirely within the classical framework.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

479

12.2.1 Scattering functions and dynamics


This is just a reminder of material which may be familiar to you.
P
We are interested in the particle density (r, t) = i (r ri ) and
P

its Fourier transform (k,


t) = i exp(ikri (t)). Correlations of
these two quantities are measured by the dynamic pair correlation
function
(12-4)
G(r, t) = 1 h(0, 0)(r, t)i
and the intermediate scattering function
Z

0)(k,
t)i . (12-5)
I(k, t) = dr exp(ik r)G(r, t) = N 1 h(k,
Dynamic neutron scattering actually measures the Fourier transform of I(k, t)
Z
1
dt eit I(k, t) .
(12-6)
S(k, ) =
2

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

480

In each case an analogous single-particle function can be dei (k, t) = exp(ik ri ):


fined, based on i (r, t) = (r ri ) and
Gs (r, t) = V hi (0, 0)i (r, t)i
(k, 0)
i (k, t)i
Is (k, t) = Nh
Z i
Ss (k, ) =
dt eit Is (k, t)

(12-7)
(12-8)
(12-9)

The single particle function gives incoherent contributions to the


scattering. Here we concentrate on these single-particle functions.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

481

Problem 12.4 Liquids are translationally (and rotationally) invariant. No equilibrium average should depend upon the absolute
position (or orientation) of our coordinate frame. If
Gs (r, t) = V hi (0, 0)i (r, t)i
show that
Gs (r, t) = h(r + ri (0) ri (t))i

Z
=
dr (r + ri (0) r0 )(r0 ri (t))
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

482

Problem 12.5 If we define


A(r, t) =

Ai (t)(r ri (t))

and
A(k, t) =

Z
dr exp(ik r)A(r, t) =

Ai (t) exp(ik ri (t))

then show that hA(k, 0)B(k0 , t)i = 0 unless k+k0 = 0. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

483

12.2.2 The diffusion equation


First, lets check the meaning of Gs (r, t). Recall that the relaxation
function and the correlation function are essentially the same.
Gs is the correlation between a couple of -functions of position:
one at time 0 and the other at time t. Hence it measures the
value of h(r, t)inoneq subject to an initial nonequilibrium condition (r, 0) = (r) at the origin. In words, it is the probability
density for finding a particle at position r at time t given that it
was at the origin at time 0. At long times we expect the relaxation
to be governed by the macroscopic diffusion equation

hi (r, t)inoneq = D2 hi (r, t)inoneq


t
and so

hi (0, 0)i (r, t)i = D2 hi (0, 0)i (r, t)i .


t
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

Hence

484

Gs (r, t)
= D2 Gs (r, t)
t

valid at large t and r . The solution of this equation is well known,


given the initial condition Gs (r, 0) = (r). We get
!
3/2

1
r2
exp
Gs (r, t) =
4 Dt
4Dt
Is (k, t) = exp(k2 Dt)
Ss (k, ) =

Dk2
2 + (Dk2 )2

This spectrum is a Lorentzian of width 2Dk2 , and is quite


typically observed in quasielastic light and neutron scattering.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

485

12.2.3 Short-time behaviour


At short times these functions behave differently. We expect the
short-time expansion ri (t) ri (0) = vi (0)t. Moreover the velocity
has a Gaussian distribution; hence (ri (t) ri (0))/t is also Gaussian. From this we deduce
!

3/2
m
m r2
exp
Gs (r, t) =
2 kB T t 2
2kB T t 2


kB T 2 2
k t
Is (k, t) = exp
2m
!
1/2

m
m 2
exp
Ss (k, ) =
2 kB T k2
2kB T k2
Presumably a changeover from short-time to long-time behaviour
is seen in real experiments.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

486

12.2.4 The Gaussian approximation


Suppose that the velocity and displacement are distributed in a
Gaussian fashion at all times (we saw above that this is true at
short and long times). Define a width function
w(t) =

2
h|ri (t) ri (0)|2 i .
3

At short times w(t) = (2kB T /m)t 2 while at long times w(t) =


4Dt. Assuming Gaussian behaviour, at all times we can prove
that
Gs (r, t) = ( w(t))3/2 exp(r 2 /w(t))
Is (k, t) = exp(k2 w(t)/4) .
Non-Gaussian corrections have been investigated by Rahman [1964].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

487

Problem 12.6 Here we investigate the Gaussian approximation to


the intermediate scattering function Is (k, t). A Gaussian variable
x is distributed according to the probability density function
!
x2
2 1/2
exp
f (x) = (2 )
2 2
where is the standard deviation and we have chosen hxi = 0.
Each component of a vector (say) might be an independent Gaussian variable. Moments are defined
Z
dx x m f (x)
hx m i =

(the odd ones vanish).


Show that hx 2m i = 1 3 5 . . . (2m 1)hx 2 im .
1

Show that heix i = exp( 2 hx 2 i).


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

488

Show that, if we adopt the Gaussian approximation for ri (t)


ri (0),

E
1 2D
2
Is (k, t) exp k |ri (t) ri (0)|
.
6
Hence show that, in this approximation, at long times, we
expect


Is (k, t) exp k2 Dt


Gs (r, t) (4 Dt)3/2 exp r 2 /4Dt
Show that, at long times, the mean square displacement is
Z
hr 2 i = dr r 2 Gs (r, t) 6Dt
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

489

12.2.5 Memory function approach


Apply the projection operator method to the variable
A(t) = i (k, t) = exp(ikrx (t))
where we take k in the x-direction and drop the i subscript. Then

A(t)
= ikvx (t) exp(ikrx (t)) .
The k-dependence in the exponential can be dropped in the low-k
limit, but the ik prefactor is important. The projected variable has
QiLA definition.
this same prefactor, by virtue of the iL in the A
Write

A(t)
= ikv x (t) exp(ikrx (t)) .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

490

The ik factor persists at all times; hence the memory function,


A(t)i,

proportional to hA
is proportional to k2 . The generalized
Langevin equation is
Is (k, t)
= k2
t

Zt
0

dt 0 hv x v x (t 0 )iIs (k, t t 0 )

Because of the k2 factor, the Is (t) function can be made to decay


arbitrarily slowly, relative to the memory function. We simply take
k 0. Physically, the observation time (the practical upper limit
of the integration, see Fig. 12.1) is limited by the distance ( k1 )
that a molecule can diffuse. In this limit we are allowed to replace
v x by vx ; moreover we can perform the integral while keeping Is
constant.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

The result is

491

Is (k, t)
= Dk2 Is (k, t)
t

as might have been expected; weve identified


Z
dt hvx vx (t)i .
D=
0

We expect this to be true at long times, and over large distances.


In a sense, weve derived the diffusion equation from first principles. Kushick and Berne [1976] calculated the memory functions
from molecular dynamics simulations, to test the underlying assumptions.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

492

Problem 12.7 Neutron scattering can, in principle, allow us to


determine the velocity autocorrelation function. Relate Is (k, t) at
low k to hvi vi (t)i. Hence relate Ss (k, ) at low k to the spectrum
of the velocity autocorrelation function. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

493

12.3 Collective motion


12.3.1 Conservation relations
We have, in macroscopic terms, the following conservation relations:
t) = m1 p(r, t)
(r,
(r, t) = P(r, t)
p
e(r, t) = je (r, t)
Here p is the local momentum density, P the local pressure tensor, e the local energy density and je the local energy current.
These local variables are based on large spatial regions; the time
variation occurs over long times. However, exact microscopic conservation relations also exist.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

494

Problem 12.8 Here we investigate one of the conservation laws.


These are neatly expressed in k-space. Define
X

exp(ik ri )
number density
(k,
t) =
i

(k, t) =
p

pi exp(ik ri )

momentum density.

Then it is easy to see that


X

(k, t)/m .

ri exp(ik ri ) = ik p
(k,
t) = ik
i

0 as k 0. Now show that


Clearly, (k,
t) is conserved, since
(k, t) is itself conserved, i.e. that
p

(k, t)
(k, t) = ik P
p

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

495

(k, t). Express your results in


and find the form of the tensor P
terms of rij = ri rj , the vector between pairs of atoms, and fij ,
the force on i due to j. (Hint: Newtons law fji = fij will be
useful.) Answer provided.
As in the single particle case, a link to equilibrium time correlation functions exists through relations of the kind hA(t)iA
hAA(t)i.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

496

12.3.2 Constitutive relations


Macroscopic hydrodynamics then proceeds by introducing the socalled constitutive relations.
For momentum flow we have
!
v (r, t) v (r, t)
+
P (r, t) = P (r, t)
r
r
2
+ ( ) v(r, t) .
3

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

497

This brings together three equations. In the absence of any


velocity fields P = P . It is useful to define P = P P . If
a uniform shear is applied, for example vy /x = with no other
gradients, then we get the usual definition of the shear viscos. Finally, a uniform dilation vx /x = vy /y =
ity: Pyx =
vz /z = gives Pxx = Pyy = Pzz = 3 . Introducing
p(r, t) = mv(r, t) and the momentum conservation relation followed by linearization gives the linearized Navier-Stokes equation:


1
+ ( v(r, t)) = 0 .
m
v(r, t) + P (r, t) 2 v(r, t)
3

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

498

For heat flow


je (r, t) = (e + P )v(r, t) T (r, t)
where T is the temperature gradient and the thermal conductivity. We introduce the heat density
!
e+P
(r, t)
Q(r, t) = e(r, t)

and the energy conservation equation gives


t) 2 T (r, t) = 0 .
Q(r,
We can go further, and eliminate the fluctuations Q and P in
t) = m1
favour of and T . If we include the relation (r,
p(r, t), we have a set of coupled linear differential equations in
the variables (r, t), T (r, t), and v(r, t).
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

499

12.3.3 Transverse and longitudinal modes


It is convenient to spatially Fourier transform the Navier-Stokes
equation:

(k, t) ikP(k, t) + k2
v(k, t)
mv


1
(k, t)) = 0 .
+ ik(ik v

3
The second and fourth terms lie along the k direction. We can
k (k, t) parallel to k, and
split the velocity field into components v

(k, t) perpendicular to k.
v

(k, t) + k2
v (k, t) = 0
mv
and



k
2 4

(k, t) ikP (k, t) + k


k (k, t) = 0 .
+ v
mv
3

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

500

, both clearly independent of each


There are two components of v
. These transother. Henceforth well just pick one and call it v
verse mode equations are very simple: well study them closely.
The remaining component v k is coupled in with the density and
thermal fluctuations. The resulting longitudinal mode equations
are a little more complicated, and well skip over those.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

501

12.3.4 Transverse modes


Directly from the above equations, defining
(k, 0)v
(k, t)i/h(v
)2 i
c (k, t) = hv
(k, t)i/h(p
)2 i
(k, 0)p
= hp
, we see
= mv
where p
c (k, t) =
or

k2
c (k, t)
m

k2
t
c (k, t) = exp
m

Statistical Mechanics and Molecular Simulation

!
.

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

502

Hence the Fourier-Laplace transform is


c (k, ) =

1
i + k2 /m

i.e. a Lorentzian about = 0. We can relate to the low (k, )


limit of this:
m
= lim lim k2 c (k, )

k0 0
Take care! Note the order of the limits.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

503

A memory function approach would give a similar result and


also provide a time correlation function formula for . Let
X
(k, t) =
pi exp(ik ri )
A=p
i

from which we have shown, in problem 12.8, that

=p
(k, t) = ikP
A

where P is an off-diagonal element of the pressure (or stress) tensor. The derivation exactly parallels that for the diffusion coefficient. The results are just as above, but now derived in a complete,
microscopic, formalism.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

504

Moreover, there is a zero-k formula for :


Z
1

dt hP (0, 0)P (0, t)i


=
m
NmkB T 0
or
=

1
V kB T

Z
0

dt hP (0, 0)P (0, t)i.

Notice that this is a low (k, ) limit, but with the k 0 limit taken
first. This formula is actually the standard way of calculating the
shear viscosity in a molecular dynamics simulation. There are
equivalent Einstein-relation versions of the formula just as for
diffusion.
We can systematically improve our theory by adding P to the
set of dynamical variables A. This leads to viscoelastic effects.
We dont have time to look at them here.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

505

Problem 12.9 The transverse momentum correlation function


)2 i1 hp
(k, 0)p
(k, t)i
c (k, t) = h(p
)2 i = NmkB T , may be used
perpendicular to k and h(p
with p
to define a generalized viscosity (k, ), via the Fourier-Laplace
transform:
1
.
c (k, ) =
2
i + (k /m)(k, )
1. Relate (k, ) to the memory function in a projection-operator
treatment of c (k, t).
2. Obtain an exact expression for (k, ), valid at zero and
nonzero k and , in terms of the off-diagonal pressure correlation function
C (k, t) = h(P )2 i1 hP (k, 0)P (k, t)i
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

12

TRANSPORT COEFFICIENTS

506

= ikP and h(P )2 i = V kB T G (G is the shear modwhere p


ulus). Check how this behaves when we do limk0 lim0
and when lim0 limk0 .

3. Consider applying a perturbation of the form HA = FA (t)A


P
with A = i rix piy , where FA (t) is zero for t < 0 and constant FA (t) = F for t > 0. Use linear response theory to write
down the nonequilibrium response of the pressure tensor
component hPxy (t)iA in terms of a correlation function and
interpret your result.
Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

507

13 Free energies and weighted sampling


A major drawback of molecular dynamics and Monte Carlo techniques, is that they calculate average properties. The free energy
and entropy functions cannot be expressed as simple averages of
functions of the state point . They are directly connected to the
logarithm of the partition function, and our methods do not give
us the partition function itself.
Nonetheless, calculating free energies is important, especially
when we wish to determine the relative thermodynamic stability
of different phases. How can we approach this problem?
Formally, we may write expressions allowing us to calculate
a free energy, but these typically involve averages of properties
whose most significant values are where the sampling is poorest.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

508

13.1 What we can and cannot do


Suppose we choose A( ) = exp{+E( )}, then
hexp{+E( )}iNV T

=
=
=

Nt
1 X
exp{+E(t )}
Nt t=1
P
exp{+E( )} exp{E( )}
P
exp{E( )}
N
QNV T

where N is the total number of states of the system. Unfortunately,


to get an accurate estimate of this average, we need to sample
where exp{+E( )} is high; our scheme has been designed to
sample where it is low. Thus, in general we cannot measure QNV T .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

509

However we can go some of the way along the above route,


and determine a free energy difference. We have seen already
(sec. 9.2.1) the derivation of the expression
F1 = F0 kB T ln hexp{E( )}i0 .
We can use this to estimate F1 F0 . One famous example of this
is where system 1 differs from system 0 by the addition of a particle: this leads to the Widom [1963] test-particle insertion method,
sec. 1.4.3, for estimating the chemical potential. Another example
is where a molecule in the system, perhaps a drug of some kind,
can be mutated into another possible drug, allowing estimates of
the relative binding free energies at a receptor site. The point
is that in this simple form the method will not work if the two
systems are very different from each other, because importance
sampling in the reference ensemble will not sample the states that
are important in the other one.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

510

13.1.1 Hard work


The ensemble average in the Widom formula
hexp{vtest }i0
is sometimes loosely referred to as the insertion probability. It
becomes very low for dense fluids, for example around the triple
point. For example, for hard spheres, we can use the scaledparticle theory [Reiss et al., 1959] or the Carnahan-Starling equation of state [Carnahan and Starling, 1969] to estimate it (see Fig. 13.1).
The insertion probability falls below 104 , well before the freezing transition at 0.49. Similar estimates can be made for the
Lennard-Jones fluid. The problem is particularly acute for molecular fluids where, as a first guess, one could take the overall Boltzmann factor to be the product of the individual atomic values.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

511

Figure 13.1 Insertion probability for hard spheres of various sizes


in the hard sphere fluid, as a function of packing fraction , predicted using scaled particle theory.

0.0

log10(insertion probability)

-1.0
-2.0
-3.0
-4.0
-5.0

=1.0

-6.0
-7.0
-8.0
0.0

0.1

0.2

0.3

Statistical Mechanics and Molecular Simulation

0.4

0.5

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

512

13.1.2 Excluded volume map sampling


What shall we do if Widoms method fails to give a reliable estimate of ex ? One practical improvement is to rapidly reject (or
not even attempt) very low probability insertion attempts. A simple method of improving the efficiency of test particle insertion
was proposed by Deitrick et al. [1989] [see also Yoon et al., 1981,
Lee et al., 1981]. The simulation box is divided into small cubic regions, which are assigned to two categories: the sampled volume
and the non-sampled (or excluded) volume. The non-sampled
cubes are those within which particle insertion (anywhere) would
make a negligible contribution to the Widom formula, due to overlap with one or more atoms: they are identified by scanning over
all atoms, and marking the cubes lying completely within a specified exclusion radius rexcl . This is illustrated in figure 13.2.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

513

Figure 13.2 Excluded volume map sampling.

sampling region

Statistical Mechanics and Molecular Simulation

excluded region

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

514

The actual test particle insertion is restricted to the unmarked


cubes, and this volume is sampled uniformly. Naturally this gives
a much higher acceptance rate, because the sampling is biased
towards the favourable regions, but this is simply corrected by a
factor (sampled volume/total volume). (For hard spheres, given
a fine enough mesh, the non-sampled volume becomes a good
estimate of the true excluded volume, and it gives the chemical potential directly.) Deitrick et al. [1989] tested the method
for Lennard-Jones atoms, using rexcl = 0.8 . In the dense fluid,
only 1% of the simulation volume remained to be sampled, so
the technique improved efficiency by two orders of magnitude.
Swope and Andersen [1995] have described a similar method in
connection with their bicanonical ensemble simulation technique.
Nonetheless, this method only works up to a point: at high densities the insertion probability is too low to be compensated by this
scheme.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

515

13.1.3 Mixtures and smaller particles


Suppose we have a two-component mixture, in which one of the
species, A, is smaller than the other, B. From figure 13.1, for hard
spheres, we can see that A need not be particularly small in order
for the test particle insertion probability to climb to acceptable
levels, even when insertion of B would almost always fail. In these
circumstances, the chemical potential of A may be determined
directly, while that of B is evaluated indirectly, relative to that of
A, as illustrated in figure 13.3.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

516

Figure 13.3 Chemical potential estimation in mixtures.

particle insertion

Statistical Mechanics and Molecular Simulation

particle conversion

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

517

An A particle is randomly selected, and a trial conversion to B


attempted. It is easy to show that
*
+
NA
B
A
exp{vtest }
ex = ex ex = kB T ln
NB + 1
where vtest is the potential energy change associated with the
interconversion. Moreover, the chemical potential difference is
equal to the mole fraction derivative of the Gibbs free energy per
mole: g = x A A + x B B , g/x B = B A , so measurements of
this kind enable determination of g across the whole composition
range, given a starting point of (say) one pure component. The
related semi-grand ensemble has been discussed in some detail
by Kofke and Glandt [1988].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

518

13.2 The natural way


It is possible to calculate derivatives of the free energy directly
in a simulation. We can determine the average energy E = hEi
as a function of ; likewise we can determine the pressure P as a
function of volume V . If we do this over a range of state points
between the state of interest and one for which we know F exactly, the ideal gas, or harmonic crystal for example, then we may
perform the integral
(F )2 (F )1 =
or
F2 F1 =

Statistical Mechanics and Molecular Simulation

Z 2

Z V2
V1

E d

P dV .

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

519

This is reliable and fairly accurate, if tedious. It was used, for


example, by Hoover et al. [1970] to locate the melting parameters
for soft-sphere systems.
The only point to watch out for is that one should not cross
any phase transitions in taking the path from 1 to 2: it must be
reversible, as illustrated in figure 13.4.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

520

Figure 13.4 Reversible thermodynamic integration paths.


P

solid
liquid

harmonic
t
crystal

ideal
gas

gas

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

521

13.3 Slightly unnatural methods


Sometimes it is necessary to invent novel paths to take us to a
state whose free energy is well known. One imagines varying a
parameter to convert the system of interest into some reference
system. One early example [Hoover and Ree, 1967, 1968] is for
a crystal. Each atom is artificially restricted to a single cell in
space. This has no effect on the dense solid, but as the density
is lowered, the system does not melt, but converts more-or-less
smoothly into a kind of lattice gas, as illustrated in figure 13.5.
In another variant, the cell walls are switched on reversibly.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

522

Figure 13.5 The single-occupancy cell method.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

523

13.3.1 The Einstein crystal


More recently, Frenkel et al. [1984] proposed a method in which
corresponds to switching between the true potential and a harmonic spring which couples each atom at instantaneous position
(0)
ri to its ideal lattice site ri :
V () = V1 + (1 )V0
X
(0)
= V1 + (1 ) v(|ri ri |) .

(13-1)

Here V1 is the original, many-body potential energy function, while


1
V0 is a sum of single-particle spring potentials with v(r ) = 2 r 2 ;
is the spring constant. As 0 the system becomes a perfect
Einstein crystal, whose free energy is exactly calculable. This is
illustrated in figure 13.6.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

524

Figure 13.6 The Einstein crystal method.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

525

Both the Hoover and Ree [1967, 1968] and Frenkel et al. [1984]
methods have minor drawbacks: the single-occupancy pathway
generally crosses a weak first-order transition, near the point where
the effect of the walls in confining the atoms takes over from the
inter-particle forces. The Einstein crystal route typically involves
a weak (but integrable) divergence in the strong-spring limit, although this is avoidable [Mezei, 1993]. Recently, Meijer et al. [1990]
have combined both approaches in a method which seems robust:
first the solid is subjected to a set of one-particle spring potentials, and then the influence of the interparticle forces is reduced
to zero by expanding the crystal. This method was used to locate the melting transition for a model of nitrogen at T =300 K,
at which temperature the solid is orientationally disordered. This
may be the first such study of a realistic molecular system, and it
would have been difficult to achieve without this kind of approach.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

526

Very recently, Lovett [1995], Sheu et al. [1995] have examined


the Einstein solid route from both a formal and practical point of
view. They propose switching over from the true potential to a
one-body potential defined such that the one-body density (r) is
the same at all points along the integration path. This is illustrated
in figure 13.7.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

527

Figure 13.7 Keeping the one-body density unchanged.

(r)
Many-body potential V1

Combination of V0 and V1

(r)

(r)

One-body potential V0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

528

In the 0 Einstein limit, the required potential is simply


v(r) = kB T ln (r) where (r) is the density function in the original = 1 solid. Assuming that the atoms in the solid are reasonably well localised about their lattice sites, with an approximately
Gaussian density, this will be close to the harmonic spring potential defined above, with the correct choice of spring constant to
give the Einstein frequency of the original solid. The choice of potential at the intermediate values of is not explicitly prescribed
(although density-functional theory tells us that it is unique and
well defined); for practical purposes we may expect that the simple linear combination above will be reasonably close. The advantages of the path proposed by Lovett [1995], Sheu et al. [1995] are
(a) that it cannot traverse a first-order phase transition (since that
would imply a discontinuous change in (r) and this is precluded
by construction) and (b) that (compared with other limiting onebody potentials) it minimizes the statistical error in F1 F0 .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

529

13.3.2 Gradual insertion


The relative ease with which a smaller particle may be inserted,
and then converted to a larger one (see sec. 13.1.3 and Fig. 13.1)
leads to a method of gradual insertion to estimate the chemical potential. This can be thought of as yet another thermodynamic integration pathway, connecting the states with N and N +1
particles via a set of intermediate points, characterized by a parameter , 0 1 which determines the degree to which
the extra -particle is switched on. The basic idea is due to
Mon and Griffiths [1985] and it has been refined by Nezbeda and Kolafa
[1991], Attard [1993]. A Monte Carlo scheme is constructed, which
(in addition to the usual moves) allows to vary either continuously or in predefined discrete jumps.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

530

Then the chemical potential is expressed


ex

= Fex ( = 1) Fex ( = 0)
( P
()
Fex
discrete values of
R 1
=
0 d Fex / continuous values of

Some care must be taken in deciding how acts to switch on the


extra particle. For hard particles, it is natural to allow to scale
the pair interaction range, i.e. essentially the particle size. For
more general potentials it may be tempting to scale the interaction
energy, but this (on its own) is not a good idea: even for quite small
values of , the repulsive core still diverges at small separation,
so varying will produce dramatic overlaps and poor statistics.
Mon and Griffiths [1985] suggest a practical way of tackling the
repulsive core.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

531

There is a downside to this approach: the shotgun attack of


attempting test-particle insertions at many places in the fluid is
replaced by a sampling method which concentrates on just one
particle. This means that poor statistics may be obtained, especially since the environment of the -particle may change only
slowly. Several strategies can be adopted to offset this. Largescale moves of the -particle to new, randomly-selected positions
can be attempted from time to time; when is small these moves
will have a high probability of success. Exchanges of position between the -particle and a randomly-selected full-size particle can
be attempted; when is large, i.e. close to unity, these moves will
have a high success rate.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

532

Once more, this method, in its simplest form, has its limitations. At high , the conversion probabilities become lower. It is
possible to extrapolate from the low- results, in some case using
extra information about the = 1 limit [Smith and Labk, 1993].
We see an improvement later.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

533

13.4 Energy difference distributions


A more general approach, and one which makes more use of the
information available in a simulation, relies on comparing energy
distributions in two systems whose free energies we wish to relate.
We have seen
Q1
= exp{F } = hexp{E( )}i0
Q0
where h. . .i0 denotes an average in the reference-system ensemble.
A similar expression can be written down based on averages in ensemble 1. Here E = E1 E0 , the difference in energy between
two systems, with identical atomic coordinates, but different energy functions. Re-write this as an integral over the distribution
function for E:
Z
Q1
=
dE P0 (E) exp{E} .
exp{F } =
Q0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

534

The function P0 (E) is the probability density of configurations


for which E0 and E1 differ by exactly the prescribed amount E,
per unit E. It can be accumulated as a histogram; formally each
E histogram bin is (to the precision of the bin widths) just an
average of the delta function (E1 E0 E).
P0 (E) = h (E1 E0 E)i0 .
Calculating the free energy difference this way gives us the
chance to see whether we are obtaining good statistics (through
the P0 (E) histogram) in the regions of the integrand (with the
exponential weighting) that contribute heavily to the final result.
This is not guaranteed, especially if the two systems differ significantly; if there is a problem, it may be possible to bridge the gap
with umbrella sampling, or by inserting intermediate state points.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

535

Even better, if we simulate ensemble 1, and calculate the distribution P1 (E), we may relate it to P0 (E) as follows:
P1 (E) = h (E1 E0 E)i1
Q0
=
h (E1 E0 E) exp{E}i0
Q1
Q0
=
h (E1 E0 E)i0 exp{E}
Q1
= exp{+F }P0 (E) exp{E}
ln P1 (E) = ln P0 (E) + F E .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

536

A couple of graphical methods suggest themselves. Firstly,


if the energy distributions overlap, so values of P0 and P1 are
available for the same values of E, we can simply plot
ln P1 (E) ln P0 (E)
as a function of E. This should be a straight line of slope 1
with an intercept value of F at E = 0, as illustrated in figure 13.8.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

537

Figure 13.8 Comparing energy distributions (schematic). Dashed


lines indicate regions of poor statistics.

ln P ( E)
1

ln P0 ( E)

difference

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

538

More likely, the region of overlap of P0 and P1 will be small or


nonexistent. In this case a plot of the two functions
ln P1 (E) +

1
E
2

ln P0 (E)

1
E
2

and

against E will be more useful. These two curves should be


the same, apart from a vertical shift of F separating them, as
illustrated in figure 13.9.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

539

Figure 13.9 Comparing energy distributions (schematic). Again,


dashed lines indicate regions of poor statistics.
ln P1 ( E) + E/2

E
ln P0 ( E) E/2

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

540

A combined fit to a single smooth curve, with the extra shift


included as a fitting parameter, will serve to determine F . In
principle this will work whether the distributions overlap or not,
although clearly a more accurate result will be obtained if they are
not too far apart. For more details of these techniques see Bennett
[1976].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

541

13.5 Umbrella sampling


These techniques rely on the two distributions not being too different from each other, and ideally they should overlap to a degree. To broaden the sampling into the wings of the distribution,
thereby improving statistics and extending the overlap region, we
may estimate P0 and P1 using non-Boltzmann sampling, or umbrella sampling.
A weight factor W ( ) is included in the Monte Carlo sampling
algorithm. This is used to generate a modified, or weighted, distribution,
%W W ( ) exp {0 E( )} .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

542

The usual Monte Carlo procedure is adopted, with trial moves


m n selected as usual, but now accepted with probability
min (1, (Wn /Wm ) exp[0 (En Em )]) .
In the calculation of ensemble averages, we correct for the weighting
hA/W iW
hAi0 =
h1/W iW
This applies to the histograms used to calculate P0 (and P1 ) as
well as to the usual thermodynamic variables.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

543

Figure 13.10 Umbrella sampling, with a distribution bridging between two unweighted distributions.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

544

13.5.1 Free energy barriers


Consider the following problem. We wish to obtain reasonable
estimates of trans and gauche percentages for a single molecule
of butane dissolved in a liquid, or, more specifically,
P() = h[ ( )]i
where is the internal bond rotation angle (see Fig. 13.11). The
logarithm of this gives a free energy barrier for the interconversion F () = kB T ln P().
The problem is that the internal potential v() dominates;
barrier crossing may be slow in the simulation.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

545

Figure 13.11 Umbrella sampling, applied to the gauche-trans barrier for butane.
v

g+

gt

P
gas

liquid

PW

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

546

A simple solution is to perform MC with v() switched off. This


means the weighting function is W = exp[+v()]. Then, we
determine PW () = h[ ( )]iW , and re-weight afterwards:
P() PW () exp[v()] .
The normalizing factor is determined afterwards. Note that v()
is not the same as the free energy function F (), just the dominant contribution; the weighted simulation does not produce completely uniform sampling of (see Fig. 13.11). The biased distribution PW () will reflect solely the solvent-induced effects.
Note also that the analysis assumes that we can focus on just
one molecule to apply the weighting factor. Other properties are
computed in a similar way
hAi =

Statistical Mechanics and Molecular Simulation

hA ev() iW
.
hev() iW

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

547

13.5.2 Force-balance method


What if the biasing function is unknown (as it will be in most
cases)? We illustrate this by returning to the idea of calculating
chemical potential by gradual particle insertion, sec. 13.3.2, and
consider applying a weighting function to the sampling of the
parameter [Nezbeda and Kolafa, 1991, Attard, 1993]. A probability histogram P() of the sampled values of is built up during
the simulation. Without an external biasing potential this will be
directly related to a Landau free energy
P() exp{F ()}
where F (1) F (0) = Fex is the desired free energy difference.
However, F () will most likely increase rapidly with , giving poor
statistics as 1.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

548

To counteract this, introduce a biasing potential (), so the


probability histogram becomes
P() exp{F () ()} .
This is easily done, for example by incorporating the change in
into the accept/reject criterion for moves. Uniform sampling would result from the choice () = F (). Initially we do
not know this, but an initial guess can be iteratively refined from
the results of the first simulation runs. Attard [1993] tested the
method on hard spheres, for which scaled particle theory gives
a good first estimate, obtaining reasonable results even at high
densities.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

549

13.5.3 Windowing
Windowing is a special case of umbrella sampling: W is a constant inside a specified region of configuration space, and zero
outside. In Monte Carlo we simply reject moves which would take
the system outside the window, and otherwise proceed as usual.
This allows us to examine a free energy barrier piece by piece,
matching up the resulting curves afterwards.
Perform several MC runs with different windows.
Determine PW () = h[ ( )]iW .
Re-weighting is trivial: P() PW () within window.
Scale results so that results from adjacent windows match.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

550

It is possible to combine umbrella sampling with windowing, i.e.


apply a biasing function within each window to give uniform sampling.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

13

FREE ENERGIES AND WEIGHTED SAMPLING

551

Figure 13.12 Windowing, applied to the gauche-trans barrier for


butane.
v

PW

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

552

14 Biased Monte Carlo


Here we consider situations in which we do not wish to attempt the
forward move with the same probability as the reverse move. Once
we have established how to do this, we consider some examples
where it would be useful.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

553

14.1 Biased move selection and acceptance


Biased move selection means that the transition matrix is not
symmetric, nm mn . The method is a straightforward generalization of the one used by Metropolis.
Select a trial move with a desired nm .
Compute nm /mn and %n /%m .
Accept with probability min (1, %n mn /%m nm ).
Then the transition probabilities are

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

nm

= nm
= nm

mm

554

= 1

X
nm

mn %n > nm %m , m n
mn %n
nm %m

!
mn %n < nm %m , m n

nm

and it is easy to prove microscopic reversibility. Suppose n m


is uphill, i.e. mn %n < nm %m , hence
nm = nm (%n mn /%m nm ) .
Then m n is downhill, so mn = mn . The ratio is
mn /nm = %m /%n
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

555

so microscopic reversibility is satisfied. Now we are free to choose


an unsymmetric (or biased) underlying matrix.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

556

14.2 Sampling near a solute


As an example of biased sampling, suppose we wish to attempt
to move atoms more often if they are close to one chosen particle, perhaps a large solute molecule or a physical wall. This is
illustrated in figure 14.1.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

557

Figure 14.1 Preferential sampling near a solute (forward move).


The atoms in the red region are selected more often than in the
yellow or green regions.

state m

Statistical Mechanics and Molecular Simulation

state n

M. P. Allen 1999

14

BIASED MONTE CARLO

558

How do we choose attempted moves in this way? One method


is to give each atom a weight wi = w(ri ) which is a prescribed
function of its distance ri from the solute, and select it with probP
ability pi wi / j wj . This value will depend on all the coordi(m)

(m)

nates; call it pi in state m. Clearly then nm pi . Consider


now the possible reverse move as illustrated in figure 14.2.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

559

Figure 14.2 Preferential sampling near a solute (reverse move).


The atoms in the red region are selected more often than in the
yellow or green regions.

state m

Statistical Mechanics and Molecular Simulation

state n

M. P. Allen 1999

14

BIASED MONTE CARLO

560
(n)

It is necessary to calculate the new weight wi and hence pi


(n)
pi .

This may be used in the acceptance/rejection


since mn
criterion outlined in the previous section: the ratio of s is
(m)

nm /mn = pi

(n)

/pi

Notice why the values of will in general be different: in the illustrations, the reverse move is likely to be selected less frequently
than the forward move.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

561

14.3 Configuration-biased Monte Carlo


This approach may be considerably generalized, to allow the construction of Monte Carlo moves step-by-step, with each step depending on the success or failure of the last. Such a procedure is
biased, but it is then possible to correct for the bias (by considering the possible reverse moves). The technique has dramatically
speeded up polymer simulations, and is capable of wider application.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

562

14.3.1 Multiple choice moves


Consider first a method for increasing the acceptance rate of moves
(but at some expense of trying, and discarding several other possible moves). This is shown in figure 14.3.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

563

Figure 14.3 Selecting one particle displacement from many (forward move).
winning
position

State m

Statistical Mechanics and Molecular Simulation

State n

M. P. Allen 1999

14

BIASED MONTE CARLO

564

Having picked an atom to move, calculate the new trial interaction energy vt for a range of trial positions t = 1 . . . k. Pick the
actual attempted move from this set, with a probability proportional to the Boltzmann factor, i.e. calculate
pt = exp{vt }/

k
X

exp{vt }

t=1

and pick a winner with probability pt . This defines the new state
n; clearly
nm exp{v (n) }/w (n)
where v (n) is the winning interaction energy vt and w (n) is short
for the weight
k
X
(n)
1
=k
exp{vt }
w
t=1

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

565

We must now calculate an mn for the conceptual reverse


move. We do this by selecting k1 possible trial positions around
the new position of the atom, plus the place it originally came
from, making k in all. This is shown in figure 14.4.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

566

Figure 14.4 Selecting one particle displacement from many (reverse move).
original
position

State m

Statistical Mechanics and Molecular Simulation

State n

M. P. Allen 1999

14

BIASED MONTE CARLO

567

This means we can calculate w (m) just like w (n) , hence


mn exp{v (m) }/w (m)
where v (m) is the interaction energy for the original position. The
ratio mn /nm is used in the accept/reject decision. But we
also have the Boltzmann factors to include in the accept reject
decision, so some cancellation occurs:
!
mn exp{v (n) }
= min(1, w (n) /w (m) ) .
min 1,
nm exp{v (m) }
For k = 1 this gives the usual Metropolis prescription. For k
the acceptance rate tends to unity, but the method becomes very
expensive.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

568

14.3.2 Growing polymer chains


The expense is justified, however, when tackling polymer chains,
where reconstruction of an entire chain is expressed as a succession of atomic moves. The first atom is placed at random; the
second selected nearby (one bond length away), the third placed
near the second, and so on. Each placement of an atom a is given
a greater chance of success by selecting from multiple locations,
as just described. This is shown in figure 14.5.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

569

Figure 14.5 Polymer chain construction (forward move).


chain atoms; winning positions; losing positions.

original configuration m
final configuration n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

570
(n)

For each atom calculate a weight wa , and then define an overQ


(n)
all weight W (n) = a wa for the new chain configuration. Then
we have
X (n)
nm exp{ va }/W (n) .
a

To calculate the weight W (m) for the original chain we must carry
out the hypothetical reverse move, at each stage generating k 1
trial positions for each atom, adding the original position to make
(m)
a total of k, and computing the appropriate contribution wa .
This is shown in figure 14.6.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

571

Figure 14.6 Polymer chain construction (reverse move).


chain atoms; original positions; dummy positions.

original configuration m
final configuration n

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

14

BIASED MONTE CARLO

572

At the end of the process the acceptance probability for the


whole move is simply min(1, W (n) /W (m) ). For further details and
applications see Harris and Rice [1988], Siepmann and Frenkel [1992],
Frenkel et al. [1992].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

573

15 Phase Transitions
Here we discuss the exploration of phase diagrams, and the location of first-order phase transitions. See also Bennett [1976],
Frenkel [1986], Smit [1993], Frenkel [1995], Panagiotopoulos [1995].
Very roughly we classify phase transitions into two types: firstorder and continuous. The fact that we are dealing with a finitesized system must be borne in mind, in either case.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

574

15.1 First-order and continuous phase transitions


At a continuous phase transition, a correlation length a (see 1.1.9)
diverges and an order parameter
Z
hA(0)A(r )i
hAi
0

becomes macroscopically large. The divergence heralding the transition is describable in terms of universal exponent relations. Effects of finite size close to continuous phase transitions are well
studied.
By contrast, a first-order phase transition is abrupt, one phase
becomes thermodynamically more stable than another; there are
no transition precursors. In the thermodynamic limit, there is a
step-function discontinuity in most properties, including thermodynamic derivatives of the free energy. Again it is possible to
describe the effects of finite size.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

575

15.1.1 Finite size effects


For both first-order and continuous phase transitions, finite size
shifts the transition and rounds it in some way. The shift for firstorder transitions arises, crudely, because the chemical potential,
like most other properties, has a finite-size correction
(N) () O(1/N) .
An approximate expression for this was derived by Siepmann et al.
[1992]. Therefore, the line of intersection of two chemical potential surfaces I (T , P ) and II (T , P ) will shift, in general, by an
amount O(1/N).
The rounding is expected because the partition function only
has singularities (and hence produces discontinuous or divergent
properties) in the limit L ; otherwise, it is analytic, so for finite
N the discontinuities must be smoothed out in some way.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

576

The shift for continuous transitions arises because the transition happens when a L for the finite system, but when a
in the infinite system.
The rounding happens for the same reason as it does for firstorder phase transitions: whatever the nature of the divergence in
thermodynamic properties (described, typically, by critical exponents) it will be limited by the finite size of the system.
A careful introduction to the thermodynamic limit may be found
in Ruelle [1969].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

577

In either case, first-order or continuous, it is useful to consider


the probability distribution function for variables averaged over
a spatial block of side L; this may be the complete simulation
box (in which case we must specify the ensemble and boundary
conditions) or it may be a subsystem. For purposes of illustration
we shall not distinguish these possibilities.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

578

15.2 First-order phase transitions


In this section we discuss first-order transitions in terms of energy distributions at constant temperature and (briefly) volume
distributions at constant pressure.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

579

15.2.1 Energy and temperature


See Milchev et al. [1986], Binder and Heermann [1988], Challa et al.
[1986], Wood [1968b], Brown and Yegulalp [1991]. Consider simulating a system in the canonical ensemble, and in the microcanonical ensemble, close to a phase transition. In one phase, PNV T (E)
is essentially a Gaussian centred around a value EI , while in the
other phase the peak is around EII (recall sec 7.3.2). Far from the
transition, one or other of these will apply. Close to the phase
transition we may see contributions from both Gaussians, and a
doubly-peaked distribution results, as illustrated in figure 15.1

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

580

Figure 15.1 Energy distributions near a first-order transition.


T > Tt , < (0) , T = Tt , = (0) , T < Tt , > (0) .

Prob(E)
(0)

>

= (0)
< (0)

E I(0)

E II(0)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

581

The weight of each Gaussian changes as the temperature is


varied. Thus a smooth crossover occurs from one branch of the
equation of state E(T ) = hEiT to the other. In the transition region we may expect to see anomalies such as an increased specific
heat: the double-peak distribution is wider than its constituent
single-peaked ones, and recall that CV is linked to hE 2 i. All of
these phenomena will be influenced by the system size, because
the peaks become narrower (and overlap less) as the system becomes larger. It is possible to model this, exactly at the transition
T = T (0) , with two Gaussians having equal weight:

(E E (0) )2
(E E (0) )2
1
1
I
II
exp
+p
PNV (0) (E) p exp
2k T (0) 2 C
2k T (0) 2 C
CI
C
II
B
I
B
II
(15-1)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

582

The corresponding Landau free energy


F (E) = kB T ln P(E)

(15-2)

has two minima separated by a barrier. The high-probability, low(0)


(0)
free-energy values correspond to EI and EII , the single phase
configurations; the intermediate values are for mixtures of the two
phases, with an interfacial free energy penalty (see sec. 15.3.1).
The crossover between the branches of the equation of state
will become sharper (occur over a narrower range of ) for larger
system sizes. Metastable continuations of the single-phase equations of state are quite likely to be seen, because the crossover
requires the system to surmount a large free energy barrier (see
sec. 15.3.1). This gives rise to the kind of hysteresis often taken
as a sign (albeit unreliable) of first-order character.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

583

15.2.2 Equation of state


In the microcanonical ensemble, the signature of a first-order phase
transition is the appearance of a van der Waals loop in the equation of state, now written as T (E) or (E). The (E) curve switches
over from one branch, phase I, of the equation of state to the other,
phase II, tracing out a loop in the transition region as shown in
Fig. 15.2. This loop is a finite-size effect, due to interfacial free
energy contributions in the transition region where both phases
are present (see sec. 15.3.1).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

584

Figure 15.2 Equation of state at a first-order transition.


Prob(E)

(E)

F ()

S(E)
S

E I(0)

E II(0)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

585

For a larger system size the loop will flatten out, becoming a
horizontal line in the thermodynamic limit, joining the two coex(0)
(0)
isting energies EI and EII at the transition temperature T (0) ; for
N the interfacial properties contribute a negligible amount to
the total free energy. (Calling it a van der Waals loop is therefore
misleading: it has no connection with the loop in the approximate
van der Waals equation of state for fluids, which in any case is independent of system size.)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

586

We already have the equations necessary to predict the form


of the crossover from one branch of the equation of state (E)
to the other. We saw earlier (eqn 7-12) that differentiation of the
P(E) curve and use of T 1 = kB = (S/E) gives
ln PNV T (0) (E)
(FNV T (0) (E))
=
= (E) (0) .
E
E
(0)

(15-3)

(0)

At the transition let EI (T (0) ) = EI and EII (T (0) ) = EII .


At the three points of zero gradient of PNV T (0) (E) (two maxima,
and one minimum, see top curve in Fig. 15.2) eqn (15-3) tells us
that we must have (E) = (0) . Hence there is a loop in (E), seen
in the middle curve of Fig. 15.2.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

587

15.2.3 Coexistence
Draw a line at constant = (0) , intersecting the (E) curve at
(0)
(0)
(0)
EI , Emid and EII , such that the integral
Z E (0)
II

(0)

EI

dE


(E) (0) = 0 ,

in other words, so that it cuts off equal areas (shaded green in


Fig. 15.2) above and below. Then, from eqn (15-3), we can see

(0)
P
(0) (EII )
(0)
(0)
NV
T
=0
=
PNV T (0) (EI ) = PNV T (0) (EII )
ln
(0)
PNV T (0) (EI )
where kB T = 1/. In other words, this choice of corresponds
to equal peak heights for PNV T (0) (E), which is one definition of
thermodynamic coexistence of the two phases.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

588

It is easy to see that this choice also implies that the phases
have equal Helmholtz free energies. One way is simply to use
1/T = S/E, so
Z E (0)
II

(0)
EI

dE

(E) (0)

[SII SI ]
(0)
(0)
(0) [EII EI ]
kB

[FII FI ]
=0.
kB T (0)

This is equivalent to a common-tangent construction for the entropy curve S(E) (see the bottom part of Fig. 15.2). The gradient of
the tangent determines a common value of at both state points,
and the tangent line itself is given by
S = (SII SI ) = kB E = kB (EII EI )
which once more implies equal Helmholtz free energies FI = FII .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

589

Consequently, exactly at the transition, it seems that we can


model the distribution function thus:

(E E (0) )
(E E (0) )
I
II
+ exp
PNV T (0) (E) exp
2k T (0) 2 C
2k T (0) 2 C
B

II

with equal peak heights.


Further discussion of peak heights and areas may be found in
this note.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

590

15.2.4 Changing the parameters


For a larger system, the peaks scale in the usual way with system size, becoming sharper, and the variation of (E) (and other
thermodynamic functions) is more abrupt. In the thermodynamic
limit we obtain a straight line joining the two (E) branches.
Moving away from the transition by even a small amount quickly
changes the peak heights in PNV T (E), as well as shifting the peak
positions (see figure 15.1). The effect is directly obtained from
PNV T (E) exp{E}PNV T (0) (E), where = (0) ; to a first
approximation, the peaks shift as they must according to the equation of state, i.e.
(0)

EI = EI

+ CI T

(0)

EII = EII + CII T

where T = T T (0) .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

591
(0)

Moreover, peaks in the neighbourhood of EI

(0)
exp{EI },

(0)
EII

are scaled by

(0)
exp{EII }.

and those near


by
This is associated with the shift in free energy difference F between the two
phases which accompanies the shift in temperature. If we adopt
the double-Gaussian form we see
(
(
)
)
AI
(E EI )2
(E EII )2
AII
exp
+p
PNV T (E) p exp
2
2
CI
CII
2kB T (0) CI
2kB T (0) CII

where EI and EII are given above, and


(0)

(0)

AII /AI = exp{(EII EI

Statistical Mechanics and Molecular Simulation

)} .

M. P. Allen 1999

15

PHASE TRANSITIONS

592

Notice that as the system size grows, the distinction between


equal peak heights and equal peak areas as signatures of coexistence becomes less important. For a large system, the appearance
of two peaks with amplitudes in any way comparable with each
other indicates close proximity to the phase transition.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

593

Problem 15.1 Download the Maple worksheet for this problem


from the course home page. In this problem we investigate the
behaviour of energy distributions around a first-order phase transition. Answer provided.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

594

15.2.5 Pressure and volume


The previous discussions translate directly over into pressurevolume variables, if we compare the constant-NV T and constantNP T ensembles. The doubly-peaked distribution of volumes seen
near a transition at constant pressure can be seen in Fig. 15.3.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

595

Figure 15.3 Volume distributions near a first-order transition.


P < P (0) , P = P (0) , P > P (0) .

Prob(V)
P>P
P=P
P<P

V I(0)

V II(0)

Statistical Mechanics and Molecular Simulation

(0)
(0)
(0)

M. P. Allen 1999

15

PHASE TRANSITIONS

596

The corresponding Landau free energy


FNP (0) T (V ) = kB T ln PNP (0) T (V )

(15-4)

has two minima separated by a barrier. The high-probability, lowfree-energy values correspond to VI (P (0) ) and VII (P (0) ), the single
phase configurations; the intermediate values are for mixtures of
the two phases, with an interfacial free energy penalty.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

597

The equation
kB T

ln PNP (0) T (V )
= P (V ) P (0)
V

implies that the equation of state measured at constant volume


will have a loop, as illustrated in the middle graph of Fig. 15.4. The
coexistence pressure will be somewhere in the middle of this loop;
the exact position is given by an equal area construction on P (V ),
a common tangent construction on F (V ), equal values of Gibbs
free energy G(P ), and equal peak heights (or areas) in P(V ), all of
which are thermodynamically equivalent.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

598

Figure 15.4 Equation of state at a first-order transition.


Prob(V)

V
P

P(V)

G(P)

F(V)
F

V I(0)

V II(0)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

599

15.3 Direct simulation of phase coexistence


Direct coexistence of solid and fluid phases of hard spheres and
disks was observed in the early simulations of Wood and Jacobson
[1957], Alder and Wainwright [1957, 1962] and the appearance
of a van der Waals loop in the equation of state was explained
in some detail shortly afterwards [Mayer and Wood, 1965, Wood,
1968b,a]. (Actually, the situation in two dimensions is not simple).
Very detailed analyses of this situation, especially in relation to
spin systems, have appeared in recent years [Binder and Landau,
1984, Challa et al., 1986, Milchev et al., 1986, Binder and Heermann,
1988, Brown and Yegulalp, 1991].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

600

15.3.1 Interfacial free energy


It is important to realize that the shape of the double-peaked distribution and equivalently the height of the free energy barrier in
eqns (15-2), (15-4), depend on the system size. There will be two
bulk terms, each proportional to the amount of the corresponding phase, which scale like Ld where L is the box length and d
the dimensionality. There will also be an interfacial term, scaling like Ld1 (see Fig. 15.5). This last term dictates the barrier
height F separating the two phases: observation of this scaling behaviour is recommended as a test for first-order behaviour
[Lee and Kosterlitz, 1990].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

601

Figure 15.5 Bulk and interfacial free energies near a first-order


transition.
d
d
FI L FII L

F = FI + FII + Finterface

d-1

Finterface L

or

below transition

above transition

at transition

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

602

Measuring this distribution can be quite expensive for molecular models; a nice example of the approach for a spin model of a
liquid crystal, which exhibits a tricky weak first-order transition,
is the work of Zhang et al. [1992, 1993]. An example for a strong
first-order transition is the study of melting and nucleation barriers in the Lennard-Jones system [van Duijneveldt and Frenkel,
1992] and models of metallic systems [Lynden-Bell et al., 1993].
This approach involves a special windowing technique, together
with biasing techniques of the multicanonical or entropy-sampling
kind, geared to a particular choice of order parameter.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

603

15.3.2 Umbrella sampling


Here is an example of applying umbrella sampling (sec 13.5) to a
first-order phase transition. Recall (sec 1.2.3) that the Ising model
consists of interacting nearest neighbour spins,
X
si sj
E = J
hiji

where si = 1 and J is the coupling constant. The magnetization


P
is M = i si . Below the critical temperature Tc , and in zero magnetic field, the system shows a spontaneous magnetization hMi
0. A plot of the probability density P(M) is shown in Fig. 15.6; this
can be used to define a Landau free energy F (M) = kB T ln P(M),
also shown. Problem: how to measure this, especially if the free
energy barrier F is high?

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

604

Figure 15.6 Probability and Landau free energy curves for Ising
magnet.

Probability

Free energy
Ising spin model
Number of spins: N
Total magnetization: M

-N

Statistical Mechanics and Molecular Simulation

+N

M. P. Allen 1999

15

PHASE TRANSITIONS

605

Consider an approach similar to that used in sec 13.5.1. If


we ran Monte Carlo with a weight function W = exp[+F (M)],
i.e. used the function E( ) F (M) in place of E( ) in the usual
Metropolis prescription, then the measured PW (M) would be uniform, and the reweighting would give
P(M) PW (M) exp[F (M)] exp[F (M)] .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

606

An iterative scheme to approach this limit would start with


F (M) = 0, then proceed as follows.
1. Perform a simulation using E F (M) and accumulate a histogram PW (M).
2. Update
F (M) F (M) kB T ln PW (M)
where PW (M) is non-zero, otherwise leave unchanged.
3. Return to step 1 if not converged.
See Chandler [1987].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

607

15.3.3 Liquid-vapour interfaces


Simulation of both bulk phases in a single box, separated by an
interface, is closest to what we do in real life. It is necessary to
establish a well-defined interface, most often a planar one between
two phases in slab geometry. A large system is required, so that
one can characterize the two phases far from the interface, and
read off the corresponding bulk properties. Naturally, this is the
approach of choice if the interfacial properties (for example the
surface tension) are themselves of interest.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

608

The first stage in such a simulation is to prepare bulk samples


of each phase, as close to the coexisting densities as possible, in
cuboidal periodic boundaries, using boxes whose cross-sections
match. The two boxes are brought together, to make a single
longer box, giving the desired slab arrangement with two planar
interfaces. There must then follow a period of equilibration, with
mass transfer between the phases if the initial densities were not
quite right.
Equilibration of the interface, and the establishment of equilibrium between the two phases, may be very slow. Holcomb et al.
[1993] found that the density profile (z) equilibrated much more
quickly than the profiles of normal and transverse pressure, PN (z)
and PT (z) respectively. The surface tension is proportional to the
z-integral of PN (z) PT (z).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

609

Figure 15.7 Stages in preparation and equilibration of a liquidvapour interface (schematic). We plot density profile (z), difRference between pressure tensor components PN (z) PT (z), and
dz PN (z) PT (z).

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

610

The bulk liquid in the slab may continue to contribute to this


integral, indicating lack of equilibrium, for very long times (e.g.
more than 60000 timesteps for a Lennard-Jones system) if the initial liquid density is chosen a little too high or too low. In Fig. 15.7,
we suppose that the initial liquid density is a little higher than the
equilibrium coexisting value. The gradient of the z-integral in the
bulk liquid must become zero before equilibrium can be said to
have been achieved.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

611

A recent example, for a molecular model, is the MD simulation of the liquid-vapour surface of water at temperatures between
316K and 573K by Alejandre et al. [1995] using system sizes N =
512 and N = 1000 in an elongated box, 2 2 10 nm. Typically,
105 timesteps are needed to equilibrate the surfaces and measure surface tensions. These authors claim that the coexisting
bulk densities (measured by fitting to a density profile histogram)
agree well with values measured by other techniques for the same
model.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

612

15.4 Gibbs ensemble


Simulations in the Gibbs
of Widoms test particle
two-phase coexistence in
[1987b], Panagiotopoulos
I and II.

ensemble attempt to combine features


method with the direct simulation of
a box. The method of Panagiotopoulos
et al. [1988] uses two fully-periodic boxes,

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

613

15.4.1 The Gibbs ensemble method


In the simplest version, a one-component system is simulated at a
given temperature T in both boxes; particles in different boxes do
not interact directly with each other; however, volume moves and
particle creation and deletion moves are coupled such that the total volume V and the total number of particles N are conserved.
With appropriate acceptance/rejection probabilities for the volume exchange and particle exchange moves, together with the
usual Monte Carlo procedure for moving particles around within
the two boxes, the thermodynamic conditions for mechanical and
chemical equilibrium between the boxes are ensured. A typical
Monte Carlo cycle would consist of: one attempted move per particle in each box; one attempt to exchange volumes between boxes;
a predetermined number of attempts to exchange particles.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

614

The technique has been reviewed by Panagiotopoulos [1992,


1994, 1995] and Smit [1993]. The partition function for the twobox system is simply the usual canonical sum over all possible
states, including a sum over all the distributions of particles between the boxes such that NI + NII = N, and an integral over all
box volumes such that VI + VII = V . The probability distribution
function for the ensemble, and the acceptance and rejection rules
for particle and volume exchanges, are easily derived.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

615

For a volume move, a random change V is chosen with uniform probability in some predefined range: this generates volume
changes VI VI + V and VII VII V . The move is accepted in
the usual Metropolis manner, with probability min[1, exp{W }]
where the Wamiltonian change is




VI + V
VII V
NII kB T ln
.
W = VI + VII NI kB T ln
VI
VII
The first two terms on the right here are the potential energy
changes in the two boxes arising from the volume changes.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

616

The same formula results from combining the terms


WI

= VI NI kB T ln [(VI + V )/VI )] + P V

WII

= VII NII kB T ln [(VII V )/VII )] P V

that would correspond to making the same volume moves for each
box in the isothermal-isobaric ensemble: the P V terms cancel,
provided the specified pressures P are taken to be the same.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

617

For a particle exchange move, the direction of transfer III


or III is chosen randomly with equal probability; suppose it is
III to be definite. In box I a position is chosen randomly and an
attempt made to insert a particle, NI NI +1. In box II a particle is
chosen randomly, and an attempt made to remove it, NII NII 1.
The move is accepted with probability min[1, exp{Z}] where
the Zamiltonian change is


VI NII
.
Z = VI + VII kB T ln
VII (NI + 1)

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

618

The same formula results from combining the terms


ZI

= VI kB T ln [zVI /(NI + 1)]

ZII

= VII kB T ln [NII /zVII ]

that would correspond to making the same particle creations and


deletions in grand canonical ensemble simulations of each box;
the activities z cancel, given equal chemical potentials.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

619

The characteristic feature of the technique is the behaviour


of the system if the overall density N/V lies in a two-phase region. For a single simulation box, both phases would appear, with
an interface between them; in the Gibbs ensemble, the interface
free-energy penalty can be avoided by the system arranging to
have each phase entirely in its own box. This phase separation
happens automatically during the equilibration stage of the simulation. This is illustrated in figure 15.8.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

620

Figure 15.8 Evolution of systems in the Gibbs ensemble prepared


in the liquid-vapour coexistence region.
0.3
T=0.40
T=0.45
T=0.50

density

0.2

0.1

0.0

1000

2000

3000

4000

5000

MC sweeps

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

621

The great advantages of the technique are its avoidance of interfacial properties, and the semi-automatic way that it converges
on the coexisting densities without the need to input chemical potentials or guess equations of state. Unavoidably, it suffers from
the same problems as the Widom test-particle method: at high
density the particle exchange moves are accepted with very low
probability, and special techniques are required to overcome this.
It is essential to monitor the success rate of exchanges, and carry
out enough of them to ensure that a few percent of molecules are
exchanged at each step.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

622

15.4.2 Applications and generalizations


The method has been outstandingly successful in simulating complex fluids and mixtures. For a multicomponent system, it is possible to simulate at constant pressure rather than constant volume, as separation into phases of different compositions is still
allowed. The method allows one to study straightforwardly phase
equilibria in confined systems such as pores [Panagiotopoulos,
1987a]. Stapleton and Panagiotopoulos [1990] have applied the
excluded volume map sampling method to the Gibbs ensemble.
Configuration-biased Monte Carlo methods can be used to good
effect in the simulation of large flexible molecules [Mooij et al.,
1992, Laso et al., 1992]. An impressive demonstration of this has
been the determination of liquid-vapour coexistence curves for
n-alkane chain molecules as long as 48 atoms [Siepmann et al.,
1993, Smit et al., 1995].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

623

As we have seen, insertion of small molecules can be dramatically easier than large ones; this leads to a semi-grand version
of the Gibbs ensemble Panagiotopoulos [1989, 1995]: the smaller
particles are exchanged between the boxes, while moves that interconvert particle species are carried out within the boxes. This
is illustrated in figure 15.9.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

624

Figure 15.9 Two types of moves in Gibbs simulations of mixtures


of particles of different sizes.
Direct particle transfer from box I to box II

II

Indirect particle transfer


Small to large in box I coupled with large to small in box II

Statistical Mechanics and Molecular Simulation

II

M. P. Allen 1999

15

PHASE TRANSITIONS

625

This has led to the suggestion [de Pablo and Prausnitz, 1989]
that a few small particles can be added to a single-component
system solely to facilitate exchanges between boxes, with chemical
equilibrium maintained by the species interconversion moves; this
has been termed the inflating flea method.
The ideas seen before for computing the chemical potential by
gradual insertion [Mon and Griffiths, 1985, Nezbeda and Kolafa,
1991, Attard, 1993] can be naturally generalized to the Gibbs ensemble: at each stage a given molecule may be in an intermediate
state of transfer between one box and another. This will be represented by a parameter which varies between 0 and 1; the value
of will appear in some form for the interaction potential for the
molecule with its neighbours in one box, while 1 plays a similar
role in the other.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

626

15.5 Thermodynamic methods


The alternative to direct simulation of two-phase coexistence is
the calculation of free energies or chemical potentials together
with solution of the thermodynamic coexistence conditions. Thus,
we must solve (say) I (P ) = II (P ) at constant T . Typically we
have less interest in values of away from this point. A reasonable approach [D. Mller and Fischer, 1990, 1992, Lotfi et al.,
1992] (tested on Lennard-Jones atoms and two-centre LennardJones fluids) is to conduct constant-NP T simulations, measure
by test-particle insertion, and also to note that the simulations
give the derivative /P = hV i/N directly. Thus conducting one
or two simulations may be enough for a preliminary fit to the equations of state I (P ), II (P ) allowing one to home in on the intersection point quite quickly [Boda et al., 1995, D. Mller and Fischer,
1990].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

627

15.5.1 Tracing the coexistence curve


Once a point on the coexistence line has been found, one can trace
out more of it using the approach of Kofke [1993b,a] to numerically integrate the Clapeyron equation
!
h
dP
=
d
v
or alternatively

d ln P
d

!
=

h
.
P v

Here, h = h h is the difference in molar enthalpies of the


coexisting phases, and v is the difference in molar volumes; the
suffix indicates that the derivative is to be evaluated along the
coexistence line.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

628

The method consists of solving one or other of these equations


in a standard step-by-step manner, for example using a predictorcorrector algorithm. The right hand side of the above equations
is calculated by simulating both phases at constant T and P in
separate, uncoupled boxes. At intervals, a small change in T (the
independent variable) is made in both boxes, and this is accompanied by a change in P (the dependent variable) as dictated by
the differential equation solver. The approach relies on a starting
point at which the two phases are at thermodynamic equilibrium,
= 0; thereafter the Clapeyron equation, if solved accurately,
should guarantee that equilibrium is maintained.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

629

The method has been applied to the liquid-vapour coexistence


curve [Kofke, 1993b,a] and to the melting and sublimation curves
[Agrawal and Kofke, 1995a] for the Lennard-Jones system; it was
also extended by Agrawal and Kofke [1995b] to study the melting
transition of a large family of soft-sphere systems, showing the
emergence of the bcc phase as being stable relative to fcc for high
enough softness parameter.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

630

Various technical details of this approach have been discussed


[Kofke, 1993a, Agrawal and Kofke, 1995a] and possible sources of
inaccuracy considered. One important practical point is the likely
growth of errors due to an initial pair of state points that are not
truly at equilibrium. Suppose the initial value of P deviates from
the true coexistence value by P0 , so that the two state points
differ in chemical potential by . Assume now that the Clapeyron
equation is solved accurately enough that the chemical potential
difference between the phases is maintained at in succeeding
steps of the process. The deviation P will then obey
(P V )0
P
=
P0
(P V )
where as usual represents the difference between the values in
the two phases. Thus, the estimate of the coexistence pressure
will become worse if the compressibility factors P V of the two
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

631

phases become similar, e.g. approaching a weak transition or a


critical point. Kofke and Agrawal also consider the effects of statistical error propagation on the estimate of the coexistence point,
and the effects of finite step size used in the predictor-corrector
algorithm. This last point can be monitored by effectively reintegrating the simulation data using alternate data points, i.e.
doubling the step, and comparing with the results obtained using
the original step.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

632

15.6 Continuous phase transitions


Here we discuss briefly the effects of finite size on simulations
of continuous transitions. See Cardy [1988], Privman [1990] and
references therein.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

633

15.6.1 Finite size scaling


Suppose that the transition is characterized by a non-vanishing order parameter a and a corresponding divergent correlation length
a . We shall be interested in the block average value aL , where the
L reminds us of the system size. In a magnetic system a is the
magnetization; in a fluid it is the density. The basic idea of finite
size scaling analysis is that the values of properties of the system
are dictated by the ratio a /L, and that no other length scales enter the problem. The position of the phase transition, and hence
the finite-size shift, are determined by a L. Any property can
be written
haL i = a (a /L)
where a is the average value in the infinite system limit and is
some function.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

634

There will be exponent laws dictating the behaviour of a in the


vicinity of the phase transition, and more scaling laws stating how
a behaves inside the function . In fact, the correlation length
exponent is defined such that
a |T Tc | .
Remember that a may be singular at the transition, but haL i will
not be: therefore it is part of the job of to remove this singularity. For example, the magnetic susceptibility diverges like
/

so we can write, in the finite system,


(L1/ (T Tc ))
hL i L/

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

635

In these equations, if we take the L limit, the usual powerlaw scaling is recovered. In all of the above we have not included
the dependence on magnetic field (for a spin system) or chemical
potential (for a fluid). This is easily done, but not necessary here.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

636

15.6.2 Block distribution functions


We can apply a scaling analysis to the block distribution function
P(aL ) [Binder, 1981, Bruce, 1981]. (Really we should carefully distinguish between a variable averaged over a block which is a subsystem of the simulated system, and one constituting the entire
system, in a specified ensemble with specified boundary conditions. However, we can neglect these points for the purposes of
illustration.) The scaling form is
/ aL , a /L).
P(aL ) L/ P(L
or

/ aL , L1/ (T Tc )) .
P(aL ) L/ P(L

Here is the exponent determining the shape


of
D
E the coexistence
curve. The L/ scaling guarantees that a2L L2/ as reStatistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

637

quired by the finite-size-limited behaviour of the correlation function. The L1/ (T Tc ) scaling factor reflects the dependence on
a /L referred to above. If we define a scaled variable aL = L/ aL
then, close to the critical point, we should have
0 (aL ) + L1/ (T Tc )P
1 (aL ) + . . .]
P(aL ) L/ [P
1 (aL ) are universal functions, character0 (aL ) and P
where both P
izing the class of the transition. When the correlation length is
small compared with L, above the critical temperature, a single
Gaussian results; well below it we get a double Gaussian. Actually
at the critical point, the distribution can be calculated by simulation, or renormalization group theory [Binder, 1981, Bruce, 1981,
Nicolaides and Bruce, 1988, Nicolaides and Evans, 1989].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

638

15.6.3 Universality classes


We may describe the general form of these distributions for different universality classes, or characterize them by their cumulants. The results are quite different in different cases. For the
0 (aL ) has a single well-formed cenIsing/fluid d = 3 systems, P
tral peak, characterized by a cumulant ratio
D

G aL

Ec

/2

D

aL

Ec 2

0.33

d=3.

(For a perfect single-Gaussian distribution we would have G = 0,


while for a function consisting of two equal, sharp peaks, G =
0 (aL ) has a very distinct
1.) In the analogous d = 2 system, P
double-peaked form. The order parameter distributions around
the critical point are shown schematically for a small system in
figure 15.10 and for a larger system in figure 15.11.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

639

Figure 15.10 Order parameter distributions near a critical point


(small system).
Distributions near

d=2 criticality

two-phase
critical
one-phase

Density

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

640

Figure 15.11 Order parameter distributions near a critical point


(large system).
Distributions near

d=2 criticality

two-phase
critical

one-phase

Density

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

641

For the critical curve the cumulant ratio is


G 0.87

d=2.

Thus, for a finite system of this kind, the critical point does not
exactly correspond to the coalescence of the two peaks which represent the densities of the coexisting phases. Examination of these
functions is a powerful way of locating and characterizing critical points. For example, the prewetting critical point has been
shown to lie in the d = 2 Ising universality class in this way
[Nicolaides and Evans, 1989]. A further example is the study of
the critical point of the d = 2 Lennard-Jones fluid [Bruce and Wilding,
1992, Wilding and Bruce, 1992]. For this, runs of order 106 108
sweeps were needed, but the system sizes were relatively small:
N 100, 400. Exactly at criticality, the scaled density distribution does not change with system size: as discussed above, it is
universal. For T slightly below Tc , the distribution is similar in
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

642

appearance, but increasing the system size causes a sharpening


of the side peaks and a drop of the central region. As the system
size increases, or as we move further back down the coexistence
curve, the distribution smoothly goes over into two separate Gaussians, as we would expect. For T slightly above Tc , again the appearance of the distribution is similar, but increasing the system
size results in a flattening, and a broadening of the side peaks.
Further progress along the extrapolation of the true coexistence
curve, or simply a further increase in system size at fixed state
point, results in a completely flat mesa appearance, followed by
the growth of a single, central Gaussian. What is most interesting
is that the two peaks persist (for the system sizes studied here)
until the temperature has risen about 3% above the critical value.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

643

15.6.4 Phase Transitions: Comments


The histogram reweighting techniques seem to have their most
useful applications in the simulation of phase transitions, when a
simulation near (say) Tc can be reweighted as a function of T to
locate the transition point precisely. The cumulant approximation
method may be struggling, however. It is taxing to represent a
two-peaked distribution with a few cumulants.
If you are really interested in phase transitions (not everyone
is) you should consider the following points.
1. For your chosen ensemble and boundary conditions, is there
a finite-size scaling form for the appropriate distribution
function, giving a universal prediction at criticality? If not,
you cannot hope to locate the critical point accurately, (to
within a few percent) because this is the way it is characterized. Lets assume that this has been done, and that it is
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

644

similar to the scaling form discussed above.


2. Do you have plenty of cpu time available? Even for systems of a few hundred atoms, very slow fluctuations, 106
sweeps, are seen 1% away from criticality, and exactly at the
critical point, runs of length 5 107 seem to be necessary.
3. Do your measured distributions look like the correct scaling form? If not, you cannot be close to the critical point.
You cannot extrapolate to the critical point until you have
entered the asymptotic regime!
4. How do the scaled distributions change with increasing system size? Only at the critical point will they be invariant, and
here they will (typically) have the two-peaked structure discussed above. In the coexistence region, the side peaks will
become peakier; in the one-fluid region they will broaden
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

15

PHASE TRANSITIONS

645

and the central region will grow. This system-size-dependence


is the essential ingredient.
Of course, if one simply wants a rough guide to the position of
the critical point, it may be sufficient to make a fit to the coexistence curve far away from Tc and assume some equation for this
curve plus the law of rectilinear diameters.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

646

16 Quantum simulation using path integrals


In this section we look briefly at the problem of including quantum mechanical effects in computer simulations. We shall only
examine the simplest technique, which exploits an isomorphism
between a quantum system of atoms and a classical system of
ring-polymers, each of which represents a path integral of the
kind discussed in Feynman and Hibbs [1965]. To a large extent
we shall neglect quantum mechanical exchange and the fermion
problem, althout there will be some references to recent work on
this. For more details on work in this area see De Raedt [1996],
Ceperley [1996], Tuckerman and Hughes [1998] and other chapters in Binder and Ciccotti [1996], Berne et al. [1998].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

647

16.1 The density matrix


Recall the definition of the density matrix in sec 2.2.2, particularly
eqn (2-7)

i
%nm = hcn cm
where we expand the system state wavefunction, (q), in a complete orthonormal basis set
X
cn n (q)
=
cn = (n |)
(q) =
n

where the (. . . | . . .) is Diracs bra-ket notation. Here we are restricting attention to equilibrium ensembles, so we drop any time
dependence.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

648

The density operator, whose matrix representation is given


above, can therefore be expressed
%=h

|) (|

i=

N


1 X
(k)


(k) .
N k=1

The angle brackets denote averaging over the members of an ensemble; system states (k) may be represented, or weighted, more
than once, depending on the ensemble.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

649

16.1.1 Canonical ensemble density matrix


For an equilibrium ensemble, we have already seen (sec 2.3.1) that
% may be expressed as a function of the Hamiltonian H , and this
implies that it will be diagonal in any representation which diagonalizes H . Suppose that the (k) constitute such a representation,
i.e.
H (k) = E (k) (k)
then
% = f (H ) =






f (E (k) ) (k) (k)

where the choice of f depends on the ensemble.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

650

For the canonical ensemble


1
E
f (E (k) ) = QNV
Te

(k)

where the normalization constant guarantees that Tr% = 1


QNV T =

eE

(k)

= TreH

and so the canonical density matrix is


1
H
.
% = QNV
Te

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

651

16.1.2 Expanding the density matrix


Recall the coordinate representation of the density matrix, eqn (2-8),


XX
H 0
1

e
q
q
n (q)%nm m
(q0 ) = QNV
%(q, q0 ) =
T
m n

and correspondingly for the partition function


Z




H
= dq q eH q .
QNV T = Tre
Actually evaluating this is tricky, because H = K + V and the
kinetic and potential energy operators do not commute. Hence
e(K+V ) eK eV .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

652

When the exponent is small (e.g. at high temperature), reasonable approximations exist. This problem is attacked in a manner similar to that used to derive expressions for the propagator U(t) = eiLt , as a succession of small-timestep propagators in
sec 3.3: we split the exponential up into smaller pieces.
We will be using the Trotter formula again, eqn (3-14), which
relies on
e(K+V )/P eK/P eV /P
for sufficiently large P .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

653

This follows, loosely, by comparing Taylor series expansions


e(K+V )/P

eK/P eV /P

()
(K + V )
P

1 ()2  2
2
+
KV
+
V
K
+
V
K
+ ...
+
2 P2
()
= 1+
(K + V )
P

1 ()2  2
2
K
+ ...
+
2KV
+
V
+
2 P2
= 1+

For a more formal treatment, see Schulman [1981].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

So, we write

654

h
iP
eH = eH /P

and insert into the expression for the partition function


Z




QNV T = dq1 q1 eH /P eH /P . . . eH /P q1 .
The reason for calling our integration variable q1 will become clear
in a moment. Now we do one of the standard quantum mechanical
tricks, inserting the identity operator as a complete sum of states
in the coordinate representation:
Z

1 = dq q q
in between each exponential.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

655

This will introduce P 1 additional integrations over coordinates, which we label q2 . . . qP :


Z







dq1 . . . dqP q1 eH /P q2 q2 eH /P q3 . . .
QNV T =




. . . qP eH /P q1 .
Each of the contributions (q|eH /P |q0 ) is an un-normalized, offdiagonal, density matrix %(q, q0 ) evaluated at a temperature a factor P higher than the temperature of the real system. In fact, the
same decomposition can be applied to the density matrix itself,
by not performing the trace over the outer coordinates:
Z









H 0
q
=
dq2 . . . dqP q eH /P q2 q2 eH /P q3 . . .
q e




. . . qP eH /P q0 .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

656

16.1.3 Path integral interpretation


This has the interpretation of a path integral when we allow
P


. It is a sum of all possible contributions to a path q q0 ,
passing through intermediate states
 
  
q q2 q3 . . . qP q0
and we integrate over all such intermediate states. It represents
an un-normalized probability for this transition. The inverse temperature /P may be interpreted as an imaginary time. For developments and applications, see Feynman and Hibbs [1965].

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

657

Figure 16.1 Path integral representation of density matrix.

/P

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

658

16.1.4 Approximate form for the discrete path integral


As in the case of the propagator, we shall be applying a symmetrical version of the Trotter formula to the high-temperature density
matrix

 

1 V /P K/P 1 V /P 0
H /P 0
q .

q q e 2
e
e 2
q e

The potential energy part is diagonal in the coordinate representation.




1
0




q eH /P q0 e 2 (V (q)+V (q ))/P q eK/P q0 .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

659

Evaluating the kinetic energy part needs a Fourier transformation. Insert the complete set of momentum eigenstates
Z

1 = dp p p
to evaluate the kinetic energy




q eK/P q0
Z


=
dp q p eK/P p q0
Z


2 2
=
dp q p p q0 e p /2mP
Z
0
2 2
=
dp ei(qq )p/ e p /2mP

since q p = eiqp/ . This Fourier transform is easy.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

660

Hence
QNV T

!dP /2 Z
Z
Pm

.
.
.
dq1 . . . dqP
2 2
(
)

Pm  2
2
2
exp
q12 + q23 + . . . + qP 1
22




V (q1 ) + V (q2 ) + . . . + V (qP )


exp
P

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

661

16.2 Classical ring polymer isomorphism


This discretized path-integral form is isomorphic to the classical
partition function of a system of ring polymers. Each atom in a
given ring corresponds to different imaginary time points.
V (q) represents the interatomic interactions (for example, LennardJones) between the atoms of the real system. This couples together only correspondingly labelled atoms, i.e. atoms with the
same imaginary time index. So, between real atoms, there are P
such interactions, each one weaker than the true potential by a
factor 1/P .
In addition, harmonic quantum springs couple together successive imaginary-time representations of each atom within a ring
polymer.
We may simulate this classical ring polymer system by conventional Monte Carlo or molecular dynamics.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

662

Figure 16.2 The classical ring polymer isomorphism.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

663

16.2.1 Practical points


Temperature, or , appears in the partition function in an unusual
way. If we write
V
Vcl
Vqu

= Vcl + Vqu

1
V (q1 ) + V (q2 ) + . . . + V (qP )
=
P

Pm  2
2
2
=
+
q
+
.
.
.
+
q
q
12
23
P1
22 2

then the average energy takes the form


E=

3
NP kB T + hVcl i Vqu
2

As P is increased, both the kinetic part and the spring part


increase, possibly worsening the statistics on E. This has led to
suggestions of alternative ways of estimating E.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

664

As P goes up, the springs become stronger, the interactions become (individually) weaker, and this leads to sampling problems.
In MD, one would need to use multiple timestep methods to
ensure proper handling of the spring vibrations, and there is a
physical bottleneck in the transfer of energy between the spring
system and the other degrees of freedom.
In MC, one can attempt to use configuration-biased methods
to generate properly sampled ring-polymer coordinates. If this
means reconstructing the polymer from scratch, it will involve
biasing the moves towards closure of the polymer ring.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

665

16.3 Fermions and bosons


For fermions (especially) and bosons there are additional problems. Let P be one of the N! permutations of particle labels. Then
each fermion eigenstate has the property
(Pq) = (1)P (q)
and the density matrix %F has the symmetry
%F (q, q0 ) = (1)P %F (Pq, q0 ) = (1)P %F (q, Pq0 )
It is possible to relate this to the Boltzmann (i.e. distinguishable
particle) density matrix %(q, q0 ) by
%F (q, q0 ) =

Statistical Mechanics and Molecular Simulation

1 X
(1)P %(Pq, q0 )
N! P

M. P. Allen 1999

16

QUANTUM SIMULATION USING PATH INTEGRALS

666

16.3.1 The fermion problem


We may express a path integral in the form
Z
Z
1 X
0
P
(1)
. . . dq2 . . . dqP
%F (q, q ; ) =
N! P
%(Pq, q2 ; /P )%(q2 , q3 ; /P ) . . . %(qP , q0 ; /P )
Many permutations need to be summed over. Also, when we close
the path and take the trace, cycles corresponding to odd permutations contribute with negative weight. Near-cancelling positive
and negative permutations constitute a major practical problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

667

17 Notes
Note 7.1.3 From the usual laws of probability concerning the
adding together of n independent results, the rms error in the
mean is

rms (at ) = rms (a)/ n


We need to estimate n. We anticipate n t/a .
Giving a bit more detail,
1
at =
t
so
a2t

1
= 2
t

Zt
0

dt

Statistical Mechanics and Molecular Simulation

Zt
0

Zt
0

dt 0 a(t 0 )

dt 00 a(t 0 )a(t 00 ).

M. P. Allen 1999

17

NOTES

668

Ensemble averaging, we obtain the standard result [Papoulis, 1965]


Z
Z
E
D

1 t 0 t 00

0
00
=

dt
dt
a
(t
)
a
(t
)
a2t
t2 0
0
Z


2 t 0
dt (1 t 0 /t) a(0)a(t 0 ) .
=
t 0
If we average over only a short time compared with a , this gives
E D
E
D
a2t = a2
as expected: averaging makes no difference. If t  a we get,
asymptotically,
E D
E
D
a2t = a2 2a /t
or, in other words,

q
rms (at ) = rms (a)/ t/2a .

Statistical Mechanics and Molecular Simulation

(17-1)
M. P. Allen 1999

17

NOTES

669

So n = t/2a . If a is not known a priori then the data can be


analyzed to yield it, or n, directly. Back to main text.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

670

Note 7.1.4 From the usual laws of probability concerning the


adding together of n independent results, the rms error in the
mean is

rms (aL ) = rms (a)/ n


We need to estimate n. We anticipate n (L/a )d where d is the
spatial dimensionality (e.g. d = 3).
Giving a bit more detail, write aL as a volume integral,
Z
aL = V 1 dr a(r)
where a(r) = a(r) a. Then write
Z
Z
D
E
1
dr
dr2 ha(r1 )a(r2 )i
a2L
=
1
V 2Z
1
dr12 haa(r12 )i .
=
V
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

671

We have eliminated one of the integrals, by assuming translational


invariance: we simply choose one point as the origin. Then we use
the definition of the pair correlation function
c(r) = haa(r)i /ha2 i
D
E
D
E
to write haa(r)i = a2 c(r), where a2 is the average over a
small distance (or the single-particle average): it will have a value
of O(1). All we need to know about c(r) is that it will decay to
zero on a length scale a , so the d-dimensional integration will
yield a volume of order ad . (We assume that L  a ). The factor
V 1 , of course, is just Ld . Thus
E D
E
D
a2L a2 (a /L)d .
or, in other words,

q
rms (aL ) rms (a)/ (L/a )d .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

672

So n (L/a )d . Back to main text.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

673

Note 7.4.4 To see the system-size dependence of the secondorder cumulant, we need to analyze the pair correlations.
Z
Z
Z
E
D
1
1
2
dr12 haa(r12 )i
aL = 2 dr1 dr2 ha(r1 )a(r2 )i =
V
V
We have eliminated one of the integrals, by assuming translational
invariance: we simply choose one point as the origin. Then we
use the definition of the pair correlation
Efunction, whichDwe now
E
D
(2)
2
write c (r), to write haa(r)i = a c (2) (r), where a2 is
the average over a small distance (or the single-particle average):
it will have a value of O(1). All we need to know about c (2) (r) is
that it will decay to zero on a length scale a , so the d-dimensional
integration will yield a volume of order ad . The factor V 1 , of
course, is just Ld . Thus
E D
E
D
a2L a2 (a /L)d Ld a .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

674

We introduce a quantity a , (e.g. a heat capacity or compressibility), which should be well behaved in the thermodynamic limit.
Back to main text.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

675

Note 7.4.5 To analyze the system-size dependence of the thirdorder cumulant, we shall need to consider the triplet correlation
function c (3) (r1 , r2 , r3 ) and integrate over three coordinates. One
of the integrations will be redundant. Thus
Z
Z
Z
D
E
3
3
a V
dr1 dr2 dr3 c (3) (r1 , r2 , r3 )
ha(r1 )a(r2 )a(r3 )i =
Z
Z
E
D
=
a3 V 2 dr12 dr13 c (3) (r12 , r13 )
This will vanish whenever any one coordinate strays outside a
range of a of the other two, so the integral can only give rise
to a value of O(a2d ). The result is
E D
E
D
a3L a3 (a /L)2d L2d a0
a0 will turn out to be another thermodynamic derivative like a .
Back to main text.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

676

Note 7.4.6 In the crucial integral


Z
Z
Z
Z
E
D
4
4
a V
dr1 dr2 dr3 dr4
ha(r1 )a(r2 )a(r3 )a(r4 )i =
c (4) (r1 , r2 , r3 , r4 )
a nonzero integrand does not necessarily depend on all the coordinates lying within the same region of space, of dimension a .
There will be a contribution whenever pairs are close, lets
E
D say
r1 , r2 and r3 , r4 . We can see that we get terms involving a2L
again:
Z
Z
D

z
E
}|
{z
}|
{
=
a2 V 2 dr1 dr2 c (2) (r1 , r2 )
a(r1 )a(r2 ) a(r3 )a(r4 )
Z
Z

D
E
2
2
(2)
dr3 dr4 c (r3 , r4 )
a V
E2
D

a2L (a /L)2d .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

677

This spoils the steady reduction in the order of magnitude of


the moments, which is why the cumulants are defined with these
terms subtracted off. There are three possible ways of pairing the
coordinates, so the modified average
ha(r1 )a(r2 )a(r3 )a(r4 )i ha(r1 )a(r2 )i ha(r3 )a(r4 )i
ha(r1 )a(r3 )i ha(r2 )a(r4 )i
ha(r1 )a(r4 )i ha(r2 )a(r3 )i
genuinely does involve four points all confined to a region of space
of linear dimension a , and
D

E
D
E2 D
E
a4L 3 a2L a4 (a /L)3d L3d a00

(defining yet another quantity a00 ) as required. Back to main text.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

678

Note 15.2.3 We stated that the phase transition occurs when the
P(E) curve has two peaks of equal height, whereas it is surely correct to say that each phase should have equal integrated probability, which would correspond to peaks of equal area. The difference
turns out to be an ensemble correction. We have seen (eqn (1-13))
that the Helmholtz free energy measured in a constant-NV T Monte
Carlo simulation will be related to the microcanonical ensemble
entropy and energy by
q
F = S/kB E + ln 2 kB T 2 CV .
The correction term arises because we are averaging over the
energy fluctuations corresponding to the two peaks, we are not
(0)
(0)
simply constrained to the values EI and EII . Now if we set
(0)

FI

(0)

= FII

and apply this relation we obtain (abbreviating CV = C)


q
q
(0)
(0)
CI PNV T (0) (EI ) = CII PNV T (0) (EII ) .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

17

NOTES

679

Recalling that the peak width is proportional to C, we see that


this implies equal peak areas at coexistence. The correct (NV T
ensemble) two-Gaussian form at coexistence is therefore

(E E (0) )2
(E E (0) )2
1
1
I
II
exp
+p
PNV T (0) (E) p exp
2k T (0) 2 C
2k T (0) 2 C
CI
CII
B

II

The above argument echoes Privmans discussion [see Privman,


1990, p84] of the methods adopted in two frequently-cited papers
[Binder and Landau, 1984, Challa et al., 1986]. Back to main text.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

680

18 Answers to Problems
Answer 1.1 For the classical canonical ensemble % exp(H ),
we have
+
!
*
Z
Z
A
A
H /kB T
=
dp dq e
q
q
!
Z
Z
Z


eH /kB T

H /kB T

A
dp dq
=
dp Ae

q
where we integrate by parts. At the limits q we can assume
that the hamiltonian makes the first term vanish. Of course, if
q really stands for many coordinates, we are still implicitly keeping the integrations over the other components, along with the
integrals over p.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

681

Then we straightforwardly differentiate the exponential, giving


+ Z
+
*
*
Z
H H /kB T
A
H
= dp dq
e
.
A= A
kB T
q
q
q
In a similar way we can prove
+ *
+
*
H
A
= A
.
kB T
p
p
Choosing A = q gives kB T = hqH /qi; A = p gives kB T =
hpH /pi. In a similar way, setting A = H /q gives
kB T h 2 H /q2 i = h(H /q)2 i ,
a useful relation between the curvature of the potential and the
mean-square force. Back to problem.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

682

Answer 1.2 The required derivatives are


f 0 (x) = (n/x) 1 = 0
00

f (x) = (n/x ) = 1/n

at the maximum
at the maximum

The first of these defines the position of the maximum xmax = n.


Then
Z


1
(x n)2
dx exp n ln n n
(n + 1)
2n
0
Z


1
(x n)2 .
dx exp
exp{n ln n n}
2n

Only a small error is


made by extending the lower limit to and
the integral is just 2 n. The final result is
p

(n + 1) = n! 2 n nn en .
The term in parentheses is the value of the integrand at its maximum; the prefactor is the correction term.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

683

This is perhaps more familiar as Stirlings approximation


p
ln n! n ln n n + ln 2 n + . . . .
There is a close comparison with our discussions of energy distributions: n N and x E. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

684

= (A, H ) simply use the chain rule


Answer 2.1 To prove that A
!
!
A
A
d
+

A(q, p) =
q
p
dt
q
p
!
A H
A H

= (A, H ) .
=
q p
p q
= (H , H ) = 0, and moreover f(H ) = (f /H )H
=0
Hence H
for any function f (H ). Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

685

Answer 2.2 From the definitions we see that


XX

n (q)%nm m
(q0 )
%(q, q0 ) =
m n

XX
m n

n (q) hcn (t)cm


(t)i m
(q0 )

*
=

XX
m n

n (q)cn (t)cm
(t)m
(q0 )

= h (q, t) (q0 , t)i .


This is obviously independent of the choice of basis set n (q).
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

686

Answer 2.3 We have defined the quantum Liouville operator


iLA (i)1 [A, H ] .
Following the hint, we start by differentiating the expression
i

eiLt A = e  H t Ae  H t .
The left hand side gives
d iLt
e A = iLeiLt A = eiLt iLA .
dt
This would follow from the series expansion of the exponential,
for instance. Note how all operators commute with themselves,
and with themselves raised to any power.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

687

Time-differentiating the right gives






i
i
i
i
d
i
e  H t Ae  H t
H A e  H t
= eHt
dt



i
i
i
AH e  H t
e  H t

i

= e  H t (i)1 [A, H ]e  H t .
Inserting our definition iLA (i)1 [A, H ] we see that the left
and right sides are indeed equivalent. Since evidently
i

eiLt A = e  H t Ae  H t .
is true at t = 0, we conclude that it is always true. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

688

Answer 2.4 There are several parts to this.


RR
Using the definition Tr(. . .)
dqdp(. . .) we wish to show
that Tr(A LB) = Tr(B LA) in the classical case. Let us
start with
ZZ
ZZ
dqdpA (B, H )
dqdpA iLB =
!
ZZ
B H
B H

.
=
dqdpA
q p
p q
We tackle each of the two terms in parentheses in turn.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

689

Integrate the first term over q first, by parts, assuming as


before that quantities vanish at the boundaries.
!
Z
Z

B H
H
= dqB
A
dqA
q p
q
p
Z
Z

2H
A H
dqBA
.
= dqB
q p
qp
So, restoring the integration over p,
Z
Z
Z
Z
A H
B H
= dp dqB
dp dqA
q p
q p
Z
Z
2H
.
dp dqBA
qp

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

690

Similarly, we treat the second term in parentheses


Z
Z
Z
Z
A H
B H
= dp dqB
dp dqA
p q
p q
Z
Z
2H
.
dp dqBA
pq
When we recombine the two terms, the 2 H /pq parts cancel and we are left with
!
ZZ
ZZ
A H
A H

dqdpB

dqdpA iLB =
p q
q p
ZZ
=
dqdpB(A , H )
ZZ
=
dqdpBiLA .

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

691

The factors of i cancel and we may write


ZZ
ZZ

dqdpBLA .
dqdpA LB =
or Tr(A LB) = Tr(BLA ). Since iL is a real operator, L is
imaginary, L = L, so Tr(A LB) = Tr(B LA) as required.
The quantum proof of this relation is easier, given a basic
familiarity with operators.

= hABi
To show hABi
we apply the above result to obtain
= Tr%AiLB = TrAiLB%
hABi

= TrB%iLA = TrB%A
= hABi

= Tr%AB
.
Notice that we mustnt be sloppy and pretend that operators commute when they might not. We only use cyclic
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

692

permutation under trace here. The result also follows from


d
dt hABi = 0.
To show hA(t)i = Tr(%A(t)) = Tr(%(t)A), again we directly apply the result we obtained at the start.
hA(t)i = Tr%A(t) = Tr%eiLt A
= TrAeiLt % = TrA%(t) = Tr%(t)A .
This can also be made clear by writing
i

Tr%A(t) = Tr%e  H t Ae  H t
i

= Tre  H t %e  H t A = Tr%(t)A
where we have simply used cyclic permutation under the
trace.
Back to problem.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

693

We know %
+ Tr%A.
(the
Answer 2.5 We write dhAi/dt as Tr%A
total derivative of %) is zero anyway, so the first term vanishes.
The second term may be written
= Tr%(A, H ) = Tr(H , %)A = Tr(%/t)A ,
Tr%A
which is zero. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

694

Answer 2.6 We can start with


d
d
= hAi
=0.
hAi =
Tr%A = Tr%A
dt
dt
i + hqpi
= 0. Hamiltons equations then
If we let A = qp then hp q
give us the result
hpH /pi hqH /qi = 0 .
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

695

Answer 2.7 We have


H

(e

!
eH A eH A

, A) =
q p
p q
!
H A H A

eH
=
q p
p q
H
= (A, H )eH = Ae

as required. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

696

Answer 3.1 The Verlet trajectory is defined by


r(t + t) = 2r(t) r(t t) + t 2 a(t)
Write down the leapfrog Verlet position equation for successive
steps
1

r(t + t) = r(t) + tv(t + 2 t)

1
r(t) = r(t t) + tv(t 2 t)

and subtract to give


1
1
r(t + t) r(t) = r(t) r(t t) + t[v(t + 2 t) v(t 2 t)] .

The leapfrog velocity equation


1

v(t + 2 t) = v(t 2 t) + ta(t)


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

697

allows us to reduce the term in square brackets to ta(t), from


which the standard Verlet equation follows.
Similarly, write down the velocity Verlet position equations for
successive steps
1
r(t + t) = r(t) + tv(t) + 2 t 2 a(t)

r(t) = r(t t) + tv(t t) + 2 t 2 a(t t)


and subtract to give
o
hn
1
r(t + t) r(t) = r(t) r(t t) + t v(t) + 2 ta(t)
oi
n
.
v(t t) + 12 ta(t t)
Now the velocity equation for the previous step may be written
1
v(t) = v(t t) + 2 t [a(t) + a(t t)]
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

698

and this can be used to eliminate the velocities from the terms in
square brackets, giving the standard Verlet equation once more.
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

699

Answer 3.2 It is easiest to start with the Euler method. For the
harmonic oscillator, the position and velocity equations give
2 x 2 (t + t) = 2 x 2 (t) + 2 t 2 v 2 (t) + 22 tx(t)v(t)
v 2 (t + t) = v 2 (t) + 2 t 2 x 2 (t) 22 tx(t)v(t) .
Multiplying by m/2 and adding gives for the energy
E(t + t) = E(t)[1 + 2 t 2 ] .
The problem with this is that it is clearly monotonically increasing,
and just second order in the timestep. Thus, the Euler method is
very poor for this kind of problem. For the velocity Verlet method,
the algebra follows a similar line, but is slightly more tedious. The
result is that the second-order terms in t cancel out, so energy
conservation is much better. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

700

Answer 3.3 An example solution appears in the worksheet which


you may download from the course Web page. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

701

Answer 3.4 A sample solution appears on the course home page.


Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

702

Answer 4.1 This Maple exercise involved direct determination of


the partition function for a small spin system. You were simply
required to experiment with the parameters: there is no specific
answer. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

703

Answer 4.2 This Maple exercise allowed you to iterate the transition matrix for a simple Monte Carlo scheme, and compare with
the limiting distribution obtained from the eigenvalue/eigenvector
problem. Eigenvalue 1 does indeed correspond to the Boltzmann
distribution. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

704

Answer 4.3 In this problem you were asked to prove the microscopic reversibility of the Metropolis prescription. Suppose (without loss of generality) that %n %m . Then the move n m
has probability nm = nm . This is a downhill move, selected with probability nm and accepted unconditionally. The
reverse move m n has mn = mn (%m /%n ). This is an uphill move, selected with the same probability mn = nm , but
only accepted with probability %m /%n (this can be done by picking
a random number). We see that %n mn = %m nm as required.
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

705

Answer 4.4 In this problem you were asked to comment on the


values of those eigenvalues of the transition matrix other than the
one guaranteed to be unity. These other eigenvalues should determine the rate at which the system evolves towards the limiting
distribution. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

706

Answer 5.1 The incorporation of ln V sampling, and the calculation of the temperature, are illustrated in the answer program
which you can download from the Web. The T calculation is based
on
kB T h 2 V /q2 i = h(V /q)2 i
=

kB T

h(V /q)2 i

h 2 V /q2 i

(V /q)2
2 V /q2

+
.

The derivation of the formulae for curvature (i.e. Laplacian) and


mean-square force must be done carefully. Expanding the usual
condensed notation
N X
N
N
N
N X
X
X
X
X
X
2V
2
2
21
=
k V =
k
v(rij ) =
k
v(rij )
q2
2 i=1 ji
k=1
k=1
i=1 j>i
k=1

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

707

Then notice that taking 2k v(rij ) produces nonzero terms when


i = k and when j = k, so we get

N
X

X
X
1
2V
2
=

v(r
)
+
v(r
)
kj
ik
k

q2
2
k=1

jk

ik

Both these terms are actually identical, so with a relabelling of the


indices we get
N X
X
2V
=
2i v(rij ) =
q2
i=1 ji

N X
X



2 v(r )

i=1 ji

= 2

N X
X
i=1 j>i

Statistical Mechanics and Molecular Simulation

r =rij



2 v(r )

r =rij

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

708

Using the chain rule it is easy to show


2 v(r ) =

d2 v(r ) 2 dv(r )
+
dr 2
r dr

and for the Lennard-Jones potential in reduced units


v(r ) = 4(r 12 r 6 )

2 v(r ) = 528r 14 120r 8 .

The calculation of the other term, (V /q)2 , is relatively easy:


P
P
it is just i fi fi = i fi2 where fi is the total force on atom i.
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

709

Answer 6.1 The answer may be downloaded from the course


home page. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

710

Answer 6.2 This Maple exercise applied the Nos-Hoover thermostat to the simple harmonic oscillator. At low damping you
should see essentially harmonic behaviour, perturbed by the flow
of energy in to and out of the system. At high damping the behaviour becomes dramatically different, with rapid switching between branches characterized by positive and negative momentum. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

711

Answer 7.1 An example solution is provided on the home page.


Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

712

Answer 7.2 An example solution is provided on the home page.


Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

713

Answer 8.1 An example solution is provided on the home page.


Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

714

Answer 8.2 From eqn (8-10)


P V NkB T

2
N
3

Z
0

dr r 3

dv(r ) v(r )
e
dr

and we aim to integrate by parts. We must be careful since r 3 ev(r )


diverges as r . Hence the hint, which leads to
Z


dr r 2 ev(r ) 1
P V NkB T 2 NkB T
0

This answer is exact, notwithstanding the low-density approximation for g(r ), because B2 is defined in the limit of low density.
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

715

Answer 8.3 This is the Debye-Hckel theory of electrolytes and


plasmas in its simplest form. The OZ equation, which relates c

and h, now simply applies to v and w. In k-space it is w(k)


=

v(k)/(1
+ v(k))
where w(k)
and v(k)
are Fourier transforms
defined in the usual way. For the special case of the Coulomb
potential v(r ) = a/r we can do the Fourier transform (carefully)

=
to give v(k)
= 4 a/k2 . Then the above equation gives w(k)
2
2
2
4 a/(k + kD ) with kD = 4 a. An inverse Fourier transform
finally yields w(r ) = exp(kD r )a/r . Thus the potential of mean
force is the screened Coulomb potential, kD is an inverse screening length, and w(r ) is (interestingly) of shorter range than v(r ).
In this system the ionic atmosphere reduces the range of correlations. All the above holds in the limit of low density; nonlinear
extensions are possible, to extend the applicability to higher density. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

716

Answer 8.4 Directly from OZ we have

S(k) = 1 + h(k)

R 2
2 + k2

and a Fourier transform yields


h(r ) = exp(r /)/4 R 2 r .
This form describes, in a simple way, behaviour at the critical
point. The correlation length diverges as T Tc , but c(r ) remains of finite range. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

717

Answer 8.5 12, 2 and 120 respectively. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

718

Answer 8.6 Here they are.

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

Answer 8.7

and

1
F =
2

719

+
1

1
F / =
2

Back to problem.

Statistical Mechanics and Molecular Simulation

+
1

+
1

+
1

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

720

Answer 9.1 To lowest order c(r ) = f (r ), which behaves exactly


as the question said. To next order, we can quote the low-density
limit of PY (since both PY and HNC are equivalent and correct to
this order in ). The result is c(r ) = 0 outside the core as before,
1
and c(r ) = (1+8)+6(r / ) 2 (r / )3 where is the sphere
diameter. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

721

Answer 9.2
1. The Ornstein-Zernike equation, eqns (8-18,8-19) becomes simply
Z
h(r) = f (r) + dr0 f (r0 )h(r r0 )
=

+
1 2

....
1

All of these diagrams are called chains for obvious reasons,


and the missing diagrams to order 2 , may be seen by comparing with eqn (8-28).
2. To solve this equation analytically for the hard sphere system, we need the Fourier transform of f (r) which, recall,

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

722

equals 1 when |r| and zero otherwise:


Z
Z
sin kr
ikr

dr e
= 4
dr r 2
f (k) =
kr
0
r
4
=
(k cos k sin k ) .
k3

Then expressions for h(k)


and S(k) follow from

h(k)
=
and

f(k)
1 f(k)

S(k) = 1 + h(k)

3. The plots of S(k) appear on the next page.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

723

Plots of S(k) in the chain approximation.


1.5

S(k)

=0.1
*
=0.5
*
=0.8
*

0.5

10

15

20

25

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

724

Answer 9.3 This is just straightforward algebra.


(
)
(
)
P
P
2
1
+
=
3 kB T virial 3 kB T cmprs

(1 + 2 + 32 )(1 ) + 2(1 + + 2 )
3(1 )3
(
)
3 + 3 + 32 33
P
=
3(1 )3
kB T CS

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

725

Answer 9.4 My results for g(r ) are shown on the next page - the
results obtained with the repulsive part of the potential vR (r ) are
very close to those for the full potential v(r ). You may download
a small program to convert g(r ) and gR (r ) into E and P from the
course home page. Using this, from my runs (yours will be slightly
different) I get:
Method
MD using v(r ), simulation averages
From simulated g(r ) and full v(r )
From simulated gR (r ) and full v(r )

E
-3.94
-3.94
-3.77

P
1.50
1.51
2.31

The differences between g(r ) and gR (r ) are sufficient to make a


difference, especially in the pressure, but it is not a terrible first
approximation.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

726

3.0

rc=1.122
rc=2.5
2.5

g(r)

2.0

1.5

1.0

0.5

0.0
0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

727

Answer 10.1
1. Using stationarity we see that
hA(0)A(t)i = hA(t0 )A(t0 + t)i
and we simply choose t0 = t and use the fact that classical
quantities commute.
2. The stationarity condition tells us that hA(t0 )B(t0 + t)i is
independent of t0 ; so we can differentiate with respect to t0
and we should get zero:
d
0 )B(t0 +t)i+hA(t0 )B(t
0 +t)i = 0.
hA(t0 )B(t0 +t)i = hA(t
dt0

= hA(0)B(t)i.
Note
Then we set t0 = 0 to get hA(0)B(t)i

that hAAi = hAAi = 0 either from this or the previous


result.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

728

3. We do an integration by parts
Z
Z


dCAB (t)

dt hA(0)B(t)i
=
dt
dt
0
0

= |CAB (t)|0 = hABi .


Note: throughout we have been taking hAi = hBi = 0, so
CAB () = hAihBi = 0.
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

729

Answer 10.2
1. Setting t 0 = t,
Z
Z
0
it

dt e
CAA (t) =
dt 0 eit CAA (t 0 ).
CAA () =

Since CAA (t) is even, CAA (t 0 ) = CAA (t 0 ), so this last expresAA (), i.e. C
AA () is also even. Moreover,
sion is equal to C

0
CAA (t) is real, CAA (t ) = CAA (t 0 ), so our expression is also
AA () is also real.
() i.e. C
equal to C
AA
2. Again, from the definitions, and now integrating by parts,
we see
Z


d
it

dt e
CAA (t)
CAA() =
dt

Z



it
CAA (t)

dt eit (i)CAA (t)


= e

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

730

AA ()
= iC
since the | . . . | term is zero.
3. In a similar way
AA ().
AA() = 2 C
AA() = iC
C
4. The proof for Fourier-Laplace transforms is very similar, although the result contains an important difference.
Z


d
AA() =
CAA (t)
dt eit
C
dt
0
Z



dt eit (i)CAA (t)
= eit CAA (t)
0

AA ().
= CAA (0) + iC
Now the | . . . | term is not zero, but gives CAA (0) = hA2 i.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

731

5. In a similar way
AA() = iCAA (0) 2 C
AA ()
AA() = CAA(0) + iC
C
= 0).
(notice that CAA(0) = hAAi
6. See below.
AA () at low are obtained by straightAA () and C
7. Both C
forward use of Taylor expansion about = 0:
Z

Z






it

CAA ()
=
dt
e
C
(t)
=
dt CAA (t)
AA


=0
0

and



d

d CAA ()

=0

=0

Z



it

=
dt (it)e
CAA (t)

0
=0
Z
= i
dt tCAA (t)
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

and



d2

AA ()


C

d2
=0

732

Z



2 it

=
dt
(it)
e
C
(t)
AA


0
=0
Z
=
dt t 2 CAA (t)
0

and so on. This gives the result


Z

Z


dt CAA (t) i
dt tCAA (t)
CAA () =
0
0

Z
2
dt t 2 CAA (t) + . . . .

2
0
AA () is treated similarly but the coefficients of odd powC
ers of vanish because CAA (t) is even in t.
8. The short-time expansion of CAA (t) is dealt with in a similar
way.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

733

9. For the high-frequency expansion, use the short-time expansion of CAA (t)
Z

CAA () =
dt eit CAA (t)
0
Z


1 2
it
dt e
CAA (0) + t CAA (0) + . . . .
=
2
0
Now substitute = it to give
AA () =
C

1
i

Z
0

d e

1 2
CAA (0) + . . .
CAA (0)
2 2

AA (0)/i3 + . . . .
= CAA (0)/i C
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

734

Answer 10.3 From


rx (t) rx (0) =
i.e.
2

(rx (t) rx (0)) =

Zt
0

dt

Zt

dt 0 vx (t 0 )

Zt
0

dt 00 vx (t 0 )vx (t 00 )

we see that
D

d
1
lim
h(rx (t) rx (0))2 i
2 t dt
Z
Z
d t 0 t 00
1
lim
dt
dt hvx (t 0 )vx (t 00 )i
=
2 t dt 0
0
Z
Z
d t 0 t 00
1
dt
dt hvx (0)vx (t 0 t 00 )i
lim
=
2 t dt 0
0
Z
Z 0
d t 0 t
dt
dt 00 hvx (0)vx (t 0 t 00 )i.
= lim
t dt 0
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

735

In this last step we have used the fact that hvx vx (t)i is even in
time, so the integrand is symmetric about the line t 0 = t 00 (see
diagram).

t"

t"

Now we can set = t 0 t 00 , and define f () = hvx vx ()i. So


Zt
0

dt

Z t0
0

dt

00

00

f (t t ) =
=

Statistical Mechanics and Molecular Simulation

Zt
0

Zt
0

dt

Z t0

d f ()
Zt
d f ()
dt 0
0

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

736

Zt
0

d (t )f ().

This was the hint. Note how we switched the order of integration
in the middle (see diagram). This gives us
Zt
d (t )f ()
h(rx (t) rx )2 i = 2
0

and at large times this becomes


Z
Z
2
d hvx vx ()i 2
d hvx vx ()i .
lim h(rx (t) rx ) i = 2t
t

The second term on the right will just contribute a constant (assuming that hvx vx ()i decays faster than 1 ), while the first
term will give the dependence on t at large times. So
Z
dt hvx (0)vx (t)i .
D = kB T =
0

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

737

There is a slightly quicker route to this result, if we are not concerned to see the time-dependence coming out so explicitly:
D

d
t dt
lim

Zt
0

dt 0

Z t0
0

dt 00 f (t 0 t 00 )

Z
Z 0
d t 0 t
dt
d f ()
= lim
t dt 0
0
Zt
d f ()
= lim
t 0
Z
d f ().
=
0

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

738

Answer 10.4 The results from my runs are shown on the next
page. Yours may look slightly different. I plot Cvv (t), so the t = 0
values are not the same as each other, reflecting the different run
temperatures.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

739

2.0
gas
liquid
solid
1.5

<v(0)v(t)>

1.0

0.5

0.0

0.5

10

20

30

40

50
60
timesteps

70

80

90

100

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

740

Answer 10.5 A specimen program may be downloaded from the


home page. I set v = 1.0 which produces the results on the
next page (in principle, normalized to unity at t = 0). This value
of v increases the system temperature by about 10% over the
5000-step run suggested in the question, and the results are still
quite poorly averaged, but good enough to compare qualitatively
with the results of the previous problem. The signal-to-noise ratio
may be improved either by increasing v or by averaging over
more blocks. To do this properly, we should counter the effects of
heating due to the perturbation, and ensure that the configuration
at the start of each block is properly equilibrated.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

741

1.5
gas
liquid
solid

velocity response

0.5

0.5

20

40

60

80

100

steps

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

742

Answer 10.6 The slightly-modified MD program, and the new


analysis program, may be downloaded from the home page. Typical results are shown on the next two pages. Note the long time
scale needed before the gas-phase functions settle down. Also
note that it takes longer for the liquid h(rx (t) rx (0))2 i, and
hvx (0)(rx (t)rx (0))i curves to approach their limiting behaviour
than one might guess from looking at hvx (0)vx (t)i.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

743

1.0
gas
liquid
solid
0.8
1

0.6

0.05
<v(0)r(t)>

0.4

<v(0)r(t)>

<v(0)v(t)>

0.2

0.00
0

20

40
60
steps

80

100

Statistical Mechanics and Molecular Simulation

200

400 600
steps

0.0
800 1000

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

744

10
gas
liquid
solid

<v(0)v(t)>

8
1

6
2

<r(t) >

0.05

<r(t) >

0.00
0

20

40
60
steps

80

100

200

400 600
steps

0
800 1000

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

745

Answer 10.7 For simplicity of notation, drop the x subscript in


all of this.
For a steady field E, applied from time t = 0, our standard
formula gives
h(t)iE =

E
kB T

Zt
0

dt 0 h
(t 0 )i =

E
kB T

Zt
0

(t 0 )i .
dt 0 h

Allowing t we can use the results of earlier problems


to express this as
Eh 2 i
.
hiE =
kB T
This is an entirely static formula - no dynamics. On the left
we have the long-time, steady-state, response to the applied
field. On the right, we have a term involving the equilibrium

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

746

fluctuations of . The formula could have been derived entirely within time-independent thermodynamic perturbation
theory. The polarizability is = hiE /E = h 2 i/kB T . This
should be familiar: atomic polarizabilities (for example) are
related to quantum mechanical electronic charge cloud fluctuations.
Now let E(t) = E cos t. By a familiar argument we obtain
at long times
Z

E
cos t
dt 0 cos t 0 h
(t 0 )i
h(t)iE =
kB T
0
Z

0
dt sin t 0 h
(t 0 )i
+ sin t
0

so there are in-phase and out-of-phase components. More

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

747

compactly we write E(t) = Eeit so that, at long times,


Z
E it 0 it 0
e
dt e
h
(t 0 )i
h(t)iE =
kB T
0
E it
e C ()
=
kB T

E it 
()
e
C (0) iC
=
kB T
so writing h(t)iE = hiE eit , the frequency-dependent polarizability is
() = hiE /E =


1 
()
C (0) iC
kB T

As 0 this gives the static result seen above, (


() C(0)/i = h 2 i/i
0) = h 2 i/kB T . As , C
and ( ) vanishes.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

748

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

749

Answer 11.1 We start by introducing the time-displacement operator for B, and permuting under the trace:
Z
AB () =
dt eit Tr eH AB(t)
C

Z
dt eit Tr eH AeitH / BeitH /
=

Z
=
dt eit Tr eitH / BeitH / eH A

The aim is to change variables:


= t i

i/ = it/ +

making the combination of exponentials between B and A just


eiH / . If this is going to get us anywhere, we must insert eH eH =
1 just after the trace, and multiply the whole thing by e e =
1:
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

AB () = e
C

750

dt ei(ti)

H (it+)H /

Tr e Z e
Bei(t+)H / A

d ei Tr eH eiH / BeiH / A
= e
Z


d ei Tr eH B()A
= e

as required. A mathematician would cringe, of course, at our complete faith in things being analytic and well-behaved. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

751

A A() is real, we can see that


Answer 11.2 Given that C
Z
1
AA ()
d eit C
CAA (t) =
2
Z


1

it
CAA ()
d e
= CAA
(t)
=
2
as required. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

752

Answer 11.3 From the Hermitian property

BA (t) =
=
=
=
=
=
=

n
n
n

(i)1 h[A, B(t)]i

(i)1 hAB(t) B(t)Ai

o
(i)1 Tr%AB(t) %B(t)A


(i)1 Tr % A B(t) % B(t) A


(i)1 Tr % B(t) A % A B(t)


(i)1 Tr %B(t)A %AB(t)


(i)1 Tr %AB(t) %B(t)A = BA (t)

so BA is real.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

753

We can use stationarity to show the effects of time reversal:


BA (t) = (i)1 h[A, B(t)]i
= (i)1 h[A(t), B]i
= (i)1 h[B, A(t)]i = AB (t).
Hence AA (t) is real and odd. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

754

Answer 11.4 Introducing = t 12 i gives us


AA () =
C

cl
dt eit CAA
()
Z
1
cl
d ei CAA
()
= e 2 

= e

2 

cl (),
C
AA

cl
(t) is real and
assuming analytic behaviour. Hence, assuming CAA
cl


CAA () satisfying
even, as is CAA (), we have CAA () = e
detailed balance. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

755

Answer 11.5 We can start with the formal solution of the Langevin
equation
A(t) = A(0)et/tA + et/tA

Zt
0

dt 0 et

0 /t
A

0 ).
A(t

0 )i = 0 for t 0 >
Multiply by A(0) and average, noting that hAA(t
2
t/t
A . Back to problem.
0, so directly hAA(t)i = hA ie

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

756

Answer 11.6 This time square both sides and average. Again
0 )i = 0 for t 0 > 0, so
hAA(t
hA(t)2 i = hA2 ie2t/tA
Zt
Zt
0
00
2t/tA
0
0 )A(t
00 )i .
+e
dt
dt 00 e(t +t )/tA hA(t
0

t 00

t 0 and t+ = t 00 + t 0 , for which


We change variables to t =
1
the Jacobian is 2 . On the other hand, because of the t 0 t 00
symmetry, we can divide the integral into two equal parts, just
integrate over positive t , and double the result. Note that, by
stationarity, hA(t)2 i = hA2 i Then
!
Zt
Z 2tt
2
2t/tA
2
t+ /tA
dt
dt+ e
hAA(t )i
hA i +
hA i = e
0

= e

2t/tA

hA i + tA

Statistical Mechanics and Molecular Simulation

Zt
0

dt

(2tt )/tA

t /tA

!
A(t
)i
hA

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

757

This becomes
2

hA i =

tA
+e

Zt
0

!
t /tA

dt e

2t/tA

A(t
)i
hA

hA(0) i tA

Zt
0

!
t /tA

dt e

A(t
)i
hA

When we allow t , the exponential e2t/tA will wipe out the


second term, and we are left with
hA2 i = tA

Zt

or
1
tA

2 1

= hA i

A(t
)i
dt et /tA hA

Z
0

dt et/tA hA(0)
A(t)i

as required. Back to problem.


Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

758

Answer 12.1 The equations were P2 = P and Q 2 = Q. This is


pretty obvious for P because PB gives something proportional to
A; the second time we operate, it acts only on A (the other terms
are just numbers) and clearly PA = hAAi1 hAAiA = A. Hence
P2 = P. For Q we have QQB = Q(1 P)B = QB QPB. This last
term must be zero, since PB gives something proportional to A,
and then when we operate with Q we get
QA = (1 P)A = A A = 0 .
Hence Q 2 = Q. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

759

= 0
Answer 12.2 Because i = hA2 i1 hAAiA(t)
and hAAi
for a single variable A. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

760

Answer 12.3 We want to show


Zt
0
0
dt 0 eiL(tt ) PiLeQiLt
eiLt = eQiLt +
0

given P and Q satisfying P + Q = 1. Start with the thing we have


to prove and time-differentiate:
iLt

iLe

QiLt

= QiLe

+ iL

= iL eQiLt +

Zt

Zt
0

dt 0 eiL(tt ) PiLeQiLt + PiLeQiLt


!
0

dt 0 eiL(tt ) PiLeQiLt

The last step uses P + Q = 1. The quantity in parentheses is what


we started out with. So if the equation is true at t = 0 (it is,
obviously), then it is true at all other times. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

761

Answer 12.4 From the definition of the Dirac delta function,


Z

0
0
0
dr (r + ri (0) r )(r ri (t))
Gs (r, t) =
= h(r + ri (0) ri (t))i .
Also, from the definition of i (r, t),
Z

0
0
0
dr i (r r, 0)i (r , t)
Gs (r, t) =

Z
=
dr0 i (r0 , 0)i (r0 + r, t)

Z
0
=
dr i (0, 0)i (r, t)
= V hi (0, 0)i (r, t)i
since the integrand is independent of r0 by translational invariance. Back to problem.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

762

Answer 12.5 Here, we simply write down the desired correlation


function in our original coordinate system, and again in a new
system defined by ri ri r0 :
*
+
XX
0
Ai (0)Bj (t)eikri (0) eik rj (t)
hA(k, 0)B(k0 , t)i =
i

XX

i(k+k0 )r0

Ai (0)Bj (t)eikri (0) eik rj (t)


E

By translational invariance, these must be the same, for any r0 ,


0
0
i.e. ei(k+k )r = 1 for all r0 . Hence we must have k + k0 = 0.
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

763

Answer 12.6
Setting = 1/2 2 , we can see that
Z
Z


1
2
2m x 2
x e
dx =
x 2m1 d ex
2

Z
1
2
(2m 1)x 2m2 ex dx
=
2
But

hx i =
=

Z

2
x 2 ex dx

1
= 2.
2

Hence we see that hx 2m i = (2m 1)hx 2 ihx 2m2 i and the


result follows by iteration.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

764

We can use the series expansion to get this; note that odd
powers vanish on averaging:
+ *
+
*
X (ix)n
X (ix)2m
ix
=
he i =
n!
(2m)!
n=0
m=0
=

X
(1)m hx 2m i
(2m)!
m=0

X
(1)m 1 3 5 . . . (2m 1)hx 2 im
1 2 3 . . . (2m 1) (2m)
m=0

=
=

(1)m hx 2 im
2 4 . . . (2m)
m=0

X
( 12 )m hx 2 im
m=0

Statistical Mechanics and Molecular Simulation

m!



1
= exp hx 2 i
2

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

765

as required. This is Blochs theorem.


Now to the physical results. If we assume that ri (t)ri (0) is
Gaussian, choose k to lie in the x direction, and use Blochs
theorem, we get immediately
Is (k, t) hexp {ik (xi (t) xi (0))}i

E
1 2D
2
= exp k (xi (t) xi (0))
2

E
1 2D
= exp k |ri (t) ri (0)|2
6
as required. The last step follows by symmetry.



At long times h|r(t)r(0)|2 i 6Dt, so Is (k, t) exp k2 Dt
and the spatial Fourier transform of this is


Gs (r, t) (4 Dt)3/2 exp r 2 /4Dt .
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

766

Here we go around in a circle. Gs (r, t) is clearly a product of


functions like (4 Dt)1/2 exp(x 2 /4Dt) in each coordinate
direction. Hence, as in the first part of this question, we can
write = 1/4Dt, and obtain
Z
p
2
hx 2 i = / dx x 2 ex = 1/2 = 2Dt
from which the result follows.
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

767

Answer 12.7 Choose k again to lie in the x direction, then


i (k, t) = eikxi (t)
i eikxi (t) .
i (k, t) = ikx

Hence
d2
hi (k, 0)i (k, t)i
dt 2
i (k, t)i
i (k, 0)
= h
D
E
2
i (t)eik(xi (t)xi (0))
i (0)x
= k x

Is (k, t) =

i (0)x
i (t)i
k2 hx
the last step holding as k 0.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

768

Hence if Cvv (t) is the velocity autocorrelation function,


1 d2
Is (k, t)
k0 k2 dt 2
vv () = 2 lim Ss (k, ) .
C
k2
k0
Cvv (t) = lim

Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

769

Answer 12.8 Take k to lie in the direction, and consider the


(, = x, y, z) .
component of p
X
(k, t) =
pi exp(ikri )
p
i

(k, t) =
p

X
i

= ik

ik
ri pi exp(ikri ) +

X pi pi
i

mi

i exp(ikri )
p

exp(ikri ) +

fi exp(ikri )

fi being a component of the total force acting on i. The first term


is clearly proportional to ik, but we need to work on the second.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

770

Write fi as a sum of forces on i due to other atoms j, and


manipulate the double sum as follows:
XX
X
fi exp(ikri ) =
fij exp(ikri )
i

=
=

XX

fji exp(ikrj )



1 XX
fij exp(ikri ) exp(ikrj ) .
2 i j

In the penultimate step we switched i j; in the last step we


added and halved the previous two lines, using fji = fij . Now if
we let rij = ri rj ,
X
i

fi exp(ikri ) =

h
i
1 XX
fij exp(ikri ) 1 exp(ikrij ) .
2 i j

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

771

The term in square brackets is clearly proportional to ik. So, in


the end, we can write

(k, t) = ik.P (k, t)


p
with
P (k, t) =

X pi pi
i

mi

exp(ikri )

"
#
1 exp(ikrij )
1 XX
fij exp(ikri )
+
2 i j
ik
and in the limit k 0, this becomes
X pi pi
1 XX
+
rij fij .
P (k, t) =
mi
2 i j
i
This is the pressure or stress tensor. Back to problem.
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

772

Answer 12.9
1. Directly from the definition we see that (k2 /m)(k, ) is
the (Fourier-Laplace transformed) memory function for transverse momentum.
2. From the definition
(k, 0)p
(k, t)i
c (k, t) = (NmkB T )1 hp

(k, 0)p
(k, t)i
c (k, t) = (NmkB T )1 hp
= k2 (NmkB T )1 hP (k, 0)P (k, t)i
=

k2 G
C (k, t)
m

Now, from sec 10.3.4,

c () = 2 c () ic (0) = 2 c () i

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

773

since here c (t) is normalized, c (0) = 1. Hence

k2 G
C (k, ) = 2 c (k, ) i
m
=

2
i .
i + (k2 /m)(k, )

This rearranges to
(k, ) =

(k, )
iGC
.
(k, )
i (k2 /m)GC

This is valid for all k, . Note how, if we take the 0


limit first, this gives zero. Alternatively, if we take the k 0
limit first, this gives the usual Green-Kubo expression.
= V Pxy
3. In the usual linear response expression we need A
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

and hence
FV
hPxy (t)iA =
kB T

774

Z
0

dt

Pxy (t)Pxy (0)

which gives us through the Green-Kubo expression. (Take


care to distinguish between Pxy (t) which is intensive, a component of the pressure tensor, and P (k = 0, t) = V Pxy (t)).
Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

18

ANSWERS TO PROBLEMS

775

Answer 15.1 This Maple exercise investigated energy distributions around a first-order phase transitions. You were simply required to experiment with the parameters. Back to problem.

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

776

References
R. Agrawal and D. A. Kofke. Thermodynamic and structural properties of model systems at solid-fluid coexistence. II. melting and
sublimation of the Lennard-Jones system. Molec. Phys., 85:43
59, 1995a. 629, 630
R. Agrawal and D. A. Kofke. Thermodynamic and structural properties of model systems at solid-fluid coexistence. I. fcc and bcc
soft spheres. Molec. Phys., 85:2342, 1995b. 629
B. J. Alder and T. E. Wainwright. Phase transition for a hard sphere
system. J. Chem. Phys., 27:12081209, 1957. 599
B. J. Alder and T. E. Wainwright. Phase transition in elastic disks.
Phys. Rev., 127:359361, 1962. 599

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

777

J. Alejandre, D. J. Tildesley, and G. A. Chapela. Molecular dynamics


simulation of the orthobaric densities and surface tension of
water. J. Chem. Phys., 102:45744583, 1995. 611
Michael P. Allen. Back to basics. In Michael P. Allen and Dominic J.
Tildesley, editors, Computer simulation in chemical physics, volume 397 of nato ASI Series C, pages 4992. Kluwer Academic
Publishers, Dordrecht, 1993. Proceedings of the nato Advanced
Study Institute on New Perspectives on Computer Simulation
in Chemical Physics, Alghero, Sardinia, Italy, September 1424,
1992. 261
Michael P. Allen and Dominic J. Tildesley. Computer simulation of
liquids. Clarendon Press, Oxford, hardback edition, 1987. isbn
0198553757, 385pp. 7, 112, 143
Michael P. Allen and Dominic J. Tildesley, editors. Computer simStatistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

778

ulation in chemical physics, volume 397 of nato ASI Series C.


Kluwer Academic Publishers, Dordrecht, 1993. isbn 07923
22835, 519pp. Proceedings of the nato Advanced Study Institute on New Perspectives on Computer Simulation in Chemical
Physics, Alghero, Sardinia, Italy, September 1424, 1992. 7
H. C. Andersen. Molecular dynamics simulations at constant pressure and/or temperature. J. Chem. Phys., 72:23842393, 1980.
236
P. Attard. Simulation of the chemical potential and the cavity free
energy of dense hard-sphere fluids. J. Chem. Phys., 98:2225
2231, 1993. 529, 547, 548, 625
J. A. Barker and D. Henderson. J. Chem. Phys., 47:2856, 1967. 373
J. A. Barker and D. Henderson. What is liquid? understanding the
states of matter. Rev. Mod. Phys., 48:587, 1976. 6
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

779

R. Becker. Theory of Heat. Springer, Berlin, 1967. 6


C. H. Bennett. J. Comput. Phys., 22:245, 1976. 540, 573
B. J. Berne, G. Ciccotti, and D. F. Coker, editors. Classical and
Quantum Dynamics in Condensed Phase Simulations, Singapore,
1998. World Scientific. Proceedings of Euroconference, Lerici,
Italy, July 718, 1997, isbn 9810234988. 646
B. J. Berne and R. Pecora. Dynamic Light Scattering. J. Wiley New
York, 1976. 6, 393
K. Binder. Z. Phys. B. Cond. Mat., 43:119, 1981. 237, 261, 636, 637
K. Binder, editor. Applications of the Monte Carlo Method in Statistical Physics, volume 36 of Topics in Current Physics. Springer,
Berlin, 1984. 7

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

780

K. Binder, editor. Monte Carlo Methods in Statistical Physics, volume 7 of Topics in Current Physics. Springer, Berlin, second edition, 1986. 7
K. Binder. The Monte Carlo Method in Condensed Matter Physics.
Springer, Berlin, 1992. 7
K. Binder and G. Ciccotti, editors. Monte Carlo and molecular dynamics of condensed matter systems, volume 49, Bologna, 1996.
Italian Physical Society. Proceedings of Euroconference, Como,
Italy, July 328, 1995, isbn 8877940786. 7, 646
K. Binder and D. W. Heermann. Monte Carlo Simulation in Statistical Physics, volume 80 of Solid State Sciences. Springer, Berlin,
1988. 7, 277, 579, 599
K. Binder and D. P. Landau. Phys. Rev. B, 30:1477, 1984. 599, 679

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

781

K. Binder and D. Stauffer. A simple introduction to Monte Carlo


simulation and some specialized topics. In K. Binder, editor, Applications of the Monte Carlo method in statistical physics, pages
136. Springer-Verlag, Berlin, Heidelberg, 1987. 7
D. Boda, J. Liszi, and I. Szalai. An extension of the NpT plus test
particle method for the determination of the vapour-liquid equilibria of pure fluids. Chem. Phys. Lett., 235:140145, 1995. 626
F. R. Brown and A. Yegulalp. Physics Letters A, 155:252, 1991. 579,
599
A. D. Bruce. J. Phys. C, 14:3667, 1981. 636, 637
A. D. Bruce and N. B. Wilding. Phys. Rev. Lett., 68:193, 1992. 641
J. L. Cardy, editor. Finite-Size Scaling, volume 2 of Current Physics
- Sources and Comments. North Holland, 1988. 632
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

782

N. F. Carnahan and K. E. Starling. J. Chem. Phys., 51:635, 1969.


289, 361, 510
D. M. Ceperley. Path integral monte carlo for fermions. In K. Binder
and G. Ciccotti, editors, Monte Carlo and molecular dynamics of
condensed matter systems, volume 49, pages 443482. Italian
Physical Society, Bologna, 1996. Proceedings of the Euroconference on Monte Carlo and molecular dynamics of condensed
matter systems, Como, Italy, July 328, 1995, isbn 887794
0786. 646
M. S. S. Challa, D. P. Landau, and K. Binder. Phys. Rev. B, 34:1841,
1986. 579, 599, 679
D. Chandler. Introduction to Modern Statistical Mechanics. Oxford
University Press, New York, 1987. 6, 606

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

783

G. Ciccotti, D. Frenkel, and I. R. McDonald, editors. Simulation of


Liquids and Solids. North Holland, Amsterdam, 1987. 7
D. Mller and J. Fischer. Vapour liquid equilibrium of a pure fluid
from test particle method in combination with npt molecular
dynamics simulations. Molec. Phys., 69:463473, 1990. 626,
626
D. Mller and J. Fischer. Vapour liquid equilibrium of a pure fluid
from test particle method in combination with npt molecular
dynamics simulations. Molec. Phys., 75:14611462, 1992. Erratum. 626
J. J. de Pablo and J. M. Prausnitz. Phase equilibria for fluid mixtures
from Monte Carlo simulation. Fluid Phase Equilibria, 53:177189,
1989. 625

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

784

H. De Raedt. Quantum theory. In K. Binder and G. Ciccotti, editors, Monte Carlo and molecular dynamics of condensed matter systems, volume 49, pages 401442. Italian Physical Society,
Bologna, 1996. Proceedings of the Euroconference on Monte
Carlo and molecular dynamics of condensed matter systems,
Como, Italy, July 328, 1995, isbn 8877940786. 646
G. L. Deitrick, L. E. Scriven, and H. T. Davis. Efficient molecular
simulation of chemical potentials. J. Chem. Phys., 90:2370, 1989.
512, 514
R. Eppenga and D. Frenkel. Monte Carlo study of the isotropic and
nematic phases of infinitely thin hard platelets. Molec. Phys., 52:
13031334, 1984. 184
D. J. Evans. J. Chem. Phys., 78:3297, 1983. 234

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

785

D. J. Evans and G. P. Morriss. The isothermal isobaric molecular


dynamics ensemble. Phys. Lett. A, 98:433, 1983. 236
D. J. Evans and G. P. Morriss. Statistical Mechanics of Nonequilibrium Liquids. Academic Press, London, 1990. 382
W. Feller. An introduction to probability theory and its applications,
volume 1. Wiley, New York, second edition, 1957. 144
A. M. Ferrenberg and R. H. Swendsen. Phys. Rev. Lett., 61:2635,
1988. 279
R. P. Feynman and A. R. Hibbs. Quantum Mechanics and Path
Integrals. McGraw-Hill, 1965. 646, 656
D. Frenkel. Free-energy computation and first-order phase transitions. In G. Ciccotti and W. G. Hoover, editors, Molecular Dynamics Simulation of Statistical Mechanical Systems, pages 151188,
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

786

Amsterdam, 1986. International School of Physics Enrico Fermi,


Varenna, 1985, Course XCVII, North Holland. 573
D. Frenkel. Numerical techniques to study complex liquids. In
M. Baus, L. F. Rull, and J.-P. Ryckaert, editors, Observation, prediction and simulation of phase transitions in complex fluids,
volume 460 of NATO ASI Series C, pages 357419, Dordrecht,
1995. Kluwer Academic Publishers. Proceedings of the NATO
Advanced Study Institute on Observation, prediction and simulation of phase transitions in complex fluids, Varenna, Italy,
July 25August 5, 1994. 573
D. Frenkel, G. A. M. Mooij, and B. Smit. J. Phys. Cond. Mat., 4:
30533076, 1992. 572
D. Frenkel, B. M. Mulder, and J. P. McTague. Phys. Rev. Lett., 52:
287290, 1984. 523, 525
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

787

D. Frenkel and B. Smit. Understanding molecular simulation : from


algorithms to applications. Academic Press, San Diego, 1996.
isbn 0122673700. 7, 382
H. L. Friedman. A Course in Statistical Mechanics. Prentice-Hall,
1985. 6
G. Galli and A. Pasquarello. First-principles molecular dynamics.
In Michael P. Allen and Dominic J. Tildesley, editors, Computer
simulation in chemical physics, volume 397 of NATO ASI Series
C, pages 261313, Dordrecht, 1993. Kluwer Academic Publishers. Proceedings of the NATO Advanced Study Institute on New
Perspectives on Computer Simulation in Chemical Physics, Alghero, Sardinia, Italy, September 1424, 1992. 17
C. W. Gear. The numerical integration of ordinary differential

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

788

equations of various orders. ANL 7126, Argonne National Laboratory, 1966. 113
C. W. Gear. Numerical initial value problems in ordinary differential equations. Prentice-Hall, Englewood Cliffs, NJ, 1971. 113
H. Goldstein. Classical Mechanics. Addison Wesley, Reading, Massachusetts, second edition, 1980. 77
C. Gray and K. E. Gubbins. Theory of Molecular Fluids. Clarendon
Press, Oxford, 1984. 6, 37
J.-P. Hansen and I. R. McDonald. Theory of Simple Liquids. Academic Press, London, second edition, 1986. 6, 329, 354, 382,
393
J. Harris and S. A. Rice. J. Chem. Phys., 88:1298, 1988. 572

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

789

T. L. Hill. An Introduction to Statistical Thermodynamics. AddisonWesley, Reading, 1960. 6


R. W. Hockney and J. W. Eastwood. Computer simulations using
particles. Adam Hilger, Bristol, 1988. 105
C. D. Holcomb, P. Clancy, and J. A. Zollweg. A critical study of
the simulation of the liquid-vapour interface of a Lennard-Jones
fluid. Molec. Phys., 78:437459, 1993. 608
W. G. Hoover. Phys. Rev. A, 31:1695, 1985. 229
W. G. Hoover, A. J. C. Ladd, and B. Moran. Phys. Rev. Lett., 48:1818,
1982. 234
W. G. Hoover and F. H. Ree. J. Chem. Phys., 47:4873, 1967. 521,
525

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

790

W. G. Hoover and F. H. Ree. J. Chem. Phys., 49:3609, 1968. 521,


525
W. G. Hoover, M. Ross, D. Henderson, J. A. Barker, and B. C. Brown.
J. Chem. Phys., 52:4931, 1970. 519
K. Huang. Statistical Mechanics. Wiley, New York, 1963. 6
?? Johnson, J. A. Zollweg, and K. E. Gubbins. Molec. Phys., 78:591,
1993. 288
M. H. Kalos and P. A. Whitlock. Monte Carlo Methods. John Wiley,
New York, 1986. 7
D. A. Kofke. Direct evaluation of phase coexistence by molecular
simulation via integration along the saturation line. J. Chem.
Phys., 98:41494162, 1993a. 627, 629, 630

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

791

D. A. Kofke. Gibbs-Duhem integration: a new method for direct


evaluation of phase coexistence by molecular simulation. Molec.
Phys., 78:1331, 1993b. 627, 629
D. A. Kofke and E. D. Glandt. Molec. Phys., 64:11051131, 1988.
517
R. Kubo. Journal of the Physical Society of Japan, 17:1100, 1962.
263
R. Kubo. Statistical Mechanics. North Holland, Amsterdam, 1965.
6
J. Kushick and B. J. Berne. J. Chem. Phys., 64:1362, 1976. 491
A. J. C. Ladd and W. G. Hoover. Phys. Rev. B, 28:1756, 1983. 234

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

792

M. Laso, J. J. de Pablo, and U. W. Suter. Simulation of phase equilibria for chain molecules. J. Chem. Phys., 97:28172819, 1992.
622
J. Lee and J. M. Kosterlitz. Phys. Rev. Lett., 65:137, 1990. 279, 600
Y. S. Lee, D. G. Chae, T. Ree, and F. H. Ree. J. Chem. Phys., 74:6881,
1981. 512
E. M. Lifshitz and L. P. Pitaevskii. Statistical Physics, volume 5 of
Landau and Lifshitz Course of Theoretical Physics. Pergamon,
Oxford, third edition, 1980. 259
A Lotfi, J. Vrabec, and J. Fischer. Vapour liquid equilibria of the
Lennard-Jones fluid from the npt plus test particle method.
Molec. Phys., 76:13191333, 1992. 626

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

793

R. Lovett. Can a solid be turned into a gas without passing through


a first order phase transition? In M. Baus, L. F. Rull, and J.P. Ryckaert, editors, Observation, prediction and simulation of
phase transitions in complex fluids, volume 460 of NATO ASI Series C, pages 641654, Dordrecht, 1995. Kluwer Academic Publishers. Proceedings of the NATO Advanced Study Institute on
Observation, prediction and simulation of phase transitions in
complex fluids, Varenna, Italy, July 25August 5, 1994. 526,
528
R. M. Lynden-Bell, J. S. van Duijneveldt, and D. Frenkel. Molec.
Phys., 80:801, 1993. 602
S.-K. Ma. Statistical Mechanics. World Scientific, Singapore, 1985.
6
G. C. Maitland, M. Rigby, E. B. Smith, and W. A. Wakeham. InStatistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

794

termolecular forces: their origin and determination. Clarendon


Press, Oxford, 1981. 37
J. Mathews and R. L. Walker. Mathematical Methods of Physics. W.
A. Benjamin, second edition, 1973. 70
J. E. Mayer and W. W. Wood. J. Chem. Phys., 42:4268, 1965. 599
I. R. McDonald and K. Singer. Discuss. Faraday Soc., 43:40, 1967.
279
D. A. McQuarrie. Statistical Mechanics. Harper and Row, New York,
1976. 6
D. A. McQuarrie and ?? Katz. J. Chem. Phys., 44:2393, 1966. 373
E. J. Meijer, D. Frenkel, R. A. LeSar, and A. J. C. Ladd. Location of
melting point at 300K of nitrogen by Monte Carlo simulation. J.
Chem. Phys., 92:7570, 1990. 525
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

795

N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, A. H. Teller,


and E. Teller. J. Chem. Phys., 21:1087, 1953. 147
M. Mezei. Molec. Simul., 10:225, 1993. 525
A. Milchev, K. Binder, and D. W. Heermann. Z. Phys. B. Cond. Mat.,
63:521, 1986. 237, 261, 277, 579, 599
K. K. Mon and R. B. Griffiths. Phys. Rev. A, 31:956, 1985. 529, 530,
625
G. C. A. M. Mooij, D. Frenkel, and B. Smit. Direct simulation of
phase equilibria of chain molecules. J. Phys. Cond. Mat., 4:L255
L259, 1992. 622
I. Nezbeda and J. Kolafa. A new version of the insertion particle
method for determining the chemical potential by Monte Carlo
simulation. Molec. Simul., 5:391403, 1991. 529, 547, 625
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

796

D. Nicolaides and A. D. Bruce. J. Phys. A Math. Gen., 21:233, 1988.


637
D. Nicolaides and R. Evans. Phys. Rev. Lett., 63:778, 1989. 637,
641
S. Nos. A molecular dynamics method for simulations in the
canonical ensemble. Molec. Phys., 52:255, 1984a. 227
S. Nos. A unified formulation of the constant-temperature molecular dynamics methods. J. Chem. Phys., 81:511, 1984b. 236
A. Z. Panagiotopoulos. Molec. Phys., 62:701, 1987a. 622
A. Z. Panagiotopoulos. Direct determination of phase coexistence
properties of fluids by Monte Carlo simulation in a new ensemble. Molec. Phys., 61:813826, 1987b. 612

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

797

A. Z. Panagiotopoulos. Int. J. Thermophys., 10:447, 1989. 623


A. Z. Panagiotopoulos. Direct determination of fluid phase equilibria by simulation in the Gibbs ensemble: a review. Molec. Simul.,
9:123, 1992. 614
A. Z. Panagiotopoulos. Molecular simulation of phase equilibria. In
E. Kiran and J. M. H. Levelt Sengers, editors, Supercritical fluids
- fundamentals for application, NATO ASI Series E, Dordrecht,
1994. Kluwer Academic Publishers. 614
A. Z. Panagiotopoulos. Gibbs ensemble techniques. In M. Baus,
L. F. Rull, and J.-P. Ryckaert, editors, Observation, prediction and
simulation of phase transitions in complex fluids, volume 460 of
NATO ASI Series C, pages 463501, Dordrecht, 1995. Kluwer Academic Publishers. Proceedings of the NATO Advanced Study
Institute on Observation, prediction and simulation of phase
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

798

transitions in complex fluids, Varenna, Italy, July 25August 5,


1994. 573, 614, 623
A. Z. Panagiotopoulos, N. Quirke, M. Stapleton, and D. J. Tildesley.
Phase equilibria by simulation in the Gibbs ensemble. alternative
derivation,generalization and application to mixture and membrane equilibria. Molec. Phys., 63:527, 1988. 612
A. Papoulis. Probability, Random Variables and Stochastic Processes. McGraw-Hill, 1965. 668
S. R. Phillpot and J. M. Rickman. J. Chem. Phys., 94:1454, 1991.
279
S. R. Phillpot and J. M. Rickman. Molec. Phys., 75:189, 1992. 279,
282, 287

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

799

V. Privman, editor. Finite Size Scaling and Numerical Simulation


of Statistical Systems. World Scientific, Singapore, 1990. 6, 632,
679
A. Rahman. Correlations in the motion of liquid argon. Phys. Rev.,
136:A405A411, 1964. 486
H. Reiss, H. L. Frisch, and J. L. Lebowitz. J. Chem. Phys., 31:369,
1959. 510
J. M. Rickman and S. R. Phillpot. Phys. Rev. Lett., 66:349, 1991.
279
J. S. Rowlinson and F. L. Swinton. Liquids and Liquid Mixtures.
Butterworth, London, third edition, 1982. 7
D. Ruelle. Statistical Mechanics: Rigorous Results. Benjamin, Reading, Massachusetts, 1969. 576
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

800

L. S. Schulman. Techniques and applications of path integration.


Wiley, New York, 1981. 653
S.-Y. Sheu, C.-Y. Mou, and R. Lovett. How a solid can be turned
into a gas without passing through a first-order phase transformation. Phys. Rev. E, 51:R3795R3798, 1995. 526, 528
J. I. Siepmann and D. Frenkel. Molec. Phys., 75:59, 1992. 572
J. I. Siepmann, S. Karaborni, and B. Smit. Simulating the critical
behaviour of complex fluids. Nature, 365:330332, 1993. 622
J. I. Siepmann, I. R. McDonald, and D. Frenkel. Finite-size corrections to the chemical potential. J. Phys. Cond. Mat., 4:679, 1992.
575
B. Smit. Computer simulations in the Gibbs ensemble. In Michael P.
Allen and Dominic J. Tildesley, editors, Computer simulation in
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

801

chemical physics, volume 397 of NATO ASI Series C, pages 173


209, Dordrecht, 1993. Kluwer Academic Publishers. Proceedings of the NATO Advanced Study Institute on New Perspectives
on Computer Simulation in Chemical Physics, Alghero, Sardinia,
Italy, September 1424, 1992. 573, 614
B. Smit, S. Karaborni, and J. I. Siepmann. Computer simulations of
vapor-liquid phase equilibria of n-alkanes. J. Chem. Phys., 102:
21262140, 1995. 622
W. R. Smith and S. Labk. Molec. Phys., 80:1561, 1993. 532
M. Sprik. Effective pair potentials and beyond. In Michael P. Allen
and Dominic J. Tildesley, editors, Computer simulation in chemical physics, volume 397 of NATO ASI Series C, pages 211259,
Dordrecht, 1993. Kluwer Academic Publishers. Proceedings of
the NATO Advanced Study Institute on New Perspectives on
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

802

Computer Simulation in Chemical Physics, Alghero, Sardinia,


Italy, September 1424, 1992. 37
M. R. Stapleton and A. Z. Panagiotopoulos. Application of excluded
volume map sampling to phase equilibrium calculations in the
gibbs ensemble. J. Chem. Phys., 92:1285, 1990. 622
W. C. Swope and H. C. Andersen. A computer simulation method
for the calculation of chemical potentials of liquids and solids
using the bicanonical ensemble. J. Chem. Phys., 102:28512863,
1995. 514
W. C. Swope, H. C. Andersen, P. H. Berens, and K. R. Wilson. A
computer simulation method for the calculation of equilibrium
constants for the formation of physical clusters of molecules:
application to small water clusters. J. Chem. Phys., 76:637649,
1982. 107
Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

803

M. Tuckerman, G. J. Martyna, and B. J. Berne. J. Chem. Phys., 97:


1990, 1992. 119, 220
M. E. Tuckerman and A. Hughes. Path integral molecular dynamics: a computational approach to quantum statistical mechanics. In B. J. Berne, G. Ciccotti, and D. F. Coker, editors, Classical
and Quantum Dynamics in Condensed Phase Simulations, pages
311357. World Scientific, Singapore, 1998. Proceedings of Euroconference, Lerici, Italy, July 718, 1997, isbn 9810234988.
646
J. S. van Duijneveldt and D. Frenkel. Computer simulation study
of free-energy barriers in crystal nucleation. J. Chem. Phys., 96:
4655, 1992. 602
L. Verlet. Computer experiments on classical fluids. i. thermody-

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

804

namical properties of Lennard-Jones molecules. Phys. Rev., 159:


98103, 1967. 102, 203
L. Verlet. Computer experiments on classical fluids. ii. equilibrium
correlation functions. Phys. Rev., 165:201214, 1968. 102
L. Verlet and J.-J. Weis. Phys. Rev. A, 5:939, 1972. 363
J. Weeks, D. Chandler, and H. C. Andersen. J. Chem. Phys., 54:
5237, 1971. 376
B. Widom. Some topics in the theory of fluids. J. Chem. Phys., 39:
28082812, 1963. 57, 509
N. B. Wilding and A. D. Bruce. Density fluctuations and field mixing
in the critical fluid. J. Phys. Cond. Mat., 4:30873108, 1992. 641

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

805

W. W. Wood. Monte carlo calculations for hard disks in the


isothermal-isobaric ensemble.
J. Chem. Phys., 48:415434,
1968a. 599
W. W. Wood. Monte Carlo studies of simple liquid models. In
H. N. V. Temperley, J. S. Rowlinson, and G. S. Rushbrooke, editors, Physics of Simple Liquids, chapter 5, pages 115230. North
Holland, Amsterdam, 1968b. 183, 255, 260, 579, 599
W. W. Wood and J. D. Jacobson. Preliminary results from a recalculation of the Monte Carlo equation of state of hard spheres. J.
Chem. Phys., 27:12071208, 1957. 599
K. Yoon, D. G. Chae, T. Ree, and F. H. Ree. J. Chem. Phys., 74:1412,
1981. 512
Z. Zhang, O. G. Mouritsen, and M. J. Zuckermann. Weak first-order

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

REFERENCES

806

orientational transition in the lebwohl-lasher model for liquid


crystals. Phys. Rev. Lett., 69:28032806, 1992. 602
Z. Zhang, M. J. Zuckermann, and O. G. Mouritsen. Weak first-order
orientational transition in the lebwohl-lasher model for liquid
crystals. Molec. Phys., 80:1195, 1993. 602
R. Zwanzig. J. Chem. Phys., 22:1420, 1954. 366

Statistical Mechanics and Molecular Simulation

M. P. Allen 1999

You might also like