The canonical ensemble is the probability measure for a system in contact with a heat bath at fixed temperature T, with fixed volume V and particle number N. Energy E is random. It is the right tool for equilibrium properties at a specified temperature: a gas in a thermostat, a solid in an oven, or any system where T is controlled but energy fluctuates. It is the most commonly used ensemble in chemistry and condensed matter.
where Z is the partition function (normalization):
Z(T,V,N)=α∑e−βEαDetails
Derivation from the microcanonical reservoir. Imagine a small system S (the “system”) in contact with a very large reservoir R (the “heat bath”), with total energy Etot fixed. The combined system is isolated, so it is described by the microcanonical ensemble: every microstate of S+R with energy Etot is equally likely.
If S is in microstate α with energy Eα, the reservoir must have energy Etot−Eα. The number of reservoir microstates compatible with this is ΩR(Etot−Eα). The probability of α is therefore proportional to this count:
P(α)∝ΩR(Etot−Eα)
Since Eα≪Etot, expand the reservoir entropy SR=kBlnΩR to first order:
SR(Etot−Eα)≈SR(Etot)−Eα(∂E∂SR)Etot
The slope (1/kB)(∂SR/∂E)=1/(kBT)=β defines the temperature of the reservoir. Exponentiating:
P(α)∝e−βEα
The normalization constant is the partition function Z=∑αe−βEα.
Two-level example. Consider a single spin in a magnetic field with energies E0=0 (spin down) and E1=ε (spin up):
Z=1+e−βε,P0=1+e−βε1,P1=1+e−βεe−βε
At low temperature (βε≫1), the system is almost certainly in the ground state. At high temperature (βε≪1), both states are equally likely.
Partition function as a Laplace transform. For a continuous density of states Ω(E):
Z=∫0∞Ω(E)e−βEdE
This is the Laplace transform of Ω(E) with parameter β. At low temperature, only states near the ground state contribute; at high temperature, the integral samples the full density of states.
Factorization for non-interacting particles. If the total energy is a sum of single-particle energies E=∑iεni, the partition function factorizes:
For two independent subsystems A and B (no interaction energy, no shared degrees of freedom), the total partition function is the product:
Ztot=ZA×ZB
More generally, for N independent subsystems: Ztot=∏iZi.
Details
Why the product? If A is in state i with energy EiA and B is in state j with energy EjB, the combined state $(i,j)$ has energy EiA+EjB (additivity of energy for independent systems). The joint Boltzmann factor is:
Consequence: extensivity of free energy. Since F=−kBTlnZ:
Ftot=−kBTln(ZAZB)=−kBT(lnZA+lnZB)=FA+FB
The Helmholtz free energy is extensive (additive) for independent subsystems. This is the statistical-mechanical origin of the extensivity of thermodynamic potentials.
Example: ideal gas as N independent particles. For N non-interacting, indistinguishable particles:
ZN=N!1(Z1)N
where Z1 is the single-particle partition function. The 1/N! prevents overcounting of permutations (Gibbs paradox). Taking the logarithm: lnZN=NlnZ1−lnN!≈N(lnZ1−lnN+1) (Stirling), which is extensive in N.
Why F? The Helmholtz free energy F=U−TS is the Legendre transform of the internal energy U(S,V,N) that replaces the entropy variable S with its conjugate T=(∂U/∂S)V,N. At fixed T,V,N, the equilibrium state minimizes F. This is the statistical-mechanical statement of the second law for systems in a heat bath.
Derivation from Z. The mean energy is:
⟨E⟩=Z∑αEαe−βEα=−∂β∂lnZ
The Gibbs entropy of the canonical distribution is:
Practical use. Once you compute Z(T,V,N) from the microscopic Hamiltonian, every thermodynamic quantity follows by differentiation. This is the central workflow of equilibrium statistical mechanics.
Connection to thermodynamics. Using F=−kBTlnZ (so lnZ=−F/(kBT)):
S=kBβ⟨E⟩−TF=T⟨E⟩−TF=T⟨E⟩−F
This is exactly the thermodynamic identity F=U−TS rearranged: S=(U−F)/T. The canonical ensemble reproduces the thermodynamic relation between internal energy, free energy, and entropy.
Physical interpretation. The two terms in S=kB(lnZ+β⟨E⟩) have distinct meanings:
kBlnZ: the “configurational” entropy — the number of accessible states weighted by the Boltzmann factor.
kBβ⟨E⟩=⟨E⟩/T: the “thermal” contribution from the energy the system carries.
Example: two-level system. With Z=1+e−βε:
S=kB[ln(1+e−βε)+eβε+1βε]
At T→0: S→0 (third law — the system is in a unique ground state). At T→∞: S→kBln2 (maximum entropy — both states equally likely).
The pressure is obtained directly from the partition function:
P=kBT(∂V∂lnZ)T,N
This is equivalent to P=−(∂F/∂V)T,N since F=−kBTlnZ.
Details
Derivation. From F=−kBTlnZ, the thermodynamic relation P=−(∂F/∂V)T,N gives:
P=−∂V∂(−kBTlnZ)=kBT(∂V∂lnZ)T,N
Ideal gas law. For N classical, non-interacting particles in volume V:
ZN=N!1(λT3V)N,λT=2πmkBTh
Taking the logarithm: lnZN=NlnV−3NlnλT−lnN!. Differentiating with respect to V at fixed T,N:
P=kBT⋅VN⟹PV=NkBT
This recovers the ideal gas law directly from the partition function.
Microscopic interpretation. The volume dependence of Z comes from the number of available single-particle states in volume V. Increasing V increases Z (more states), and the system “pushes back” against the walls — this is pressure.
A single particle is confined in a one-dimensional box of length L with energy levels En=n2ℏ2/(8mL2), n=1,2,3,…. In the high-temperature limit, show that P=kBT/L.
Solution
In the high-temperature limit (kBT≫ℏ2/(8mL2)), the sum over states becomes an integral:
The fluctuation–dissipation relationVar(E)=kBT2CV ties the energy variance to the heat capacity: a system with large CV (readily absorbs heat) has large energy fluctuations.
Details
Derivation of the variance. The mean energy is:
⟨E⟩=Z∑αEαe−βEα=−Z1∂β∂Z=−∂β∂lnZ
The second moment:
⟨E2⟩=Z1∂β2∂2Z
Therefore:
Var(E)=⟨E2⟩−⟨E⟩2=∂β2∂2lnZ
Since CV=∂⟨E⟩/∂T and ∂/∂T=−(1/kBT2)∂/∂β:
Var(E)=−∂β∂⟨E⟩=kBT2∂T∂⟨E⟩=kBT2CV
Thermodynamic limit. For a macroscopic system with N∼1023 particles, the relative energy fluctuation is:
⟨E⟩Var(E)∼N1≈10−12
This is the key result behind the equivalence of ensembles: in the thermodynamic limit (N→∞, V→∞, N/V fixed), the canonical ensemble gives the same macroscopic predictions as the microcanonical ensemble, because the energy distribution becomes a delta function. The canonical ensemble is the one used in the standard equivalence proof: the relative fluctuations ∼1/N→0 justify replacing the fluctuating energy by its mean. See Statistical Foundations of Thermodynamics for the full argument.
Small systems. For nanoparticles or single-molecule experiments (N∼102–106), the relative fluctuations are significant and the deterministic thermodynamic description breaks down. See NonequilibriumStatisticalMechanics for fluctuation theorems.
Connection to the grand canonical ensemble. The canonical energy fluctuation Var(E)=kBT2CV is the analogue of the grand-canonical particle-number fluctuation Var(N)=kBT∂μ⟨N⟩. Both express the same principle: the variance of the conserved quantity exchanged with the reservoir is proportional to the corresponding response function. See GrandCanonicalEnsemble.
For quantum systems, the canonical ensemble is expressed using the density matrix:
ρ=Ze−βH^,Z=Tr(e−βH^)
The expectation value of any observable A^ is:
⟨A⟩=Tr(ρA^)Details
From classical to quantum. In the classical canonical ensemble, microstates are points in phase space and P(α) is a probability density. In quantum mechanics, the state is a density operator ρ on Hilbert space. The classical Boltzmann weight e−βEα becomes the operator e−βH^ (defined by the spectral decomposition of H^):
If H^∣n⟩=En∣n⟩, then e−βH^∣n⟩=e−βEn∣n⟩, and:
ρ=n∑Ze−βEn∣n⟩⟨n∣
Expectation values. For any observable A^:
⟨A⟩=Tr(ρA^)=n∑Ze−βEn⟨n∣A^∣n⟩
This generalizes the classical ∑αPαAα to the quantum setting. In particular:
⟨E⟩=Tr(ρH^)=−∂β∂lnZ
Entropy. The von Neumann entropy S=−kBTr(ρlnρ) reduces to the Gibbs entropy in the classical limit and equals kB(lnZ+β⟨E⟩) for the canonical state.
Connection to quantum statistics. When the system consists of many indistinguishable particles, the trace in Z=Tr(e−βH^) is over the appropriate (symmetrized or antisymmetrized) many-body Hilbert space. This is where Fermi–Dirac and Bose–Einstein statistics enter naturally. See GrandCanonicalEnsemble for the quantum ideal gas and occupation-number formalism.
A two-level system has ground state energy E0=0 and excited state energy E1=ε. It is in contact with a heat bath at temperature T. Find the partition function, mean energy, and heat capacity, and identify the Schottky anomaly.
At T→0: ⟨E⟩→0, CV→0 (ground state frozen). At T→∞: ⟨E⟩→ε/2, CV→0 (equipartition between two levels).
The Schottky anomaly: CV peaks at T≈0.417ε/kB (equivalently βε≈2.399), with peak value CVmax≈0.439kB. This is a hallmark of any system with a finite number of energy levels and is observed in real materials (e.g., paramagnetic salts, molecular crystals) as a characteristic bump in the low-temperature heat capacity.
The canonical ensemble is the microcanonical ensemble with a heat bath added: the reservoir fixes T (the entropy slope), and the Boltzmann factor e−βE weights microstates. The partition function Z is the generating function for all thermodynamic quantities: energy, entropy, pressure, and chemical potential all follow by differentiation.
Equivalence of ensembles. The canonical ensemble is the one used in the standard thermodynamic-limit equivalence proof: the relative energy fluctuations scale as 1/N→0, so the canonical and microcanonical ensembles give identical macroscopic predictions for large systems. This justifies using the simpler canonical formalism (fixed T rather than fixed E) for all practical equilibrium calculations.
Adding particle exchange to the heat bath gives the grand canonical ensemble, where the partition function is replaced by the grand partition function Ξ. See MicrocanonicalEnsemble for the isolated limit, GrandCanonicalEnsemble for the open-system generalization, and PhaseTransitions for non-analyticities in F at critical points.