In

statistical mechanics
In physics, statistical mechanics is a mathematical framework that applies statistical methods and probability theory to large assemblies of microscopic entities. It does not assume or postulate any natural laws, but explains the macroscopic b ...

, a canonical ensemble is the statistical ensemble that represents the possible states of a mechanical system in thermal equilibrium with a heat bath at a fixed temperature. The system can exchange energy with the heat bath, so that the states of the system will differ in total energy.
The principal thermodynamic variable of the canonical ensemble, determining the probability distribution of states, is the absolute temperature (symbol: ). The ensemble typically also depends on mechanical variables such as the number of particles in the system (symbol: ) and the system's volume (symbol: ), each of which influence the nature of the system's internal states. An ensemble with these three parameters is sometimes called the ensemble.
The canonical ensemble assigns a probability to each distinct microstate
A microstate or ministate is a sovereign state having a very small population or very small land area, usually both. However, the meanings of "state" and "very small" are not well-defined in international law.Warrington, E. (1994). "Lilliputs ...

given by the following exponential:
:$P\; =\; e^,$
where is the total energy of the microstate, and is the Boltzmann constant.
The number is the free energy (specifically, the Helmholtz free energy
In thermodynamics, the Helmholtz free energy (or Helmholtz energy) is a thermodynamic potential that measures the useful work obtainable from a closed thermodynamic system at a constant temperature (isothermal). The change in the Helmholtz ene ...

) and is a constant for the ensemble. However, the probabilities and will vary if different ''N'', ''V'', ''T'' are selected. The free energy serves two roles: first, it provides a normalization factor for the probability distribution (the probabilities, over the complete set of microstates, must add up to one); second, many important ensemble averages can be directly calculated from the function .
An alternative but equivalent formulation for the same concept writes the probability as
:$\backslash textstyle\; P\; =\; \backslash frac\; e^,$
using the canonical partition function
The adjective canonical is applied in many contexts to mean "according to the canon" the standard, rule or primary source that is accepted as authoritative for the body of knowledge or literature in that context. In mathematics, "canonical examp ...

:$\backslash textstyle\; Z\; =\; e^$
rather than the free energy. The equations below (in terms of free energy) may be restated in terms of the canonical partition function by simple mathematical manipulations.
Historically, the canonical ensemble was first described by Boltzmann (who called it a ''holode'') in 1884 in a relatively unknown paper. It was later reformulated and extensively investigated by Gibbs in 1902.
Applicability of canonical ensemble

The canonical ensemble is the ensemble that describes the possible states of a system that is in thermal equilibrium with a heat bath (the derivation of this fact can be found in Gibbs). The canonical ensemble applies to systems of any size; while it is necessary to assume that the heat bath is very large (i. e., take a macroscopic limit), the system itself may be small or large. The condition that the system is mechanically isolated is necessary in order to ensure it does not exchange energy with any external object besides the heat bath. In general, it is desirable to apply the canonical ensemble to systems that are in direct contact with the heat bath, since it is that contact that ensures the equilibrium. In practical situations, the use of the canonical ensemble is usually justified either 1) by assuming that the contact is mechanically weak, or 2) by incorporating a suitable part of the heat bath connection into the system under analysis, so that the connection's mechanical influence on the system is modeled within the system. When the total energy is fixed but the internal state of the system is otherwise unknown, the appropriate description is not the canonical ensemble but the microcanonical ensemble. For systems where the particle number is variable (due to contact with a particle reservoir), the correct description is thegrand canonical ensemble
In statistical mechanics, the grand canonical ensemble (also known as the macrocanonical ensemble) is the statistical ensemble that is used to represent the possible states of a mechanical system of particles that are in thermodynamic equilibriu ...

. In statistical physics textbooks for interacting particle systems the three ensembles are assumed to be thermodynamically equivalent: the fluctuations of macroscopic quantities around their average value become small and, as the number of particles tends to infinity, they tend to vanish. In the latter limit, called the thermodynamic limit, the average constraints effectively become hard constraints. The assumption of ensemble equivalence dates back to Gibbs and has been verified for some models of physical systems with short-range interactions and subject to a small number of macroscopic constraints. Despite the fact that many textbooks still convey the message that ensemble equivalence holds for all physical systems, over the last decades various examples of physical systems have been found for which breaking of ensemble equivalence occurs.
Properties

Free energy, ensemble averages, and exact differentials

