Skip to content

Canonical and Grand Canonical Ensembles: Free Energy and Thermodynamic Quantities

CSIR NET statistical physics: canonical and grand canonical ensembles, partition functions, F = −kT ln Z, fluctuations, equipartition, paramagnets, adsorption.

  • 16 min read
  • Updated
On this page · 14 sections
  1. Prerequisites
  2. The Hook: A Thermometer in a Bath
  3. The Canonical Ensemble
  4. Classical Partition Function and Equipartition
  5. Standard Quantum Systems
  6. The Grand Canonical Ensemble
  7. Which Ensemble, Which Potential
  8. Memory Tricks
  9. Don’t Confuse
  10. Common Mistakes
  11. Practice
  12. Quick Revision Table
  13. Key Takeaways
  14. What’s Next

Prerequisites

The Hook: A Thermometer in a Bath

The Canonical Ensemble

Derivation

Put a system S in contact with a much larger reservoir R at temperature \( T \), the two together isolated with total energy \( E_0 \). The probability that S is in a particular microstate \( i \) of energy \( E_i \) is proportional to the number of reservoir states with energy \( E_0 - E_i \):

$$p_i \propto \Omega_R(E_0 - E_i) = \exp\left[\frac{S_R(E_0 - E_i)}{k_B}\right] \approx \exp\left[\frac{S_R(E_0)}{k_B} - \frac{E_i}{k_BT}\right]$$

using \( \partial S_R/\partial E = 1/T \) and keeping the first-order term (the reservoir is huge). Hence the Boltzmann distribution:

$$\boxed{p_i = \frac{e^{-\beta E_i}}{Z}, \qquad Z = \sum_ie^{-\beta E_i}, \qquad \beta = \frac{1}{k_BT}}$$

The sum runs over states, not levels: a level of degeneracy \( g \) contributes \( g\,e^{-\beta E} \).

From \( Z \) to thermodynamics

The bridge equation is

$$\boxed{F = -k_BT\ln Z}$$

and everything else follows from \( dF = -S\,dT - P\,dV + \mu\,dN \):

QuantityFrom \( Z \)
Mean energy\( U = -\dfrac{\partial\ln Z}{\partial\beta} = k_BT^2\dfrac{\partial\ln Z}{\partial T} \)
Entropy\( S = -\left(\dfrac{\partial F}{\partial T}\right)_V = k_B\ln Z + \dfrac{U}{T} \)
Pressure\( P = k_BT\left(\dfrac{\partial\ln Z}{\partial V}\right)_T \)
Chemical potential\( \mu = -k_BT\left(\dfrac{\partial\ln Z}{\partial N}\right)_{T,V} \)
Heat capacity\( C_v = \dfrac{\partial U}{\partial T} = \dfrac{\langle E^2\rangle - \langle E\rangle^2}{k_BT^2} \)

The entropy formula is the Gibbs entropy \( -k_B\sum p_i\ln p_i \) evaluated for the Boltzmann distribution.

Energy fluctuations

$$\boxed{\langle(\Delta E)^2\rangle = \frac{\partial^2\ln Z}{\partial\beta^2} = k_BT^2C_v}$$

Because \( C_v \geq 0 \) follows, stability is automatic. For a monatomic ideal gas, \( U = \tfrac{3}{2}Nk_BT \) and \( C_v = \tfrac{3}{2}Nk_B \), so

$$\frac{\Delta E_{\text{rms}}}{U} = \sqrt{\frac{2}{3N}}$$

which is about \( 10^{-12} \) for a mole. The energy in the canonical ensemble is sharp in practice, which is why the canonical and microcanonical ensembles give the same thermodynamics for large systems.

Independent subsystems

If \( H = H_1 + H_2 \) with independent degrees of freedom, \( Z = Z_1Z_2 \), and \( \ln Z \), \( F \), \( U \), \( S \) all add.

Particles\( Z_N \) in terms of the one-particle \( z \)
Distinguishable (localised on lattice sites)\( z^N \)
Identical, classical (dilute) limit\( z^N/N! \)

Within one molecule, \( z = z_{\text{trans}}z_{\text{rot}}z_{\text{vib}}z_{\text{elec}} \), so the contributions to \( U \) and \( C_v \) add.

Classical Partition Function and Equipartition

For a classical system,

$$Z = \frac{1}{N!\,h^{3N}}\int e^{-\beta H(q, p)}\,d^{3N}q\,d^{3N}p$$

Ideal gas. \( H = \sum p_i^2/2m \). Each momentum integral is Gaussian:

