Skip to content

Canonical Ensemble

The canonical ensemble describes a system that can exchange energy with a thermal environment while its particle number and external control parameters are fixed. Its standard macroscopic controls are

T,V,N,T,\qquad V,\qquad N,

with Hamiltonian HN(V,λ,…)H_N(V,\lambda,\ldots) acting on the fixed-NN Hilbert space.

The equilibrium state is

ρN,β=e−βHNZN,\rho_{N,\beta} = \frac{ e^{-\beta H_N} }{ Z_N },

where

ZN(β,V,λ,…)=Tr⁡HNe−βHN.Z_N(\beta,V,\lambda,\ldots) = \operatorname{Tr}_{\mathcal H_N} e^{-\beta H_N}.

The subscript NN is often suppressed, but the trace domain is part of the ensemble definition. The general operator properties of this state live in Thermal Density Operators. Here the focus is fixed-T,N,VT,N,V thermodynamics.

QuantityCanonical status
temperature TTexternally fixed
volume VV and other controlsexternally fixed
particle number NNfixed exactly
energy EEfluctuates
density operatorρN,β\rho_{N,\beta}
thermodynamic potentialHelmholtz free energy FF

The ensemble describes a probability distribution over energy eigenstates in one fixed-particle-number sector. It does not imply that particles are exchanged with the environment. Particle exchange belongs to the grand-canonical ensemble.

Consider a small system SS weakly coupled to a much larger reservoir BB. The combined system is isolated with total energy

Etot=En+EB.E_{\mathrm{tot}} = E_n+E_B.

If SS occupies an energy eigenstate with energy EnE_n, the reservoir can occupy

ΩB(Etot−En)\Omega_B(E_{\mathrm{tot}}-E_n)

compatible states. Therefore

pn∝ΩB(Etot−En).p_n \propto \Omega_B(E_{\mathrm{tot}}-E_n).

Using

SB(E)=kBln⁡ΩB(E),S_B(E) = k_{\mathrm B}\ln\Omega_B(E),

expand the reservoir entropy:

SB(Etot−En)=SB(Etot)−EnT−En22T2CB+⋯ .\begin{aligned} S_B(E_{\mathrm{tot}}-E_n) ={}& S_B(E_{\mathrm{tot}}) - \frac{E_n}{T} \\ &- \frac{E_n^2}{2T^2C_B} + \cdots. \end{aligned}

The thermodynamic identity

∂SB∂EB=1T\frac{\partial S_B}{\partial E_B} = \frac{1}{T}

then gives

ΩB(Etot−En)∝e−En/(kBT)=e−βEn.\Omega_B(E_{\mathrm{tot}}-E_n) \propto e^{-E_n/(k_{\mathrm B}T)} = e^{-\beta E_n}.

Normalizing over system states yields the canonical probabilities.

This argument assumes:

  • the reservoir is much larger than the system;
  • the coupling energy is negligible at leading order;
  • the reservoir temperature changes negligibly across relevant system energies;
  • the combined system explores or is assigned the appropriate energy shell;
  • the fixed particle-number and external-parameter constraints are respected.

At strong system–bath coupling, the reduced equilibrium state need not be the bare Gibbs state of HSH_S.

For a spectral decomposition

HN=∑aEaPa,H_N = \sum_a E_aP_a,

the canonical state is

ρN,β=1ZN∑ae−βEaPa.\rho_{N,\beta} = \frac{1}{Z_N} \sum_a e^{-\beta E_a}P_a.

If ga=Tr⁡Pag_a=\operatorname{Tr}P_a, the energy probability is

Pr⁡(Ea)=gae−βEaZN.\Pr(E_a) = \frac{ g_a e^{-\beta E_a} }{ Z_N }.

The partition function is

ZN=∑agae−βEa.Z_N = \sum_a g_a e^{-\beta E_a}.

The sum is over the fixed-NN spectrum. Including states with other particle numbers silently changes the ensemble.

The Partition Function as a Generating Object

Section titled “The Partition Function as a Generating Object”

