Helmholtz Free Energy from the Partition Function

Thermodynamics and statistical mechanics meet at a single bridge equation: F=−kBTln⁡ZF = -k_BT\ln Z. On the left is the Helmholtz free energy, the thermodynamic potential that governs a system at fixed temperature and volume — the quantity that is minimized at equilibrium and that measures the maximum work extractable at constant TT. On the right is the logarithm of the partition function, the microscopic sum over Boltzmann-weighted states. This one relation converts a microscopic spectrum into a full macroscopic potential, and from it every equilibrium quantity follows by differentiation. The free energy earns its name from the split F=U−TSF = U - TS: it is the internal energy UU minus the part TSTS that is thermally "locked up" as entropy and unavailable for work. At fixed temperature, a system spontaneously evolves to minimize FF, balancing two competing drives — lowering the energy UU and raising the entropy SS. This energy–entropy competition, weighted by temperature, is the master principle behind phase transitions, chemical equilibria, folding, and self-assembly: at low TT energy wins (ordered, low-UU states); at high TT entropy wins (disordered, high-SS states); and the transition is where the balance tips. Because F=−kBTln⁡ZF = -k_BT\ln Z and ln⁡Z\ln Z is additive for independent parts, the free energy is extensive, and everything descends from it: S=−∂F/∂TS = -\partial F/\partial T, p=−∂F/∂Vp = -\partial F/\partial V, U=F+TS=∂(βF)/∂βU = F + TS = \partial(\beta F)/\partial\beta. The article's owned result is the Gibbs–Bogoliubov variational inequality F≤F0+⟨H−H0⟩0F \le F_0 + \langle H - H_0\rangle_0, which makes FF the foundation of the most powerful approximation method in the field: mean-field theory bounds the true free energy from above using a solvable trial system. This article derives the bridge relation, shows that the equilibrium distribution minimizes FF, proves the Bogoliubov bound, and computes real numbers — all python-verified.

Key takeaways
  • The bridge relation F=−kBTln⁡ZF = -k_BT\ln Z converts the partition function into the Helmholtz free energy — the thermodynamic potential at fixed T,V,NT,V,N.
  • F=U−TSF = U - TS: the free energy is the internal energy minus the thermally locked-up part TSTS; it measures the maximum work at constant TT.
  • At fixed TT, equilibrium minimizes FF — the balance of the energy drive (lower UU) against the entropy drive (higher SS).
  • Everything follows: S=−∂F/∂T=kBln⁡Z+U/TS = -\partial F/\partial T = k_B\ln Z + U/T, p=−∂F/∂Vp = -\partial F/\partial V, U=∂(βF)/∂βU = \partial(\beta F)/\partial\beta.
  • The Gibbs–Bogoliubov inequality F≤F0+⟨H−H0⟩0F \le F_0 + \langle H - H_0\rangle_0 bounds FF from above using a solvable trial Hamiltonian — the foundation of mean-field theory.
  • Key idea: F=−kBTln⁡ZF = -k_BT\ln Z is the bridge from microscopics to thermodynamics; minimizing FF is the energy–entropy competition, and the Bogoliubov bound turns it into a variational approximation method.
The core insight

The bridge relation F=−kBTln⁡ZF = -k_BT\ln Z makes the Helmholtz free energy a direct readout of the partition function; all thermodynamics follows by differentiating FF. At fixed temperature the equilibrium distribution minimizes F=U−TSF = U - TS (energy versus entropy), and the Gibbs–Bogoliubov inequality F≤F0+⟨H−H0⟩0F \le F_0 + \langle H-H_0\rangle_0 turns this into a variational bound — the engine of mean-field theory.

Where this lives today