$$z = \frac{V}{h^3}(2\pi mk_BT)^{3/2} = \frac{V}{\lambda^3}, \qquad \lambda = \frac{h}{\sqrt{2\pi mk_BT}}$$

\( Z = (V/\lambda^3)^N/N! \) gives \( P = Nk_BT/V \), \( U = \tfrac{3}{2}Nk_BT \), \( \mu = k_BT\ln(n\lambda^3) \), and \( S \) equal to the Sackur–Tetrode result: the two ensembles agree.

The equipartition theorem

For any canonical coordinate or momentum \( x_i \) of a classical system,

$$\boxed{\left\langle x_i\frac{\partial H}{\partial x_j}\right\rangle = \delta_{ij}k_BT}$$

provided the boundary terms vanish. In particular, every term in \( H \) quadratic in one variable contributes \( \tfrac{1}{2}k_BT \) to \( U \). More generally, a term \( c\lvert x\rvert^s \) contributes \( k_BT/s \).

SystemQuadratic terms\( U \) per particle\( C_v \) per mole
Monatomic gas3\( \tfrac{3}{2}k_BT \)\( \tfrac{3}{2}R \)
Rigid diatomic3 trans + 2 rot\( \tfrac{5}{2}k_BT \)\( \tfrac{5}{2}R \)
Diatomic with vibration active5 + 2\( \tfrac{7}{2}k_BT \)\( \tfrac{7}{2}R \)
Classical solid (3D oscillators)6\( 3k_BT \)\( 3R \) (Dulong–Petit)
Particle in \( V = c\,x^4 \) (1D)\( p^2 \) + quartic\( \tfrac{1}{2}k_BT + \tfrac{1}{4}k_BT \)\( \tfrac{3}{4}R \)

Equipartition fails when \( k_BT \) is small compared with the level spacing: those degrees of freedom are “frozen out”. This is why diatomic gases near room temperature show \( \tfrac{5}{2}R \) rather than \( \tfrac{7}{2}R \), and why solids lose heat capacity at low \( T \).

Standard Quantum Systems

Two-level system (Schottky anomaly)

Levels 0 and \( \varepsilon \) (non-degenerate), \( N \) independent units:

$$z = 1 + e^{-\beta\varepsilon}, \qquad U = \frac{N\varepsilon}{e^{\beta\varepsilon} + 1}, \qquad C = Nk_B\frac{(\beta\varepsilon)^2e^{\beta\varepsilon}}{(e^{\beta\varepsilon} + 1)^2}$$

\( U \) rises from 0 to \( N\varepsilon/2 \) (never beyond, at positive \( T \)). \( C \) vanishes at both ends and peaks at \( k_BT \approx 0.42\,\varepsilon \) with \( C_{\max} \approx 0.44\,Nk_B \): the Schottky anomaly, a signature of a finite set of levels.

Quantum harmonic oscillator

\( E_n = (n + \tfrac{1}{2})\hbar\omega \):

$$z = \sum_{n=0}^{\infty}e^{-\beta\hbar\omega(n + 1/2)} = \frac{e^{-\beta\hbar\omega/2}}{1 - e^{-\beta\hbar\omega}} = \frac{1}{2\sinh(\beta\hbar\omega/2)}$$$$\boxed{U = \frac{\hbar\omega}{2}\coth\frac{\beta\hbar\omega}{2} = \frac{\hbar\omega}{2} + \frac{\hbar\omega}{e^{\beta\hbar\omega} - 1}}$$

High \( T \): \( U \to k_BT \) (equipartition). Low \( T \): \( U \to \hbar\omega/2 \), and \( C \) falls as \( e^{-\hbar\omega/k_BT} \). Three oscillators per atom give the Einstein model of a solid, with \( C = 3Nk_B \) at high \( T \) and about \( 0.92\times3Nk_B \) at \( T = \Theta_E \).

Ideal paramagnet

\( N \) spin-1/2 moments \( \mu \) in a field \( B \), energies \( \mp\mu B \):

$$z = 2\cosh(\beta\mu B), \qquad \boxed{M = N\mu\tanh\frac{\mu B}{k_BT}}$$

Weak field: \( M \approx N\mu^2B/k_BT \), the Curie law (susceptibility \( \propto 1/T \)). Strong field or low \( T \): saturation at \( N\mu \). For a general angular momentum \( J \) the tanh becomes a Brillouin function, and the Curie constant involves \( g^2J(J+1)\mu_B^2 \). Classical dipoles (Langevin) give \( M = N\mu L(x) \) with \( L(x) = \coth x - 1/x \) and the weak-field result \( N\mu^2B/3k_BT \).

The Grand Canonical Ensemble

