# Grand canonical ensemble

In statistical mechanics, a grand canonical ensemble is the statistical ensemble that is used to represent the possible states of a mechanical system of particles that is being maintained in thermodynamic equilibrium (thermal and chemical) with a reservoir.[1] The system is said to be open in the sense that the system can exchange energy and particles with a reservoir, so that various possible states of the system can differ in both their total energy and total number of particles. The system's volume, shape, and other external coordinates are kept the same in all possible states of the system.

The thermodynamic variables of the grand canonical ensemble are chemical potential (symbol: µ) and absolute temperature (symbol: T). The ensemble is also dependent on mechanical variables such as volume (symbol: V) which influence the nature of the system's internal states. This ensemble is therefore sometimes called the µVT ensemble, as each of these three quantities are constants of the ensemble.

In simple terms, the grand canonical ensemble assigns a probability P to each distinct microstate given by the following exponential:

$P = e^{\frac{\Omega + \mu N - E}{k T}},$

where N is the number of particles in the microstate and E is the total energy of the microstate. k is Boltzmann's constant.

The number Ω is known as the grand potential and is constant for the ensemble. However, the probabilities and Ω will vary if different µ, V, T are selected. The grand potential Ω serves two roles: to provide a normalization factor for the probability distribution (the probabilities, over the complete set of microstates, must add up to one); and, many important ensemble averages can be directly calculated from the function Ω(µ, V, T).

In the case where more than one kind of particle is allowed to vary in number, the probability expression generalizes to

$P = e^{\frac{\Omega + \mu_1 N_1 + \mu_2 N_2 + \ldots + \mu_s N_s - E}{k T}},$

where µ1 is the chemical potential for the first kind of particles, N1 is the number of that kind of particle in the microstate, µ2 is the chemical potential for the second kind of particles and so on (s is the number of distinct kinds of particles). However, these particle numbers should be defined carefully (see the note on particle number conservation below).

Grand ensembles are apt for use when describing systems such as the electrons in a conductor, or the photons in a cavity, where the shape is fixed but the energy and number of particles can easily fluctuate due to contact with a reservoir (e.g., an electrical ground or a dark surface, in these cases). The grand canonical ensemble provides a natural setting for an exact derivation of the Fermi-Dirac statistics or Bose-Einstein statistics for a system of non-interacting quantum particles (see examples below).

Note on formulation: An alternative formulation for the same concept writes the probability as $\textstyle P = \frac{1}{\mathcal Z} e^{(\mu N-E)/(k T)}$, using the grand partition function $\textstyle \mathcal Z = e^{-\Omega/(k T)}$ rather than the grand potential. The equations below (in terms of grand potential) may be restated in terms of the grand partition function by simple mathematical manipulations.

## Applicability of grand canonical ensemble

The grand canonical ensemble is exactly the ensemble that describes the possible states of an isolated system that is in thermal and chemical equilibrium with a reservoir (the derivation proceeds along lines analogous to the heat bath derivation of the normal canonical ensemble, and can be found in Reif[2]). In this case the grand canonical ensemble applies exactly to systems of any size; while it is necessary to assume that the reservoir is very large (i. e., in the macroscopic limit), the system itself may be small or large.

The condition that the system is isolated is necessary in order to ensure it has well-defined equation of motion.[1] In practice, however, it is desirable to apply the grand canonical ensemble to describe systems that are in direct contact with the reservoir, since it is that contact that ensures the equilibrium. The use of the grand canonical ensemble in these cases is usually justified either 1) by assuming that the contact is weak, or 2) by incorporating a part of the reservoir connection into the system under analysis, so that the connection's influence on the region of interest is correctly modelled.

Another case in which the grand canonical ensemble appears is when considering a system that is large and thermodynamic (a system that is "in equilibrium with itself"). Even if the exact conditions of the system do not actually allow for variations in energy or particle number, the grand canonical ensemble can be used to simplify calculations of some thermodynamic properties. The reason for this is that various thermodynamic ensembles (microcanonical, canonical) become equivalent in some aspects to the grand canonical ensemble, once the system is very large.[note 1] Of course, for small systems, the different ensembles are no longer equivalent even in the mean. As a result, the grand canonical ensemble can be highly inaccurate when applied to small systems of fixed particle number, such as atomic nuclei.[3]

### Requirement of particle number conservation