The canonical partition function is not only a normalization. Its logarithm generates equilibrium thermodynamics. Partition Functions owns the general trace, cumulant, factorization, quantum-statistics, and path-integral structure; this section records the identities needed for fixed-T,N,VT,N,V thermodynamics.

Define

F(T,V,N,λ,…)=−kBTln⁡ZN.F(T,V,N,\lambda,\ldots) = -k_{\mathrm B}T\ln Z_N.

Equivalently,

βF=−ln⁡ZN.\beta F = -\ln Z_N.

The internal energy is

U=⟨HN⟩=−∂∂βln⁡ZN,U = \langle H_N\rangle = -\frac{\partial}{\partial\beta} \ln Z_N,

for a Hamiltonian with no explicit temperature or β\beta dependence.

Another useful identity is

U=∂∂β(βF).U = \frac{\partial}{\partial\beta} \left( \beta F \right).

The entropy follows from

S=−(∂F∂T)V,N,λS = -\left( \frac{\partial F}{\partial T} \right)_{V,N,\lambda}

and equals

S=kB(ln⁡ZN+βU).S = k_{\mathrm B} \left( \ln Z_N+\beta U \right).

These relations use the natural logarithm.

The Helmholtz free energy is the thermodynamic potential appropriate to fixed TT, VV, and NN:

F=U−TS.F = U-TS.

At equilibrium, the Gibbs state minimizes the state functional

FT(ρ)=Tr⁡(ρHN)−TS(ρ)\mathcal F_T(\rho) = \operatorname{Tr}(\rho H_N) - TS(\rho)

over normalized density operators on HN\mathcal H_N.

The equilibrium value is

FT(ρN,β)=F=−kBTln⁡ZN.\mathcal F_T(\rho_{N,\beta}) = F = -k_{\mathrm B}T\ln Z_N.

Free energy balances energy against entropy. A low-energy state is favored energetically; a large set of accessible states is favored entropically.

Let the Hamiltonian depend on an external parameter λ\lambda. Even when HH and ∂λH\partial_\lambda H do not commute, cyclicity of the trace gives

∂F∂λ=⟨∂H∂λ⟩β.\frac{\partial F}{\partial\lambda} = \left\langle \frac{\partial H}{\partial\lambda} \right\rangle_\beta.

If the physical generalized force is defined by

Xλ=−∂H∂λ,\mathcal X_\lambda = -\frac{\partial H}{\partial\lambda},

then

⟨Xλ⟩=−∂F∂λ.\langle\mathcal X_\lambda\rangle = -\frac{\partial F}{\partial\lambda}.

Examples include:

P=−(∂F∂V)T,NP = -\left( \frac{\partial F}{\partial V} \right)_{T,N}

for pressure and

M=−(∂F∂B)T,NM = -\left( \frac{\partial F}{\partial B} \right)_{T,N}

for magnetization when the Hamiltonian contains the appropriate magnetic-field coupling.

Sign conventions follow the definition of the Hamiltonian term. They should be checked rather than memorized independently of HH.

For a simple system,

dF=−S dT−P dV+μ dN.dF = -S\,dT - P\,dV + \mu\,dN.

The canonical ensemble holds NN fixed during fluctuations, but μ\mu can still be defined by comparing neighboring fixed-NN systems:

μ=(∂F∂N)T,V\mu = \left( \frac{\partial F}{\partial N} \right)_{T,V}

in a thermodynamic or smoothly interpolated description.

At finite integer NN, addition and removal chemical potentials are naturally finite differences:

μ+=FN+1−FN,μ−=FN−FN−1.\begin{aligned} \mu_+ &= F_{N+1}-F_N, \\ \mu_- &= F_N-F_{N-1}. \end{aligned}

They need not coincide in a finite system or across a gap.

The second β\beta derivative of ln⁡ZN\ln Z_N is

∂2∂β2ln⁡ZN=⟨HN2⟩−⟨HN⟩2.\frac{\partial^2}{\partial\beta^2} \ln Z_N = \langle H_N^2\rangle - \langle H_N\rangle^2.

