Skip to content

7.6 Equivalence of the Canonical and Grand Canonical Ensembles

Huang, Statistical Mechanics 2ed, Sections 7.6–7.8

Three ensembles. One answer. (Usually.)

Here's something that bugged me for a while. We've built three completely different ensembles. The microcanonical is the control freak: fixed \(N\), fixed \(V\), fixed \(E\). Won't let go of anything. The canonical is more relaxed: lets energy flow in and out, just keeps \(T\) constant. And the grand canonical? Total free spirit. Energy and particles wandering in and out. Only \(\mu\), \(V\), and \(T\) are pinned down.

Three different starting points. Three different partition functions. Three different probability distributions.

And they all give the same thermodynamics.

How? Why? And when does it break?

That's what this section is about. Huang doesn't just claim equivalence. He proves it. And the proof reveals something beautiful about what happens at phase transitions, where the ensembles seem like they should disagree, but still don't.

Why should you care?

  • "Can I trust my NVT results?" Yes. This section is the theoretical guarantee. NVE, NVT, and \(\mu\)VT all give the same averages for macroscopic systems. Pick the one that's convenient.
  • Phase transitions: If you're studying liquid-vapor coexistence, the grand canonical ensemble handles it naturally. The canonical ensemble needs tricks (umbrella sampling, histogram reweighting, Wang-Landau). This section explains why.
  • Small systems: For your 108-atom argon box, the ensembles aren't equivalent. We saw 2% energy fluctuations in NVT, 12% particle fluctuations in GCMC. Knowing where equivalence breaks tells you when those differences matter.

The bad intuition: "more constraints = more accurate"

You might think: the microcanonical ensemble fixes \(N\), \(V\), and \(E\). Everything is locked down. That must be the most "precise" ensemble. The grand canonical lets everything bounce around. Surely that's the sloppiest one?

I used to think this too. It feels like giving the system more freedom should make the description worse.

Nope. For macroscopic systems, all three are equally precise. The fluctuations that distinguish them are \(O(1/\sqrt{N})\). For a mole of gas, that's one part in \(10^{12}\). Nobody can measure that. Nobody.

And here's the twist. For phase transitions, the grand canonical is actually better. The "sloppy" ensemble that lets particles come and go? It naturally handles two-phase coexistence. No tricks. No barrier crossing. No special sampling. The extra fluctuations aren't a weakness. They're a superpower.

The easy case: no phase transitions

Let's start simple. Away from phase transitions, the pressure satisfies \(\partial P / \partial v < 0\) everywhere (compress the system, pressure goes up, as it should).

The grand partition function is a sum over all possible particle numbers:

\[\mathcal{Q}(z, V, T) = \sum_{N=0}^{\infty} z^N Q_N(V, T)\]

Each term is a number. Some are big, some are small. Huang writes each term as \(e^{V\phi(V/N, z)}\) where \(\phi\) encodes the free energy and the fugacity.

Now here's the key. Every term has \(V\) in the exponent. And \(V\) is enormous. For a macroscopic system, \(V \sim 10^{23}\) in atomic units. That exponent crushes everything.

What does that mean? The sum is completely dominated by its single largest term. The runner-up loses by a factor of \(e^{V \cdot \Delta\phi}\), where \(\Delta\phi\) is the gap between the two largest values. Even if \(\Delta\phi\) is \(10^{-20}\), multiply by \(V = 10^{23}\) and you get \(e^{1000}\). The winner wins by a factor of \(e^{1000}\).

That's not close. That's annihilation. The sum is its maximum.

\[\frac{1}{V}\log \mathcal{Q} \approx \max_v\, \phi(v, z)\]

The \(\bar{v}\) that maximizes \(\phi\) satisfies \(\partial\phi/\partial v = 0\), and when you work through the algebra:

\[P_{\text{grand canonical}}(\bar{v}) = P_{\text{canonical}}(\bar{v})\]