Just as the total energy must be conserved in order to define temperature, it is also necessary to conserve total particle number in order to define chemical potential. There are however real physical cases where particle number is not conserved. The grand canonical ensemble can then only be applied with due care:

• Ordinary particles can be spawned out of pure energy, if a corresponding antiparticle is created. If this sort of process is allowed, then the conserved quantity is instead N = (particle number - antiparticle number); this conserved N can then be used in the grand canonical ensemble.[4] Of course, very high temperatures are required for thermally generated particle-antiparticle pairs to be created in significant quantity, e.g., of order 109 K for electron-positron creation, and so this process is not a concern for everyday thermodynamics.
• Chemical reactions can convert one type of molecule to another; the particle numbers used in the grand canonical ensemble must be defined such that they do not change during the chemical reaction.
• Photons can be created out of pure energy, but there is simply no conserved number quantity associated with them (photons are their own antiparticles). The grand canonical ensemble can only be used for photons when µphoton = 0, in which case it becomes equivalent to the canonical ensemble with non-conserved particle number.

## Properties

• Uniqueness: The grand canonical ensemble is uniquely determined for a given system at given temperature and given chemical potentials, and does not depend on arbitrary choices such as choice of coordinate system (classical mechanics) or basis (quantum mechanics).[1]
• Statistical equilibrium (steady state): A grand canonical ensemble does not evolve over time, despite the fact that the underling system is in constant motion. This is because the ensemble is only a function of a conserved quantities of the system (energy and particle numbers).[1]
• Thermal and chemical equilibrium with other systems: Two systems, each described by a grand canonical ensemble of equal temperature and chemical potentials, brought into chemical contact[note 2] will each retain the same ensemble and the resulting combined system is described by a grand canonical ensemble of the same temperature and chemical potentials.[1]
• Maximum entropy: For a given mechanical system (fixed V), the grand canonical ensemble average −⟨log P is the maximum possible of any ensemble with the same E, N1, etc.[1]
• Minimum grand potential: For a given mechanical system (fixed V) and given values of T, µ1, …, µs, the ensemble average E + kT log Pµ1N1 − … µsNs is the lowest possible of any ensemble.[1]
• The partial derivatives of the function Ω(µ1, …, µs, V, T) give important grand canonical ensemble average quantities:[1][5]
• the averages of numbers of particles
$\langle N_1 \rangle = -\frac{\partial \Omega} {\partial \mu_1} , \quad \ldots \quad\langle N_s \rangle = -\frac{\partial \Omega} {\partial \mu_s},$
• the average pressure
$\langle p \rangle = -\frac{\partial \Omega} {\partial V},$
• the Gibbs entropy
$S = -k \langle \log P \rangle = - \frac{\partial \Omega} {\partial T},$
• and the average energy
$\langle E \rangle = \Omega + \langle N_1 \rangle \mu_1 \ldots + \langle N_s \rangle \mu_s + ST.$
• Exact differential: From the above expressions, it can be seen that the function Ω has the exact differential
$d\Omega = - S dT - \langle N_1 \rangle d\mu_1 \ldots - \langle N_s \rangle d\mu_s - \langle p\rangle dV .$
• First law of thermodynamics: Substituting the above relationship for E into the exact differential of Ω, an equation similar to the first law of thermodynamics is found, except with average signs on some of the quantities:[1]
$d\langle E \rangle = T dS + \mu_1 d\langle N_1 \rangle \ldots + \mu_s d\langle N_s \rangle - \langle p\rangle dV .$
• Thermodynamic fluctuations: The variances in energy and particle numbers are[6][7]
$\langle E^2 \rangle - \langle E \rangle^2 = k T^2 \frac{\partial \langle E \rangle} {\partial T} + k T \mu_1 \frac{\partial \langle E \rangle} {\partial \mu_1} + k T \mu_2 \frac{\partial \langle E \rangle} {\partial \mu_2} + \ldots ,$
$\langle N_1^2 \rangle - \langle N_1 \rangle^2 = k T \frac{\partial \langle N_1 \rangle} {\partial \mu_1}.$
• Correlations in fluctuations: The covariances of particle numbers and energy are[1]
$\langle N_1 N_2 \rangle - \langle N_1 \rangle\langle N_2\rangle = k T \frac{\partial \langle N_2 \rangle} {\partial \mu_1} = k T \frac{\partial \langle N_1 \rangle} {\partial \mu_2}.$
$\langle N_1 E \rangle - \langle N_1 \rangle\langle E\rangle = k T \frac{\partial \langle E \rangle} {\partial \mu_1},$

