TL;DR
A canonical ensemble describes a system that is not isolated but sits in contact with a much larger body at a fixed temperature . Each possible state of the system, called a microstate, gets a probability that falls off exponentially with its energy. Low-energy states are the most likely, and raising the temperature makes the high-energy states more common.
The normalising sum over all states is called the partition function . Once you know , you can recover the average energy, the entropy and the free energy of the system.
Where you'll see it: in the populations of energy levels in a gas, in the physics of magnetic resonance, and in Monte Carlo simulations of molecules that sample states at a set temperature.
This lesson is physics, not engineering advice or a guide to any real device; the numbers are for illustration.
Intuition
A small system in a large bath
Picture a single molecule in a box of air. It bumps into its neighbours constantly, trading energy back and forth. The rest of the air is so large that it barely changes temperature when the molecule gives up or takes energy. The air acts as a heat bath, a reservoir that fixes and absorbs any energy exchanged with the system.
The canonical ensemble is the bookkeeping for that situation. We do not know which exact state the molecule is in at a given moment. We know only that it is in thermal contact with the bath, so over time it visits many states, and the bath sets how often each one is visited.
Two forces pulling in opposite directions
Two things compete. Energy wants the system to settle into its lowest states. Entropy, the count of ways a state can be realised, wants the system to spread across many states. The bath is the tiebreaker. A state with energy is penalised by the factor , where is Boltzmann's constant. At low temperature the penalty is steep, so the system sits near the bottom. At high temperature the penalty is gentle, so many states are populated.
The plot below shows that penalty, called the Boltzmann factor, for three temperatures. Energies are in the same units as , so the curves show the shape rather than absolute numbers.
- T = 0.5
- T = 1
- T = 2
The math
Consider a system with discrete microstates labelled , where state has energy . The canonical ensemble assigns state the probability
where is the inverse temperature, is Boltzmann's constant, and is the partition function
Dividing by makes the probabilities add to 1, since by construction. If several microstates share the same energy, the sum simply counts each of them, so also equals with the number of states at energy .
Where the formula comes from
The Boltzmann factor is what you get by maximising entropy, subject to the constraints that the probabilities sum to 1 and the mean energy is fixed. The Gibbs entropy of a distribution is
This is the same quantity as the Shannon entropy in Entropy, multiplied by and written with the natural logarithm. Measured in bits, Shannon's satisfies .
Maximise with Lagrange multipliers: one multiplier enforces , and another, , enforces . Setting the derivative of the constrained function with respect to to zero gives
so . Exponentiating, . The normalisation fixes the constant, and matching the result to thermodynamics identifies the multiplier with . So the exponential form is not an extra assumption. It is the least-biased distribution consistent with a given average energy.
Thermodynamic quantities from
Three results follow directly from . The average energy is
The Helmholtz free energy is
and the entropy follows from :
These three relations mean that knowing the partition function as a function of temperature is enough to get the thermodynamics of the system. The probabilities themselves follow from as well.
Worked examples
Take a system with two states. The ground state has energy and the excited state has energy . Choose the temperature so that , that is .
- Partition function: .
- Ground-state probability: .
- Excited-state probability: .
- Check: .
- Mean energy: .
Interpretation: the excited state is a quarter as likely as the ground state, so one molecule in five sits in the higher level. Lowering the temperature makes larger and pushes toward zero.
Take a molecule with an excited state electronvolts above its ground state, at K. Boltzmann's constant times the temperature is eV.
- Ratio of the two populations: .
- Exponent: .
- Ratio: .
- So about 2 molecules in every 100 sit in the excited state, while the rest are in the ground state.
Interpretation: at room temperature the thermal energy is only a few hundredths of an electronvolt, so states that are a tenth of an electronvolt up are only slightly occupied. A state several times higher is almost empty. This is why most molecules in air at room temperature stay in their lowest vibrational and electronic levels.
Tradeoffs and failure modes
The canonical ensemble is the right tool when a system's temperature is fixed by a bath and its particle number and volume are fixed too. Other situations call for a different ensemble.
| Situation | What goes wrong with the canonical form | Better choice |
|---|---|---|
| The system is fully isolated, energy fixed | The energy fluctuates, which the isolated system does not allow | Microcanonical ensemble |
| Particles can be exchanged with a reservoir | The particle number is not fixed | Grand canonical ensemble |
| The system is very small | Energy fluctuations are large, so averages hide structure | Work with the full distribution, not just the mean |
| Particles are identical quantum objects at low temperature | Counting states as if distinguishable gives wrong results | Fermi-Dirac or Bose-Einstein statistics, see Fermi-Dirac Statistics |
| The system has many interacting parts | is a sum over an enormous number of states and cannot be done exactly | Monte Carlo sampling with the Metropolis rule, or approximations |
A common mistake is to treat as if it were the probability of a state. It is not. is a normalising sum. The probability of a state is its Boltzmann factor divided by .
History
Ludwig Boltzmann worked out the exponential energy distribution for gas molecules in the late 1860s and 1870s. He showed that a gas in equilibrium spreads its molecules over energies in this way, and he linked entropy to the number of ways a state can be realised. The constant that bears his name was introduced later, by Max Planck, when he wrote the physics in its modern form in the early 1900s.
Josiah Willard Gibbs generalised the idea in the early 1900s. His book Elementary Principles in Statistical Mechanics (1902) introduced the notion of an ensemble, a collection of imagined copies of a system, and treated the case of a system in contact with a heat bath as one of its central cases. The name "canonical" comes from his use of the term. Gibbs's framework is why the same formulas describe a single molecule, a crystal and a magnet.
The partition function became the working tool of statistical physics because it packs the whole thermodynamics into one function. That made the canonical ensemble the default starting point for calculations in chemistry, solid-state physics and, later, computer simulation.
Check yourself
QuestionWhat does the Boltzmann factor tell you about a state with energy ?Show answer
It gives the state's weight relative to other states at the same temperature. The probability of the state is this weight divided by the partition function , which sums the weights over all states. A higher-energy state has a smaller weight, so it is less likely, and the gap between weights grows as the temperature falls.
QuestionA two-level system has energies 0 and , with . What is the probability that the system is in the excited state?Show answer
The ratio of weights is . The partition function is . The excited-state probability is .
QuestionWhy does raising the temperature make high-energy states more likely, even though they carry more energy?Show answer
Temperature sets how much energy the bath can exchange with the system. At high the Boltzmann factor decreases slowly with , so the penalty for a high-energy state is small. Meanwhile there are often many more high-energy states than low-energy ones, so their combined weight can become large. Entropy wins when the bath is hot.
QuestionA chemist reports entropy in joules per kelvin, and an information theorist reports the same kind of distribution's entropy as 3 bits. Both are describing one distribution. How do the two numbers relate?Show answer
Both use up to a constant. The chemist's is times the natural-log sum, so it carries units of joules per kelvin. The information theorist's uses base-2 logarithms and is measured in bits. The two are related by . Multiplying 3 bits by gives the chemist's entropy for the same distribution.