The bridge relation F=−kBTln⁡ZF=-k_BT\ln Z and the Bogoliubov variational principle are the daily tools of theoretical condensed-matter and chemical physics. Mean-field theory — the first approximation applied to essentially every interacting system, from magnetism (Weiss/Curie theory) to superconductivity (BCS) to the liquid–gas transition (van der Waals) — is precisely the Gibbs–Bogoliubov bound optimized over a solvable trial: replace the intractable interacting Hamiltonian with an effective single-particle one and minimize the free-energy bound to get the self-consistent mean-field equations. Density-functional theory, the workhorse of computational materials science and quantum chemistry, is a sophisticated descendant of free-energy minimization, casting the ground-state energy as a functional to be minimized over the electron density. Free-energy computation is also the central task of modern molecular simulation. Predicting whether a drug binds a protein, whether a material is thermodynamically stable, or whether a reaction proceeds all reduce to computing free-energy differences — and because F=−kBTln⁡ZF=-k_BT\ln Z involves the full partition function, this is one of the hardest problems in computational science, tackled by thermodynamic integration, free-energy perturbation, umbrella sampling, and metadynamics. The Jarzynski and Crooks fluctuation theorems even let free-energy differences be extracted from non-equilibrium pulling experiments. In machine learning, variational inference is mathematically identical to the Gibbs–Bogoliubov bound: the "evidence lower bound" (ELBO) maximized in variational autoencoders is a free-energy bound, and the "free energy" language pervades the field. The humble bridge relation, and the variational principle built on it, reach from the origins of thermodynamics to the frontiers of AI.

The physical picture

The free energy is what a system at fixed temperature "tries to minimize," and the reason is a tug-of-war. The internal energy UU pulls the system toward low-energy configurations — a magnet toward alignment, water toward the crystalline order of ice. The entropy SS pulls it toward disorder — the magnet toward random spins, water toward the many arrangements of a liquid. Temperature sets the exchange rate between them: F=U−TSF = U - TS says that raising TT increases the weight of the entropy term, so at high temperature disorder wins and at low temperature order wins. Every phase transition is this balance tipping.

Figure
The energy–entropy competition: F = U − TS. Low T favors low-U order; high T favors high-S disorder. The minimum of F is equilibrium.
order ← configuration → disorder F min F = equilibrium low-U (energy drive) high-S (entropy drive) F = U − TS

The bridge relation F=−kBTln⁡ZF = -k_BT\ln Z makes this quantitative and computable. Since ln⁡Z\ln Z is a sum over Boltzmann weights, it automatically contains both drives: at low TT the sum is dominated by the ground state (energy wins, F→E0F\to E_0), at high TT it counts all states (entropy wins, F→−kBTln⁡ΩF\to -k_BT\ln\Omega). The free energy is the single scalar that packages the competition, and its derivatives hand you the entropy (−∂F/∂T-\partial F/\partial T), the pressure (−∂F/∂V-\partial F/\partial V), and the energy — the complete thermodynamics from one function. The most powerful use of FF is as a variational quantity. The true equilibrium distribution is the one that minimizes FF; any other trial distribution gives a higher free energy. This is the Gibbs–Bogoliubov inequality, and it is the engine of approximation: pick a solvable trial system, compute its free energy plus a correction, and you get a rigorous upper bound on the true (intractable) free energy — then optimize the trial to make the bound as tight as possible. The punchline plot below shows this: the Bogoliubov bound sits above the true free energy for any trial, touching it only when the trial equals the true system, so minimizing the bound over trial parameters approaches the exact answer from above.

Figure
The Gibbs–Bogoliubov bound: F_bound(trial) ≥ F_true for every trial, touching only at the exact system. Minimizing over trial parameters approaches F_true from above.
trial parameterF F_true (exact, unknown) best variational bound F_bound(trial) ≥ F_true always

The core equations

The central bridge relation and the definition it encodes:

F=−kBTln⁡Z,F=U−TS(1)F = -k_BT\ln Z,\qquad F = U - TS \qquad (1)

where: FF — Helmholtz free energy; Z=∑ie−βEiZ=\sum_i e^{-\beta E_i} — canonical partition function; UU — internal energy; SS — entropy. The two forms are equivalent: −kBTln⁡Z-k_BT\ln Z equals U−TSU-TS, as the derivation shows. Every thermodynamic quantity is a derivative of FF (or of ln⁡Z\ln Z):

S=−(∂F∂T)V=kBln⁡Z+UT,p=−(∂F∂V)T,μ=(∂F∂N)T,V(2)S=-\left(\frac{\partial F}{\partial T}\right)_{V}=k_B\ln Z+\frac{U}{T},\qquad p=-\left(\frac{\partial F}{\partial V}\right)_{T},\qquad \mu=\left(\frac{\partial F}{\partial N}\right)_{T,V} \qquad (2)

