The Canonical Ensemble and Q

Ensembles, the canonical partition function and fluctuations

Lesson 3055 of 4,500 · Chemical and Statistical Thermodynamics I

Learning objectives

Introduction

The molecular partition function q was built for molecules that do not interact. Real liquids, solids and dense gases are full of interactions, so the energy of the system cannot be split molecule by molecule. Gibbs's solution was to change the object being counted: instead of states of one molecule, consider states of the whole system , and imagine a huge collection of copies of it. This is the idea of an ensemble , and it leads to the canonical partition function Q, the central quantity of statistical thermodynamics.

Core explanation

Ensembles. An ensemble is a mental construction: a very large number of replicas of the real system, each prepared under the same macroscopic conditions but free to be in any microscopic state consistent with them. Averages over the ensemble are identified with measured thermodynamic properties. Three ensembles are common:

- Microcanonical (fixed N, V, E): isolated systems. Every accessible state is equally probable; the key quantity is the number of states W, and S = k ln W. - Canonical (fixed N, V, T): each replica is closed but in thermal contact with the others, which act as a heat bath. Energy can flow between replicas. - Grand canonical (fixed μ, V, T): replicas exchange both energy and particles; useful for adsorption and open systems.

The canonical distribution. Applying the same maximum-weight argument used for the Boltzmann distribution — but now to replicas rather than molecules — gives the probability that a system is in state i with total energy E i:

P i = e^(−βE i)/Q, Q = Σ i e^(−βE i), β = 1/kT

Q is the canonical partition function . The sum runs over complete quantum states of the whole N-particle system, including all interactions. It plays the same role for the system that q plays for a molecule: it measures how many system states are thermally accessible.

Grouping by energy. Many system states share the same energy. If Ω(E) states have energy E, then Q = Σ E Ω(E)e^(−βE). Ω(E) rises astronomically fast with E for a macroscopic system, while e^(−βE) falls. Their product is an extremely sharp peak at the mean energy.

Fluctuations. Because the canonical system can exchange energy, its energy fluctuates. Differentiating ln Q twice gives

⟨E⟩ = −(∂ln Q/∂β) V, σ E² = ⟨E²⟩ − ⟨E⟩² = (∂²ln Q/∂β²) V = kT²C V

Since both ⟨E⟩ and C V are extensive (proportional to N), σ E/⟨E⟩ ∝ √N/N = 1/√N. For a mole of substance the relative spread is of order 10⁻¹², far below any measurement.

Equivalence of ensembles. Because fluctuations are negligible for macroscopic systems, the canonical and microcanonical ensembles give the same thermodynamics. We choose whichever is mathematically convenient — and the canonical ensemble, with its unrestricted sum, usually is.

Formulae

Q = Σ i e^(−E i/kT). P i = e^(−E i/kT)/Q. ⟨E⟩ = −(∂ln Q/∂β) V. σ E² = kT²C V. Relative fluctuation σ E/⟨E⟩ ∝ N^(−½).

Step-by-step reasoning

To see why the canonical distribution holds:

1. Imagine Ñ replicas sharing a fixed total energy. 2. Count the ways to assign replicas to system states. 3. Maximise the count subject to fixed Ñ and fixed total energy. 4. The result has the same Boltzmann form as for molecules, with E i in place of ε i. 5. The normalising sum is Q.

Visual explanation

Picture a vast chessboard of identical sealed flasks, all touching so heat flows between neighbours. Each flask holds the same number of molecules in the same volume. Zoom in on any flask and its instantaneous energy differs slightly from the others; plot a histogram of flask energies and you see an extremely narrow spike centred on ⟨E⟩.

Real-world analogy

A national opinion poll surveys many randomly chosen households, each a replica drawn from the same population, instead of following one household for years. The average over the sample stands in for the long-term behaviour of a typical household, just as an ensemble average stands in for a time average of one system.

Real-world example

Molecular dynamics and Monte Carlo simulations of proteins, liquids and materials routinely sample the canonical ensemble using a "thermostat" that mimics a heat bath. Averages from these simulations predict densities, binding free energies and phase behaviour. For small simulated systems of a few thousand atoms, the energy fluctuations are large enough to see and are used to calculate heat capacities.

Why?

Why does the ensemble average equal what we measure on a single system? The ergodic hypothesis states that over a long enough time a single system visits its accessible states in proportion to their ensemble probabilities. A measurement takes long enough compared with molecular timescales that it effectively averages over the ensemble.

Common misconception

"Q is just q for a bigger molecule, so Q = q × N." The canonical partition function counts states of the whole system; for independent molecules it is related to q by powers (q^N or q^N/N!), not by multiplication by N. For interacting systems no simple relation to q exists at all.

Worked example

Question: Estimate the relative energy fluctuation for one mole of a monatomic perfect gas in the canonical ensemble.

Reasoning: ⟨E⟩ = (3/2)NkT and C V = (3/2)Nk. Then σ E² = kT² × (3/2)Nk, so σ E = kT(3N/2)^½. Dividing: σ E/⟨E⟩ = (3N/2)^½/(3N/2) = (2/(3N))^½. With N = 6.02 × 10²³, 2/(3N) = 1.11 × 10⁻²⁴, whose square root is 1.05 × 10⁻¹².

Answer: About 1 part in 10¹² — utterly negligible.

Quick check

1. Which ensemble fixes N, V and T, and which physical situation does it describe? Answer: The canonical ensemble, which describes a closed system of fixed volume in thermal contact with a heat bath at temperature T.

Exam focus

Know the variables fixed in each ensemble, write Q and P i correctly, and derive ⟨E⟩ = −∂ln Q/∂β. The fluctuation result σ E² = kT²C V and its 1/√N consequence are favourite derivation questions.

Advanced insight

The fluctuation formula links a microscopic quantity (the energy spread) to a macroscopic response (the heat capacity). This is the simplest example of the fluctuation–dissipation principle: how a system responds to a push is determined by how it fluctuates spontaneously at equilibrium. The same idea relates compressibility to density fluctuations, which cause the strong light scattering (critical opalescence) seen near a liquid–vapour critical point.

Summary

An ensemble is a large collection of replicas of a system. The canonical ensemble fixes N, V and T; its states have probabilities P i = e^(−βE i)/Q, where Q = Σ e^(−βE i) is the canonical partition function over whole-system states. Q works even for interacting systems. The mean energy is −∂ln Q/∂β, energy fluctuations obey σ E² = kT²C V, and relative fluctuations scale as 1/√N, so different ensembles agree for macroscopic systems.

Practice questions

1. What quantity is held fixed in the microcanonical ensemble but not in the canonical ensemble? Answer: The total energy E; in the canonical ensemble T is fixed instead and E fluctuates. 2. Why is the canonical ensemble usually easier to use than the microcanonical one? Answer: Its sum over states is unrestricted, whereas the microcanonical count must respect a fixed total energy, which is mathematically awkward. 3. If a system contains 100 atoms of monatomic ideal gas, estimate σ E/⟨E⟩. Answer: (2/300)^½ ≈ 0.082, about 8 %, which is significant. 4. Write Q grouped by energy levels and explain why the resulting distribution of system energies is sharply peaked. Answer: Q = Σ E Ω(E)e^(−βE); Ω(E) increases enormously with E while e^(−βE) decreases, so their product is a sharp maximum near ⟨E⟩.