Therefore

Var⁡(E)=−∂U∂β.\operatorname{Var}(E) = -\frac{\partial U}{\partial\beta}.

For a temperature-independent Hamiltonian,

CV≡(∂U∂T)V,N=kBβ2Var⁡(E).C_V \equiv \left( \frac{\partial U}{\partial T} \right)_{V,N} = k_{\mathrm B}\beta^2 \operatorname{Var}(E).

Thus

CV≥0C_V\geq0

in the canonical ensemble under these assumptions.

This does not prove that every definition of heat capacity in every ensemble is nonnegative. Microcanonical and nonadditive long-range systems can require separate analysis.

The canonical probability of energy EaE_a is

Pβ(Ea)=gae−βEaZN.P_\beta(E_a) = \frac{ g_a e^{-\beta E_a} }{ Z_N }.

Its mean and variance are

E‾=U,(E−U)2‾=kBT2CV.\begin{aligned} \overline E &= U, \\ \overline{ (E-U)^2 } &= k_{\mathrm B}T^2 C_V. \end{aligned}

For ordinary additive systems away from criticality,

U∼N,Var⁡(E)∼N.U \sim N, \qquad \operatorname{Var}(E) \sim N.

Hence the relative energy width scales as

Var⁡(E)U∼1N.\frac{ \sqrt{\operatorname{Var}(E)} }{ U } \sim \frac{1}{\sqrt N}.

Macroscopic energy density becomes sharply concentrated even though total energy still fluctuates.

Near criticality, long-range correlations can modify simple scaling. At first-order coexistence, the energy distribution can become bimodal. Finite-size data should be inspected rather than forced into a Gaussian assumption.

Let ΩN(E)\Omega_N(E) count fixed-NN states near energy EE. The partition function is the Laplace transform

ZN(β)=∫dE ΩN(E)e−βE,Z_N(\beta) = \int dE\, \Omega_N(E)e^{-\beta E},

or the corresponding discrete sum.

Writing

SN(E)=kBln⁡ΩN(E)S_N(E) = k_{\mathrm B}\ln\Omega_N(E)

gives

ZN(β)=∫dE exp⁡[SN(E)kB−βE].Z_N(\beta) = \int dE\, \exp \left[ \frac{S_N(E)}{k_{\mathrm B}} - \beta E \right].

For a large system, a saddle point E∗E_* satisfies

∂SN∂E∣E∗=1T.\left. \frac{\partial S_N}{\partial E} \right|_{E_*} = \frac{1}{T}.

At leading order,

F≈E∗−TSN(E∗).F \approx E_*-TS_N(E_*).

This is the Legendre relation between microcanonical entropy and canonical free energy. Its validity can fail or require convexification in nonadditive systems and coexistence regions.

Suppose

H=HA⊗IB+IA⊗HBH = H_A\otimes\mathbb I_B + \mathbb I_A\otimes H_B

on

H=HA⊗HB.\mathcal H = \mathcal H_A\otimes\mathcal H_B.

The terms commute, so

e−βH=e−βHA⊗e−βHB.e^{-\beta H} = e^{-\beta H_A} \otimes e^{-\beta H_B}.

Therefore

ZAB=ZAZB,Z_{AB} = Z_AZ_B,

and

FAB=FA+FB.F_{AB} = F_A+F_B.

This factorization assumes a tensor-product decomposition with independent Hamiltonians. Identical-particle symmetrization, global particle-number constraints, or interactions can prevent a naive product of one-particle partition functions.

Canonical Ensemble and Identical Particles

Section titled “Canonical Ensemble and Identical Particles”

For NN identical particles, the trace must be taken over the appropriate symmetric or antisymmetric NN-particle subspace:

ZN(±)=Tr⁡HN(±)e−βHN.Z_N^{(\pm)} = \operatorname{Tr}_{\mathcal H_N^{(\pm)}} e^{-\beta H_N}.

One should not begin with an NN-fold labeled-particle trace and forget to impose exchange symmetry.