where: S,p,μS,p,\mu — entropy, pressure, chemical potential; the natural variables of FF are (T,V,N)(T,V,N), so its derivatives with respect to them give the conjugate quantities. The internal energy is recovered as U=F+TS=∂(βF)/∂βU = F + TS = \partial(\beta F)/\partial\beta. At fixed TT, the equilibrium distribution minimizes the free-energy functional over all normalized distributions:

F[p]=⟨E⟩−TS[p]=∑ipiEi+kBT∑ipiln⁡pi,F[p]≥F[peq]=−kBTln⁡Z(3)F[p] = \langle E\rangle - TS[p] = \sum_i p_i E_i + k_BT\sum_i p_i\ln p_i,\qquad F[p]\ge F[p_{\text{eq}}]=-k_BT\ln Z \qquad (3)

where: F[p]F[p] — free-energy functional of a trial distribution pip_i; peq=e−βEi/Zp_{\text{eq}}=e^{-\beta E_i}/Z — the Boltzmann distribution, which is the unique minimizer. This is the variational principle for the free energy. The Gibbs–Bogoliubov inequality bounds FF using a solvable trial Hamiltonian H0H_0:

F≤F0+⟨H−H0⟩0(4)F \le F_0 + \langle H - H_0\rangle_0 \qquad (4)

where: FF — true free energy (of HH); F0F_0 — free energy of the trial H0H_0; ⟨⋅⟩0\langle\cdot\rangle_0 — average in the trial ensemble. The bound is an upper bound, tight when H0=HH_0=H; minimizing the right side over H0H_0's parameters gives the best mean-field approximation.

Derivation AThe bridge relation F = −k_BT ln Z, and that equilibrium minimizes F

The goal is to prove that −kBTln⁡Z-k_BT\ln Z equals the thermodynamic free energy U−TSU-TS, and that the Boltzmann distribution is the unique distribution that minimizes the free-energy functional at fixed temperature. The strategy is to compute UU, SS, and F=U−TSF=U-TS from the canonical distribution and show they collapse to −kBTln⁡Z-k_BT\ln Z, then vary the functional.

Step 1. From the canonical distribution pi=e−βEi/Zp_i=e^{-\beta E_i}/Z, the internal energy is U=∑ipiEi=−∂βln⁡ZU=\sum_i p_i E_i=-\partial_\beta\ln Z, and the Gibbs entropy is S=−kB∑ipiln⁡piS=-k_B\sum_i p_i\ln p_i. Substitute ln⁡pi=−βEi−ln⁡Z\ln p_i=-\beta E_i-\ln Z: S=−kB∑ipi(−βEi−ln⁡Z)=kBβU+kBln⁡Z=UT+kBln⁡ZS=-k_B\sum_i p_i(-\beta E_i-\ln Z)=k_B\beta U+k_B\ln Z=\frac{U}{T}+k_B\ln Z. Why: the Gibbs entropy of the Boltzmann distribution evaluates cleanly because ln⁡pi\ln p_i is linear in the energy plus a constant, so the sum splits into ⟨E⟩\langle E\rangle and a normalization piece.

Step 2. Form F=U−TS=U−T(UT+kBln⁡Z)=U−U−kBTln⁡Z=−kBTln⁡ZF=U-TS=U-T(\tfrac{U}{T}+k_B\ln Z)=U-U-k_BT\ln Z=-k_BT\ln Z. The bridge relation is proved. Why: the internal-energy terms cancel exactly, leaving the free energy as pure −kBTln⁡Z-k_BT\ln Z — the clean bridge between the microscopic sum and the thermodynamic potential.