Now let the system exchange both energy and particles with a reservoir at temperature \( T \) and chemical potential \( \mu \). Repeating the reservoir argument with \( \partial S_R/\partial N = -\mu/T \):

$$\boxed{p_{i,N} = \frac{e^{-\beta(E_{i,N} - \mu N)}}{\Xi}, \qquad \Xi = \sum_{N=0}^{\infty}\sum_ie^{-\beta(E_{i,N} - \mu N)} = \sum_N\zeta^NZ_N}$$

where \( \zeta = e^{\beta\mu} \) is the fugacity and \( Z_N \) the canonical partition function for \( N \) particles. The bridge equation:

$$\boxed{\Omega_G = -k_BT\ln\Xi = -PV}$$
QuantityFrom \( \Xi \)
Mean number\( \langle N\rangle = k_BT\dfrac{\partial\ln\Xi}{\partial\mu} = \zeta\dfrac{\partial\ln\Xi}{\partial\zeta} \)
Pressure\( P = \dfrac{k_BT}{V}\ln\Xi \)
Entropy\( S = k_B\ln\Xi + \dfrac{U - \mu\langle N\rangle}{T} \)
Energy\( U = -\dfrac{\partial\ln\Xi}{\partial\beta}\Big\rvert_\zeta \)

Number fluctuations

$$\boxed{\langle(\Delta N)^2\rangle = k_BT\left(\frac{\partial\langle N\rangle}{\partial\mu}\right)_{T,V}, \qquad \frac{\langle(\Delta N)^2\rangle}{\langle N\rangle^2} = \frac{k_BT\kappa_T}{V}}$$

For an ideal classical gas \( \langle(\Delta N)^2\rangle = \langle N\rangle \): Poisson statistics. Near a critical point \( \kappa_T \) diverges, so density fluctuations become huge; this is the origin of critical opalescence.

Ideal gas in the grand ensemble

With \( Z_N = z^N/N! \), \( \Xi = \sum_N(\zeta z)^N/N! = \exp(\zeta z) \). So \( \ln\Xi = \zeta V/\lambda^3 = \langle N\rangle \), and \( PV = k_BT\ln\Xi = \langle N\rangle k_BT \). The ideal-gas law in one line.

Lattice adsorption (Langmuir isotherm)

\( M \) independent sites, each empty (energy 0) or holding one molecule (energy \( -\varepsilon_0 \)). Per site, \( \xi = 1 + e^{\beta(\varepsilon_0 + \mu)} \), so the fractional coverage is

$$\theta = \frac{\langle N\rangle}{M} = \frac{1}{e^{-\beta(\varepsilon_0 + \mu)} + 1}$$

With the gas phase in equilibrium, \( \mu = k_BT\ln(P/P_Q) \) for some \( T \)-dependent reference pressure \( P_Q \), giving \( \theta = P/(P + P_0(T)) \): the Langmuir isotherm. The single-site formula is the Fermi–Dirac function in disguise, since each site holds at most one particle.

Which Ensemble, Which Potential

EnsembleFixedDistributionNormaliserBridge
Microcanonical\( E, V, N \)uniform on shell\( \Omega \)\( S = k_B\ln\Omega \)
Canonical\( T, V, N \)\( e^{-\beta E_i} \)\( Z \)\( F = -k_BT\ln Z \)
Grand canonical\( T, V, \mu \)\( e^{-\beta(E_i - \mu N)} \)\( \Xi \)\( -PV = -k_BT\ln\Xi \)
Isothermal–isobaric\( T, P, N \)\( e^{-\beta(E_i + PV)} \)\( \Delta \)\( G = -k_BT\ln\Delta \)

For macroscopic systems, away from phase transitions, all ensembles give the same thermodynamics because relative fluctuations scale as \( N^{-1/2} \). Choose whichever makes the counting easiest: canonical for fixed \( N \) with independent units, grand canonical for quantum gases and adsorption.

Memory Tricks

Don’t Confuse

ThisvsThat
\( Z = \sum_{\text{states}}e^{-\beta E} \)\( Z = \sum_{\text{levels}}g\,e^{-\beta E} \) (same thing, written by levels)
\( z^N \) for localised (distinguishable) units\( z^N/N! \) for gas molecules
\( U = -\partial\ln Z/\partial\beta \)\( S = k_B\ln Z + U/T \) (not \( k_B\ln Z \) alone)
Two-level \( U \to N\varepsilon/2 \) as \( T \to \infty \)Oscillator \( U \to k_BT \), unbounded
Curie law for spin-1/2: \( N\mu^2B/k_BT \)Classical Langevin: \( N\mu^2B/3k_BT \)
Canonical: energy fluctuates, \( N \) fixedGrand canonical: both fluctuate