## Example ensembles

The usefulness of the grand canonical ensemble is illustrated in the examples below:

### Statistics of noninteracting bosons and fermions

In the special case of a quantum system of many non-interacting particles, the thermodynamics are simple to compute.[8] Since the particles are non-interacting, one can compute a series of single-particle stationary states, each which represent a separable part that can be included into the total quantum state of the system. For now let us refer to these single-particle stationary states as orbitals (to avoid conflating these "states" with the total many-body state), with the provision that each possible internal particle property (spin or polarization) counts as a separate orbital. Each orbital may be occupied by a particle (or particles), or may be empty.

Since the particles are non-interacting, we may make the simplification that each orbital forms a separate thermodynamic system. Thus each orbital is a grand canonical ensemble unto itself, one simple that its statistics can be immediately derived here. Focussing on just one orbital, the total energy for a microstate of N particles in this orbital will be EN = , where ϵ is the characteristic energy level of that orbital.

• For fermions, the Pauli exclusion principle allows only two microstates for the orbital: N = 0 with E0 = 0, or N = 1 with E1 = ϵ, leading to
$e^{-\frac{\Omega}{k T}} = 1 + e^{\frac{\mu - \epsilon}{k T}}$
• For bosons, N may be any nonnegative integer but each value of N only counts as one microstate due to the indistinguishability of particles, leading to the geometric series:
$e^{-\frac{\Omega}{k T}} = \sum_{N=0}^{\infty} e^{N\frac{\mu - \epsilon}{k T}} = \Big[1 - e^{\frac{\mu - \epsilon}{k T}}\Big]^{-1}$

In each case the value $\langle N\rangle = -\tfrac{\partial \Omega}{\partial \mu}$ gives the thermodynamic average number of particles on the orbital: the Fermi-Dirac distribution for fermions, and the Bose-Einstein distribution for bosons.

### Ionization of an isolated atom

Does an isolated atom prefer to be charge neutral? An atom is able to exist in ionized states with more or fewer electrons, and these may occur spontaneously as a thermal fluctuation; they may even be preferred depending on the environment. Consider a simplified model where the atom can be in a neutral state or in one of two ionized states (a detailed calculation also includes the degeneracy factors of the states[9]):

The grand potential in this case is thus determined by

$e^{-\frac{\Omega}{k T}} = e^{\frac{\mu N_0 - E_0}{k T}} \Big[ 1 + e^{\frac{-\mu - \Delta E_{\rm I} - e\phi}{k T}} + e^{\frac{\mu + \Delta E_{\rm A} + e\phi}{k T}}\Big],$

giving

$\Omega = E_0 - \mu N_0 - kT \ln \Big[ 1 + e^{\frac{-\mu - \Delta E_{\rm I} - e\phi}{k T}} + e^{\frac{\mu + \Delta E_{\rm A} + e\phi}{k T}}\Big].$

The value of µ + clearly is critical here, and it is determined by the environment around the atom.

If we place one (or very few) of these atoms into a vacuum box, then µ + = −W where W is the work function of the box lining material. Comparing the tables of work function for various materials with the tables of electron affinity and ionization energy for atomic species, we can see that some combinations could result in the atom actually preferring an ionized state over the charge neutral state (e.g., a halogen atom in a ytterbium box, or a cesium atom in an osmium box). Of course, this sort of situation is not actually possible; the reality is that the ion would strongly prefer to adsorb to the exposed lining of the box instead of floating freely.

This example finds its real application in a semiconductor, where the ionization of an dopant atom is well described by this ensemble.[9] In the semiconductor, the band edge ϵC plays the role of the vacuum energy level , and µ is known as the Fermi level. Of course, the ionization energy and electron affinity of the dopant atom are strongly modified relative to their vacuum values. A typical donor dopant in silicon, phosphorus, has ΔEI = 45 meV;[10] the value of µϵC in the intrinsic silicon is initially about −600 meV, guaranteeing the ionization of the dopant. The value of ϵC depends strongly on electrostatics, however, so under some circumstances it is possible to de-ionize the dopant.

## Precise expressions for the ensemble