Step 3. Now show equilibrium minimizes FF. Consider the functional F[p]=∑ipiEi+kBT∑ipiln⁡piF[p]=\sum_i p_i E_i+k_BT\sum_i p_i\ln p_i over normalized pip_i. Minimize with a Lagrange multiplier λ\lambda for ∑pi=1\sum p_i=1: ∂/∂pi[F[p]−λ∑jpj]=Ei+kBT(ln⁡pi+1)−λ=0\partial/\partial p_i[F[p]-\lambda\sum_j p_j]=E_i+k_BT(\ln p_i+1)-\lambda=0, giving pi∝e−Ei/kBTp_i\propto e^{-E_i/k_BT}. Why: the stationarity condition forces the exponential form; the entropy term kBT∑piln⁡pik_BT\sum p_i\ln p_i is convex, so this stationary point is the unique minimum.

Step 4. Evaluate the functional at the minimizer: F[peq]=−kBTln⁡ZF[p_{\text{eq}}]=-k_BT\ln Z, and F[p]>F[peq]F[p]>F[p_{\text{eq}}] for any other pp (by convexity). So the Boltzmann distribution is the unique free-energy minimizer, and F=−kBTln⁡ZF=-k_BT\ln Z is the minimum value. Why: the free-energy functional is convex in the distribution, so its stationary point is a global minimum — the equilibrium distribution is the one that best balances low energy against high entropy. *Verified: F=U−TS=−kBTln⁡ZF=U-TS=-k_BT\ln Z and S=kBln⁡Z+U/TS=k_B\ln Z+U/T checked symbolically on the two-level system; a numerical search over 2000 perturbations confirms the Boltzmann distribution minimizes F=⟨E⟩−TSF=\langle E\rangle-TS, in verify_aq-sm-helmholtz-free-energy-partition-function.py.*

Go deeper · Derivation B · 1 minThe Gibbs–Bogoliubov variational inequality — the owned result
Derivation BThe Gibbs–Bogoliubov variational inequality — the owned result

This is the article's owned structural result: the free-energy minimization principle can be turned into a rigorous upper bound on the true free energy using any solvable trial system, giving the mathematical foundation of mean-field theory. The goal is to prove F≤F0+⟨H−H0⟩0F\le F_0+\langle H-H_0\rangle_0, where H0H_0 is a trial Hamiltonian and ⟨⋅⟩0\langle\cdot\rangle_0 is the average in its (solvable) canonical ensemble. The strategy is to use the convexity of the exponential (Jensen's inequality) applied to the difference H−H0H-H_0.

Step 1. Write the true partition function in terms of the trial ensemble: Z=Tr e−βH=Tr e−βH0e−β(H−H0)Z=\mathrm{Tr}\,e^{-\beta H}=\mathrm{Tr}\,e^{-\beta H_0}e^{-\beta(H-H_0)} (for commuting/classical H0,HH_0,H; the operator case needs the Peierls–Bogoliubov version). Factor out Z0Z_0: Z=Z0 ⟨e−β(H−H0)⟩0Z=Z_0\,\langle e^{-\beta(H-H_0)}\rangle_0. Why: inserting e−βH0e+βH0e^{-\beta H_0}e^{+\beta H_0} rewrites the true Boltzmann weight as the trial weight times a correction, whose average in the trial ensemble is exactly ⟨e−β(H−H0)⟩0\langle e^{-\beta(H-H_0)}\rangle_0.

Step 2. Apply Jensen's inequality. Since exe^{x} is convex, ⟨ex⟩≥e⟨x⟩\langle e^{x}\rangle\ge e^{\langle x\rangle}; with x=−β(H−H0)x=-\beta(H-H_0), ⟨e−β(H−H0)⟩0≥e−β⟨H−H0⟩0\langle e^{-\beta(H-H_0)}\rangle_0\ge e^{-\beta\langle H-H_0\rangle_0}. Why: Jensen's inequality for a convex function says the average of the function exceeds the function of the average — the key mathematical fact that turns an intractable average into a bound.

Step 3. Take logs and multiply by −kBT-k_BT: F=−kBTln⁡Z=−kBTln⁡Z0−kBTln⁡⟨e−β(H−H0)⟩0≤F0+⟨H−H0⟩0F=-k_BT\ln Z=-k_BT\ln Z_0-k_BT\ln\langle e^{-\beta(H-H_0)}\rangle_0\le F_0+\langle H-H_0\rangle_0. This is the Gibbs–Bogoliubov inequality — an upper bound on FF. Why: the inequality flips direction under the −kBTln⁡(⋅)-k_BT\ln(\cdot) (which is decreasing), turning the Jensen lower bound on ZZ into an upper bound on FF.

