Skip to content
Tutorials Center
My learning

Topics

Lesson 11 of 39 · The Microcanonical and Canonical Ensembles

The Canonical Ensemble and the Boltzmann Distribution

Derive the Boltzmann distribution p = e^(-E/kT)/Z for a system in contact with a heat bath, then compute and sample level populations in Python.

Most experiments run at fixed temperature, not fixed energy: a flask in a water bath, a crystal in a cryostat. The canonical ensemble describes a small system in thermal contact with a much larger heat bath (or reservoir). Its central result, the Boltzmann distribution, is probably the most important formula in statistical mechanics.

Setting up

Let the system S have microstates s with energies E_s. The bath R is huge. Together they form an isolated system with total energy E_0. The system can exchange energy with the bath, so its energy fluctuates; the bath's temperature stays constant.

If the system is in a particular microstate s, the bath must have energy E_0 − E_s, and it can be in any of Ω_R(E_0 − E_s) microstates. By the fundamental postulate, every microstate of the combined system is equally probable, so

Text
p_s ∝ Ω_R(E_0 − E_s)

Because E_s is tiny compared with E_0, expand the logarithm of the bath multiplicity to first order:

Text
ln Ω_R(E_0 − E_s) ≈ ln Ω_R(E_0) − E_s · ∂(ln Ω_R)/∂E
                  = ln Ω_R(E_0) − E_s / (k_B T)

where we used ∂S/∂E = 1/T with S = k_B ln Ω. Therefore Ω_R(E_0 − E_s) ≈ Ω_R(E_0) e^(−E_s/(k_B T)), and

Text
p_s = e^(−β E_s) / Z,      β = 1/(k_B T)

with the normalization constant

Text
Z = Σ_s e^(−β E_s)

called the partition function (German Zustandssumme, "sum over states"). This is the Boltzmann distribution. The factor e^(−βE_s) is the Boltzmann factor.

flowchart LR
  S["System<br/>energy E_s"] --- R["Heat bath at T<br/>huge, absorbs or supplies energy"]
  R -->|"p_s proportional to e^(-E_s/kT)"| S

A small system in a heat bath: low-energy microstates are favored exponentially.

Reading the formula

  • Lower-energy microstates are more probable, but only by the factor e^(−ΔE/(k_B T)).
  • If two microstates differ in energy by ΔE, their probability ratio is e^(−ΔE/(k_B T)).
  • At low T (large β) the system sits in its ground state. At high T all states become nearly equally likely.
  • The temperature T is that of the bath.

Degeneracy

Often many microstates share the same energy. If energy level E_j has g_j microstates (its degeneracy), then the probability of finding the system in any state of that level is

Text
P(E_j) = g_j e^(−β E_j) / Z,      Z = Σ_j g_j e^(−β E_j)

The degeneracy factor g_j competes with the Boltzmann factor: a high-energy level may still be well populated if it has many states. Think of g as the entropy factor and e^(−βE) as the energy factor.

Python Level populations at several temperatures

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

As the temperature rises, the populations move away from the ground state and approach the ratios g_j / Σ g (here 1/16, 3/16, 5/16, 7/16).

Sampling the distribution

You can generate random microstates with Boltzmann probabilities using numpy, which is the basis of Monte Carlo methods (explored in a later chapter).

Python Sample the Boltzmann distribution

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Energy distribution and the role of the bath

The Boltzmann distribution gives the probability of a particular microstate. The probability of a particular energy also involves the density of states g(E) (how many microstates sit near E):

Text
P(E) ∝ g(E) e^(−βE)

Typically g(E) rises steeply with energy while e^(−βE) falls, producing a sharp peak at the typical energy. This is why the energy of a large system in a bath, though not strictly fixed, fluctuates very little. We quantify that in the lesson on energy fluctuations.

The derivation assumed the bath is so large that its temperature does not change when it exchanges energy with the system. Real baths are never infinite, but the approximation is excellent whenever the bath is much bigger than the system.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Two microstates differ in energy by 3 k_B T (the higher one has more energy). What is the ratio of their probabilities (higher / lower) in the canonical ensemble?

    The ratio is e^(-DeltaE/(k_B T)) = e^(-3), about 0.05.
  2. 2. What is Z, the partition function?

    Z = sum of Boltzmann factors; dividing each factor by Z makes the probabilities add to one.
  3. 3. At very high temperature, how do populations of the energy levels behave?

    When k_B T is far above the level spacing the Boltzmann factors approach 1, so P is proportional to g.
  4. 4. Why does the Boltzmann factor arise from the heat bath?

    The probability is proportional to Omega_R(E_0 - E_s), and expanding ln Omega_R gives exp(-E_s/kT).

Summary

  • A system in contact with a bath at temperature T is in microstate s with probability p_s = e^(−βE_s)/Z, β = 1/(k_B T).
  • Z = Σ_s e^(−βE_s) is the partition function; with degeneracies, Z = Σ_j g_j e^(−βE_j).
  • The ratio of probabilities of two microstates is e^(−ΔE/(k_B T)).
  • The distribution can be sampled directly, the starting point of Monte Carlo.

Next: The Two-Level System