For a dilute classical gas, a factor of 1/N!1/N! emerges in the appropriate limit. For a quantum-degenerate gas, Bose–Einstein or Fermi–Dirac statistics must be treated directly.

The canonical ensemble fixes NN exactly. It can still describe identical particles, occupation numbers, and exchange correlations.

For a finite-dimensional Hamiltonian H(g)H(g) analytic in a real parameter gg,

ZN(β,g)=Tr⁡e−βH(g)>0Z_N(\beta,g) = \operatorname{Tr} e^{-\beta H(g)} > 0

at finite positive temperature. Therefore

FN(β,g)=−1βln⁡ZN(β,g)F_N(\beta,g) = -\frac{1}{\beta} \ln Z_N(\beta,g)

is analytic under the stated assumptions.

Finite systems can have sharp peaks, rapid crossovers, and bimodal distributions. A genuine thermal nonanalyticity requires an infinite-system or another singular limit.

Zero temperature is different: taking β→∞\beta\to\infty can expose a finite-system level crossing in the ground-state energy.

The canonical ensemble allows energy fluctuations; the microcanonical ensemble fixes an energy shell. For short-range additive systems in a regular thermodynamic limit, local observables often agree between the two ensembles when their mean energies are matched.

The reason is concentration:

ΔEU∼N−1/2.\frac{\Delta E}{U} \sim N^{-1/2}.

Equivalence is not automatic for:

  • finite systems;
  • long-range nonadditive interactions;
  • phase coexistence;
  • observables sensitive to global fluctuations;
  • constrained sectors;
  • nonconcave entropy regions.

“Thermodynamic limit” should not be used as a universal spell that erases ensemble definitions. Ensemble Equivalence gives the full concentration, entropy-concavity, local-state, coexistence, and long-range analysis.

Temperature-Dependent Effective Hamiltonians

Section titled “Temperature-Dependent Effective Hamiltonians”

The familiar identity

U=−∂βln⁡ZU = -\partial_\beta\ln Z

assumes HH has no explicit β\beta dependence. If an effective Hamiltonian is written as H(β)H(\beta), then

−∂∂βln⁡Z=⟨H+β∂H∂β⟩.-\frac{\partial}{\partial\beta} \ln Z = \left\langle H + \beta \frac{\partial H}{\partial\beta} \right\rangle.

The extra term cannot be dropped.

Temperature-dependent effective Hamiltonians can arise after integrating out degrees of freedom or fitting phenomenological parameters. Their thermodynamic consistency must be derived from the underlying model rather than assumed from formal resemblance.

Let

H=Δ∣1⟩⟨1∣,Δ>0.H = \Delta|1\rangle\langle1|, \qquad \Delta>0.

With

x=βΔ,x = \beta\Delta,

the partition function is

Z1=1+e−x.Z_1 = 1+e^{-x}.

The free energy and internal energy are

F1=−kBTln⁡(1+e−x),U1=Δex+1.\begin{aligned} F_1 &= -k_{\mathrm B}T \ln(1+e^{-x}), \\ U_1 &= \frac{\Delta}{ e^x+1 }. \end{aligned}

The energy variance is

Var⁡(E)=Δ2ex(1+ex)2.\operatorname{Var}(E) = \Delta^2 \frac{e^x}{ (1+e^x)^2 }.

Therefore

C1kB=x2ex(1+ex)2.\frac{C_1}{k_{\mathrm B}} = x^2 \frac{e^x}{ (1+e^x)^2 }.

The heat capacity vanishes as T→0T\to0 and T→∞T\to\infty and has a finite-temperature Schottky peak.

For LL distinguishable noninteracting copies,

HL=∑j=1LΔ∣1⟩j⟨1∣.H_L = \sum_{j=1}^{L} \Delta |1\rangle_j\langle1|.

Factorization gives

ZL=(1+e−x)L.Z_L = (1+e^{-x})^L.

Consequently,

FL=LF1,UL=LU1,CL=LC1.\begin{gathered} F_L = L F_1, \\ U_L = L U_1, \\ C_L = L C_1. \end{gathered}