Step 4. Use it. Choose a family of solvable trial Hamiltonians H0({θ})H_0(\{\theta\}), compute F0(θ)+⟨H−H0⟩0F_0(\theta)+\langle H-H_0\rangle_0, and minimize over θ\theta to get the tightest bound. The bound is tight (equality) when H0=HH_0=H, and the optimized H0H_0 is the best mean-field approximation. Why: since every trial gives an upper bound, the lowest bound is the best estimate; the optimization is exactly the self-consistent mean-field equations for the trial parameters. *Verified: for a 3-state true Hamiltonian H=[0,1,2.3]H=[0,1,2.3] and trial H0=[0,1,1]H_0=[0,1,1], Ftrue≤F0+⟨H−H0⟩0F_{\text{true}}\le F_0+\langle H-H_0\rangle_0 holds, the bound is an upper bound, and it is tight (equality) when H0=HH_0=H, in the verify script.*

Limiting cases

The free energy across regimes:

CaseResultMeaning
Low temperatureF→E0−kBTln⁡g0F\to E_0 - k_BT\ln g_0Ground state dominates; F→E0F\to E_0, residual entropy S→kBln⁡g0S\to k_B\ln g_0.
High temperatureF→−kBTln⁡ΩF\to -k_BT\ln\OmegaEntropy dominates; free energy driven by −TS-TS.
Independent partsF=∑aFaF=\sum_a F_aAdditive (extensive), since ln⁡Z=∑aln⁡Za\ln Z=\sum_a\ln Z_a.
H0=HH_0=HBogoliubov bound tightThe variational estimate becomes exact.
Convexity∂2F/∂T2=−CV/T<0\partial^2 F/\partial T^2=-C_V/T<0FF is concave in TT (stability).

Worked examples

1 · Free energy and entropy of the two-level system (a full readout)

For NN independent two-level systems (gap ε\varepsilon), compute FF, then obtain SS and UU from it, and verify the low- and high-temperature limits.

Step 1. Partition function per system: Z1=1+e−βεZ_1 = 1 + e^{-\beta\varepsilon}, so for NN distinguishable systems ln⁡Z=Nln⁡(1+e−βε)\ln Z = N\ln(1+e^{-\beta\varepsilon}). Free energy: F=−kBTln⁡Z=−NkBTln⁡(1+e−βε)F = -k_BT\ln Z = -Nk_BT\ln(1+e^{-\beta\varepsilon}).

Step 2. Entropy from S=−∂F/∂TS=-\partial F/\partial T: S=NkB[ln⁡(1+e−βε)+βε e−βε1+e−βε]S = Nk_B\left[\ln(1+e^{-\beta\varepsilon}) + \dfrac{\beta\varepsilon\,e^{-\beta\varepsilon}}{1+e^{-\beta\varepsilon}}\right]. Energy from U=F+TSU=F+TS: U=Nεeβε+1U = \dfrac{N\varepsilon}{e^{\beta\varepsilon}+1}, matching the direct result — a consistency check.

Step 3. Low-TT limit (β→∞\beta\to\infty): e−βε→0e^{-\beta\varepsilon}\to0, so F→0F\to0 (ground energy, taken as zero), S→0S\to0, U→0U\to0. All systems freeze into the ground state — the third law satisfied, S→0S\to0 for a non-degenerate ground state.

Step 4. High-TT limit (β→0\beta\to0): ln⁡(1+e−βε)→ln⁡2\ln(1+e^{-\beta\varepsilon})\to\ln2, so F→−NkBTln⁡2F\to -Nk_BT\ln2 and S→NkBln⁡2S\to Nk_B\ln2 (both levels equally likely — ln⁡2\ln2 per system of "which level"), while U→Nε/2U\to N\varepsilon/2. The two limits bracket the physics: energy dominates at low TT (order, S=0S=0), entropy dominates at high TT (S=NkBln⁡2S=Nk_B\ln2), and F=U−TSF=U-TS tracks the crossover — the free energy is the complete thermodynamic story in one function.

2 · A Gibbs–Bogoliubov bound in action (exam level)