Common Mistakes

Practice

All questions below are original practice questions written for this page. They are not from any CSIR NET paper.

Level 1: Foundation

  1. Write the partition function of a single two-level system with energies 0 and \( \varepsilon \).
  2. Using equipartition, what is the molar \( C_v \) of a rigid diatomic ideal gas?
  3. How does the Helmholtz free energy follow from \( Z \)?
Answers
  1. \( z = 1 + e^{-\varepsilon/k_BT} \).
  2. \( \tfrac{5}{2}R \). Three translational and two rotational quadratic terms.
  3. \( F = -k_BT\ln Z \).

Level 2: Part B Style

Practice Q1. A system has three non-degenerate levels at 0, \( \varepsilon \) and \( 2\varepsilon \), in equilibrium at \( k_BT = \varepsilon \). Its mean energy is closest to:

(a) \( 0.33\,\varepsilon \) (b) \( 0.42\,\varepsilon \) (c) \( 0.58\,\varepsilon \) (d) \( \varepsilon \)

Answer: (b) 0.42 ε

With \( x = e^{-1} = 0.3679 \): \( Z = 1 + x + x^2 = 1.5032 \). \( U = \varepsilon(x + 2x^2)/Z = \varepsilon(0.3679 + 0.2707)/1.5032 \approx 0.425\,\varepsilon \). (d) is the infinite-temperature mean.

Practice Q2. A classical particle moves in one dimension with \( H = \dfrac{p^2}{2m} + c\,x^4 \), \( c > 0 \). Its mean energy in contact with a bath at \( T \) is:

(a) \( \tfrac{1}{2}k_BT \) (b) \( \tfrac{3}{4}k_BT \) (c) \( k_BT \) (d) \( \tfrac{5}{4}k_BT \)

Answer: (b) 3/4 k_BT

Generalised equipartition: \( \langle x\,\partial H/\partial x\rangle = k_BT \Rightarrow 4c\langle x^4\rangle = k_BT \Rightarrow \langle cx^4\rangle = k_BT/4 \). Kinetic part \( \tfrac{1}{2}k_BT \). Total \( \tfrac{3}{4}k_BT \). (c) is the harmonic answer.

Practice Q3. \( N \) spin-1/2 moments, each of magnitude \( \mu \), are in a field \( B \) with \( \mu B = k_BT \). The magnetisation as a fraction of its saturation value is closest to:

(a) 0.33 (b) 0.50 (c) 0.76 (d) 1.00

Answer: (c) 0.76

\( M/N\mu = \tanh(\mu B/k_BT) = \tanh1 \approx 0.762 \). (a) is close to the classical Langevin value \( L(1) = \coth1 - 1 \approx 0.31 \), which applies to classical dipoles, not to spin-1/2 moments.

Practice Q4. For \( N \) atoms of a monatomic ideal gas in the canonical ensemble, the relative energy fluctuation \( \Delta E_{\text{rms}}/U \) is:

(a) \( 1/N \) (b) \( \sqrt{2/(3N)} \) (c) \( \sqrt{3/(2N)} \) (d) \( 2/(3N) \)

Answer: (b)

\( \langle\Delta E^2\rangle = k_BT^2C_v = \tfrac{3}{2}Nk_B^2T^2 \); dividing the square root by \( U = \tfrac{3}{2}Nk_BT \) gives \( \sqrt{\tfrac{3}{2}N}/\left(\tfrac{3}{2}N\right) = \sqrt{2/(3N)} \).

Level 3: Part C Style

Practice Q5. An adsorption site can be empty (energy 0), hold one particle in either of two spin states (energy \( \varepsilon \) each), or hold two particles (energy \( 2\varepsilon + U_0 \)). It is in equilibrium with a reservoir at temperature \( T \) and chemical potential \( \mu \) such that \( e^{-\beta(\varepsilon - \mu)} = 1 \) and \( e^{-\beta U_0} = 1/4 \). Consider:

  1. The grand partition function of the site is 3.25.
  2. The mean occupancy is about 0.77.
  3. The probability that the site is empty is about 0.31.
  4. If \( U_0 \to \infty \), the mean occupancy becomes \( 2/3 \).

Which are correct?

(a) 1 and 2 only (b) 1, 2 and 3 only (c) 2 and 4 only (d) 1, 2, 3 and 4

Answer: (d) 1, 2, 3 and 4