* The partial derivatives of the function give important canonical ensemble average quantities: **the average pressure is $$\backslash langle\; p\; \backslash rangle\; =\; -\backslash frac\; ,$$ **the Gibbs entropy is $$S\; =\; -k\; \backslash langle\; \backslash log\; P\; \backslash rangle\; =\; -\; \backslash frac\; ,$$ **the partial derivative is approximately related tochemical potential
In thermodynamics, the chemical potential of a species is the energy that can be absorbed or released due to a change of the particle number of the given species, e.g. in a chemical reaction or phase transition. The chemical potential of a species ...

, although the concept of chemical equilibrium does not exactly apply to canonical ensembles of small systems.Since is an integer, this "derivative" actually refers to a finite difference expression such as , or , or . These finite difference expressions are equivalent only in the thermodynamic limit (very large ).
**and the average energy is $$\backslash langle\; E\; \backslash rangle\; =\; F\; +\; ST.$$
* ''Exact differential'': From the above expressions, it can be seen that the function , for a given , has the exact differential
In multivariate calculus, a differential or differential form is said to be exact or perfect (''exact differential''), as contrasted with an inexact differential, if it is equal to the general differential dQ for some differentiable function&n ...

$$dF\; =\; -\; S\; \backslash ,\; dT\; -\; \backslash langle\; p\backslash rangle\; \backslash ,\; dV\; .$$
* ''First law of thermodynamics'': Substituting the above relationship for into the exact differential of , an equation similar to the first law of thermodynamics is found, except with average signs on some of the quantities: $$d\backslash langle\; E\; \backslash rangle\; =\; T\; \backslash ,\; dS\; -\; \backslash langle\; p\backslash rangle\; \backslash ,\; dV\; .$$
* '' Energy fluctuations'': The energy in the system has uncertainty in the canonical ensemble. The variance
In probability theory and statistics, variance is the expectation of the squared deviation of a random variable from its population mean or sample mean. Variance is a measure of dispersion, meaning it is a measure of how far a set of num ...

of the energy is $$\backslash langle\; E^2\; \backslash rangle\; -\; \backslash langle\; E\; \backslash rangle^2\; =\; k\; T^2\; \backslash frac.$$
Example ensembles

Boltzmann distribution (separable system)

If a system described by a canonical ensemble can be separated into independent parts (this happens if the different parts do not interact), and each of those parts has a fixed material composition, then each part can be seen as a system unto itself and is described by a canonical ensemble having the same temperature as the whole. Moreover, if the system is made up of multiple ''similar'' parts, then each part has exactly the same distribution as the other parts. In this way, the canonical ensemble provides exactly the Boltzmann distribution (also known asMaxwell–Boltzmann statistics
In statistical mechanics, Maxwell–Boltzmann statistics describes the distribution of classical material particles over various energy states in thermal equilibrium. It is applicable when the temperature is high enough or the particle density ...

) for systems of ''any number'' of particles. In comparison, the justification of the Boltzmann distribution from the microcanonical ensemble only applies for systems with a large number of parts (that is, in the thermodynamic limit).
The Boltzmann distribution itself is one of the most important tools in applying statistical mechanics to real systems, as it massively simplifies the study of systems that can be separated into independent parts (e. g., particles in a gas, electromagnetic modes in a cavity, molecular bonds in a polymer).
Ising model (strongly interacting system)

In a system composed of pieces that interact with each other, it is usually not possible to find a way to separate the system into independent subsystems as done in the Boltzmann distribution. In these systems it is necessary to resort to using the full expression of the canonical ensemble in order to describe the thermodynamics of the system when it is thermostatted to a heat bath. The canonical ensemble is generally the most straightforward framework for studies of statistical mechanics and even allows one to obtain exact solutions in some interacting model systems. A classic example of this is the Ising model, which is a widely discussed toy model for the phenomena of ferromagnetism and of self-assembled monolayer formation, and is one of the simplest models that shows aphase transition
In chemistry, thermodynamics, and other related fields, a phase transition (or phase change) is the physical process of transition between one state of a medium and another. Commonly the term is used to refer to changes among the basic states ...

. Lars Onsager famously calculated exactly the free energy of an infinite-sized square-lattice Ising model at zero magnetic field, in the canonical ensemble.
Precise expressions for the ensemble

The precise mathematical expression for a statistical ensemble depends on the kind of mechanics under consideration—quantum or classical—since the notion of a "microstate" is considerably different in these two cases. In quantum mechanics, the canonical ensemble affords a simple description since diagonalization provides a discrete set ofmicrostate
A microstate or ministate is a sovereign state having a very small population or very small land area, usually both. However, the meanings of "state" and "very small" are not well-defined in international law.Warrington, E. (1994). "Lilliputs ...