A three-state system has Hamiltonian energies H=(0,1,2.3)H=(0, 1, 2.3) (units of kBT=1k_BT=1, so β=1\beta=1). Estimate its free energy using a solvable trial H0=(0,1,1)H_0=(0,1,1) via the Gibbs–Bogoliubov inequality, and compare to the exact value.

Step 1. Exact free energy: Z=e0+e−1+e−2.3=1+0.3679+0.1003=1.4682Z=e^{0}+e^{-1}+e^{-2.3}=1+0.3679+0.1003=1.4682, so Ftrue=−ln⁡Z=−ln⁡1.4682=−0.3840F_{\text{true}}=-\ln Z=-\ln1.4682=\mathbf{-0.3840}.

Step 2. Trial free energy: Z0=e0+e−1+e−1=1+0.3679+0.3679=1.7358Z_0=e^{0}+e^{-1}+e^{-1}=1+0.3679+0.3679=1.7358, so F0=−ln⁡1.7358=−0.5516F_0=-\ln1.7358=\mathbf{-0.5516}.

Step 3. Correction term ⟨H−H0⟩0\langle H-H_0\rangle_0: the states differ only in the third level, where H−H0=2.3−1=1.3H-H_0=2.3-1=1.3, with trial probability p0(3)=e−1/Z0=0.3679/1.7358=0.2120p_0^{(3)}=e^{-1}/Z_0=0.3679/1.7358=0.2120. So ⟨H−H0⟩0=1.3×0.2120=0.2756\langle H-H_0\rangle_0 = 1.3\times0.2120 = 0.2756.

Step 4. Bogoliubov bound: F≤F0+⟨H−H0⟩0=−0.5516+0.2756=−0.2760F\le F_0+\langle H-H_0\rangle_0 = -0.5516+0.2756 = \mathbf{-0.2760}. Compare: Ftrue=−0.3840≤−0.2760F_{\text{true}}=-0.3840 \le -0.2760 ✓ — the bound holds and lies above the true value, as it must. The trial gives an upper bound within about 0.1 kBT0.1\,k_BT of the exact free energy; optimizing the trial parameter would tighten it further. This is exactly how mean-field theory estimates the free energy of an intractable interacting system — replace it with a solvable trial and minimize the Bogoliubov bound.

Origins · 1 minRudolf Peierls and how this was discovered
RP
Rudolf Peierls
1907–1995 · Birmingham

Peierls, a German-born physicist who spent most of his career in Britain, gave his name to the Peierls–Bogoliubov inequality, the operator (quantum) form of the variational bound F≤F0+⟨H−H0⟩0F\le F_0+\langle H-H_0\rangle_0 that this article's owned result rests on. In a 1938 paper he proved a convexity inequality for the free energy that bounds the true free energy of a quantum system from above using a trial Hamiltonian — a result Bogoliubov later developed into the systematic variational method underlying mean-field theory. Peierls made foundational contributions across physics: the theory of electrons in solids (the "Peierls transition" and Peierls substitution), the Peierls argument establishing that the two-dimensional Ising model has a phase transition (a landmark in the rigorous theory of phase transitions), and crucial early work on nuclear physics — his 1940 memorandum with Otto Frisch first showed that a small critical mass of uranium-235 could sustain an explosive chain reaction, launching the Allied atomic-bomb programs. The variational inequality bearing his name turned free-energy minimization from a principle into a practical, rigorous approximation tool used throughout condensed-matter and statistical physics.

History
1882
— Helmholtz introduces the free energy in "Zur Thermodynamik chemischer Vorgänge," distinguishing free and bound energy.
1902
— Gibbs's Elementary Principles establishes F = −k_BT ln Z as the bridge to statistical mechanics.
1938
— Peierls proves the free-energy convexity inequality (the Peierls–Bogoliubov bound).
1958
— Bogoliubov develops the variational method for free energy into a systematic tool.
1937
— Landau's mean-field theory of phase transitions applies free-energy minimization to order parameters.

Going further