Let \( y = e^{-\beta(\varepsilon - \mu)} = 1 \). \( \Xi = 1 + 2y + y^2e^{-\beta U_0} = 1 + 2 + 0.25 = 3.25 \). True.

\( \langle N\rangle = (1\times2y + 2\times y^2e^{-\beta U_0})/\Xi = (2 + 0.5)/3.25 \approx 0.769 \). True.

\( P_0 = 1/3.25 \approx 0.308 \). True.

\( U_0 \to \infty \): \( \Xi = 3 \), \( \langle N\rangle = 2/3 \). True.

This is the atomic limit of the Hubbard model; with \( U_0 = 0 \) it reduces to two independent Fermi–Dirac orbitals, each with occupancy \( 1/2 \) here.

Practice Q6. For \( N \) independent two-level units with level spacing \( \varepsilon \), consider:

  1. The heat capacity has a maximum near \( k_BT \approx 0.42\,\varepsilon \).
  2. As \( T \to \infty \) the mean energy tends to \( N\varepsilon \).
  3. As \( T \to \infty \) the entropy tends to \( Nk_B\ln2 \).
  4. Making the upper level doubly degenerate raises the high-temperature mean energy to \( 2N\varepsilon/3 \).

Which are correct?

(a) 1 and 3 only (b) 1, 3 and 4 only (c) 2 and 3 only (d) 1, 2, 3 and 4

Answer: (b) 1, 3 and 4 only
  1. Maximising \( x^2e^x/(1 + e^x)^2 \) gives \( x = \varepsilon/k_BT \approx 2.40 \), i.e. \( k_BT \approx 0.417\,\varepsilon \), with \( C \approx 0.44\,Nk_B \). True.

  2. Both levels become equally populated: \( U \to N\varepsilon/2 \). False.

  3. Two equally likely states per unit: \( S \to Nk_B\ln2 \). True.

  4. Three equally likely states, two of them at \( \varepsilon \): \( U \to \tfrac{2}{3}N\varepsilon \). True.

Practice Q7. Consider the following statements about statistical ensembles for a macroscopic system away from any phase transition:

  1. In the grand canonical ensemble of a classical ideal gas, the variance of \( N \) equals its mean.
  2. The canonical energy variance is \( k_BT^2C_v \), so \( C_v \) cannot be negative.
  3. \( \ln\Xi = PV/k_BT \) holds for any system, ideal or not.
  4. Because the canonical ensemble allows energy fluctuations, it predicts a different equation of state from the microcanonical ensemble for an ideal gas.

Which are correct?

(a) 1 and 2 only (b) 1, 2 and 3 only (c) 2 and 4 only (d) 1, 2, 3 and 4

Answer: (b) 1, 2 and 3 only
  1. \( \Xi = \exp(\zeta V/\lambda^3) \) gives a Poisson distribution of \( N \): variance = mean. True.

  2. A variance cannot be negative. True.

  3. \( \Omega_G = -k_BT\ln\Xi \) and the Euler relation \( \Omega_G = -PV \) hold for any homogeneous system. True.

  4. Fluctuations are relatively \( O(N^{-1/2}) \); both give \( PV = Nk_BT \). False.

Quick Revision Table

IdeaFormula or fact
Boltzmann distribution\( p_i = e^{-\beta E_i}/Z \)
Canonical bridge\( F = -k_BT\ln Z \)
Energy, entropy\( U = -\partial_\beta\ln Z \); \( S = k_B\ln Z + U/T \)
Energy fluctuation\( \langle\Delta E^2\rangle = k_BT^2C_v \)
Ideal gas\( z = V/\lambda^3 \), \( Z = z^N/N! \)
Equipartition\( \tfrac{1}{2}k_BT \) per quadratic term; \( k_BT/s \) for \( \lvert x\rvert^s \)
Two-level\( U = N\varepsilon/(e^{\beta\varepsilon} + 1) \); Schottky peak at \( k_BT \approx 0.42\varepsilon \)
Oscillator\( U = \tfrac{\hbar\omega}{2}\coth\tfrac{\beta\hbar\omega}{2} \)
Paramagnet\( M = N\mu\tanh(\beta\mu B) \); Curie \( N\mu^2B/k_BT \)
Grand canonical\( \Xi = \sum\zeta^NZ_N \), \( PV = k_BT\ln\Xi \), \( \langle N\rangle = \zeta\partial_\zeta\ln\Xi \)
Number fluctuation\( \langle\Delta N^2\rangle/N^2 = k_BT\kappa_T/V \); ideal gas Poisson
Langmuir\( \theta = 1/(e^{-\beta(\varepsilon_0 + \mu)} + 1) \)

Key Takeaways

What’s Next