# Canonical ensemble

The canonical ensemble is the statistical description of a system with fixed particle number \( N \), fixed volume \( V \), and fixed temperature \( T \), in thermal contact with a large heat reservoir. It assigns to each microstate \( n \) of the system the Boltzmann probability

\[ P(n) = \frac{1}{Z} e^{-\beta E_n}, \qquad \beta = \frac{1}{k_{\mathrm{B}} T}, \]

where \( E_n \) is the energy of the state and the normalization constant

\[ Z = \sum_n e^{-\beta E_n} \]

is the canonical partition function<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup>. The ensemble is also called the \( (N,V,T) \)-ensemble, in contrast with the microcanonical ensemble of an isolated system with fixed energy<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup>.

| Key fact | Detail |
|---|---|
| Fixed variables | Particle number \( N \), volume \( V \), temperature \( T \); energy fluctuates through heat exchange with the reservoir<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup> |
| State probabilities | Boltzmann distribution \( P(n) = e^{-\beta E_n}/Z \), with \( \beta = 1/k_{\mathrm{B}}T \)<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup> |
| Partition function | \( Z = \sum_n e^{-\beta E_n} \); it contains all equilibrium thermodynamic information about the system<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup> |
| Free energy | \( F = -k_{\mathrm{B}}T \ln Z \), the Helmholtz free energy, from which other thermodynamic quantities follow by differentiation<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup> |
| Energy fluctuations | \( \langle E \rangle = -\partial \ln Z / \partial \beta \) and \( \sigma_E^2 = k_{\mathrm{B}} T^2 C_V \)<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup> |
| Ideal gas result | \( Z = (1/N!)(V/\lambda_T^3)^N \) with thermal wavelength \( \lambda_T = \sqrt{2\pi\hbar^2/(m k_{\mathrm{B}}T)} \)<sup>[2](https://phys.libretexts.org/Bookshelves/Thermodynamics_and_Statistical_Mechanics/Book%3A_Thermodynamics_and_Statistical_Mechanics_%28Arovas%29/04%3A_Statistical_Ensembles/4.07%3A_Ideal_Gas_Statistical_Mechanics)</sup> |
| Ensemble equivalence | Microcanonical and canonical ensembles agree whenever the microcanonical entropy is concave in energy density; long-range interactions can break this equivalence<sup>[3](https://arxiv.org/abs/1403.6608)</sup> |

## Origin of the name

[Josiah Willard Gibbs](https://www.edgepedia.org/josiah-willard-gibbs) introduced three ensembles, the microcanonical, the canonical, and the grand canonical. He wrote that the canonical distribution, "on account of its unique importance in the theory of statistical equilibrium, I have ventured to call canonical"<sup>[4](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)</sup>. The name carries no technical meaning beyond this historical choice, but the distribution it names is the working tool of equilibrium statistical mechanics<sup>[4](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)</sup>.

## Derivation from a reservoir

The canonical distribution follows from the microcanonical assumption that every microstate of an isolated system is equally probable<sup>[5](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_4.html)</sup>. Consider a small system in thermal contact with a much larger reservoir; the combined system is isolated with total energy \( E \). If the small system is in microstate \( n \) with energy \( E_n \), the reservoir must hold the remaining energy \( E - E_n \), and the number of joint microstates is proportional to \( \Omega_{\mathrm{Reservoir}}(E - E_n) \)<sup>[5](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_4.html)</sup>.

Writing the reservoir's state count in terms of its entropy, \( S = k_{\mathrm{B}} \ln \Omega \), and expanding to first order in \( E_n \) gives

\[ \ln \Omega_{\mathrm{Reservoir}}(E - E_n) \approx \ln \Omega_{\mathrm{Reservoir}}(E) - \frac{E_n}{k_{\mathrm{B}} T}, \]

because the derivative \( \partial S / \partial U = 1/T \) is the reservoir's inverse temperature<sup>[4](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)</sup>. The probability of the system's state is therefore proportional to \( e^{-\beta E_n} \), the Boltzmann factor, and normalizing over all states produces the partition function \( Z \)<sup>[4](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)</sup>. The argument assumes the reservoir is large enough that \( U \), \( S \), and \( T \) are well-defined thermodynamic averages<sup>[4](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)</sup>.

An alternative route reaches the same distribution by maximizing the information entropy of the probability distribution subject to fixed mean energy; the resulting equilibrium distribution is again the [Boltzmann distribution](https://www.edgepedia.org/boltzmann-distribution)<sup>[6](https://fb15.pages.uni-marburg.de/ag-von-domaros/teaching/fecomp/canonical-ensemble.html)</sup>.

## Thermodynamics from the partition function

The partition function is the central object of the formalism: once \( Z \) is known, all equilibrium properties follow by differentiation<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup>. The [Helmholtz free energy](https://www.edgepedia.org/helmholtz-free-energy) is

\[ F = -k_{\mathrm{B}} T \ln Z, \]

and the mean energy and its fluctuations are derivatives of \( \ln Z \)<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup>:

\[ \langle E \rangle = -\frac{\partial \ln Z}{\partial \beta}, \qquad \sigma_E^2 = \langle E^2 \rangle - \langle E \rangle^2 = \frac{\partial^2 \ln Z}{\partial \beta^2}. \]

Combining the variance with the heat capacity \( C_V = \partial \langle E \rangle / \partial T \) gives the relation

\[ \sigma_E^2 = k_{\mathrm{B}} T^2 C_V, \]

an example of a fluctuation-dissipation theorem: the size of spontaneous energy fluctuations is governed by the same quantity, the heat capacity, that measures how much energy the system absorbs when heated<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup>. A larger heat capacity means both more energy needed to raise the temperature and larger energy fluctuations<sup>[1](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)</sup>.

Although individual microstates carry Boltzmann weights, the probability that a large system has a particular total energy \( U \) is proportional to \( \Omega(U) e^{-\beta U} \), the product of the number of configurations at that energy and the Boltzmann factor. Because \( \Omega(U) \) rises very rapidly with \( U \), this distribution is sharply peaked near the mean energy and is treated as Gaussian for a large system<sup>[4](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)</sup>. This is why a canonical system behaves, at the macroscopic level, much like a system of fixed energy.

## Relation to other ensembles

The three standard ensembles differ in what the system may exchange with its surroundings<sup>[7](https://web.stanford.edu/~peastman/statmech/statisticaldescription.html)</sup>:

- **Microcanonical**: an isolated system with fixed energy; every accessible microstate is equally probable<sup>[5](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_4.html)</sup>.
- **Canonical**: energy may be exchanged with a heat bath at fixed temperature; the relevant potential is \( E - TS \), the Helmholtz free energy<sup>[7](https://web.stanford.edu/~peastman/statmech/statisticaldescription.html)</sup>.
- **Grand canonical**: both energy and particles may be exchanged with a reservoir of fixed temperature and chemical potential; probabilities carry an additional Gibbs factor \( e^{\beta \mu N_i} \) and the normalization is the grand partition function \( \Xi \)<sup>[4](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)</sup><sup> • </sup><sup>[7](https://web.stanford.edu/~peastman/statmech/statisticaldescription.html)</sup>.

For large systems the three ensembles normally give identical thermodynamic averages, and any of them may be used for a given problem<sup>[4](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)</sup>. Rigorous results show that the microcanonical and canonical ensembles are equivalent at the levels of thermodynamics, equilibrium macrostates, and microstate measures whenever the microcanonical entropy is a concave function of the energy density in the thermodynamic limit<sup>[3](https://arxiv.org/abs/1403.6608)</sup>. Where the entropy is nonconcave, the canonical mean energy skips over a range of energies, which appears as a discontinuous phase transition in the canonical ensemble<sup>[3](https://arxiv.org/abs/1403.6608)</sup>.

Equivalence can fail in systems with long-range interactions, where energy is nonadditive. There the canonical ensemble can still be given a physical meaning: numerical and analytical work shows it correctly describes the equilibrium of a mean-field model when the system is coupled through local interactions to a large reservoir, or when screening weakens the mean-field coupling between a small part of the system and the rest<sup>[8](https://journals.aps.org/pre/abstract/10.1103/PhysRevE.98.012121)</sup>.

## Example: the classical ideal gas

For \( N \) noninteracting monatomic particles in a box of volume \( V \), the canonical partition function evaluates to

\[ Z(T,V,N) = \frac{1}{N!} \left( \frac{V}{\lambda_T^3} \right)^N, \qquad \lambda_T = \sqrt{\frac{2\pi\hbar^2}{m k_{\mathrm{B}} T}}, \]

where \( \lambda_T \) is the thermal de Broglie wavelength, the wavelength of a particle of mass \( m \) with kinetic energy of order \( k_{\mathrm{B}} T \)<sup>[2](https://phys.libretexts.org/Bookshelves/Thermodynamics_and_Statistical_Mechanics/Book%3A_Thermodynamics_and_Statistical_Mechanics_%28Arovas%29/04%3A_Statistical_Ensembles/4.07%3A_Ideal_Gas_Statistical_Mechanics)</sup>. The factor \( 1/N! \) accounts for the indistinguishability of the particles, and the partition function can be read as counting how many thermal wavelengths fit into the volume<sup>[9](https://www.damtp.cam.ac.uk/user/tong/statphys/statmechhtml/S2.html)</sup>. From \( F = -k_{\mathrm{B}}T \ln Z \) and [Stirling's approximation](https://www.edgepedia.org/stirlings-approximation) one obtains \( -F/(k_{\mathrm{B}}T) = N \ln [ e (V/N) / \lambda^3 ] \), and differentiating recovers the ideal gas law \( pV = N k_{\mathrm{B}} T \)<sup>[10](https://www.phys.nthu.edu.tw/~yphuang/c_ensemble.html)</sup>. When the average volume per particle is much larger than the volume associated with \( \lambda_T \), wavefunction overlap is negligible and quantum statistics need not be considered<sup>[10](https://www.phys.nthu.edu.tw/~yphuang/c_ensemble.html)</sup>.

## Temperature limits

The Boltzmann weights encode the effect of temperature directly. As \( T \to 0 \), \( \beta \to \infty \), and the distribution forces the system into its ground state: all higher-energy states have vanishing probability at zero temperature<sup>[11](https://www.damtp.cam.ac.uk/user/tong/statphys/statmechhtml/S1.html)</sup>. At high temperature the weights approach unity for states within a fixed energy band, and the system samples its states nearly uniformly.

## References

1. [5. Distributions, NB2220 Statistical Physics, TU Delft](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_5.html)
2. [4.7: Ideal Gas Statistical Mechanics, D. Arovas, Thermodynamics and Statistical Mechanics, LibreTexts](https://phys.libretexts.org/Bookshelves/Thermodynamics_and_Statistical_Mechanics/Book%3A_Thermodynamics_and_Statistical_Mechanics_%28Arovas%29/04%3A_Statistical_Ensembles/4.07%3A_Ideal_Gas_Statistical_Mechanics)
3. [Equivalence and nonequivalence of ensembles: Thermodynamic, macrostate, and measure levels, H. Touchette and R. S. Ellis, arXiv:1403.6608](https://arxiv.org/abs/1403.6608)
4. [Canonical ensemble: Boltzmann distribution and partition function, Statistical Physics handout, University of Cambridge](https://people.bss.phy.cam.ac.uk/~emt1000/statphys/handout2012.pdf)
5. [4. Boltzmann statistics and entropy, NB2220 Statistical Physics, TU Delft](https://interactivetextbooks.tudelft.nl/NB2220/content/Exercise_set_4.html)
6. [7. Canonical Ensemble, Statistical Thermodynamics and Free Energy Computation, University of Marburg](https://fb15.pages.uni-marburg.de/ag-von-domaros/teaching/fecomp/canonical-ensemble.html)
7. [2. The Statistical Description of Physical Systems, P. Eastman, Introduction to Statistical Mechanics, Stanford University](https://web.stanford.edu/~peastman/statmech/statisticaldescription.html)
8. [Physical interpretation of the canonical ensemble for long-range interacting systems in the absence of ensemble equivalence, M. Baldovin, Phys. Rev. E 98, 012121 (2018)](https://journals.aps.org/pre/abstract/10.1103/PhysRevE.98.012121)
9. [2. Classical Gases, D. Tong, Statistical Physics, University of Cambridge](https://www.damtp.cam.ac.uk/user/tong/statphys/statmechhtml/S2.html)
10. [Canonical ensemble, 2022 Statistical Mechanics (I) PHYS521000, Y.-P. Huang, National Tsing Hua University](https://www.phys.nthu.edu.tw/~yphuang/c_ensemble.html)
11. [1. The Fundamentals of Statistical Mechanics, D. Tong, Statistical Physics, University of Cambridge](https://www.damtp.cam.ac.uk/user/tong/statphys/statmechhtml/S1.html)

---
*Topic: Encyclopedia › Physical world and mathematics › Physics › Classical physics › Thermodynamics › Statistical mechanics and kinetic theory › Ensembles and partition functions*

*Initially written Sep 17, 2026 · Reviewed: Sep 19, 2026; Sep 30, 2026; Oct 15, 2026 · Edited: Sep 19, 2026; Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