The energy standard deviation grows as L\sqrt L, while the mean energy grows as LL at fixed finite temperature. Relative energy fluctuations therefore scale as L−1/2L^{-1/2}.

For

H=ℏω(a†a+12),H = \hbar\omega \left( a^\dagger a+\frac12 \right),

define

x=βℏω.x = \beta\hbar\omega.

The partition function is

Z=e−x/21−e−x.Z = \frac{ e^{-x/2} }{ 1-e^{-x} }.

The internal energy is

U=ℏω(12+1ex−1).U = \hbar\omega \left( \frac12 + \frac{1}{e^x-1} \right).

The heat capacity is

CkB=x2ex(ex−1)2.\frac{C}{k_{\mathrm B}} = x^2 \frac{e^x}{ (e^x-1)^2 }.

As T→0T\to0, U→ℏω/2U\to\hbar\omega/2 and C→0C\to0. At high temperature, UU approaches kBTk_{\mathrm B}T and CC approaches kBk_{\mathrm B}.

This page owns:

  • the fixed-T,V,NT,V,N ensemble;
  • the reservoir motivation for Boltzmann weights;
  • ZNZ_N as a fixed-sector trace;
  • Helmholtz free energy and its derivatives;
  • canonical energy fluctuations and heat capacity;
  • the density-of-states transform and large-system saddle;
  • factorization and ensemble-equivalence caveats.

Other pages own:

  • the general operator structure and temperature limits of the Gibbs state: Thermal Density Operators;
  • partition functions as general spectral and generating objects: Partition Functions;
  • natural variables, Legendre transforms, Gibbs free energy, and stability identities: Thermodynamic Potentials;
  • thermal entropy versus information and entanglement entropy: Entropy in Quantum Statistical Mechanics;
  • the general constrained-entropy derivation and multiplier duality: Maximum Entropy Principle;
  • the unified static fluctuation–response dictionary and noncommuting correction: Fluctuations and Susceptibilities;
  • variable-particle-number traces and number fluctuations: Grand-Canonical Ensemble;
  • finite-system addition and removal chemical potentials: Chemical Potential;
  • isolated energy shells and microcanonical entropy: Microcanonical Ensemble;
  • open-system heat, work, and entropy production: Quantum Thermodynamics;
  • Bose–Einstein and Fermi–Dirac occupation laws: Quantum Statistics and Ideal Gases.
  • Forgetting that the trace is restricted to fixed NN.
  • Calling a variable-particle-number calculation canonical.
  • Treating ZZ as only a normalization and missing its derivative structure.
  • Using log⁡10\log_{10} instead of the natural logarithm.
  • Dropping degeneracy factors in an energy-level sum.
  • Multiplying one-particle partition functions for identical quantum particles without exchange corrections.
  • Inferring a preparation or thermalization mechanism from the equilibrium ensemble.
  • Assuming the reservoir derivation remains exact at strong coupling.
  • Using U=−∂βln⁡ZU=-\partial_\beta\ln Z when HH depends explicitly on β\beta.
  • Forgetting what is held fixed in a thermodynamic derivative.
  • Assuming every generalized-force sign convention is the same.
  • Concluding that canonical heat capacity can be negative for a temperature-independent finite Hamiltonian.
  • Calling a finite-size peak a phase transition without scaling.
  • Assuming canonical and microcanonical ensembles are always equivalent.
  • Confusing total energy fluctuations with uncertainty in a pure-state energy measurement.

Starting from

Z=1+e−βΔ,Z=1+e^{-\beta\Delta},

derive the heat capacity and show its low- and high-temperature limits.

Solution

The mean energy is

U=ΔeβΔ+1.U = \frac{\Delta}{ e^{\beta\Delta}+1 }.

Let x=βΔx=\beta\Delta. Differentiating with respect to TT gives

CkB=x2ex(1+ex)2.\frac{C}{k_{\mathrm B}} = x^2 \frac{e^x}{ (1+e^x)^2 }.

For x→∞x\to\infty,