The precise mathematical expression for statistical ensembles has a distinct form depending on the type of mechanics under consideration (quantum or classical), as the notion of a "microstate" is considerably different. In quantum mechanics, the grand canonical ensemble affords a simple description since diagonalization provides a set of distinct microstates of a system, each with well-defined energy and particle number. The classical mechanical case is more complex as it involves not stationary states but instead an integral over canonical phase space.

### Quantum mechanical

A statistical ensemble in quantum mechanics is represented by a density matrix, denoted by ρ̂. The grand canonical ensemble is the density matrix[citation needed]

$\hat \rho = \exp\big(\tfrac{1}{kT}(\Omega + \mu_1 \hat N_1 + \ldots + \mu_s \hat N_s - \hat H)\big),$

where Ĥ is the system's total energy operator (Hamiltonian), 1 is the system's total particle number operator for particles of type 1, 2 is the total particle number operator for particles of type 2, and so on. exp is the matrix exponential operator. The grand potential Ω is determined by the probability normalization condition that the density matrix has a trace of one, Tr ρ̂ = 1:

$e^{-\frac{\Omega}{k T}} = \operatorname{Tr} \exp\big(\tfrac{1}{kT}(\mu_1 \hat N_1 + \ldots + \mu_s \hat N_s - \hat H)\big).$

Note that for the grand ensemble, the basis states of the operators Ĥ, 1, etc. are all states with multiple particles in Fock space, and the density matrix is defined on the same basis. Since the energy and particle numbers are all separately conserved, these operators are mutually commuting.

The grand canonical ensemble can alternatively be written in a simple form using bra-ket notation, since it is possible (given the mutually commuting nature of the energy and particle number operators) to find a complete basis of simultaneous eigenstates |ψi, indexed by i, where Ĥ|ψi⟩ = Ei|ψi, 1|ψi⟩ = N1,i|ψi, and so on. Given such an eigenbasis, the grand canonical ensemble is simply

$\hat \rho = \sum_i e^{\frac{\Omega + \mu_1 N_{1,i} + \ldots + \mu_s N_{s,i} - E_i}{k T}} |\psi_i\rangle \langle \psi_i |$
$e^{-\frac{\Omega}{k T}} = \sum_i e^{\frac{\mu_1 N_{1,i} + \ldots + \mu_s N_{s,i} - E_i}{k T}}.$

where the sum is over the complete set of states with state i having Ei total energy, N1,i particles of type 1, N2,i particles of type 2, and so on.

### Classical mechanical

In classical mechanics, a grand ensemble is instead represented by a joint probability density function defined over multiple phase spaces of varying dimensions, ρ(N1, … Ns, p1, … pn, q1, … qn), where the p1, … pn and q1, … qn are the canonical coordinates (generalized momenta and generalized coordinates) of the system's internal degrees of freedom. The expression for the grand canonical ensemble is somewhat more delicate than the canonical ensemble since:[1]

• The number of particles and thus the number of coordinates n varies between the different phase spaces, and,
• it is vital to consider whether permuting similar particles counts as a distinct state or not.

In a system of particles, the number of degrees of freedom n depends on the number of particles in a way that depends on the physical situation. For example, in a three dimensional gas of monoatoms n = 3N, however in molecular gases there will also be rotational and vibrational degrees of freedom.

The probability density function for the grand canonical ensemble is:

$\rho = \frac{1}{h^n C} e^{\frac{\Omega + \mu_1 N_1 + \ldots + \mu_s N_s - E}{k T}},$

where

• E is the energy of the system, a function of the phase (N1, … Ns, p1, … pn, q1, … qn),
• h is an arbitrary but predetermined constant with the units of energy×time, setting the extent of one microstate and providing correct dimensions to ρ.[note 3]
• C is a counting factor (see below), a function of N1, … Ns.

Again, the value of Ω is determined by demanding that ρ is a normalized probability density function:

$e^{-\frac{\Omega}{k T}} = \sum_{N_1 = 0}^{\infty} \ldots \sum_{N_s = 0}^{\infty} \int \ldots \int \frac{1}{h^n C} e^{\frac{\mu_1 N_1 + \ldots + \mu_s N_s - E}{k T}} \, dp_1 \ldots dq_n$

This integral is taken over the entire available phase space for the given numbers of particles.

#### Counting factor (generic and specific ensembles)

