Canonical and grand canonical ensembles
- Date / 日期
- Updated / 更新
- 2026.10.28
- Reading / 阅读
- 126 Min
- Words / 字数
- 25189
Canonical and grand canonical ensembles
The microcanonical ensemble of the previous chapter describes an isolated system: the energy is given once and for all, and every average has to be computed inside a thin energy shell. This is conceptually clean but practically painful, because the shell restriction enters every integral and the entropy has to be obtained before anything else can be computed.
In this chapter we relax the constraint on the energy. The system is put in contact with a heat reservoir, so that its energy fluctuates, and the ensemble average turns into an unrestricted integral over the whole phase space. Then we relax the constraint on the particle number as well, which leads to the grand canonical ensemble and to the chemical potential.
Canonical ensemble
Canonical ensemble
We consider an isolated system made up of two subsystems
1:
2:
with
and assume that the interaction between the two subsystems is negligibly small.
As discussed in the previous chapter, a “most probable” decomposition of the energy dominates. We are interested in the special case and , so that subsystem 2 is a large environment of subsystem 1.
Let be any decomposition of the energy, fluctuating around the most probable one. The probability of finding system 1 at and system 2 at is .
If we look at only system 1, we should sum up all possible microscopic states of system 2 with ,
That is, the probability of finding system 1 in a microscopic state within the volume at is , and therefore the density distribution is
Since fluctuates only around , and ,
Here is the temperature of the whole system, and therefore also the temperature of system 1, and is irrelevant to system 1.
Question: why not expand itself?
Answer: is the volume of phase space, and it grows exponentially with . Expanding such a function in powers of produces coefficients that grow with , and the series is useless beyond the first term. The quantity that is additive and slowly varying is not but its logarithm, i.e. the entropy, and is extensive. Besides, is not even smooth on the scale of : it is a coarse-grained volume, defined only up to the shell width. The expansion of is legitimate because the second-order term is smaller than the first by a factor of order , and we have assumed .
Omitting the subscript 1, this leads to
This is the probability distribution of the so-called canonical ensemble. Similar to that of the microcanonical ensemble, of the canonical ensemble depends on also only through the Hamiltonian .
The macroscopic conditions for the canonical ensemble:
- is fixed;
- the system is in contact with a heat reservoir of temperature , and is fixed.
In other words, the energy is no longer a macroscopic parameter of the system: it is replaced by the temperature of the reservoir. Fig. 3.1(a) shows the arrangement.
\begin{tikzpicture}[>=stealth, thick, font=\small] % ---- (a) canonical ensemble ---- \draw (0,0) rectangle (2,2); \node at (1,1.35) {System 1}; \node at (1,0.75) {$N_1,V_1$};
\draw (2.9,0) rectangle (6.7,2.8); \node at (4.8,2.2) {Heat reservoir 2}; \node at (4.8,1.6) {$N_2\gg N_1$}; \node at (4.8,1.05) {$\bar{E}_2\gg\bar{E}_1$}; \node at (4.8,0.5) {$T$ fixed};
\draw[<->,red] (2.05,1.0) -- (2.85,1.0); \node[red,above] at (2.45,1.05) {$E$}; \node at (1,-0.5) {(a)};
% ---- (b) grand canonical ensemble ---- \draw (0,-5.2) rectangle (6.7,-1.9); \node[anchor=north west] at (0.15,-2.0) {Reservoir: $T$, $\mu$};
\draw (2.5,-4.3) rectangle (4.9,-2.35); \fill (2.9,-2.7) circle (2pt); \fill (4.4,-2.75) circle (2pt); \fill (3.0,-3.9) circle (2pt); \fill (4.5,-3.95) circle (2pt); \node at (3.7,-4.6) {open system: $V$ fixed, $N$ varies};
\fill (0.6,-2.5) circle (2pt); \fill (1.1,-3.4) circle (2pt); \fill (1.7,-4.3) circle (2pt); \fill (0.6,-4.7) circle (2pt); \fill (5.9,-2.4) circle (2pt); \fill (6.2,-3.4) circle (2pt); \fill (5.5,-4.3) circle (2pt); \fill (6.2,-4.7) circle (2pt);
\draw[->,red] (2.0,-3.25) -- (2.4,-3.25); \node[red,above left] at (2.3,-3.3) {$\Delta N$}; \draw[->,red] (5.0,-3.25) -- (5.4,-3.25); \node[red,above right] at (5.1,-3.3) {$\Delta N$};
\node at (1,-5.65) {(b)};\end{tikzpicture}We define the partition function as the effective volume in space, i.e. the effective number of the microscopic states,
then the thermodynamics is obtained from
where is the free energy. To show this, one should prove
(a) is extensive;
(b) is related to by with .
Proof of (b): differentiating the following identity with respect to ,
we obtain, keeping in mind that does not depend on ,
Since
where we have used and therefore . Therefore the bracket is just , and averaging gives , i.e. , with the internal energy.
Proof of (a): the partition function of a system composed of two independent parts factorizes, , up to the same binomial counting and the same neglect of terms as in the proof of the extensiveness of in the previous chapter. Hence is additive, and is extensive.
Please note that now the temperature is already defined from the beginning: it is the temperature of the reservoir, and it is an independent variable. Then the free energy is a characteristic function, and one may straightforwardly derive
The free energy in the canonical ensemble plays the role of the entropy in the microcanonical ensemble.
In principle, the integration of cannot extend to the entire space, since from the beginning requires . But we show in the next subsection that the contribution from the region is negligibly small. In fact, only one value of the energy dominantly contributes to the partition function. Therefore, practically the integration may extend over all energies. This provides much convenience for calculations in the canonical ensemble.
In addition, the free energy in the canonical ensemble can be explicitly computed. In contrast, the internal energy in the microcanonical ensemble could be potentially obtained only from the computation of , and such a solution is usually much more difficult.
The definition of the partition function in the canonical ensemble is similar to the total volume of the microscopic states in the microcanonical ensemble. In fact
Question: why and how?
Hint: only the microscopic states with the most probable energy , i.e. with the average energy , contribute to . Therefore , and taking the logarithm gives directly.
A simple argument for the canonical ensemble: suppose that a large isolated system consists of many identical quasi-independent subsystems, and each subsystem is described by the Hamiltonian . According to the result of the previous chapter, i.e. the Maxwell-Boltzmann distribution, the probability distribution of finding a subsystem at is
The same result therefore follows without repeating the reservoir argument, provided that the interaction between the subsystems is negligible.
Energy fluctuation
Questions:
- In what sense are the microcanonical and canonical ensembles equivalent?
- Why do we need both ensembles?
Any macroscopic observable can be calculated by
and for the energy,
which we may write as
Differentiating both sides with respect to , and noting that is the only term in which the derivative acts on something other than the exponential, we obtain
Further, since
the bracket is , and therefore , i.e.
or, in terms of the deviation ,
In fact, this is a special case of the well-known fluctuation-dissipation theorem, which relates the fluctuation of the energy to the response to the external change. Since the left-hand side is a variance, it also follows that in equilibrium.
Now, because and , we have, as ,
as sketched in Fig. 3.2. Therefore, the microcanonical and canonical ensembles are equivalent, in the sense that the energy only fluctuates around a fixed value in both cases. In the canonical ensemble, however, the energy is not given and needs to be computed. Further, this theorem also shows that the contribution of the states with a very large energy is negligible: the weight falls off exponentially, and the fluctuation is small.
\begin{tikzpicture}[>=stealth, thick, font=\small, x=0.8cm, y=2.8cm] \draw[->] (0,0) -- (10.5,0) node[below] {$N$}; \draw[->] (0,0) -- (0,1.05) node[above] {$\frac{\sqrt{\langle(\Delta E)^2\rangle}}{U}$}; \node[below left] at (0,0) {$O$};
\draw[blue] plot[domain=0.95:10, samples=120] (\x, {0.85/sqrt(\x)});
\draw[dashed] (1,0) -- (1,0.85); \draw[dashed] (4,0) -- (4,0.425); \draw[dashed] (4,0.425) -- (0,0.425); \draw[dashed] (1,0.85) -- (0,0.85);
\fill (1,0.85) circle (2pt); \fill (4,0.425) circle (2pt); \fill (9,0.2833) circle (2pt);
\node[right, xshift=4pt] at (1,0.85) {$N$}; \node[right, xshift=4pt] at (4,0.425) {$4N$}; \node[above] at (9,0.32) {$O(N^{-1/2})$};\end{tikzpicture}In the figure the relative fluctuation of the energy is drawn against ; the curve is , so quadrupling the system halves the relative fluctuation.
Boltzmann statistical theory
Consider identical quasi-independent particles,
where now the index labels particles. Then
where is the partition function of a single particle, the same introduced in the previous chapter, with replaced by .
Using , we then have , i.e.
The constant term comes from Stirling’s approximation, and it cannot be dropped when the entropy is computed. Then
since .
Comparing here with introduced in the previous chapter, the only difference is that the energy for calculating here is not bounded by the total energy. But this difference is negligibly small, since .
Some applications of canonical ensemble
Equipartition theorem
Let the Hamiltonian be
then .
Proof:
because the integrations over all the other variables cancel between the numerator and the denominator. For the numerator, integrating by parts,
where the boundary term vanishes because as . Therefore , as claimed.
The condition for the proof is that the Boltzmann factor decays at the boundary, i.e. that the quadratic coefficient is positive, , and that the integration over can be extended to . The same manipulation applies to any variable appearing quadratically in ; it does not matter whether it is a coordinate or a momentum, and the potential energy plays no role in the average.
Exercise: if , then .
Compare this with the derivation in the previous chapter. There the same identity required a careful treatment of the energy shell, integration by parts on the surface , and the neglect of a term containing . Here the shell is gone, the average is an ordinary Gaussian integral, and the proof takes three lines. This is the practical gain of the canonical ensemble.
For a Hamiltonian that is a sum of quadratic terms, , the theorem gives with the number of quadratic degrees of freedom, as derived in the previous chapter.
Ideal gases
For an ideal gas, , and
with
using
Then
and
This is the equation of state. For the internal energy, . Eliminating in favour of , i.e. ,
Everything is the same as that from the microcanonical ensemble in the previous chapter: the equation of state, , and the entropy as a function of and , including the under the logarithm that solves the Gibbs paradox.
Two remarks are in order. First, the factor is essential; without it the entropy would contain instead of , which is not extensive. Second, no factor of appears in the measure : a choice of the unit volume of phase space only shifts by a term proportional to , i.e. by a constant per particle, and does not affect , , or any derivative of . That constant cannot be fixed inside classical statistical mechanics.
The calculation is therefore classical throughout: the particles are treated as distinguishable up to permutations, and the sum over states is an integral over phase space. This describes a dilute gas at high temperature, where the particles are on average far apart compared with their quantum spread. At low temperature or high density the counting of states has to be redone with quantum statistics, and the of the Gibbs factor is then replaced by the correct symmetry of the many-particle wave function.
Ising model
The Ising model is the simplest model for magnetic materials, and it exhibits a phase transition.
Fig. 3.3 shows a square lattice in two dimensions, describing a crystal. On each lattice site there is a magnet, described by .
\begin{tikzpicture}[>=stealth, thick, font=\small, x=1.35cm, y=1.35cm] % lattice \foreach \i in {0,1,2,3} { \draw[gray!55] (0,\i) -- (3,\i); \draw[gray!55] (\i,0) -- (\i,3); }
% spins \foreach \x/\y/\s in { 0/0/1, 1/0/-1, 2/0/1, 3/0/1, 0/1/-1, 1/1/-1, 2/1/1, 3/1/-1, 0/2/1, 1/2/1, 2/2/-1, 3/2/-1, 0/3/-1, 1/3/1, 2/3/1, 3/3/-1} { \fill (\x,\y) circle (1.6pt); \draw[->, blue] (\x,\y-0.26*\s) -- (\x,\y+0.26*\s); }
% nearest neighbour pair \draw[red, dashed, thick] (0.15,1) -- (0.85,1); \node[red, above] at (0.5,1.12) {$\langle ij\rangle$};
% labels \node at (1.5,3.7) {square lattice}; \draw[<->] (2.55,3.05) -- (3.25,3.05); \node[above] at (2.9,3.05) {$a$}; \node at (1.5,-0.75) {$S_i=\pm 1$ on every site};\end{tikzpicture}The Hamiltonian is written as
where
It is a convention to put the whole Hamiltonian in units of , because only the combination enters the Boltzmann factor. With this convention the weight of a configuration is , so favours parallel neighbouring spins, i.e. it is the ferromagnetic case, while favours one sign of . The energy of a bond is , and the energy of a spin in the external field is .
The canonical ensemble is described by .
Omitting the Gibbs factor, the partition function is written as
Note that no appears here: the lattice sites are labelled, so the configurations are distinguishable, and the sum runs over the configurations of the spins.
The average magnetization is
Solvable cases, with now denoting the spatial dimension:
- : there is no real phase transition;
- : too difficult, and not treated here.
The result for is the following. There is a critical temperature such that
and near the magnetization behaves as
So is continuous at the transition while its derivative is not: the transition is continuous, with a jump in . The exponent here is the usual critical exponent of the order parameter; unfortunately it is the same letter as , and one has to tell them apart from the context.
How to solve, or at least approximate, such a model? The mean-field approximation replaces the interaction of a spin with its neighbours by the interaction with the average magnetization.
First, what is required of an approximation?
- After the approximation, one can perform the calculation.
- There is a clear physical meaning, and at extreme conditions, the approximation should be correct or roughly correct.
The mean-field replacement is
where is the coordination number, i.e. the number of nearest neighbours of a site; for a hypercubic lattice it equals twice the spatial dimension, so for a chain and for the square lattice. In the last equality the sum over pairs is counted so that each site contributes bonds, i.e. each bond is counted twice, once from each end; this is the convention that leads to below.
After the replacement the Hamiltonian no longer couples different sites,
and therefore
The self-consistent condition is . For ,
Since , we have
The graphical solutions are shown in Fig. 3.4: the curve against the straight line itself.
\begin{tikzpicture}[>=stealth, thick, font=\small, x=1.15cm, y=1.15cm]
% ---------- (a) Kd < 1 ---------- \begin{scope}[shift={(0,0)}] \draw[->] (-1.65,0) -- (1.65,0) node[below] {$M$}; \draw[->] (0,-1.45) -- (0,1.45); \node[above] at (0,1.45) {$\tanh(KdM)$}; \draw[gray] (-1.3,-1.3) -- (1.3,1.3); \draw[blue] plot[domain=-1.5:1.5, samples=150] (\x, {1-2/(exp(0.5*\x)+1)}); \fill (0,0) circle (2pt); \node at (0,-1.85) {(a) $Kd<1$: only $M=0$}; \end{scope}
% ---------- (b) Kd > 1 ---------- \begin{scope}[shift={(4.8,0)}] \draw[->] (-1.65,0) -- (1.65,0) node[below] {$M$}; \draw[->] (0,-1.45) -- (0,1.45); \node[above] at (0,1.45) {$\tanh(KdM)$}; \draw[gray] (-1.3,-1.3) -- (1.3,1.3); \draw[blue] plot[domain=-1.5:1.5, samples=150] (\x, {1-2/(exp(4*\x)+1)}); \fill (0,0) circle (2pt); \fill (0.96,0.96) circle (2pt); \fill (-0.96,-0.96) circle (2pt); \node[above left] at (0.96,0.96) {$M_0$}; \node[below, yshift=-3pt] at (-0.96,-1.02) {$-M_0$}; \node at (0,-1.85) {(b) $Kd>1$: $M=0$ and $M=\pm M_0$}; \end{scope}\end{tikzpicture}For , there is only one solution, . For , there are three roots, and , i.e. two branches.
In an equilibrium state, the free energy should reach its minimum, and one can prove that is a physical solution, while is only stationary. Therefore
and the phase transition takes place.
What are the features of the system around ? Let
Then
where has been used in going to the last line, and the term has been dropped because it is of higher order. Hence
Since with and fixed, to leading order near , so : the mean-field value of the exponent is .
Exercise: derive , and at and around , and discuss their behavior at and around .
Under what conditions is the mean-field approximation almost correct?
- Higher spatial dimensions: then each spin has many neighbours, and the replacement of the neighbours by their average is less violent.
- Long-range interactions: then the mean field is not an approximation but almost the interaction itself.
It should be kept in mind that the approximation has to be justified, not assumed. In the exact model has no transition at any finite temperature, and yet the mean-field condition above, with for a chain, predicts .
Advanced methods in statistical physics:
Approximate methods
- Mean-field methods, and improved mean-field methods
- Variational methods
- Series expansions (high temperature and low temperature expansions, cumulant expansions, …)
- Renormalization group methods (real space, momentum space)
Exact methods
- Numerical solutions
- Monte Carlo simulations
- Molecular dynamics
Grand canonical ensemble
Now we allow the number of particles of the system to be non-conserved. The idea here is similar to that for deriving the canonical ensemble.
space: spanned by ,
The grand canonical ensemble: a collection of systems, identical in composition and macroscopic conditions, but existing in different numbers of particles and different microscopic states, without interactions with each other.
A member of the ensemble, i.e. a microscopic state of the system, is represented by a point in space. The density distribution of these points is denoted by . The arrangement is sketched in Fig. 3.1(b).
To find , we consider a canonical ensemble of particles, volume , and temperature . We divide the system into two subsystems,
1:
2:
and consider the special case and .
We designate the coordinates of the particles in by , and those in by ,
Note that and here are the same functions evaluated at different values of the arguments. This is different from the discussion of the canonical ensemble, since we now allow interchange of particles between the two subsystems: if a particle moves from to , we change its coordinates from to .
The partition function of the whole canonical system is
Now the integration over is restricted to , to , and we need the sum over . The argument is similar to the decomposition of the energy in deriving the canonical ensemble. The factorial number is the number of possible ways to distribute particles to and particles to .
For example, for ,
where the binomial coefficients count the terms.
The denominator is introduced to solve the Gibbs paradox. Whenever the number of particles is relevant in the physical phenomena, such a factor is needed. Here the Gibbs factor is essential, for all , and .
Therefore, one may define the probability distribution of finding particles in to be
Understanding: taking into account the Gibbs factor,
If looking only at system 1, one should integrate over and ,
The factor
ensures the normalization
Since and ,
where and are respectively the chemical potential and the pressure of the whole system,
Note that is a macroscopic parameter:
- it is intensive, ;
- in equilibrium, .
Omitting the subscript 1,
In the thermodynamic limit, one allows the range of to be . Here is an additional term to the canonical distribution , different from the microcanonical and canonical ensembles. In other words, even with the same energy , the probability does depend on . However, it is very important that, independent of positive or negative , the Gibbs factor suppresses the probability of very large .
Additional to and , there is now another independent macroscopic parameter , the average number of particles. If , is not an independent macroscopic parameter, and it is fixed by and .
Question: does the energy non-conservation in the canonical ensemble lead to an additional macroscopic parameter?
Answer: no. In the canonical ensemble is fixed and is imposed by the reservoir, so the fluctuating energy is already determined by and the Hamiltonian, and no new independent variable appears. The extra parameter of the grand canonical ensemble comes from allowing to change, not from the energy fluctuation.
To obtain thermodynamics, we keep in mind that there is now one more microscopic variable . As usual, we define the grand partition function
then
with the grand potential .
This looks already like the equation of state, but is not convenient for experimental measurements. Thus one computes the average number of particles,
therefore . In fact, such a relation may be also obtained through replacing by in the definition of .
Question: can one prove it?
Hint: the average of a quantity is equal to the most probable value.
Eliminating between and gives the real equation of state .
The particle number fluctuates in this ensemble, and the size of the fluctuation follows from one more derivative. Differentiating once more with respect to ,
and therefore
so the canonical ensemble and the grand canonical ensemble are also equivalent. For the ideal gas this gives , as one verifies from the explicit relation computed below.
Let us keep the definition of the internal energy as the average value of the Hamiltonian. To calculate the internal energy, we denote ,
where the derivative is taken at fixed , so that the -dependence of is not differentiated. Then
Compared with the canonical ensemble, we have one more macroscopic parameter , or . is more convenient for the experimental measurement than . Once is fixed, computations of the thermodynamic quantities are the same as in the canonical ensemble; for example, one may derive all the common ones from the free energy .
Please note that the dependence of the internal energy on is only through . The Hamiltonian itself does indeed rely on the number of particles, . But is a microscopic variable, and it is already summed up in the calculation of the average.
Exercise: calculate the relative fluctuation of the particle number.
The chemical potential
Thermodynamics
The chemical potential is defined such that the free energy changes by when the number of particles changes by , at constant and . That is, is the free energy carried by a single particle. Therefore,
Then, from , we may deduce a generalized form of the first law,
In other words, is the energy carried by one particle, if and are kept constant: energy conservation has to take into account the energy transferred by the exchange of particles.
When is positive, increasing at constant and increases by , so tends to drive to smaller values, to lower the free energy at constant and , and vice versa.
Example 1: an ideal gas.
where has been used. Then
Here we should not forget the factor in the partition function , since it solves the problem of the Gibbs paradox. Otherwise, for example, it leads to a problematic relation rather than . Nor could the grand canonical ensemble be derived without it.
We may write
Therefore, is positive or negative, depending on the temperature and the density of the gas; it vanishes when .
In this simple case, one may directly verify that replacing by just gives .
Example 2: identical quasi-independent particles, , where is the partition function of a single particle, and is the Gibbs factor. Therefore
Thus
On the other hand, from the theory of the most probable distribution, , and one identifies .
A simple argument for the grand canonical ensemble: suppose that a large system consists of many identical quasi-independent subsystems, and each subsystem is with particles and described by the Hamiltonian . According to the Maxwell-Boltzmann distribution, the probability distribution of finding a subsystem at is
where , and is the chemical potential of the large system. On the other hand, is nothing but the free energy of the subsystem. Since the free energy is extensive, it can be written as , with being the chemical potential of the subsystem. Taking into account the Gibbs factor,
Exercise: derive the thermodynamics of an ideal gas, i.e. the equation of state, and , , , . Hint: to derive the entropy of the ideal gas, an isochoric transformation is not sufficient, and one needs also an isothermal transformation.
Chemical equilibrium
Suppose there are two kinds of particles in the grand canonical ensemble, , and the interactions between the two kinds of particles are negligible,
with
For example, in a mixture of water and ice, a molecule of water can be converted to that of ice, and vice versa.
Assume that the total number of particles is conserved, i.e. is a constant. In equilibrium, the free energy reaches its minimum,
From the conservation of the particle number, , we obtain a condition for equilibrium,
i.e. .
In general, we may have several kinds of particles, and a reaction
We rewrite by , and by , then
e.g. with , , .
Now, the conservation of the particle number is
e.g. .
Note that now there is not only one equation for the conservation of the particle number. Any pair of particles forms an equation. Then, minimizing the free energy ,
we obtain
This is the general condition of chemical equilibrium: the chemical potentials, weighted by the stoichiometric coefficients with the sign convention above, sum to zero.
Summary
Canonical ensemble: system 1 in contact with a reservoir at temperature , and the reservoir is traced out. Only the energy of the system enters the distribution, through the Hamiltonian.
,
as the characteristic function: , , , follow by differentiation, and the energy shell has disappeared from the integrals.
energy fluctuation , relative fluctuation , so the canonical and microcanonical ensembles are equivalent.
applications: equipartition per quadratic term; the classical ideal gas, with the same as in the microcanonical ensemble once the Gibbs factor is included.
Ising model: the canonical ensemble on a lattice, solved in the mean-field approximation; , near the transition, and the approximation is justified only for high dimensions or long-range interactions.
Grand canonical ensemble: the particle number is allowed to fluctuate, .
, ,
, , again with relative fluctuation , so this ensemble is equivalent to the canonical one.
chemical potential: , ; chemical equilibrium .
The drawback of the canonical ensemble is that must be fixed, which is why one passes to the grand canonical ensemble. The price is one more parameter , which is not directly measured, so it is usually eliminated in favour of .
Exercise
- With the canonical ensemble, prove that if , then
-
With the mean-field approximation of the Ising model, derive , and at and around , and discuss their behavior at and around .
-
Calculate the relative fluctuation of the particle number in the grand canonical ensemble.
-
With the grand canonical ensemble, derive the thermodynamics of an ideal gas, i.e. the equation of state, and , , , .
-
Problems 7.1, 7.2 and 7.3 in the textbook.
-
Discussion: Gibbs paradox

Comment评论