s with specific energies. The classical mechanical case is more complex as it involves instead an integral over canonical phase space
In dynamical system theory, a phase space is a space in which all possible states of a system are represented, with each possible state corresponding to one unique point in the phase space. For mechanical systems, the phase space usuall ...

, and the size of microstates in phase space can be chosen somewhat arbitrarily.
Quantum mechanical

A statistical ensemble in quantum mechanics is represented by adensity matrix
In quantum mechanics, a density matrix (or density operator) is a matrix that describes the quantum state of a physical system. It allows for the calculation of the probabilities of the outcomes of any measurement performed upon this system, using ...

, denoted by $\backslash hat\; \backslash rho$. In basis-free notation, the canonical ensemble is the density matrix
:$\backslash hat\; \backslash rho\; =\; \backslash exp\backslash left(\backslash tfrac(F\; -\; \backslash hat\; H)\backslash right),$
where is the system's total energy operator ( Hamiltonian), and is the matrix exponential operator. The free energy is determined by the probability normalization condition that the density matrix has a trace of one, $\backslash operatorname\; \backslash hat\; \backslash rho=1$:
:$e^\; =\; \backslash operatorname\; \backslash exp\backslash left(-\backslash tfrac\; \backslash hat\; H\backslash right).$
The canonical ensemble can alternatively be written in a simple form using bra–ket notation, if the system's energy eigenstates and energy eigenvalues are known. Given a complete basis of energy eigenstates , indexed by , the canonical ensemble is:
:$\backslash hat\; \backslash rho\; =\; \backslash sum\_i\; e^\; ,\; \backslash psi\_i\backslash rangle\; \backslash langle\; \backslash psi\_i\; ,$
:$e^\; =\; \backslash sum\_i\; e^.$
where the are the energy eigenvalues determined by . In other words, a set of microstates in quantum mechanics is given by a complete set of stationary states. The density matrix is diagonal in this basis, with the diagonal entries each directly giving a probability.
Classical mechanical

In classical mechanics, a statistical ensemble is instead represented by a joint probability density function in the system'sphase space
In dynamical system theory, a phase space is a space in which all possible states of a system are represented, with each possible state corresponding to one unique point in the phase space. For mechanical systems, the phase space usuall ...

,
, where the and are the canonical coordinates (generalized momenta and generalized coordinates) of the system's internal degrees of freedom.
In a system of particles, the number of degrees of freedom depends on the number of particles in a way that depends on the physical situation. For a three-dimensional gas of monoatoms (not molecules), . In diatomic gases there will also be rotational and vibrational degrees of freedom.
The probability density function for the canonical ensemble is:
:$\backslash rho\; =\; \backslash frac\; e^,$
where
* is the energy of the system, a function of the phase ,
* is an arbitrary but predetermined constant with the units of , setting the extent of one microstate and providing correct dimensions to .(Historical note) Gibbs' original ensemble effectively set , leading to unit-dependence in the values of some thermodynamic quantities like entropy and chemical potential. Since the advent of quantum mechanics, is often taken to be equal to Planck's constant in order to obtain a semiclassical correspondence with quantum mechanics.
* is an overcounting correction factor, often used for particle systems where identical particles are able to change place with each other.In a system of identical particles, (factorial
In mathematics, the factorial of a non-negative denoted is the product of all positive integers less than or equal The factorial also equals the product of n with the next smaller factorial:
\begin
n! &= n \times (n-1) \times (n-2) \ ...

of ). This factor corrects the overcounting in phase space due to identical physical states being found in multiple locations. See the statistical ensemble article for more information on this overcounting.
* provides a normalizing factor and is also the characteristic state function, the free energy.
Again, the value of is determined by demanding that is a normalized probability density function:
:$e^\; =\; \backslash int\; \backslash ldots\; \backslash int\; \backslash frac\; e^\; \backslash ,\; dp\_1\; \backslash ldots\; dq\_n$
This integral is taken over the entire phase space
In dynamical system theory, a phase space is a space in which all possible states of a system are represented, with each possible state corresponding to one unique point in the phase space. For mechanical systems, the phase space usuall ...

.
In other words, a microstate in classical mechanics is a phase space region, and this region has volume . This means that each microstate spans a range of energy, however this range can be made arbitrarily narrow by choosing to be very small. The phase space integral can be converted into a summation over microstates, once phase space has been finely divided to a sufficient degree.
Surrounding surface

Canonical ensemble is a closed system, so its free energy contains surface terms. Therefore, strictly speaking, CE should be called the ensemble, where ''A'' is the area of the surrounding surface. If the partition function has no special surface potential terms, this is the surface of a hard solid.Notes

References

{{Statistical mechanics topics Statistical ensembles