A well-known problem in the statistical mechanics of fluids (gases, liquids, plasmas) is how to treat particles that are similar or identical in nature: should they be regarded as distinguishable or not? In the system's equation of motion each particle is forever tracked as a distinguishable entity, and yet there are also valid states of the system where the positions of each particle have simply been swapped: these states are represented at different places in phase space, yet are seemingly equivalent.

If the permutations of similar particles are regarded to count as distinct phases, what Gibbs called specific phases, then the factor C above is simply C = 1. In the specific phase, similar particles are taken to be distinguishable with individual identities, and yet are still lumped together without under a single N. The grand canonical ensemble then includes every permuted state as a separate microstate. Although appearing simple at first, this leads to a problem of severely non-extensive entropy, known today as the Gibbs paradox. The chemical potential also becomes poorly defined, in this case.

This problem was solved by Gibbs: he introduced the concept of a generic phase where the permutation of similar particles is regarded to not give a distinct state of the system.[1] In order to incorporate this fact, integrals are still carried over full phase space but the result is always divided by the number of specific phases per generic phase, a number given by the continued product[note 4]

$C = N_1! N_2! \ldots N_s!.$

The division by C neatly corrects the overcounting that occurs in the integral over all phase space. This removed the paradox and made the entropy in the grand canonical ensemble perfectly extensive, and in the canonical ensemble very nearly extensive.

As Gibbs noted, the distinction between generic and specific phases is physically relevant when the number of particles is allowed to vary. In the canonical ensemble, it is optional whether to use correct counting since the specific and generic ensembles are related by an exact mapping. The grand canonical ensemble however always involves varying numbers of particles, and so the correct generic counting factor must be used in the grand canonical ensemble.[1] The only way to include distinguishable particles in the grand canonical ensemble, then, is to count each conserved and distinguishable kind of particle as a separate specie and assign each kind its own chemical potential.

## Notes

1. ^ To quote Reif, "For purposes of calculating mean values of physical quantities, it makes no noticeable difference whether a macroscopic system is isolated, or in contact with a reservoir with which it can only exchange energy, or in contact with a reservoir with which it can exchange both energy and particles. [...] In some problems where the constraint of a fixed number of particles is cumbersome, one can thus readily circumvent the complication by approximating the actual situation with [...] the grand canonical distribution."
2. ^ Chemical contact means that the systems are made able to exchange energy and particles through a connection. The connection must be weak as to not significantly disturb the systems' microstates.
3. ^ (Historical note) Gibbs' original ensemble effectively set h = 1 [energy unit]×[time unit], leading to unit-dependence in the values of some thermodynamic quantities like entropy and chemical potential. Since the advent of quantum mechanics, h is often taken to be equal to Planck's constant in order to obtain a semiclassical correspondence with quantum mechanics.
4. ^ Technically, there are some phases where the permutation of particles does not even yield a distinct specific phase: classically, two similar particles can share the exact same trajectory, internal state, etc.. However, in classical mechanics such phases only make up an infinitesimal fraction of the phase space (they have measure zero) and so they do not contribute to any volume integral in phase space.

## References

1. ^ Reif, F. (1965). Fundamentals of Statistical and Thermal Physics. McGraw–Hill. ISBN 9780070518001. edit
2. ^ Chaudhuri, G.; Gupta, S. (2007). "Specific heat and bimodality in canonical and grand canonical versions of the thermodynamic model". Physical Review C 76. arXiv:0704.0288. Bibcode:2007PhRvC..76a4619C. doi:10.1103/PhysRevC.76.014619. edit
3. ^ http://arxiv.org/abs/hep-th/9604039v1
4. ^ http://www.theory.physics.manchester.ac.uk/~judith/stat_therm/node87.html
5. ^ https://math.temple.edu/~prisebor/statisticalmechanics.pdf
6. ^ http://micro.stanford.edu/~caiwei/me334/Chap9_NPT_Grand_Canonical_Ensemble_v04.pdf
7. ^ Srivastava, J.; Ashok (2005). Statistical Mechanics. PHI Learning Pvt. Ltd. ISBN 9788120327825. edit
8. ^ a b page 110 of Balkanski, M.; Wallis, R.F. (2000). Semiconductor Physics and Applications. Oxford University Press. ISBN 0198517408. edit
9. ^ http://www.iue.tuwien.ac.at/phd/wittmann/node7.html