What is the physical meaning of the partition function in statistical physics?

The partition function is a measure of the volume occupied by the system in phase space. Basically, it tells you how many microstates are accessible to your system in a given ensemble. This can be easily seen starting from the microcanonical ensemble.

In the microcanonical ensemble, where every microstate with energy between $E$ and $E+\Delta E$ is equally probable, the partition function is

$$Z_{mc}(N,V,E)= \frac 1 {N! h^{3N}}\int_{E<\mathcal H(\{p,q\})<E+\Delta E} d^{3N}p \ d^{3N} q \tag{1}$$

where the integral is just the hypervolume of the region of phase space where the energy (hamiltonian) $\mathcal H$ of the system is between $E$ and $E+\Delta E$, normalized by $h^{3N}$ to make it dimensionless. The factor $N!^{-1}$ takes into account the fact that by exchanging the "label" on two particles the microstate does not change.

The Boltzmann equation

$$S=k_B \log(Z_{mc})\tag{2}$$

tells you that the entropy is proportional to the logarithm of the total number of microstates corresponding to the macrostate of your system, and this number is just $Z_{mc}$.

In the canonical and grand-canonical ensembles the meaning of the partition function remains the same, but since energy is not anymore fixed the expression is going to change.

The canonical partition function is

$$Z_c(N,V,T)= \frac 1 {N! h^{3N}}\int e^{-\beta \mathcal H(\{p,q\})} d^{3N}p \ d^{3N} q\tag{3}$$

In this case, we integrate over all the phase space, but we assign to every point $\{p,q\}=(\mathbf p_1, \dots \mathbf p_N, \mathbf q_1, \dots \mathbf q_N)$ a weight $\exp(-\beta \mathcal H)$, where $\beta=(k_B T)^{-1}$, so that those states with energy much higher than $k_B T$ are less probable. In this case, the connection with thermodynamics is given by

$$-\frac{F}{T}=k_B \log(Z_c)\tag{4}$$

where $F$ is the Helmholtz free energy.

The grand canonical partition function is

$$Z_{gc}(\mu,V,T)=\sum_{N=0}^\infty e^{\beta \mu N} Z_c(N,V,T)\tag{5}$$

where this time we are also summing over all the possible values of the number of particles $N$, weighting each term by $\exp(\beta \mu N)$, where $\mu$ is the chemical potential.

The connection with thermodynamics is given by

$$\frac{PV}{ T} = k_B \log (Z_{gc}\tag{6})$$


It's $e^{-F/T}$, where $F/T$ is the free energy normalized by the relevant thermodynamic energy scale, the temperature. The exponential is just a monotonic reparameterization, so morally speaking, the partition function is just the free energy that's available to do useful work.

Another interpretation: if you normalize it so that $E = 0$ is the ground state, then roughly speaking, it's the reciprocal of the "fraction of the system that's in the ground state." Extremely heuristically, let $g$ be the total amount of the system that's in the ground state, $e$ be the total amount of the system that's in an exited state, and $s = g + e$ be the total amount of the system. Then $g/s$ is the fraction of the system that's in the ground state, and its reciprocal is $s/g = (g + e)/g = 1 + e/g$. The Boltzmann weight gives that the relative weight (or "amount") of each excited state $i$ with energy $E_i$ relative to the weight of the ground state is $e^{-\beta E_i}$. Summing over all the excited states $i$, we get the partition function $s/g = 1 + e^{-\beta E_1} + e^{-\beta E_2} + \dots$.


Partition function physical meaning is the following: It expresses the number of thermally accesible states that a system provides to carriers (e.g. electrons).