References. Pathria & Beale, Statistical Mechanics, 3rd ed., §3.3 · Kardar, Statistical Physics of Particles, §4.3, §5.2 (Bogoliubov) · Reif, Fundamentals of Statistical and Thermal Physics, Ch. 6 · Sethna, Statistical Mechanics, Ch. 6 · Callen, Thermodynamics, Ch. 5 · Feynman, Statistical Mechanics, Ch. 2 (variational method) · Chandler, Introduction to Modern Statistical Mechanics, Ch. 5.

Provenance. The bridge relation and the variational principle are standard (Pathria §3.3; Kardar §5.2). A verifier should reproduce: F=U−TS=−kBTln⁡ZF=U-TS=-k_BT\ln Z and S=kBln⁡Z+U/TS=k_B\ln Z+U/T (checked on the two-level system); that the Boltzmann distribution minimizes F=⟨E⟩−TSF=\langle E\rangle-TS; and the Gibbs–Bogoliubov bound F≤F0+⟨H−H0⟩0F\le F_0+\langle H-H_0\rangle_0 (upper bound, tight when H0=HH_0=H). Numerical instances (two-level F,S,UF,S,U limits; the 3-state Bogoliubov bound Ftrue=−0.384≤−0.276=F0+⟨H−H0⟩0F_{\text{true}}=-0.384\le-0.276=F_0+\langle H-H_0\rangle_0) are recomputed in verify_aq-sm-helmholtz-free-energy-partition-function.py.

Builds on: Canonical Ensemble · Canonical Partition Function · Boltzmann Factor · Derivation of the Canonical Distribution from the Microcanonical Ensemble. Leads to: Thermodynamic Quantities from the Partition Function · Energy Fluctuations in the Canonical Ensemble · Factorization of the Partition Function · Grand Potential.

Why is the free energy, not the energy, minimized at equilibrium?

Because at fixed temperature the system is in contact with a heat reservoir, and what the combined system-plus-reservoir maximizes is the total entropy — which, translated into the language of the system alone, becomes minimizing the system's free energy F=U−TSF=U-TS. Here is the logic: when the system takes energy UU from the reservoir, the reservoir's entropy drops by U/TU/T, while the system's own entropy is SS; the total entropy change is S−U/T=−F/TS - U/T = -F/T. Maximizing the total entropy is therefore the same as minimizing FF. So the free energy is not an arbitrary combination — it is exactly the quantity whose minimization is equivalent to the Second Law for a system at fixed temperature. Minimizing UU alone would be correct only if the reservoir did not exist (an isolated system at T=0T=0); at any finite temperature the reservoir's entropy bookkeeping introduces the −TS-TS term, and the system genuinely prefers to raise its energy if doing so raises its entropy enough.

What does the word "free" in free energy actually mean?

It means "free to do work" — available, as opposed to locked up. The internal energy UU is the total energy stored in the system, but at fixed temperature not all of it can be extracted as useful work: a portion, TSTS, is thermodynamically bound up with the entropy and cannot be converted to work without violating the Second Law. The Helmholtz free energy F=U−TSF=U-TS is the part that is available — the maximum work you can extract from the system in a process at constant temperature. If you run a reversible isothermal process, the work you get out equals exactly −ΔF-\Delta F; try to get more and you would have to decrease the entropy of the universe, which is forbidden. So "free energy" is the free-to-do-work energy, and TSTS is the "bound" energy locked away by entropy. (For processes at constant temperature and pressure, the analogous available-work quantity is the Gibbs free energy G=H−TSG=H-TS; Helmholtz is the constant-TT-and-VV version.) This is Helmholtz's original 1882 distinction between "free" and "bound" energy.

How can the Gibbs–Bogoliubov inequality give a rigorous bound when we don't know the true answer?

That is precisely its power — you get a guaranteed upper bound on a quantity you cannot compute, using only a system you can solve. The trick is Jensen's inequality: because the exponential function is convex, the average of an exponential always exceeds the exponential of the average, ⟨ex⟩≥e⟨x⟩\langle e^x\rangle\ge e^{\langle x\rangle}. Applied to the ratio between the true and trial Boltzmann weights, this turns into a statement that the true free energy is at most the trial free energy plus a computable correction, F≤F0+⟨H−H0⟩0F\le F_0+\langle H-H_0\rangle_0 — and every term on the right is computable in the solvable trial ensemble. You never need the true partition function. Because it is a rigorous inequality (not an uncontrolled approximation), any trial you pick gives an honest upper bound, and the best trial is the one that minimizes the bound. This converts an intractable problem (compute FF exactly) into a tractable optimization (minimize the bound over trial parameters), and the optimized bound is the mean-field estimate. The rigor comes entirely from convexity — mathematics guarantees the inequality regardless of how good or bad your trial is.

