Canonical Ensemble
Almost nothing in the real world is thermally isolated. A protein folding in a cell, a magnet in a lab, a cup of coffee on a desk — each is in constant thermal contact with a vast surrounding "reservoir" that fixes its temperature but lets its energy drift. This is the situation the canonical ensemble describes, and it is the workhorse of statistical mechanics precisely because it matches how experiments are actually done: you control the temperature, not the energy. The microcanonical ensemble (fixed energy, isolated system) is conceptually primary but practically awkward — energy is hard to hold fixed and the counting is combinatorially brutal. The canonical ensemble trades the rigid energy constraint for a fixed temperature, and the payoff is enormous: the probability of a microstate takes the astonishingly simple form , the Boltzmann distribution, where and is a normalizing sum. High-energy states are exponentially suppressed; the temperature sets the scale of how much energy the system can "afford." From this one distribution, everything flows. The mean energy is a derivative of ; the entropy, free energy, pressure, and heat capacity all follow by differentiation; and the energy — though no longer fixed — is so sharply peaked (relative width ) that for a macroscopic system the canonical and microcanonical descriptions become indistinguishable. This article introduces the canonical ensemble, states the Boltzmann distribution and its consequences, solves the two-level system completely as a first concrete example, and sets up the partition function that the next articles turn into a complete thermodynamic engine.
- The canonical ensemble describes a system in thermal contact with a heat reservoir at fixed , , ; its energy fluctuates while its temperature is fixed.
- The probability of a microstate is the Boltzmann distribution , with and .
- The mean energy is — a derivative of the log of the normalizing sum.
- Energy fluctuates but is sharply peaked: relative width , so canonical ≈ microcanonical for large systems (ensemble equivalence).
- The two-level system is the simplest nontrivial case: , tending to at high and at low .
- Key idea: fixing the temperature (not the energy) makes the microstate probability , from which all equilibrium thermodynamics follows by differentiating .
The canonical ensemble replaces the fixed-energy constraint with a fixed temperature by coupling the system to a heat reservoir. The resulting microstate probability is the Boltzmann distribution , and every equilibrium quantity — mean energy, entropy, free energy, fluctuations — follows from derivatives of the partition function .
Where this lives today
The canonical ensemble is the default framework for essentially all of equilibrium statistical mechanics and its computational offspring. Molecular dynamics and Monte Carlo simulations — the tools that predict protein structures, design drugs, and model materials — almost always run in the canonical (constant-temperature) ensemble, using thermostats to couple the simulated system to a virtual heat bath so that configurations are sampled with the Boltzmann weight . The Metropolis algorithm, the most-used simulation method in physics and chemistry, is precisely a scheme for generating states with canonical probabilities. Beyond simulation, the Boltzmann distribution is a universal law that shows up wherever a system equilibrates with its surroundings. It sets the population of atomic and molecular energy levels (the basis of spectroscopy and of reading temperatures from starlight), the occupancy of vibrational modes in solids (heat capacity), the rate of thermally activated processes (the Arrhenius law that governs chemical reaction rates and diffusion), and even the firing statistics of model neurons and the weights in Boltzmann-machine neural networks, which borrow the distribution directly. The quantum version, , is the starting point for computing the thermodynamics of everything from superconductors to the quark–gluon plasma. Few equations in physics are as ubiquitous as .
The physical picture
Imagine a small system in contact with an enormous heat bath — a droplet of ink in the ocean. Energy sloshes freely across the boundary, but because the bath is so much bigger, the temperature barely moves; the bath sets , and the small system equilibrates to it. The small system's energy is no longer fixed: at any instant, it might be a little above or below its mean, borrowing from or lending to the bath. What is fixed is the statistical distribution of its energy, and that distribution is the Boltzmann law.
The Boltzmann factor is at the heart of it: it says that a microstate with energy is exponentially less likely the higher its energy, with the temperature setting the exponential's scale. At high temperature ( small), the exponential is flat — all states are nearly equally likely, and the system samples widely. At low temperature ( large), the exponential is steep — only the lowest-energy states survive, and the system freezes into its ground state. Temperature is the knob that controls how far up the energy ladder the system can afford to climb. Although the energy is not fixed, it is remarkably sharp. The distribution of the total energy of a macroscopic system is a narrow peak whose relative width shrinks as — for a mole of particles, the energy is defined to one part in . This is why the canonical ensemble (fixed , fluctuating ) and the microcanonical ensemble (fixed ) agree for large systems: the fluctuating energy is, for all practical purposes, pinned at its mean. The punchline plot below shows this sharpening — the energy distribution narrows dramatically as grows, so "the energy at temperature " becomes a well-defined number.
The core equations
The defining result of the canonical ensemble is the Boltzmann distribution for the probability of a microstate, together with its normalization:
where: — probability of microstate of energy ; — canonical partition function (the normalizing sum); — inverse temperature. The exponential weight makes high-energy states exponentially rare; ensures . The mean energy is obtained by weighting each energy by its probability, and it collapses to a derivative of :
where: — the internal energy ; the last equality holds because acting on pulls down a factor of inside the sum and divides by — exactly the ensemble average. The ratio of probabilities of two states depends only on their energy difference — the Boltzmann factor in its purest form:
where: the reservoir and the normalization cancel, leaving only the energy gap. This is the most-used single fact in the subject: the relative population of two levels is set by their energy separation measured in units of . For a system of energy levels with degeneracies , the partition function groups states by energy:
where: — degeneracy of level (number of microstates with energy ). Summing over levels with their degeneracies is equivalent to summing over microstates — a common bookkeeping simplification.
The goal is to derive the canonical probability from first principles — starting from the microcanonical postulate applied to the combined system-plus-reservoir — and thereby to identify as the inverse temperature of the reservoir. The strategy is to treat system + reservoir as one isolated (microcanonical) whole with fixed total energy, and ask for the probability that the system sits in a specific microstate .
Step 1. Combine the small system and a large reservoir into an isolated total with fixed energy . When is in a definite microstate of energy , the reservoir has energy and can be in any of microstates. Why: by the equal-a-priori postulate, every microstate of the isolated total is equally likely, so the probability of system-state is proportional to the number of reservoir states compatible with it.
Step 2. Thus . Since , expand the reservoir entropy (not itself) to first order: . Why: the entropy is extensive and smooth, so its Taylor expansion converges rapidly; expanding directly would fail because is astronomically steep.
Step 3. Identify the derivative as inverse temperature: . So , giving . Why: the thermodynamic definition of temperature is , so the linear coefficient in the expansion is exactly — the reservoir imprints its temperature on the system.
Step 4. Normalize: with . The second-order term in the expansion is suppressed by , so the exponential is exact for an infinite reservoir. Why: the reservoir's heat capacity is , so the curvature correction to the linear expansion vanishes as the reservoir grows — the Boltzmann form is exact in the reservoir limit. *As a consistency check: the two-level and agree symbolically, and computed from equals for a 3-level system numerically.*
Go deeper · Derivation B · 1 minThe two-level system solved completely — the owned worked result
This is the article's owned structural result: the simplest nontrivial canonical system — a single particle (or spin) with two energy levels and — solved from end to end, giving the mean energy, its high- and low-temperature limits, and the population ratio, all in closed form. It is the base from which paramagnetism, the Schottky heat-capacity anomaly, and two-state chemical kinetics are built. The goal is to compute , , and the level populations exactly. The strategy is direct summation over the two states.
Step 1. Partition function: with levels and , . Why: only two terms contribute; the ground state carries weight and the excited state the Boltzmann factor .
Step 2. Populations: and , so the population ratio is — the excited state is exponentially depleted by the factor . Why: this is Equation (3) applied to the two levels; the ratio depends only on , the gap in thermal units.
Step 3. Mean energy: . This equals , confirming Equation (2). Why: only the excited state contributes energy ; dividing top and bottom by gives the tidy Fermi-like form .
Step 4. Limits. High (): — both levels equally populated, mean energy is the average of and . Low (): — the system is frozen in the ground state. Why: at high temperature thermal energy overwhelms the gap and the states equilibrate to equal population; at low temperature the gap dominates and only the ground state survives. *As a consistency check: , , high- limit , low- limit , and at the excited population .*
Limiting cases
The canonical description across regimes:
| Case | Result | Meaning |
|---|---|---|
| High temperature | : all states equally likely | The Boltzmann factor flattens; the system samples every microstate. |
| Low temperature | : only the ground state | Only the lowest level(s) survive; , the ground degeneracy. |
| Large system | relative fluctuations | Energy effectively fixed; canonical ≈ microcanonical (ensemble equivalence). |
| Two-level system | The building block for paramagnetism and the Schottky anomaly. | |
| Degenerate levels | Weight each energy by its degeneracy . |
Worked examples
1 · A two-level system, populations and energy (a real computation)
Consider non-interacting two-level systems, each with a ground state at and an excited state at (about at room temperature). At (), find the fraction of systems in the excited state and the mean energy per system.
Step 1. Enumerate the states and compute : with and , .
Step 2. Partition function: .
Step 3. Excited-state fraction: — about of the systems are excited. (At exactly this would be .)
Step 4. Mean energy per system: . The boundary check: at this would rise to meV (equal populations), and at it would fall to — our meV sits sensibly between, closer to the low- end because .
2 · Reading a temperature off a population ratio (exam level)
A spectroscopic measurement of a gas finds that the population of an excited atomic level lying above the ground state is of the ground-state population. Both levels are non-degenerate. What is the temperature?
Step 1. Population ratio from the Boltzmann factor: .
Step 2. Take logs: , so , meaning the gap is about four 's.
Step 3. Solve for : , so . Converting, .
Step 4. Sanity check: corresponds to — room temperature, and , consistent with a modest but not tiny population ratio of . This is exactly how astronomers read stellar temperatures from spectral line ratios: the Boltzmann distribution turns a population ratio into a thermometer.
Origins · 1 mincanonical ensemble and how this was discovered
The canonical ensemble — Gibbs's term, introduced in his 1902 Elementary Principles in Statistical Mechanics — is the collection of infinitely many identical copies of a system, each in contact with a heat reservoir at temperature , with microstate probabilities weighted by . Gibbs called it "canonical" because it is the natural, standard-form distribution (from the Greek kanon, a rule or standard) that maximizes entropy subject to a fixed mean energy. It is the ensemble that matches almost every real experiment, where temperature rather than energy is controlled. Boltzmann had earlier obtained the weighting from his transport and combinatorial arguments; Gibbs gave it the clean ensemble formulation and showed how the partition function generates all thermodynamics. The canonical ensemble is the conceptual and computational center of equilibrium statistical mechanics — the microcanonical is more fundamental, the grand canonical more general, but the canonical is where almost all calculations actually live.
Going further
References. Pathria & Beale, Statistical Mechanics, 3rd ed., Ch. 3 · Kardar, Statistical Physics of Particles, Ch. 4 · Reif, Fundamentals of Statistical and Thermal Physics, Ch. 6 · Sethna, Statistical Mechanics, Ch. 6 · Landau & Lifshitz, Statistical Physics Part 1, Ch. III · Gibbs, Elementary Principles in Statistical Mechanics (1902). Key results: the two-level , , with high-/low- limits and ; the identity (confirmed on a 3-level system); and the ratio . Numerical instances: two-level at gives ; the room-temperature meV example and the population-ratio thermometer give K. (CODATA).
Builds on: Boltzmann Factor · Derivation of the Canonical Distribution from the Microcanonical Ensemble · The Microcanonical Ensemble and the Postulate of Equal a Priori Probabilities. Leads to: Canonical Partition Function · Helmholtz Free Energy from the Partition Function · Energy Fluctuations in the Canonical Ensemble · Grand Canonical Ensemble.
Why is the canonical ensemble more useful than the microcanonical one if the microcanonical is more fundamental?
Because it matches how experiments and calculations are actually done, and because its mathematics is far friendlier. Almost no real system has a precisely fixed energy — instead it sits in a laboratory at a controlled temperature, exchanging energy freely with its surroundings. That is exactly the canonical setup. Computationally, the microcanonical ensemble requires counting the microstates at exactly one energy, a delta-function constraint that is combinatorially painful; the canonical ensemble replaces it with a smooth exponential weight and an unconstrained sum , which factorizes for independent degrees of freedom and yields everything by differentiation. And because the energy fluctuations are negligible () for large systems, the two ensembles agree on all thermodynamics — so you get the same physics with much less pain. The microcanonical is the logical foundation; the canonical is the practical tool.
If the energy fluctuates, in what sense does the system have a definite temperature?
The temperature is a property of the reservoir, and it is imposed on the system by thermal contact — the system does not "have" a temperature independent of the bath, it equilibrates to the bath's temperature. What fluctuates is the system's energy, not its temperature. The distinction is like a small object floating in a huge tank of water at C: the object's energy jiggles as molecules exchange energy with the water, but its temperature is simply C, fixed by the tank. For a macroscopic system the energy fluctuations are so small (relative width ) that even the energy is effectively definite; for a small system the energy genuinely wanders, but the temperature — set by the bath — remains sharp. Temperature and energy play complementary roles: the canonical ensemble fixes one and lets the other fluctuate, the microcanonical does the reverse.
Why is the microstate probability e^{−βE}, and not something else like e^{−E²} or 1/E?
Because it is forced by the physics of coupling to a large reservoir, plus the equal-a-priori postulate. When the system is in a microstate of energy , the reservoir has energy and can be in equally-likely microstates, so the system-state probability is proportional to . Expanding the reservoir's entropy (which is smooth and extensive) to first order in the small energy gives , so — the exponential. The linear coefficient is exactly , the reservoir's inverse temperature. No other functional form survives: the exponential is the unique consequence of expanding a large, smooth entropy to leading order. Equivalently, is the distribution that maximizes entropy for a fixed mean energy — the two viewpoints (reservoir expansion and maximum entropy) give the same answer.
Do I sum over microstates or over energy levels in the partition function?
Either, as long as you are consistent — but the safe default is to sum over microstates. The partition function is . If several distinct microstates share the same energy (a degenerate level), you can group them: , where is the degeneracy (number of microstates at energy ). Both give the same . The common mistake is to sum over energy levels while forgetting the degeneracies — that undercounts and gives wrong thermodynamics. Likewise, the Boltzmann probability is the probability of a specific microstate; the probability of finding the system at energy is , which includes the degeneracy factor. Keeping straight whether you mean a microstate or a level is one of the most common sources of error in canonical calculations.
How does the canonical ensemble connect to the ideal gas law or to real thermodynamics?
Through the partition function and its derivatives, which is the subject of the next few articles. Once you have , every thermodynamic quantity follows: the internal energy is , the Helmholtz free energy is , the pressure is , the entropy is , and the heat capacity is . For the ideal gas, factorizes into single-particle pieces, the momentum integrals are Gaussian, and out drops together with the Sackur–Tetrode entropy and — the entire thermodynamics of the ideal gas from one sum. So the canonical ensemble is not an abstract construction: it is the machine that turns a microscopic energy spectrum into a full thermodynamic description, and the ideal gas law is one of its simplest outputs.
Is the Boltzmann distribution the same as the Maxwell–Boltzmann velocity distribution?
They are closely related but not identical. The Boltzmann distribution is completely general — it gives the probability of any microstate of any system (spins, oscillators, whatever) in thermal equilibrium. The Maxwell–Boltzmann velocity distribution is the special case you get when you apply the Boltzmann distribution to the kinetic energy of a classical gas particle, : the probability of a velocity is , a Gaussian in each velocity component, which gives the familiar bell-shaped speed distribution. So Maxwell–Boltzmann is the Boltzmann distribution specialized to translational kinetic energy. The general Boltzmann law also governs internal degrees of freedom (rotations, vibrations, electronic levels) and lattice or spin systems, none of which are described by the velocity distribution. Historically Maxwell derived the velocity distribution first (1860), and Boltzmann generalized it to arbitrary energies.