2.1 The Canonical Ensemble
2.1 The Canonical Ensemble
where we have introduced the corrections due to the indistinguishability between Ni,1
particles of the same species i (i = 1, . . . , g) in the system A1 to avoid the Gibbs’s
paradox, and Ω is defined by Eq. (1.147). On the other hand, the probability density
for E1 reads
Ω1 (E1 )Ω2 (E − E1 )
ω(E1 ) = (2.2)
Ω(E)
We know that ω(E1 ) has a very sharp maximum at E1 = Ẽ1 , which is obtained from
the condition
∂ ln Ω1 (E1 )
∂ ln Ω2 (E2 )
= (2.3)
∂E1 ∂E2
E1 =Ẽ1 E2 =E−Ẽ1
1
The canonical ensemble. 2
the same T1 = T2 = T . Now let’s consider that A2 is much larger than A1 , in the
sense that the number of degrees of freedom of A2 , f2 , is much larger than f1 . Since
Ω ∼ E νf , where ν is a number of order of 1, then the condition Eq. (2.3) leads to
the following relationship
ν1 f 1 ν2 f 2 Ẽ1 f1
∼ → ∼ (2.4)
Ẽ1 Ẽ2 Ẽ2 f2
where e−βH1 is the Boltzmann factor and Z is the so-called (canonical) partition
function, which can be obtained from the normalization condition of Eq. (2.7) as
Z
1
Z ≡ Z(T, X1 , N1 ) = f1 Qg dqdpe−βH1 (q,p) (2.8)
h i=1 Ni,1 !
If
P the system has a discrete energy spectrum, pi,1 = exp(−βEi )/Z, where Z =
i exp(−βEi ) and the sum is over all the microstates of the system A1 . We see that
The canonical ensemble. 3
Ω(E)e−βE
ω(E) ≡ δ(H(q, p) − E) = (2.10)
Z
where Ω(E) is the (microcanonical) number of microstates associated to the energy
E. Note that this expression is the same as Eq. (2.2) when expression Eq. (2.6)
is substituted into it. An interesting connection between Ω and Z comes from the
normalization condition of Eq. (2.10)
Z ∞
Z= dEΩ(E)e−βE (2.11)
E0
The canonical ensemble. 4
From a mathematical point of view, this relates Z with the Laplace transform of
Ω(E)
Z(β) = e−βE0 L(Ω̃) (2.12)
where Ω̃(E) = Ω(E + E0 ). So, Ω can be obtained in terms of the inverse Laplace
transform of Z (as a function of β).
If A is macroscopic (and so its energy E), the integrand of Eq. (2.11) has a sharp
maximum at the energy E = Ẽ, since Ω(E) ∼ E νf and the Boltzmann factor is a
rapidly decreasing function of the energy. So, we can approximate Eq. (2.11) as
where n is of order of unity. The value of Ẽ is obtained from the maximum condition
∂ ln Ω(E)
=β (2.14)
∂E
E=Ẽ
∂e−βH(q,p)
Z Z
∂Z 1 1
= f Qg dqdp = − f Qg dqdpH(q, p)e−βH(q,p)
∂β h ( i=1 Ni !) ∂β h ( i=1 Ni !)
(2.16)
Thus, Eq. (2.15) can be recast as
1 ∂Z ∂ ln Z
E=− =− (2.17)
Z ∂β ∂β
Unlike in the microcanonical ensemble, the internal energy is not constant but a
fluctuating quantity, with a probability distribution given by Eq. (2.10). We ar-
gued above that this probability distribution has a sharp maximum, which must be
equal to E macroscopically (this may not be true if the system is not macroscopic,
since in general the mean and the most-probable value or mode of a probability
distribution do not coincide). We can go further and evaluate the variance of E,
The canonical ensemble. 5
2
σE2 = (H(q, p) − E)2 = H(q, p)2 − E . To calculate this quantity, we evaluate the
derivative of E with respect to β
" 2 #
∂ 2 ln Z 1 ∂ 2Z
∂E ∂ 1 ∂Z 1 ∂Z
=− =− =− − 2 (2.18)
∂β ∂β 2 ∂β Z ∂β Z ∂β 2 Z ∂β
2
The second term in the last bracket is easily identified with E . On the other hand,
the first term can be obtained by differentiating Eq. (2.16)
∂ 2Z ∂e−βH(q,p)
Z
1
= − Qg dqdpH(q, p)
∂β 2 hf ( i=1 Ni !) ∂β
Z
1
= Qg dqdp(H(q, p))2 e−βH(q,p) (2.19)
hf ( i=1 Ni !)
Thus, the first term in the last bracket of Eq. (2.18) can be identified as H(q, p)2 .
So,
2 ∂E ∂E
σE2 = H(q, p)2 − E = − = kB T 2 = kB T 2 CX,N (2.20)
∂β ∂T
where CX,N is the heat capacity for X and N constants. Note that CX,N ≥ 0 since
the variance of the energy is a positive quantity. As the heat capacity is an extensive
property, the variance of the energy scales with√ the number of degrees of freedom
f , so its standard deviation σE is of order of f . On the other hand, the internal
energy E, which is also an extensive property, is proportional to f . So, the ratio
between σE and E scales as √
σE f 1
∼ ∼√ (2.21)
E f f
This result state that the mode (i.e. the most probable value of the energy) Ẽ will
coincide macroscopically with the mean value E, since their difference is of order of
σE E. In this sense, for macroscopic systems the canonical ensemble probability
distribution converges to the microcanonical probability distribution for an energy
E = E, which on the other hand it is the energy at which the (microcanonical)
temperature is the same as the one in the thermal bath. This fact is a special case
of the equivalence between equilibrium ensembles: the macroscopic properties ob-
tained as averages of microscopically defined properties have the same values if they
are evaluated in different ensembles, provided the parameters of these ensembles are
selected to be consistent each other (for example, the energy in the microcanonical
ensemble must have a value at which the temperature is the same as the selected
value for the canonical ensemble). Although the equivalence is strictly true in the
The canonical ensemble. 6
where in the last expression we used Eqs. (2.17) and (2.23). If we add d(βE) to
both sides of Eq. (2.24), we get that
X
d(ln Z + βE) = βdE + Edβ − Edβ + β Y α dXα
α
X dS
= β(dE + Y α dXα ) = (2.25)
α
kB
The canonical ensemble. 7
where we used the expression of the first law of the thermodynamics for reversible
processes. Thus, the entropy in the canonical ensemble can be defined as
S = kB (ln Z + βE) (2.26)
and from this expression
E − T S ≡ F = −kB T ln Z (2.27)
where F is the Helmholtz free energy. Note that F , as Z, is a function of T ,
N and X. This thermodynamic potential provides the maximum energy that can
be transformed into work along an isothermal path, since d¯W ≤ −dF . With the
definition Eq. (2.27), Eqs. (2.17), (2.23) and (2.26) can be recast as
∂F ∂F
E = F + TS , S = − , Yα =− (2.28)
∂T X,N ∂Xα T,N
in agreement with the thermodynamic relationships.
The expression Eq. (2.27) is consistent with the results in the microcanonical
ensemble. From Eq. (2.13), and taking into account that Ẽ ≈ E and that σE E,
we obtain that
S
ln Z ≈ ln Ω(E) − βE = − βE (2.29)
kB
where we used the microcanonical expression for the entropy.
The additivity of F can be shown in a similar way as we did it for the entropy
in Unit 1. We will consider the following cases of interactions between two subsys-
tems A1 and A2 , with the combined system to be in contact with a thermal bath
characterized by a temperature T :
1. Pure thermal interactions, no matter transfer. In this case, the partition
function of the combined system can be written as
Z
1
Z = f1 +f2 Qg Qg dqdpdQdP e−β(H1 (q,p)+H2 (Q,P ) (2.30)
h ( i=1 Ni,1 !) ( i=1 Ni,2 !)
where we assumed that the Hamiltonian of the combined system can be ap-
proximated as
H(q, Q, p, P ) = H1 (q, p) + H2 (Q, P ) (2.31)
Now, we notice that we can factorize the integral in Eq. (2.30) as
Z
1 −βH1 (q,p)
Z = dqdpe
hf1 ( gi=1 Ni,1 !)
Q
Z
1 −βH2 (Q,P )
× dQdP e
hf2 ( gi=1 Ni,2 !)
Q
= Z1 × Z2 (2.32)
The canonical ensemble. 8
ln Z = ln Z1 + ln Z2 (2.33)
Now we consider that both subsystems are macroscopic. Then, the integrand
in this expression has a sharp maximum for V1 = Ṽ1 , so
3. Open systems. Now the two systems can exchange particles, but the com-
bined system has constant number of particles Ni , for each species of identical
particles i = 1, . . . , g. In this case, the partition function of the combined
system can be written as
N1 Ng
X X
Z(T, X, {Ni }) = ... Z1 (T, X1 , {Ni,1 })Z2 (T, X1 , {Ni − Ni,1 })
N1,1 =0 Ng,1 =0
(2.38)
As in the microcanonical ensemble, the presence of the factorials of the number
of particles of each species in the definition of the partitionQ
functions remedi-
ate the Gibbs’s paradox (if they were not included, a factor i Ni !/[Ni,1 !(Ni −
Ni,1 )!] should be added in front of the integral, as it was done in the micro-
canonical ensemble). Now we assume that all the values of N are macroscopic.
Then, the terms which we are adding have a sharp maximum for {Ni } = {Ñi },
so we can approximate
Z(T, X, {Ni }) ≈ Z1 (T, X1 , {Ñi,1 })Z2 (T, X1 , {Ni − Ñi,1 })∆N1 . . . ∆Ng (2.39)
where ∆Ni Ñi . Taking the logarithm of this expression, we get that
which confirms the additivity of the Helmholtz free energies. This expression,
however, is not true if any of the species has a microscopic number of particles.
An extreme case would be when all the particles are distinguishable, so g = N
and Ni = 1 for i = 1, . . . , g.
The values of Ñi are obtained from the maximum condition for the terms in
the sum Eq. (2.38). Treating these variables as continuous, this condition
reads
∂ ln Z(T, X1 , {Ni,1 })
∂ ln Z(T, X2 , {Ni,2 })
= (2.41)
∂Ni,1 ∂Ni,2
Ni,1 =Ñi,1 Ni,2 =Ni −Ñi,1
so Eq. (2.41) implies that the chemical potentials of each species in both
subsystems must be equal in equilibrium.
The canonical ensemble. 10
Notice that each term in brackets is equal (they differ just in the labelling of the
dummy integration variables), so we can write the total partition function as
ζN
Z= (2.46)
N!
where ζ is the partition function of a single particle. This expression can be easily
obtained as
Z ∞ Z ∞ Z ∞
βp2
Z Z
1 3 3 − 2mp2 V βp2
− 2mx − 2my
βp2
− 2mz
ζ = 3 d r d pe = 3 dpx e dpy e dpz e
h h −∞ −∞ −∞
3
V 2πm 2 V
= 3 ≡ 3 (2.47)
h β Λ
√
where Λ ≡ h/ 2πmkB T is called the thermal de Broglie wavelength, and for the
integration in momenta we used the formula
Z ∞
h −a2 x2 1 h+1
I(h) = dxx e = h+1 Γ (2.48)
0 2a 2
so
∞ ∞
Z Z r r
βp2
− 2mx
βp2
− 2mx 2m 1 2πm
dpx e =2 dpx e = Γ = (2.49)
−∞ 0 β 2 β
The canonical ensemble. 11
Thus, the logarithm of the partition function can be expressed, for large N , as
V 3 3 2πm
ln Z = N ln − ln β + ln +1 (2.50)
N 2 2 h2
Note that, as in the microcanonical ensemble, the factor (N !)−1 solves the Gibbs’s
paradox, so the Helmholtz free energy F = −kB T ln Z is an additive quantity.
From the expression Eq. (2.50), we can get
• The equation of state. The pressure p can be obtained from Eq. (2.23) as
1 ∂ ln Z N
p= = → pV = N kB T (2.51)
β ∂V T,N Vβ
• The energy equation. The internal energy E can be obtained from Eq.
(2.17) as
∂ ln Z 3N 3
E=− = = N kB T (2.52)
∂β V,N 2β 2
As a consequence, the heat capacity of the gas is
∂E 3
CV = = N kB (2.53)
∂T V,N 2
Note that all these expressions are the same as those derived from the microcanonical
ensemble, which is a confirmation of the equivalence between equilibrium ensembles.
The canonical ensemble. 12
1 ∂e−βH
Z Z
∂H −βH
dqdpxi e = dx1 . . . dx2f xi − (2.57)
∂xj β ∂xj
where we assume that all the coordinates can be extended from −∞ to ∞. This can
always be done for Cartesian coordinates (where the confinement of the system on a
volume V is due to an external potential which is infinite far away from the volume),
but there are other choices of generalized coordinates, as the angular variables, where
this cannot be done and the results which we will obtain here may not be applicable.
Now we note that the first term in Eq. (2.58) vanishes, since for any function of the
phase space which can represent a property of the system (as it is xi ), the condition
must be satisfied, otherwise the average f (x1 , . . . , x2f ) would diverge. On the other
hand, ∂xi /∂xj = δi,j , where δi,j is the Kronecker delta. Substituting these expres-
sions into Eq. (2.58), and back to Eq. (2.57), the Eq. (2.56) can be recast as
∂H
xi = kB T δi,j (2.60)
∂xj
∂H
pi = kB T (2.61)
∂pi
The canonical ensemble. 13
The virial theorem then states that, in average, each term in the virial has a value
kB T /2.
Finally, we will apply the generalized equipartition theorem to some simple sit-
uations:
1. A system of N monodimensional independent harmonic oscillators.
In this case, the Hamiltonian can be written as
X p2 X1
i
H(q, p) = + Ki qi2 (2.66)
i
2m i i
2
where mi and Ki are the mass and the elastic constant of the oscillator i,
respectively. Applying both the equipartition and the virial theorem we get
that
∂H p2 p2 kB T
pi = i = kB T → i = (2.67)
∂pi mi 2mi 2
∂H Ki qi2 kB T
qi = Ki qi2 = kB T → = (2.68)
∂qi 2 2
The canonical ensemble. 14
p2i Ki qi2
i = + = kB T (2.69)
2mi 2
and for the system of N oscillators
N
X
E= i = N kB T (2.70)
i=1
where F0 and FL are the modulus of the (mean) forces beween the gas and
the lower and upper walls, respectively. In this expression we assume that
The canonical ensemble. 15
the interactions between the gas and the walls act only on the particles on
the faces of the cube. A similar argument can be applied along the X and Y
directions. Now, the force that the wall exerts on the gas must be the same
as the force that the gas exerts on the wall in modulus, which is pA = pL2 ,
where p is the gas pressure. So, we get that
N
3
X ∂H
pL = pV = zi = N kB T (2.74)
i=1
∂zi
vx = vy = vz = 0 (2.75)
However, this result does not mean that the particle is not moving. In fact,
the equipartition theorem states that
1 3 3kB T
M v 2 = kB T → v 2 = (2.76)
2 2 M
So, the motion of the particle is random, with all the directions equally prob-
able, but the modulus of the velocity, also random, satisfies Eq. (2.76). This
motion is named after the botanist Robert Brown, who first observed it ex-
perimentally.