Canonical Ensemble and Fluctuations
The canonical ensemble describes a system that can exchange energy with a heat bath while its volume and particle number remain fixed. It is the workhorse of equilibrium statistical mechanics because many laboratory systems are closer to fixed temperature than fixed energy, and because the partition function turns sums over states into thermodynamic potentials.
Schwabl derives the canonical density by embedding the system in a larger microcanonical universe. The bath's entropy supplies the Boltzmann factor, and the system's partition function normalizes it. Fluctuations, response functions, and thermodynamic stability all follow from derivatives of this one object.
Definitions
For inverse temperature
the quantum canonical density matrix is
For a classical system,
The Helmholtz free energy is
Canonical averages are
When commutes with , this is an ordinary weighted average over energy eigenstates. When it does not, the trace formula remains valid, but operator ordering matters in correlation functions.
Key results
The energy follows from the partition function:
The energy variance is the second derivative:
Using , one obtains the fluctuation formula
This is a central bridge between fluctuations and response. A large heat capacity means the system can absorb energy with little temperature change, and it also means its canonical energy distribution is broad in absolute terms. Relative fluctuations still vanish for macroscopic systems because both and are extensive.
The canonical entropy can be written as
Since , one also has
The equipartition theorem follows for classical quadratic degrees of freedom. If the Hamiltonian contains a term , then
The virial theorem generalizes this structure and is especially useful for classical gases and bound systems:
under the usual assumptions that boundary terms vanish.
The canonical ensemble can be viewed as a saddle-point approximation to the microcanonical ensemble of a larger system. If the bath density of states is , then
The first-order term gives the Boltzmann factor. The quadratic correction is negligible when the bath heat capacity is very large compared with the subsystem's exchanged energy scale. This derivation explains both the power and the limitation of fixed-temperature descriptions: the reservoir must be large and internally equilibrated.
Partition-function derivatives generate cumulants, not only means. If
then
This is why response functions and fluctuations are so tightly connected. A singular heat capacity at a continuous transition is also a statement that energy fluctuations become anomalously large.
The free energy has a variational property. For any trial density matrix ,
The minimum is reached at . This Gibbs-Bogoliubov inequality is a standard route to mean-field approximations: choose a solvable trial Hamiltonian, minimize the variational free energy, and interpret the optimum as an effective field or quasiparticle description. Schwabl's later molecular-field theory fits this broader pattern.
Canonical calculations also require attention to degeneracy. If an energy has degeneracy , its contribution is . Entropy often comes as much from degeneracy as from energy. In a spin system, for example, a macrostate with nearly equal up and down spins has huge combinatorial degeneracy even if its energy is not minimal. The canonical distribution balances this entropy against the Boltzmann energy penalty.
At low temperature, is dominated by the ground state and the first few excitations. At high temperature, many states contribute, and classical approximations may become valid if quantum level spacings are small compared with . This low/high temperature reasoning is used repeatedly for oscillators, molecular rotations, phonons, and magnetic systems.
The same derivative machinery also gives generalized forces. If the Hamiltonian depends on an external parameter , then
Pressure is the case where with a sign convention, magnetization is the case where , and elastic stress follows from differentiating with respect to strain. Thus the canonical ensemble is not just a method for energy; it is a generator of equations of state for any controlled parameter.
For finite systems, canonical energy fluctuations are not negligible background. They can dominate calorimetry of nanoscale systems, clusters, and mesoscopic conductors. The thermodynamic limit hides them, but the fluctuation formulas remain exact and measurable.
Visual
| Quantity | Canonical formula | Thermodynamic role |
|---|---|---|
| Partition function | normalization and generator | |
| Free energy | potential at fixed | |
| Mean energy | caloric equation | |
| Heat capacity | response to temperature | |
| Energy variance | equilibrium fluctuation |
Worked example 1: Two-level system in the canonical ensemble
Problem: A system has energies and . Find , , and .
Method:
- Sum the Boltzmann weights:
- Compute the mean energy:
- Differentiate with respect to temperature. Let :
- Then
Checked answer: vanishes at very low because the excited state is frozen out, and at very high because both levels are nearly equally populated.
Worked example 2: Energy fluctuation of a harmonic oscillator
Problem: A quantum oscillator has levels . Compute and the variance.
Method:
- The partition function is a geometric series:
- Its logarithm is
- Differentiate:
- The variance is
Checked answer: the zero-point energy contributes to but not to the variance because it is a constant shift.
Code
import numpy as np
def two_level_cv(T, eps=1.0, kB=1.0):
x = eps / (kB * T)
return kB * x**2 * np.exp(x) / (np.exp(x) + 1.0)**2
def oscillator_energy(T, hw=1.0, kB=1.0):
x = hw / (kB * T)
return hw * (0.5 + 1.0 / np.expm1(x))
for T in [0.2, 0.5, 1.0, 3.0]:
print(T, two_level_cv(T), oscillator_energy(T))
Common pitfalls
- Forgetting that is dimensionless; the classical phase-space measure needs .
- Confusing fixed-temperature energy fluctuations with microcanonical fixed-energy constraints.
- Dropping constant energy shifts in without checking the target quantity. They do not affect heat capacity but they do affect and .
- Applying equipartition to quantum degrees of freedom at low temperature. Equipartition is classical and high-temperature in spirit.
- Using and interchangeably without the factor .