CkB∼x2e−x⟶0.\frac{C}{k_{\mathrm B}} \sim x^2e^{-x} \longrightarrow 0.

For x→0x\to0,

CkB∼x24⟶0.\frac{C}{k_{\mathrm B}} \sim \frac{x^2}{4} \longrightarrow 0.

If H′=H+CIH'=H+C\mathbb I, determine how ρβ\rho_\beta, ZZ, FF, UU, SS, and CVC_V change.

Solution

The partition function changes by

Z′=e−βCZ.Z' = e^{-\beta C}Z.

The normalized state is unchanged:

ρβ′=ρβ.\rho_\beta' = \rho_\beta.

The free energy and internal energy shift:

F′=F+C,U′=U+C.F'=F+C, \qquad U'=U+C.

The entropy is

S′=U′−F′T=S,S' = \frac{U'-F'}{T} = S,

and CV=∂U/∂TC_V=\partial U/\partial T is unchanged when CC is temperature independent.

For LL independent two-level sites with energies 00 and Δ\Delta, derive ZLZ_L, FLF_L, and the probability that exactly mm sites are excited.

Solution

Each site has

Z1=1+e−βΔ.Z_1 = 1+e^{-\beta\Delta}.

Independence gives

ZL=Z1L,FL=LF1.Z_L = Z_1^L, \qquad F_L = L F_1.

There are (Lm)\binom{L}{m} configurations with mm excitations, each of energy mΔm\Delta. Hence

Pr⁡(m)=(Lm)e−βmΔ(1+e−βΔ)L.\Pr(m) = \binom{L}{m} \frac{ e^{-\beta m\Delta} }{ (1+e^{-\beta\Delta})^L }.

This is a binomial distribution with single-site excitation probability 1/(eβΔ+1)1/(e^{\beta\Delta}+1).

Show that

Var⁡(E)=∂2∂β2ln⁡Z.\operatorname{Var}(E) = \frac{\partial^2}{\partial\beta^2} \ln Z.
Solution

First,

∂∂βln⁡Z=−⟨H⟩.\frac{\partial}{\partial\beta} \ln Z = -\langle H\rangle.

Differentiating again,

∂2∂β2ln⁡Z=1ZTr⁡(H2e−βH)−[1ZTr⁡(He−βH)]2=⟨H2⟩−⟨H⟩2.\begin{aligned} \frac{\partial^2}{\partial\beta^2} \ln Z &= \frac{1}{Z} \operatorname{Tr} \left( H^2e^{-\beta H} \right) \\ &\quad- \left[ \frac{1}{Z} \operatorname{Tr} \left( He^{-\beta H} \right) \right]^2 \\ &= \langle H^2\rangle - \langle H\rangle^2. \end{aligned}

A calculation sums over states with N=0,1,2,…N=0,1,2,\ldots and weights each state by e−β(E−μN)e^{-\beta(E-\mu N)}. Is it canonical? Identify the correct ensemble and explain what must change to make the calculation canonical.

Solution

It is grand canonical because particle number varies and the chemical potential appears in the weight.

To make the calculation canonical, choose one particle number NN and restrict the trace to HN\mathcal H_N:

ZN=Tr⁡HNe−βHN.Z_N = \operatorname{Tr}_{\mathcal H_N} e^{-\beta H_N}.

The chemical-potential term is then unnecessary because NN is fixed. Different fixed-NN partition functions can be compared afterward to define addition or removal chemical potentials.

  • R. K. Pathria and P. D. Beale, Statistical Mechanics, 3rd ed., Elsevier (2011).
  • K. Huang, Statistical Mechanics, 2nd ed., Wiley (1987).
  • M. Kardar, Statistical Physics of Particles, Cambridge University Press (2007).
  • L. D. Landau and E. M. Lifshitz, Statistical Physics, Part 1, 3rd ed., Butterworth–Heinemann (1980).
  • H. B. Callen, Thermodynamics and an Introduction to Thermostatistics, 2nd ed., Wiley (1985).
  • L. E. Reichl, A Modern Course in Statistical Physics, 4th ed., Wiley–VCH (2016).