Done. Same pressure. The grand canonical sum collapsed to a single term, which is exactly the canonical partition function for \(\bar{N} = V/\bar{v}\) particles. The grand canonical ensemble looked at every possible \(N\), considered all of them, and decided that one specific \(N\) beats all the others by a cosmic margin.

In other words: \(W(N) = z^N Q_N\) has a single, insanely sharp peak at \(N = \bar{N}\). The system "fluctuates," sure, but by a laughable amount relative to the mean. The grand canonical ensemble is a canonical ensemble wearing a trench coat.

Key Insight

The "largest term dominates" trick is the single most important mathematical argument in statistical mechanics. It works because extensive quantities scale as \(V\) (or \(N\)), so exponentials \(e^{V\phi}\) are absurdly sensitive to the value of \(\phi\). The tiniest advantage gets amplified to total domination. That's why statistical mechanics only makes sense in the thermodynamic limit. For 100 atoms, the other terms matter. For \(10^{23}\), they don't exist.

The hard case: phase transitions

Now the fun part.

What happens when \(\partial P / \partial v = 0\)? That's the transition region of a first-order phase transition. Liquid-vapor coexistence. The flat part of the isotherm.

In the canonical ensemble, you fix \(v = V/N\). If \(v\) lands in the coexistence region (\(v_1 < v < v_2\)), the system splits into two phases: some liquid, some vapor. Pressure stays constant at \(P_0\). Straightforward.

But in the grand canonical ensemble, \(N\) fluctuates. So what does \(W(N)\) look like?

Here's where it gets wild. At the coexistence fugacity \(z = z_0\), the function \(\phi(v, z)\) is constant across the entire coexistence region. Not peaked. Not approximately constant. Actually constant. Every \(v\) between \(v_1\) and \(v_2\) gives the same \(e^{V\phi}\).

That means \(W(N)\) is flat. Not a sharp peak. A plateau. The system doesn't prefer any particular \(N\) in the coexistence range. It happily fluctuates across all densities between the pure liquid and pure vapor. Sometimes mostly liquid. Sometimes mostly gas. Sometimes half and half. All equally probable.

The number of equally likely values of \(N\) is proportional to \(V\). Not \(\sqrt{V}\). The \(1/\sqrt{N}\) suppression that saved us before? Gone. These aren't small fluctuations. This is the system genuinely unable to make up its mind.

And yet the ensembles still agree. The pressure is still \(P_0\) on both sides. The equation of state is the same. The grand canonical ensemble just honestly represents what's happening: the system is a free mixture of two phases, and any proportion is equally valid.

Actually, that's kind of beautiful. The canonical ensemble forces you to specify the proportion (through \(v\)). The grand canonical lets the system choose, and says "all proportions are fine." Both give the same \(P\). Both are correct.

MD Connection

This is exactly why GCMC is the natural tool for studying phase coexistence. In an NVT simulation at a density in the two-phase region, the system has to spontaneously nucleate a liquid droplet inside the vapor (or vice versa). That means crossing a free energy barrier. Could take millions of timesteps. Could take forever.

In GCMC, particles can appear and disappear. The system samples both phases freely. No nucleation barrier. No waiting. Set \(\mu\) to the coexistence value and the system hops between liquid-like and vapor-like states on its own. If you're computing a phase diagram, coexistence densities, or vapor pressures, GCMC is often the fastest path.

The Maxwell construction: for free

OK, here's my favorite result in this chapter. Maybe in the whole book so far.

You know the van der Waals equation of state? It has that famous loop where \(\partial P / \partial v > 0\). That's mechanically unstable. Release the pressure and the system shrinks. That doesn't happen in nature. It's an artifact of the mean-field approximation.

In your thermodynamics course, you learned to fix this with the Maxwell construction: draw a horizontal line that cuts off the loop, choosing the pressure \(P_0\) so that the area above the line equals the area below. It works. But it always felt like a patch to me. A hand-wavy fix imposed from outside.

Huang shows that the grand canonical ensemble does this automatically. No patching. No hand-waving. It falls straight out of the math.

