Computational Molecular Physics Lecture Notes
Petra Imhof
19th May 2014
Contents
1 Introduction
1.1
2
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
1.1.1
Random Walker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
1.1.2
1-dimensional harmonic oscillator . . . . . . . . . . . . . . . . . . . . . . .
2
1.1.3
Lennard-Jones uid
2
1.1.4
Classical water . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
1.1.5
Ising model
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
1.1.6
Diusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Statistical Mechanics/Statistical Thermodynamics
2.1
2.2
2.3
2.4
Microstates and Macrostates
Ensembles
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
5
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7
2.2.1
The Microcanonical Ensemble (N,V,E) . . . . . . . . . . . . . . . . . . . .
7
2.2.2
The most probable distribution in the microcanonical ensemble . . . . . . .
9
2.2.3
Equilibrium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
2.2.4
Entropy and Temperature . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
2.2.5
The Canonical Ensemble (N,V,T) . . . . . . . . . . . . . . . . . . . . . . .
13
2.2.6
The most probable distribution in the canonical ensemble . . . . . . . . . .
15
2.2.7
Isobaric-Isothermal Ensemble (N,p,T) . . . . . . . . . . . . . . . . . . . . .
18
Thermodynamic functions derived from the partition function . . . . . . . . . . . .
19
2.3.1
Internal energy, pressure and heat capacity . . . . . . . . . . . . . . . . . .
19
2.3.2
Entropy
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
2.3.3
Helmholtz Free energy . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
2.3.4
Chemical equilibrium
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22
Ensemble Averages
1
1
Introduction
Computational Molecular Physics or Molecular Simulations are somewhere between theory and
experiment. Simulations are often understood as the third pillar of science, etween theory and
experiment.
Simulations are used to obtain numerical solutions to theories that are analytically not solvable
or too tedious to be solved manually.
Such problems are e.g.
many-body systems with many
interacting particles. Thereby theories can be tested.
Moreover simulations allow to mimick experiments, Such computer experiments are useful to
explain real experiments because of the additional or complementary information contained in the
simulation, or to predict/replace experiments that are dicult or even impossible to perform in
real. Think of experiments which have to be conduncted a te.g. very high pressure or temperature
or other extreme or unrealistic conditions. One can even simulate the behaviour of yet unmade
molecules.
Just like real experiments, computer experiments, simulations, can help to test and to develop
theories.
This course deals with the questions how to perform simulation by introducing some of the
numerical methods and how to reate the simulation to theory and/or experiment.
1.1
Examples
There are a number of classical example systems that will reoccur in this course to show various
dierent concepts.
1.1.1 Random Walker
(to be completed...)
1.1.2 1-dimensional harmonic oscillator
(to be completed...)
1.1.3 Lennard-Jones uid
A Lennard-Jones potential is a means to introduce interaction between particles. It is a good model
for weakly interacting particles such as noble gases (e.g. Argon).
The ineraction is described by a pair potential as a function of the interatomic distances
U
σ
LJ
σ 12 σ 6
(r) = 4ε
−
r
r
is the optimal (lowest energy) distance and
ε
r
(1.1.1)
is the well depth at the optimal distance.
1.1.4 Classical water
Water can be modelled classically by a Lennard-Jones potential plus electrostatic interactions
U = U LJ + U coulomb
2
Figure 1: Radial distribution function of oxygen atoms in water. a) experiment (blue) b) simulation
One way to relate the molecular dynamics or Monte Carlo simulation of water is via the radial
distribution function
g (r).
This function describes the distriution of e.g. oxygen-oxygen distances
in bulk water, cf. 1. From this distribution the water density can be obtained.
Integrating over the rst solvation shell (up to a distance of 3.5Å) gives the average number
of water molecules (strictly speaking oxygen atoms) within that distance.
ˆ
3.5
gOO (r) r2 dr = 4
n = 4πρ
0
1.1.5 Ising model
The Ising model describes the interaction of
N
spins on a lattice, such as
↑↑↓↑ ↑↑↓↑ ↑↑↓↑
↑↓↑↑ ↑↓↑↑ ↑↓↑↑
The energy is given by
Er = −
N
X
Hµsi − J
i=1
with
n.n.
X
si sj
i,j
si,j = ±1.
1.1.6 Diusion
Diusion can be described by Fick's law
j = −D∇c
where the ux
D.
j
is proportional to the gradient of concentration
∇c
and the diucion coecient
To conserve the total amount of (labelled) material) we introduce
∂c (r, t)
+ ∇j (r, t) = 0
∂t
combining the two
∂c (r, t)
− D∇2 c (r, t) = 0
∂t
3
(1.1.2)
By intodrucing the boundary condition
c(r, 0) = δ (r)
We need only the second moment
Multipying eq 1.1.3 by
r2
∂
∂t
r2
exp −
4Dt
1
c (r, t) =
we get
(4πDt)d/2
2 ´
r (t) = drc (r, t) r2
using
´
drrc (r, t) = 1
and integrate
ˆ
ˆ
dr · r2 c (r, t) = D
dr · r2 ∇2 c (r, t)
solve by integration by parts
∂
∂t
ˆ
ˆ
2
dr · r2 ∇2 c (r, t)
dr · r c (r, t) = D
∂ 2 r (t) = D
∂t
ˆ
ˆ
2
dr∇ · r ∇c (r, t) − D dr∇r2 · ∇c (r, t)
ˆ
ˆ
2
= D dS r ∇c (r, t) − 2D drr · ∇c (r, t)
ˆ
ˆ
= 0 − 2D dr (∇ · rc (r, t)) + 2D dr (∇ · r) c (r, t)
ˆ
= 0 + 2dD drc (r, t)
(1.1.3)
= 2dD
Equation 1.1.3 relates the macroscopic diusion coecient
D
to the mean-squared distance
over which particles have moved in time. This distance can be measured in computer simulations
where we can monitor for every particle the position and hence the distance travelled in time
D
N
E
1 X
∆r (t)2 =
∆ri (t)2
N
i=1
4
t
(1.1.4)
2
Statistical Mechanics/Statistical Thermodynamics
The relation between the very detailed information we can obtain in simulations and the real world
which allows for a comparison with experiment is given by statistical mechanics. Computing the
individual properties we are now interested in the properties of systems.
Table 1: Molecular properties and properties of systems. Note that this is not a one-to-one relation
Mechanical properties of molecules
n
with atoms
xi , yi , zi
pxi , pyi , pzi
i
Thermodynamic properties of systems
positions / coordinates
Temperature
veloscities / momenta
pressure
mi
Un
T
p
m
individual masses
total mass
potential energy
Internal Energy
kinetic energy
Ekinn
Entropy
U
S
H
Enthalpy
Free Energy
A, G
For a comprehensive presentation of statistical mechanics the reader is referred to the appro-
? ?].
priate text books [ ,
The following brief introduction is only meant to outline the terms, ideas
and concepts necessary for the following chapters.
2.1
Microstates and Macrostates
Let us start the denition of a
microstate by an illustration.
If you toss a coin it will show head
or tail (and in very rare caces it will stand on the edge but those cases will be neglected here).
Then head or tail are two possible states for the coin. These are microstates. Another example is
a particle with spin, say an electron. That particle can have two spin states, spin up or spin down.
Without an external eld these two states are both equally probable. A third example is a die that
can show numbers 1 . . . 6. For a fair die all numbers are equally probable. All of those examples
are about one particle and we further note that in all those examples the ossible outcomes, the
microstate have equal a priori probability.
Let us now consider systems that contain many
particles.
Two coins:
The possible outcomes are head or tail for each of the two coins leading to following
combinations.
Coin 1
Coin 2
Value
H
H
2
H
T
1
T
H
1
T
T
0
If we assign a value to each of the two cases, say 1 for head and 0 for tail, the result can be
assigned a total value.
5
Four electrons with spin:
.
The spin of an individual electron is either
s = + 12
sz = − 12
r by E r =
or
B we can assign an energy value for each possible realisation
1
1
s
(
µ
:
Bohr's
magneton). Setting ↑= +
B
ν z,ν
2 and ↓= − 2 we have the following
In a magnetic eld
2µB B
P
mi-
crostates
Realisations
(↑↑↑↑)
(↑↑↑↓)
(↑↑↓↓)
(↓↓↓↑)
(↓↓↓↓)
(↑↑↓↑)
(↑↓↑↓)
(↓↓↑↓)
(↑↓↑↑)
(↓↑↑↓)
(↓↑↓↓)
(↓↑↑↑)
(↓↓↑↑)
(↑↓↓↓)
Value
(↓↑↓↑)
(↑↓↓↑)
Er
Er
Er
Er
Er
= 4µB B
= 2µB B
=0
= −2µB B
= −4µB B
Already with these simple examples we notice a couple of things:
1. The total value depends on the values of the individual outcomes.
2. Dierent combinations of individual values can lead to the same total value.
3. The numbers of individual combinations realising a total value dier.
.
The total value of the system here denes its macrostate
More general a
macrostate of a system
is dened by its (macromolecular) parameters, e.g. an energy value, a conformational fold (α-helix
or
β -sheet)
of a protein, being solid or uid, bound or unbound, before or after a reaction etc.
As we can see from above, dierent macrostates can be realised by dierent numbers of microstates which determines the probability of the macrostates.
Two dice:
equal
a priori
For one die the probability for each individual number 1,2. . . 6 is
1
6 . All numbers have
probability and all possible counts 16 have equal probability. Throwing now the two
dice and adding the numbers to give a count, the individual numbers per die still have the same
probability. However, the probabilities of the counts 2, 3, 4,..12 show a dierent distribution:
Realisations
6+1
5+1
5+2
6+2
4+1
4+2
4+3
5+3
6+3
3+1
3+2
3+3
3+4
4+4
5+4
6+4
2+1
2+2
2+3
2+4
2+5
3+5
4+5
5+5
6+5
1+1
1+2
1+3
1+4
1+5
1+6
2+6
3+6
4+6
5+6
6+6
1
2
3
4
5
6
5
4
3
2
1
2
36
3
36
4
36
5
36
6
36
5
36
4
36
3
36
2
36
3
4
5
6
7
8
9
10
11
Number of
Realisations
Probability
Count
1
6
·
1
6
=
2
1
36
1
6
The most probable outcome is 7 which has six realisation possibilites and hence a probability
of
1
6 . This is the macrostate with the highest number of microstates.
6
·
1
6
=
12
1
36
Let us summarise:
The probability of a microstate
r
is given by
1
Pr = P
r
and the probability of a macrostate (with value
E)
depends on the number of realisations repre-
senting it
{Pr with Er =E } = (P1 , P2 . . .)
The microstate, i.e. the states (position, velocity, spin, . . . ) of each particle in a system is known
in a simulation, hence the macrostate of the total system determined by those microstates is also
known.
We remember a denition of probability as the relative frequency of an event
i
according to
Ni
N →∞ N
Pi = lim
This shows that we need many experiments or many equivalent systems to obtain reasonable
probabilities. Consider
given by
Mr ,
M
many equivalent systems, then the probability to be in microstate
the number of systems in state
r
r
is
divided by the total number of systems.
Mr
Mr
≈
M →∞ M
M
Pr = lim
for
M
2.2
large. Those
M
systems are called a
statistical ensemble.
Ensembles
In this section we will look at dierent ensembles, distributions therein and arrive at relations to
thermodynamics properties.
2.2.1 The Microcanonical Ensemble (N,V,E)
N , xed volume V and xed total
Ĥ (q, p, x) with x = N, V and q :positions; p :momenta, denes
the energy of microstates Er = E r (x) either direct (classical) or as eigenvalues of the Hamiltonian
Imagine an isolated system with a xed number of particles
energy
E.
The Hamilton function
(quantum mechanical)
H (q, p, x) = Er (x)
(2.2.1)
Ĥ (x) |r > = E (x) |r >
Example: 1dim Harmonic Oscillator
For the one-dimensional harmonic oscillator the classical
Hamilton function is
H (q, p) =
p2
1
+ kq 2
2m
|{z}
|2 {z }
kinetic
with
m:
mass;
k:
sprnig constant.
7
potential
Figure 2: Eliptic orbit of an one-dimensional harmonic oscillator.
Figure 3: Space space spanned by positions
q
and momenta
p.
Classicaly points in phase space
represent microstates, uqnatum mechanically these are small cells of size
hν .
The total energy
Etotal = Ekin + Epot
does not depend on time. Therefore the total energy
Etotal = H (q, p)
is a
constant of motion.
Figure 2 shows all combinations of position and momenta the harmonic oscillator can reach lie
on an ellipse. The positions
q
and momenta
p
span the
phase space.
The ellipse's principal axes a,b (see Fig. 2) are given by
√
p2
2m hence p =q 2mE and
1
2E
2
b: zero kinetic energy E= kq hence q =
2
k .
a:zero potential energy
E=
That is, for a given system (given mass and spring constant) all points on the ellipse have the
same total energy. Each point in the ellipse represents one state of motion with total energy
E.
Each point is a microstate.
Note that according to the uncertainty principle
∆p∆q ≥
~
2 position and momenta cannot be
exactly dened at the same time. To account for that, we imagine phase space to be divided into
small cells of size
hν
where
ν
is the dimension. Each cell represents a microstate. In the classical
picture each point in phase space is a microstate (see Fig.3).
We can dene an energy hypersurface with area
dimensioanl harmonic oscillator this area is
σ = πab.
σ (E) =
´
E=H(q,p) dqdp.
For the one-
The size of the hypersurface can be used as
a measure for the number of microstates.
Let us now be a bit more tolerant and allow states with energy
are on an energy shell, cf. Fig. 4.
8
E + δE .
Then all allowed states
Figure 4: Energy shell with
E + δE
If we sum over all points that are compliant with the condition
microcanonical partition function
X
Er = E + δE
we obtain the
1 = Ω (N, V, E)
(2.2.2)
r:E≤Er (N,V )≤E+δE
The probabilities for the microstates are
(
Pr (N, V, E) =
1
Ω(N,V,E)
0
for E ≤ Er (N, V ) ≤ E + δE = const.
otherwise
(2.2.3)
In a continuous way one can likewise dene the probability to nd a system in a phase space element
ρ (N, V, E) =
where the
δ -function
1
δ [E − H (q, p)]
Ω (N, V, E)
(2.2.4)
ensures that only points on the energy surface contribute.
The statistical ensemble of systems with xed
ensemble.
N, V, E
=const.
is called a
microcanonical
2.2.2 The most probable distribution in the microcanonical ensemble
Consider an ensemble of
M
systems, all with the same with
systems is at time t in a microstate
(qν , pν ).
N, V, E
=const.
same energy surface. Now partition the surface in elements such that element
P mi systems (cf, Fig. 5. All
i mi . Then mi represents the
probability of system to be inσi .
Each of the
M
Microstates can be dierent, but they are all on the
i
has area
∆σi
and
contains
systems are distributed over the energy surface such that
M =
statistical weight of the system in the ensemble and
the
mi
M is
M systems over the surface elements. For example
m1 = 2;m2 = 2;m3 = 1;m4 = 0 or m1 = 1;m2 = 1;m3 =
There are many possible distributions of the
5 systems can be distributed such that
1;m4 = 2
, What is now the most probable distribution?
The probability for a certain distribution (set of
W {mi } =
9
{mi )
M!
Πi mi !
is given by
(2.2.5)
Figure 5: Energy surface partitioned into elements of area
There are
M!
possibilities to relabel the
M
∆σi
systems, however those
with
mi !
ni
systems (dots)
relabelled within the same
cell do not contribute to the total number of possibilities. Hence the total number of relabelling
possibilities is reduced (divided) by all the combinations (the product) of all relabellings within the
cells.
In order to nd the most probable distribution
{mi }∗
we have to determine the maximum
max {Wtot {mi }}. Since we are dealing with a smooth function, we will instead search for the
maximum of ln (Wtot {mi }) which will have the same {mi }. The logarithm enables us to make
use of Striling's formula such that we don't have to deal with the factorials
ln Wtot = ln M ! −
X
ln mi !
(2.2.6)
i
= M ln M − M −
X
(mi ln mi − mi )
i
To consider the boundary condition
and maximise the Lagrangian
L,
P
M =
i mi
= const
we use a Lagrangian mutliplier
i.e. we take the derivative with respect to
mi :
!
L = − ln Wtot + α
X
mi − M
i
∂L
∂mi
0
0
0
0
0
"
!#
X
∂
= −
ln Wtot + α
mi − M
∂mi
i
∂
ln Wtot + α
= −
∂mi
"
#
X
∂
= −
M ln M − M −
(mi ln mi − mi ) + α
∂mi
i
#
"
X
∂
=
(mi ln mi − mi ) + α
∂mi
i
mi
= ln mi +
−1+α
mi
= ln mi + α
10
α
Figure 6: An isolated system with constant N,V,E, subdivided into two subsystems A and B.
Arriving at
mi = exp (−α)
Equation 2.2.7 must hold for all
mi .
(2.2.7)
The most probable distribution is a constant distribution
with all cells having the same number of systems. For the microcanonical ensemble, we obtain the
same probability we have already seen
mi
Pi =
=
Mi
(
const
0
forH = E
otherwise
(2.2.8)
or for a small energy shell in continuous form
ρN,V,E
(
const
=
0
for E ≤ H (qν , pν ) ≤ E + δE .
otherwise
(2.2.9)
2.2.3 Equilibrium
From experience we know that any systems, left alone, evolves to a stable state whose macroscopic
properties do not change any more. We call this macrostate
equilibrium.
We can furthermore
dene the equilibrium as the most probable macrostate.
2.2.4 Entropy and Temperature
Consider an isolated system that is divided into two sub-systems. The total system has
N, V, E =const
but between the two subsystems we allow heat exchange.
Etotal = EA + EB .
We know that in the total system all microstates are equally probable with probability Pr =
1
Ωtotal (N,V,E) . What is now the probability W (E1 )for subsystem A to have energy E1 (and hence
for subsystem B to have energy E2 = Etot − E1 ) ? We sum over all microstates that are compliant
with the partition Etotal = E1 + E2 :
X
W (E1 ) =
Pr
The total energy, the sum of the two subsystem's energies is constant
r:E1 ,E2
=
X
X
r:EA =E1 r:EB =E2
=
1
Ωtotal (N, V, E)
ΩA (E1 ) · ΩB (E2 )
Ωtotal (E)
11
(2.2.10)
The partition functions, i.e., statistical weights of the two subsystems multiply
Ω = ΩA ·ΩB .
In
order to get the number of realisations of the total system (statistical weight), each realisation of
subsystem A has to be combined with every realisation of subsystem B.
To nd the most probable energy
the derivative w.r.t.
E1
E1
, i.e. the energy for which
W (E1 )
is maximal we take
and set to zero
d
W (E1 ) = 0
dE1
Since the partition function of the total system
Ωtotal (E)
is constant we leave this here out of our
calculation. We are thus left with
dΩA (E1 ) · ΩB (E2 )
dE1
dΩA (E1 )
· ΩB (E2 )
dE1
dΩA (E1 )
ΩA (E1 ) dE1
d ln ΩA (E1 )
dE1
d ln ΩA (E1 )
dE1
d ln ΩA (E1 )
dE1
=
=
=
=
=
=
dΩA (E1 )
dΩB (E2 )
· ΩB (E2 ) +
· ΩA (E1 )
dE1
dE1
dΩB (E2 )
−
· ΩA (E1 )
dE1
dΩB (E2 )
−
dΩB (E2 ) dE1
d ln ΩB (E2 )
−
dE1
d ln ΩB (E − E1 )
−
d (E − E1 )
d ln ΩB (E2 )
dE2
At this point it is useful to dene a quantity that is related to
ln Ω.
We dene the
entropy S
S = kB ln Ω
The constant
kB
(2.2.11)
(2.2.12)
is called the Boltzmann constant. We see that while the partition functions of
the two subsystems multiply to give the total partition function, the entropy is additive
Ωtotal = ΩA · ΩB
ln Ωtotal = ln ΩA + ln ΩB
Stotal = SA + SB
(2.2.13)
Entropy is a fundamental quantity in statistical mechanics. Its partial derivative with respect to
the variables determining the microcanonical ensemble dene important thermodynamic quantities.
These are
temperature T
pressure p
and the
chemical potential
∂S
∂E
∂S
∂V
∂S
∂N
=
1
T
(2.2.14)
=
p
T
(2.2.15)
N,V
N,E
=−
V,E
12
µ
T
(2.2.16)
Figure 7: A small subsystem A embedded ina larger subsyste B that can function as a heat bath
and hence allow heat exchange. The total system is isolated with N,V,E=cont.
With those denitions we can rewrite the condition for the most probable state as
d ln ΩA (E1 )
dE1
dkB SA
dE1
kB
TA
TB
d ln ΩB (E2 )
dE2
dkB SB
=
dE2
kB
=
TB
= TA
=
and see that the most probable state represents a
the same in both subsystems.
subsystems. At equilibrium
ln Ω
(2.2.17)
thermal equilibrium where the temperature is
This also means that the change in entropy is the same in both
is maximal
d ln Ω = d ln ΩA + d ln ΩB = 0
and therefore also the entropy is maximal
dS = dSA + dSB = 0 .
(2.2.18)
2.2.5 The Canonical Ensemble (N,V,T)
Let us consider again an isolated system that is divided into two subsystems A and B between which
we allow heat exchange. Let A be much smaller than B, Bb can be ragrded as a heat bath for A,
resulting in constant temperature
T = TA = TB .
is composed of the energies if the two subsystems
that
Etotal ≈ EB .
Again all
Ω (E)
Etotal = EA + EB
but we have
EA EB
such
microstates of the total system are equally probable.
Let now subsystem A have energy
ΩB (E − Er )
Furthermore the total energy, which is constant
EA = Er ,
corresponding to
ΩA (Er )
states.
Then only
states, that are equally probable, are left for the total system. The probability for
that scenario is
Pr =
We can already guess that for larger
Er
ΩB (E − Er )
Ω (E)
(2.2.19)
this ratio, and hence the probability becomes smaller. In
order to calculate the probility we make use of the fact that
13
Er E
and expand
ΩB (E − Er )
in
powers of
Er
around
E.
Actually, we expand
ln ΩB (E − Er )
:
∂
ln ΩB (E) · Er + . . .
∂E
∂ SB
· Er + . . .
= ln ΩB (E) −
∂E kB
Er
= ln ΩB (E) −
+ ...
kB T
ln ΩB (E − Er ) ≈ ln ΩB (E) −
(2.2.20)
Neglegting all hgher order term we get
Er
ΩB (E − Er ) = ΩB (E) · exp −
kB T
(2.2.21)
and hence for the probability
Pr =
=
The exponential term is called the
ΩB (E)
Er
· exp −
Ω (E)
kB T
Er
1
· exp −
Z
kB T
(2.2.22)
(2.2.23)
Boltzmann factor and denes the relativ probaility of a state
1
ZPcan be determined from the
normalisation, i.e. the sum of all porbabilities must be equal to one
Pr = 1, as
with energy
Er
at a given temperature. The pre-exponential factor
Z=
X
r
Z (N, V, T )
is called the
Er
exp −
kB T
(2.2.24)
canonical partition function.
In order to arrive at a general expression (which will turn out to look like eq.
2.2.22) for
distributing many systems over dierent energy levels, we will rst look at a simple, explicit example.
Example three systems
Let us consider three molecules A,B, and C. These molecules can be
ε0 , ε1 ,P
ε2 , ε3 where ε0 = 0, ε2 = 2 · ε1 , and ε2 = 2 · ε1 .
i Ni · εi = E = 3 · ε1 and the total number of particles (molecules) is
P
N
=
N
=
3
are
xed
where Ni is the number of molecules at energy level εi . Distributing the
i i
at energy levels
The total energy
molecules over the available energy levels we obtain three dierent macrostates I, II and III with
the following occupation numbers :
N0 = 2, N1 = 0, N2 = 0, and N3 = 1
II: N0 = 1, N1 = 1, N2 = 1, and N3 = 0
III: N0 = 0, N1 = 3, N2 = 0, and N3 = 0
I:
The realisations are as follows
Macrostate
ε3
ε2
ε1
ε0
Number of microstates
I
A
BC
3=
B
AC
II
III
C
AB
C
B
C
A
B
A
B
C
A
C
A
B
A
A
B
B
C
C
3!
2!·0!·0!·1!
6=
14
3!
0!·1!·1!·1!
ABC
1=
3!
2!·0!·0!·0!
Wn
The probability, i.e. the statistical weight
is the largest for state II, because it has most
microstates.
When counting the realisations, the microstates, the following rules apply:
•
exchanging two particles within the same energy level, does not generate a new microstate,
e.g. exchanging the order of writing from AB to BA at energy level
•
ε0
of state I
exchanging two particles between two dierent energy levels generate a new microstate,
e.g. swapping A and B in the rst realisation (microstate) of state I generates the second
microstate
•
putting one particle at a dierent energy level generates a new macrostate, e.g. putting A
ε3
of the rst microstate of state I from
to
ε2
would generate a macrostate that is neither I,
nor II nor III.
The statistical weight
Wn
can be calculated by
Wn =
with
N!
N!
N0 !N1 ! . . . Nm !
(2.2.25)
is the number of possibilities (permutations) to distribute N particles over the energy
levels, divided by the product of all
energy level (Ni
=number
Ni !
to account for the permuation of particles within the same
of particles at energy level
i).
This is equivalent to how we calculated
the statistical weight in Sec. 2.2.2 for a microcanonical ensemble.
2.2.6 The most probable distribution in the canonical ensemble
Consider now a system with
e.g. the set of
Ni
N
particles. We are again looking for the most probable distribution,
which maximises
Wn =
N!
N0 !N1 ! . . . Nm !
(2.2.26)
under the constraint that the total number of particles (molecules)
X
Ni = N
(2.2.27)
Ni · εi = E
(2.2.28)
i
and the total energy
X
i
are xed.
Instead of searching for the maximum of
Rewrite
ln W = ln N ! −
P
lni Ni !.
Wn
we will again search the maxmimum of
Using Stirling's equation for large
N
X
Ni
Ni ln Ni +
i
Taking the derivative w.r.t.
Nj
the term
N · ln N − N
15
X
.
this can be approximated
to
ln W = N · ln N − N −
ln W
i
vanishes. We have
=
∂ ln W
∂Nj
= −
∂ ln W
∂Nj
∂ ln W
∂Nj
of the sum only element
!
∂
∂Nj
∂ ln W
∂Nj
N · ln N − N −
X
Ni ln Ni +
X
i
Ni
i
∂ X
∂ X
Ni ln Ni +
Ni
∂Nj
∂Nj
i
i
X
∂Ni X ∂ ln Ni
∂ X
= −
ln Ni
−
Ni
+
Ni
∂Nj
∂Nj
∂Nj
i
i
i
X
∂Ni X
1 ∂Ni
∂ X
= −
ln Ni
−
Ni
+
Ni
∂Nj
Ni ∂Nj
∂Nj
i
i=j
i
(2.2.29)
i
remains, hence
∂ ln W
= − ln Nj
∂Nj
(2.2.30)
We will account for the two boundary conditions eq.2.2.27 and eq.2.2.28 by introducing the
lagrangian multipliers
α
and
β
and minimise the Langrangian
L,
i.e. take the derivative w.r.t.
Nj
and set to zero:
!
L = − ln W + α
X
Ni − N
!
+β
i
∂L
∂Nj
ln Nj
Nj
X
Ni εi − E
i
= ln Nj + α + βεj = 0
= (−α − βεj )
= exp (−α) exp (−βεj )
(2.2.31)
We know need to know the values of the Langrange multipliers. The one for
from the boundary condition
P
i Ni = N . Using eq 2.2.31
X
exp (−α − βεi ) = N
α can be determined
i) yields
(and changing the index to
i
exp(−α)
X
exp(−βεi ) = N
i
exp(−α) =
plugging this expression 2.2.32 for
α
N
i exp(−βεi )
now into eq 2.2.31 yields (again using index
Ni =
Ni
N
P
=
(2.2.32)
i):
N
exp (−βεi )
i exp(−βεi )
exp (−βεi )
P
i exp(−βεi )
P
We recognise this as the same relation for the probability in eq. 2.2.22 and identify
16
(2.2.33)
β=
1
kB T .
Figure 8:
a) According to Boltzmann's law, states with high energy have are signicantly less
populated (are less likely) than states with low energy. b) At higher temperature, more and more
higher energy states are populated.
This relation is called
Boltzmann's law
Ni
N
and applies for all
Ni
. Hence the most probable distribution is the
the relative occupation
temperature.
exp (−εi /kB T )
P
i exp(−εi /kB T )
=
Ni /N
(2.2.34)
Boltzmann distribution where
depends exponentially on the energy
εi
of level
i
and the inverse
This means that the occupation number of a high energy level will be (very) low
unless the temperature is high (see Fig. 8).
For degenerate energy levels
εi
with a degeneracy of
Ni
N
=
gi
eq. 2.2.34 changes to
g exp (−εi /kB T )
Pi
i gi exp(−εi /kB T )
(2.2.35)
Let us look at the temperature dependence of the partition function
Z=
X
i
For a tempertaure close to zero
−x
vanish (e
→0
1
exp −
εi
kB T
1
kB T will be close to innity and all terms except that for
x → ∞) because ε0 /kB T = 0 at all temperatures.
−x → 1.
very high (T → ∞) then εi /kB T → 0 and e
for
the temperature is
(2.2.36)
ε0 = 0
On the other hand, if
Each term in the sum
∞). The
At T = 0
contributes by 1, the sum becomes equal to the number of states (usually also close to
partition function essentially tells which states are accessible at a given temperature.
only the lowest energy state (ground state) is populated, at higher temperatures more and more
higher energy states are populated, and at very high temperatures almost all states are accessible
and
Z
will become large.
In continuous form the partition function reads
17
1
Z= ν
h
ˆ
exp [H (p, q) /kB T ]
(2.2.37)
phase space
and the phase space density
exp [H (p, q) /kB T ]
1
´
hν dpdq exp [H (p, q) /kB T ]
ρN,V,T (q, p) =
2.2.7 Isobaric-Isothermal Ensemble (N,p,T)
We can derive many other ensembles in the same manner we obtained the canonical ensemble. Let
us do this briey on more time.
We consider a system, divided in two subsystems and allow energy and volume exchange. One
subsystem is small, the other functions as a heat and a volume bath. The probability that the
small subsystem has energy
Er
and volume
Pr =
We again expand
ln ΩB
Vr
is
ΩB (E − Er , V − Vr )
Ω (E, V )
(2.2.38)
in a power series
∂
∂
ln ΩB (E, V ) · Er −
ln ΩB (E, V ) · Vr + . . .
∂E
∂V
Er
∂
Vr
∂
= ln ΩB (E, V ) −
SB ·
−
SB ·
+ ...
∂E
kB
∂V
kB
Er
pVr
= ln ΩB (E, V ) −
−
+ ...
(2.2.39)
kB T
kB T
ln ΩB (E − Er , V − Vr ) = ln ΩB (E, V ) −
and neglecting all higher order term we get
Er
ΩB (E − Er , V − Vr ) = ΩB (E, V ) · exp −
kB T
pVr
· exp −
kB T
(2.2.40)
and for the probability
Pr =
ΩB (E, V )
Er
pVr
· exp −
· exp −
Ω (E, V )
kB T
kB T
(2.2.41)
The pre-exponential factor can again be determined from the normalisation, and this is the isothermal.isobaric partition function
∆ (N, p, T ) =
XX
V
exp (−βE − βpV )
(2.2.42)
r
such that
Pr =
r
exp − kEBrT · exp − kpV
BT
∆ (N, p, T )
18
(2.2.43)
We can also rewrite the new partition function as
pVr
∆ (N, p, T ) =
Z (N, V, T ) · exp −
kB T
V
XX
Er
pVr
=
Ω (N, V, E) · exp −
· exp −
kB T
kB T
X
V
(2.2.44)
E
The corresponding thermodynamic potential is the Gibbs' free energy
G = −kB T ln ∆ (N, p, T )
(2.2.45)
which is also known from thermodynamics as
G = H − TS
Generalisation
(2.2.46)
We notice a scheme: The partition function of the microcanonical ensemble can
be transformed to other partition functions by summing over the macroscopic
variables
allowed to uctuate and weight by a Boltzmann factor
we can obtain the probability of a state
r
exp
− kXB
·
∂S
∂X
X
that are
. With the same recipe
for a given value of the
macroscopic
properties that
are allowed to uctuate by multiplying the Boltzmann factors
exp − kXB ·
∂S
∂X
of all uctuating
variable and dividing by the partition function of that ensemble.
Grand-Canonical Ensemble
We use the Grand-Canonical ensemble as an example.
We can
again consider a system, divided into a small subsystem and a larger system that now functions as
a heat bath and a particle reservoir. That means, we allow the energy and the number of particles
to uctuate. According to recipe the grand-canonical partition function is
Nr ∂S
Er ∂S
Ξ =
Ω (N, V, E) · exp −
·
· exp −
·
kB ∂E
kB ∂N
N E
XX
Er
µNr
· exp −
Ξ =
Ω (N, V, E) · exp −
kB T
kB T
N E
X
µNr
Ξ =
Z (N, V, T ) · exp −
kB T
XX
(2.2.47)
(2.2.48)
N
The probability is then
Pr (Er , Nr ) =
2.3
r
exp − kEBrT · exp − kµN
BT
Ξ
Thermodynamic functions derived from the partition function
2.3.1 Internal energy, pressure and heat capacity
Knowing the partition function, we can calculate several thermodynamic properties.
19
(2.2.49)
For example the average energy as the arithmetic mean of energies.
hEi i =
X
i
This is the thermodynamic
P
Ni εi
Pi · εi = Pi
i Ni
(2.3.1)
internal energy U (N, V, T ) = hEi.
From the internal energy we can furthermore calculate pressure
p=
∂U
∂V
(2.3.2)
N
enthalpy
H = U + pV
heat capcacity at constant volume Cv
and constant pressure
Cv =
Cp =
and the
(2.3.3)
∂U
∂T
∂H
∂T
Cp
V,N
p,N
Helmholtz Free energy
A = U + TS
We can compute
hEi
(2.3.4)
and hence the internal energy from the partition function by taking the
derivative w.r.t. temperature T
∂Z
∂T
∂Z
∂T
=
=
∂
P
i exp (εi /kB T )
1
kB T 2
∂T
X
εi exp (−εi /kB T )
(2.3.5)
i
rearrange
X
∂z
=
εi exp (−εi /kB T )
∂T
i
P
the same as dividing by
i exp (−εi /kB T ):
P
εi exp (−εi /kB T )
1 ∂Z
= Pi
kB T 2
z T
i exp (−εi /kB T )
∂
ln
Z
kB T 2
= hEi
∂T
kB T 2
and divide by Z which is
(2.3.6)
(2.3.7)
and this yields
U = kB T
2
∂ ln Z
∂T
(2.3.8)
V,N
Likewise the heat capacity can be calculated taking the derivative w.r.t. temperature
Cv
"
#
d
2 ∂ ln Z
=
kB T
dT
∂T
V,N
2
∂ ln Z
= 2kB T 2 +
∂T 2 V,N
20
2.3.2 Entropy
P
Z (N, V, T ) = r exp − kEBrT
P
Ω (N, V, E) = r 1 by the Boltzmann factor
Er
Z = Ω · exp −
kB T
The canonical partition function
partition function
is related to the microcanonical
(2.3.9)
While all microstates on one energy surface are equally probable, the dierent energy surfaces are
Boltzmann-weighted.
We can also write
We can now replace
Er
by
Er
ln Z = ln Ω · exp −
kB T
Er
ln Z = ln Ω −
kB T
Er
kB ln Z = kB ln Ω −
T
∗
the most probable energy E or the average
(2.3.10)
energy
U
T
−kB T ln Z = U − T S
hEi = U .
kB ln Z = S −
(2.3.11)
The thermodynamic entropy in the canonical ensemble is thus
U
+ kB ln Z
T
S=
(2.3.12)
and using the above equation 2.3.8 for the internal energy
S = kB T
We also note that the Helmholtz free energ
∂ ln z
∂T
+ kB ln z
(2.3.13)
N,V
y
A = U − TS
(2.3.14)
A = −kB T ln Z
can be directly obtained from the canonical partition function. The Helmholtz free energy is thus
the macroscopic
thermodynamic potential of the canonical ensemble.
2.3.3 Helmholtz Free energy
Let us now consider two states
Then the free energy of state
M and L with m and l microstates of energy εm and εl , respectively.
M is
m
X
AM
= −kB T ln
AM
= −kB T ln [m · exp (−εm /kB T )]
AM
= −m · kB T − ln [exp (−εm /kB T )] · kB T
AM
= εm − kB T ln m
exp (−εi /kB T )
i
21
(2.3.15)
and for state
L
accordingly
AL = εl − kB T ln l
(2.3.16)
For the free energy dierence we get
∆A = AM − AL
(2.3.17)
∆A = εm − kB T ln m − εl + kB T ln l
m
∆A = εm − εl − kB T ln
l
At equilibrium the free energy dierence is zero, i.e.
m
εm − εl = kB T ln
l
εm − εl
m
exp
=
kB T
l
Thus, if the two energies
εm
and
εl
are equal, the number of microstates
If one energy is larger than the other, e.g.
much larger than
(2.3.18)
l to be in equilibrium, i.e.
εM > εL ,
m
and
l
are also equal.
m must be
to have equally stable macrostates M and L. However,
then the number of microstates
with increasing temperature the exponential term on the left hand side decreases and the ratio of
m/l
needs to be smaller and smaller. For
T →∞
the exponent tends to zero and macrostates
with equal number of microstates are equally stable.
2.3.4 Chemical equilibrium
Consider a system in equilibrium that is divided in two subsystems. WE allow exchange of heat,
volume and particles such that
E = EA + EB = const
V
= VA + VB = const
N
= NA + NB = const
(2.3.19)
at equilibrium the entropy s maximal
S (EA , VA , NA ) = SA (E − EA , V − VA , N − NA ) + SB (E − EA , V − VA , N − NA )
And from the optimality condition
hence
pA = pB
and nally from
∂S
∂EA
∂S
∂NA
= 0 we get TA = TB ; from
B
= 0 we get µTAA = µTB
that is
∂S
∂VA
=0
we get
pA
TA
=
pB
TB
µ A = µB
the two subsystems are also in
2.4
chemical equilibrium.
Ensemble Averages
In an experiment often a series of measurements is carried out at certain time intervalls
an observable
O
with
O (q, p)
where
q
are the positions and
22
p
τ
to probe
are the momenta of the articles
(atoms) in the system.Let us assume we know how
time-average of the observable
O
O
evolves in time. Then we can calculate the
of a system (in the N,V,E ensemble) as
1
t→∞ t
ˆ
t
O (q, p) = lim
dτ O (q, p)
(2.4.1)
0
The time average does not depend on the initial conditions for long times t, hence the time average
does not change if we average over dierent initial conditions
P
O (q, p) =
1
initial conditions limt→∞ t
´t
0
q0 , p0
dτ O (q, p, q0 , p0 τ )
Number of initial conditions
(2.4.2)
and we can also swap the summation with the integration
1
O (q, p) = lim
t→∞ t
ˆ
t
P
dτ
0
initial conditions O (q, p, q0 , p0 τ )
Number of initial conditions
(2.4.3)
For the limit case that the sum runs over all initial conditions that are compatible with the N,V,E
of the ensemble we can write
´
E
where
h. . .idenotes
dqdp O (q, p)
´
= hOiN V E
E dqdp
(2.4.4)
an ensemble average and the integration index
E
is used to indicate that only
points in phase space with the correct energy are taken into account (integration over the correct
shell of phase space). This can be alternatively written as
´
where the density of states
dqdp O (q, p) δ (H (q, p) − E)
´
= hOiN V E
dqdpδ (H (q, p) − E)
ρN V E = δ (H (q, p) − E) is a delta function,
H (q, p) = E .
(2.4.5)
that is non-vanishing only
for points that have the correct energy
Using the notation for the ensemble average we can rewrite eq. 2.4.3 as
1
O (q, p) = lim
t→∞ t
ˆ
t
dτ hO (q, p, ) q0 , p0 , τ i
(2.4.6)
0
Since the ensemble average does not depend on time
τ
the expression simplies to
O (q, p) = hO (q, p, )iN V E
(2.4.7)
which means that averaging over all initial phase space coordinates is equivalent to averaging over
time-evolved phase space coordinates (for ininitely long times). This is the
ergodic hypothesis,
which can also be understodd as: if a time series visits all points in phase space, the average over
the time series is equivalent to the ensemble average.
We can therefore generate one or the other average. Generating an ensemble would be the
Monte-Carlo way, whereas generating a time series is the Molecular-Dynamics way.
Note: In the canonical ensemble with the density of states
average is
´
ρ = exp (−βH (q, p))
dqdp O (q, p) exp (−βH (q, p))
´
= hOiN V T
dqdp exp (−βH (q, p))
23
the thermal
(2.4.8)
© Copyright 2026 Paperzz