Is F = −k_BT ln Z exact, or an approximation?

It is exact — it is a mathematical identity, not an approximation. Given the exact partition function Z=∑ie−βEiZ=\sum_i e^{-\beta E_i}, the free energy is exactly F=−kBTln⁡ZF=-k_BT\ln Z, as the derivation (F=U−TS=−kBTln⁡ZF=U-TS=-k_BT\ln Z) shows with the internal-energy terms cancelling identically. There is no truncation or limit involved. The catch is entirely practical: computing ZZ exactly requires summing over all microstates, which is intractable for interacting many-body systems. So while the relation F=−kBTln⁡ZF=-k_BT\ln Z is exact, the evaluation of ZZ is where approximations enter — and that is exactly where the Gibbs–Bogoliubov variational bound and Monte Carlo methods come in. They approximate the intractable ZZ (or bound FF), but the bridge relation itself is one of the exact cornerstones of statistical mechanics, as rigorous as S=kBln⁡ΩS=k_B\ln\Omega. When people say "we computed the free energy in the mean-field approximation," they mean they approximated ZZ; the formula F=−kBTln⁡ZF=-k_BT\ln Z connecting them is never the source of error.

Why is the free energy concave in temperature but convex in volume?

This is the stability signature inherited from the Second Law, and it comes from the Legendre-transform structure of the potentials. Take two derivatives of FF with respect to temperature: since S=−∂F/∂TS=-\partial F/\partial T, we get ∂2F/∂T2=−∂S/∂T=−CV/T\partial^2 F/\partial T^2=-\partial S/\partial T=-C_V/T, which is negative (because CV>0C_V>0 for stability), so FF is concave in TT. Take two derivatives with respect to volume: since p=−∂F/∂Vp=-\partial F/\partial V, we get ∂2F/∂V2=−∂p/∂V=1/(VκT)\partial^2 F/\partial V^2=-\partial p/\partial V=1/(V\kappa_T), which is positive (because κT>0\kappa_T>0), so FF is convex in VV. The general rule, which the Legendre transform enforces, is that thermodynamic potentials are convex in their extensive variables and concave in their intensive variables — and F(T,V,N)F(T,V,N) has one intensive natural variable (TT) and two extensive ones (V,NV,N). The concavity in TT and convexity in VV are not independent quirks; they are two faces of the requirement that the entropy be concave (equilibrium is a maximum of entropy), which is the master stability condition. Where these curvatures fail, the system is unstable and phase-separates.

How does free-energy minimization explain phase transitions?

A phase transition is where the global minimum of the free energy jumps from one phase to another as you tune temperature (or pressure). Each candidate phase — solid, liquid, gas, or an ordered versus disordered magnetic state — has its own free energy Fphase(T)=Uphase−TSphaseF_{\text{phase}}(T)=U_{\text{phase}}-TS_{\text{phase}}, a straight-ish line whose slope is −Sphase-S_{\text{phase}} (steeper for higher-entropy phases). The stable phase at a given temperature is the one with the lowest FF. Because higher-entropy phases have steeper (more negative) slopes, they win at high temperature, while lower-energy phases win at low temperature — the lines cross at the transition temperature, where the two phases have equal free energy and coexist. At that crossing, the system switches from minimizing FF via the ordered phase to minimizing it via the disordered phase. This is why ice melts at 0∘0^\circC (above it, liquid water's higher entropy makes its FF lower despite higher energy) and why magnets lose their magnetization above the Curie temperature (the disordered paramagnet's entropy wins). The energy–entropy competition packaged in F=U−TSF=U-TS, minimized as a function of temperature, is the theory of phase transitions — and Landau built his entire mean-field theory of transitions by expanding the free energy in an order parameter and minimizing.

Before this

Where this leads