Here's why. When the grand canonical sum picks its maximum term, it can never land in the unstable region (\(\partial P / \partial v > 0\)). In that region, the extremum of \(\phi\) is a minimum, not a maximum. The sum skips right over it, like it doesn't exist.

At the coexistence fugacity \(z_0\), two values of \(\bar{v}\) (one on the liquid branch, one on the vapor branch) give maxima of equal height. The condition for equal heights works out to:

\[\int_{v_1}^{v_2} dv' \, P_{\text{can}}(v') = (v_2 - v_1) P_0\]

That's the equal-area rule. That's the Maxwell construction. It just... fell out. From a sum.

The grand canonical ensemble looked at the van der Waals loop, considered all possible density fluctuations, and naturally selected the thermodynamically stable solution. The unstable states aren't "removed" or "fixed." They're outcompeted. They lose the exponential competition to the stable states.

That's not a mathematical trick. That's the physics. The stability condition \(\partial P / \partial v \le 0\) is an experimental fact. The grand canonical ensemble enforces it because it includes all possible density fluctuations. The canonical ensemble with an approximate model (van der Waals) can give you the loop. The grand canonical ensemble with the same model gives you the Maxwell construction. Automatically.

That's crazy.

Common Mistake

The van der Waals loop (\(\partial P/\partial v > 0\)) isn't a "bug" in the canonical ensemble. It's a correct consequence of an approximate model. The canonical ensemble is doing its job. The model is what's approximate. The grand canonical ensemble resolves the unphysical prediction because it sums over all \(N\) and automatically selects the stable maximum. Don't blame the ensemble. Blame the model.

What this means for your simulations

Let's bring this home.

For most simulations, you don't need to think about ensemble equivalence. Just pick what's convenient:

  • NVE: Transport properties. Diffusion. Viscosity. You want pure Newtonian dynamics with no thermostat messing up the correlations.
  • NVT: Equilibrium thermodynamics. Structure. Energy. Pressure. The workhorse. Use it by default.
  • \(\mu\)VT: Open systems. Adsorption. Phase coexistence. Anything where \(N\) should fluctuate.

Same averages. Same thermodynamics. Different convenience.

For phase transitions, use GCMC if you can. It skips the nucleation barrier and naturally samples the coexistence region. Computing a full phase diagram with NVT requires free energy methods and careful extrapolation. With GCMC, you scan \(\mu\) and read off \(\langle N \rangle\) at each value. Much cleaner.

For small systems (\(N \lesssim 100\)), don't blindly trust equivalence. Our argon simulations had measurable differences between ensembles. Fluctuation-sensitive quantities (heat capacity from the fluctuation formula, compressibility from density fluctuations) require the correct ensemble. \(C_V\) from energy fluctuations requires NVT, period. Using NVE gives \(C_V = 0\). The formula only works in the ensemble where the quantity actually fluctuates.

Takeaway

Three ensembles, one answer. The grand canonical sum over \(N\) is dominated by a single term that reproduces the canonical result. At phase transitions, that single term becomes a degenerate plateau (flat \(W(N)\)), and the grand canonical ensemble naturally handles coexistence while the canonical one struggles. The Maxwell construction, which you draw by hand in thermodynamics, drops out of the math for free. Ensemble equivalence isn't an approximation. It's exact in the thermodynamic limit, and it's the reason statistical mechanics is self-consistent.

Check Your Understanding
  1. The "largest term dominates" trick works because the exponent scales as \(V\). But what if your system has long-range interactions and the energy is NOT extensive? Does the whole argument collapse? Would you still trust ensemble equivalence?
  2. At liquid-vapor coexistence, \(W(N)\) goes flat and fluctuations scale as \(V\), not \(\sqrt{V}\). Didn't we just prove that fluctuations always scale as \(1/\sqrt{N}\)? What gives?
  3. You run your 108-atom argon box in both NVE and NVT. You compute the RDF from each. Do they agree? Now you compute \(C_V\) from the fluctuation formula in both ensembles. Do those agree? Why the different answer for the two quantities?