Partition function (statistical mechanics)
In physics, a partition function describes the statistical properties of a system in thermodynamic equilibrium. Partition functions are functions of the thermodynamic state variables, such as the temperature and volume. Most of the aggregate thermodynamic variables of the system, such as the total energy, free energy, entropy, and pressure, can be expressed in terms of the partition function or its derivatives. The partition function is dimensionless.
Each partition function is constructed to represent a particular statistical ensemble. The most common statistical ensembles have named partition functions. The canonical partition function applies to a canonical ensemble, in which the system is allowed to exchange heat with the environment at fixed temperature, volume, and number of particles. The grand canonical partition function applies to a grand canonical ensemble, in which the system can exchange both heat and particles with the environment, at fixed temperature, volume, and chemical potential. Other types of partition functions can be defined for different circumstances; see partition function for generalizations. The partition function has many physical meanings, as discussed in [|Meaning and significance].
Canonical partition function
Definition
Initially, let us assume that a thermodynamically large system is in thermal contact with the environment, with a temperature T, and both the volume of the system and the number of constituent particles are fixed. A collection of this kind of system comprises an ensemble called a canonical ensemble. The appropriate mathematical expression for the canonical partition function depends on the degrees of freedom of the system, whether the context is classical mechanics or quantum mechanics, and whether the spectrum of states is discrete or continuous.Classical discrete system
For a canonical ensemble that is classical and discrete, the canonical partition function is defined aswhere
- is the index for the microstates of the system;
- is Euler's number;
- is the thermodynamic beta, defined as where is the Boltzmann constant;
- is the total energy of the system in the respective microstate.
Classical continuous system
In classical mechanics, the position and momentum variables of a particle can vary continuously, so the set of microstates is actually uncountable. In classical statistical mechanics, it is rather inaccurate to express the partition function as a sum of discrete terms. In this case we must describe the partition function using an integral rather than a sum. For a canonical ensemble that is classical and continuous, the canonical partition function is defined aswhere
- is the Planck constant;
- is the thermodynamic beta, defined as ;
- is the Hamiltonian of the system;
- is the canonical position;
- is the canonical momentum.
For generalized cases, the partition function of particles in -dimensions is given by
Classical continuous system (multiple identical particles)
For a gas of identical classical non-interacting particles in three dimensions, the partition function iswhere
- is the Planck constant;
- is the thermodynamic beta, defined as ;
- is the index for the particles of the system;
- is the Hamiltonian of a respective particle;
- is the canonical position of the respective particle;
- is the canonical momentum of the respective particle;
- is shorthand notation to indicate that and are vectors in three-dimensional space.
- is the classical continuous partition function of a single particle as given in the previous section.
Quantum mechanical discrete system
For a canonical ensemble that is quantum mechanical and discrete, the canonical partition function is defined as the trace of the Boltzmann factor:where:
- is the trace of a matrix;
- is the thermodynamic beta, defined as ;
- is the Hamiltonian operator.
Quantum mechanical continuous system
For a canonical ensemble that is quantum mechanical and continuous, the canonical partition function is defined aswhere:
- is the Planck constant;
- is the thermodynamic beta, defined as ;
- is the Hamiltonian operator;
- is the canonical position;
- is the canonical momentum.
where gj is the degeneracy factor, or number of quantum states s that have the same energy level defined by Ej = Es.
The above treatment applies to quantum statistical mechanics, where a physical system inside a finite-sized box will typically have a discrete set of energy eigenstates, which we can use as the states s above. In quantum mechanics, the partition function can be more formally written as a trace over the state space :
where is the quantum Hamiltonian operator. The exponential of an operator can be defined using the exponential power series.
The classical form of Z is recovered when the trace is expressed in terms of coherent states and when quantum-mechanical uncertainties in the position and momentum of a particle are regarded as negligible. Formally, using bra–ket notation, one inserts under the trace for each degree of freedom the identity:
where is a normalised Gaussian wavepacket centered at position x and momentum p. Thus
A coherent state is an approximate eigenstate of both operators and, hence also of the Hamiltonian, with errors of the size of the uncertainties. If and can be regarded as zero, the action of reduces to multiplication by the classical Hamiltonian, and reduces to the classical configuration integral.
Connection to probability theory
For simplicity, we will use the discrete form of the partition function in this section. Our results will apply equally well to the continuous form.Consider a system S embedded into a heat bath B. Let the total energy of both systems be E. Let pi denote the probability that the system S is in a particular microstate, i, with energy Ei. According to the fundamental postulate of statistical mechanics, the probability pi will be proportional to the number of microstates of the total closed system in which S is in microstate i with energy Ei. Equivalently, pi will be proportional to the number of microstates of the heat bath B with energy. We then normalize this by dividing by the total number of microstates in which the constraints we have imposed on the entire system; both S and the heat bath; hold. In this case the only constraint is that the total energy of both systems is E, so:
Assuming that the heat bath's internal energy is much larger than the energy of S, we can Taylor-expand to first order in Ei and use the thermodynamic relation, where here, are the entropy and temperature of the bath respectively:
Thus
Since the total probability to find the system in some microstate must be equal to 1, we know that the constant of proportionality must be the normalization constant, and so, we can define the partition function to be this constant:
Calculating the thermodynamic total energy
In order to demonstrate the usefulness of the partition function, let us calculate the thermodynamic value of the total energy. This is simply the expected value, or ensemble average for the energy, which is the sum of the microstate energies weighted by their probabilities:or, equivalently,
Incidentally, one should note that if the microstate energies depend on a parameter λ in the manner
then the expected value of A is
This provides us with a method for calculating the expected values of many microscopic quantities. We add the quantity artificially to the microstate energies, calculate the new partition function and expected value, and then set λ to zero in the final expression. This is analogous to the source field method used in the path integral formulation of quantum field theory.
Relation to thermodynamic variables
In this section, we will state the relationships between the partition function and the various thermodynamic parameters of the system. These results can be derived using the method of the previous section and the various thermodynamic relations.As we have already seen, the thermodynamic energy is
The variance in the energy is
The heat capacity is
In general, consider the extensive variable X and intensive variable Y where X and Y form a pair of conjugate variables. In ensembles where Y is fixed, then the average value of X will be:
The sign will depend on the specific definitions of the variables X and Y. An example would be X = volume and Y = pressure. Additionally, the variance in X will be
In the special case of entropy, entropy is given by
where A is the Helmholtz free energy defined as, where is the total energy and S is the entropy, so that
Furthermore, the heat capacity can be expressed as