Helmholtz Free Energy from the Partition Function
Thermodynamics and statistical mechanics meet at a single bridge equation: . 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 . 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 : it is the internal energy minus the part that is thermally "locked up" as entropy and unavailable for work. At fixed temperature, a system spontaneously evolves to minimize , balancing two competing drives — lowering the energy and raising the entropy . This energy–entropy competition, weighted by temperature, is the master principle behind phase transitions, chemical equilibria, folding, and self-assembly: at low energy wins (ordered, low- states); at high entropy wins (disordered, high- states); and the transition is where the balance tips. Because and is additive for independent parts, the free energy is extensive, and everything descends from it: , , . The article's owned result is the Gibbs–Bogoliubov variational inequality , which makes 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 , proves the Bogoliubov bound, and computes real numbers — all python-verified.
- The bridge relation converts the partition function into the Helmholtz free energy — the thermodynamic potential at fixed .
- : the free energy is the internal energy minus the thermally locked-up part ; it measures the maximum work at constant .
- At fixed , equilibrium minimizes — the balance of the energy drive (lower ) against the entropy drive (higher ).
- Everything follows: , , .
- The Gibbs–Bogoliubov inequality bounds from above using a solvable trial Hamiltonian — the foundation of mean-field theory.
- Key idea: is the bridge from microscopics to thermodynamics; minimizing is the energy–entropy competition, and the Bogoliubov bound turns it into a variational approximation method.
The bridge relation makes the Helmholtz free energy a direct readout of the partition function; all thermodynamics follows by differentiating . At fixed temperature the equilibrium distribution minimizes (energy versus entropy), and the Gibbs–Bogoliubov inequality turns this into a variational bound — the engine of mean-field theory.
Where this lives today
The bridge relation 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 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 pulls the system toward low-energy configurations — a magnet toward alignment, water toward the crystalline order of ice. The entropy pulls it toward disorder — the magnet toward random spins, water toward the many arrangements of a liquid. Temperature sets the exchange rate between them: says that raising 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.
The bridge relation makes this quantitative and computable. Since is a sum over Boltzmann weights, it automatically contains both drives: at low the sum is dominated by the ground state (energy wins, ), at high it counts all states (entropy wins, ). The free energy is the single scalar that packages the competition, and its derivatives hand you the entropy (), the pressure (), and the energy — the complete thermodynamics from one function. The most powerful use of is as a variational quantity. The true equilibrium distribution is the one that minimizes ; 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.
The core equations
The central bridge relation and the definition it encodes:
where: — Helmholtz free energy; — canonical partition function; — internal energy; — entropy. The two forms are equivalent: equals , as the derivation shows. Every thermodynamic quantity is a derivative of (or of ):
where: — entropy, pressure, chemical potential; the natural variables of are , so its derivatives with respect to them give the conjugate quantities. The internal energy is recovered as . At fixed , the equilibrium distribution minimizes the free-energy functional over all normalized distributions:
where: — free-energy functional of a trial distribution ; — the Boltzmann distribution, which is the unique minimizer. This is the variational principle for the free energy. The Gibbs–Bogoliubov inequality bounds using a solvable trial Hamiltonian :
where: — true free energy (of ); — free energy of the trial ; — average in the trial ensemble. The bound is an upper bound, tight when ; minimizing the right side over 's parameters gives the best mean-field approximation.
The goal is to prove that equals the thermodynamic free energy , and that the Boltzmann distribution is the unique distribution that minimizes the free-energy functional at fixed temperature. The strategy is to compute , , and from the canonical distribution and show they collapse to , then vary the functional.
Step 1. From the canonical distribution , the internal energy is , and the Gibbs entropy is . Substitute : . Why: the Gibbs entropy of the Boltzmann distribution evaluates cleanly because is linear in the energy plus a constant, so the sum splits into and a normalization piece.
Step 2. Form . The bridge relation is proved. Why: the internal-energy terms cancel exactly, leaving the free energy as pure — the clean bridge between the microscopic sum and the thermodynamic potential.
Step 3. Now show equilibrium minimizes . Consider the functional over normalized . Minimize with a Lagrange multiplier for : , giving . Why: the stationarity condition forces the exponential form; the entropy term is convex, so this stationary point is the unique minimum.
Step 4. Evaluate the functional at the minimizer: , and for any other (by convexity). So the Boltzmann distribution is the unique free-energy minimizer, and 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: and checked symbolically on the two-level system; a numerical search over 2000 perturbations confirms the Boltzmann distribution minimizes , in verify_aq-sm-helmholtz-free-energy-partition-function.py.*
Go deeper · Derivation B · 1 minThe 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 , where is a trial Hamiltonian and 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 .
Step 1. Write the true partition function in terms of the trial ensemble: (for commuting/classical ; the operator case needs the Peierls–Bogoliubov version). Factor out : . Why: inserting rewrites the true Boltzmann weight as the trial weight times a correction, whose average in the trial ensemble is exactly .
Step 2. Apply Jensen's inequality. Since is convex, ; with , . 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 : . This is the Gibbs–Bogoliubov inequality — an upper bound on . Why: the inequality flips direction under the (which is decreasing), turning the Jensen lower bound on into an upper bound on .
Step 4. Use it. Choose a family of solvable trial Hamiltonians , compute , and minimize over to get the tightest bound. The bound is tight (equality) when , and the optimized 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 and trial , holds, the bound is an upper bound, and it is tight (equality) when , in the verify script.*
Limiting cases
The free energy across regimes:
| Case | Result | Meaning |
|---|---|---|
| Low temperature | Ground state dominates; , residual entropy . | |
| High temperature | Entropy dominates; free energy driven by . | |
| Independent parts | Additive (extensive), since . | |
| Bogoliubov bound tight | The variational estimate becomes exact. | |
| Convexity | is concave in (stability). |
Worked examples
1 · Free energy and entropy of the two-level system (a full readout)
For independent two-level systems (gap ), compute , then obtain and from it, and verify the low- and high-temperature limits.
Step 1. Partition function per system: , so for distinguishable systems . Free energy: .
Step 2. Entropy from : . Energy from : , matching the direct result — a consistency check.
Step 3. Low- limit (): , so (ground energy, taken as zero), , . All systems freeze into the ground state — the third law satisfied, for a non-degenerate ground state.
Step 4. High- limit (): , so and (both levels equally likely — per system of "which level"), while . The two limits bracket the physics: energy dominates at low (order, ), entropy dominates at high (), and 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 (units of , so ). Estimate its free energy using a solvable trial via the Gibbs–Bogoliubov inequality, and compare to the exact value.
Step 1. Exact free energy: , so .
Step 2. Trial free energy: , so .
Step 3. Correction term : the states differ only in the third level, where , with trial probability . So .
Step 4. Bogoliubov bound: . Compare: ✓ — the bound holds and lies above the true value, as it must. The trial gives an upper bound within about 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
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 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.
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: and (checked on the two-level system); that the Boltzmann distribution minimizes ; and the Gibbs–Bogoliubov bound (upper bound, tight when ). Numerical instances (two-level limits; the 3-state Bogoliubov bound ) 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 . Here is the logic: when the system takes energy from the reservoir, the reservoir's entropy drops by , while the system's own entropy is ; the total entropy change is . Maximizing the total entropy is therefore the same as minimizing . 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 alone would be correct only if the reservoir did not exist (an isolated system at ); at any finite temperature the reservoir's entropy bookkeeping introduces the 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 is the total energy stored in the system, but at fixed temperature not all of it can be extracted as useful work: a portion, , is thermodynamically bound up with the entropy and cannot be converted to work without violating the Second Law. The Helmholtz free energy 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 ; 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 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 ; Helmholtz is the constant--and- 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, . 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, — 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 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 , the free energy is exactly , as the derivation () shows with the internal-energy terms cancelling identically. There is no truncation or limit involved. The catch is entirely practical: computing exactly requires summing over all microstates, which is intractable for interacting many-body systems. So while the relation is exact, the evaluation of is where approximations enter — and that is exactly where the Gibbs–Bogoliubov variational bound and Monte Carlo methods come in. They approximate the intractable (or bound ), but the bridge relation itself is one of the exact cornerstones of statistical mechanics, as rigorous as . When people say "we computed the free energy in the mean-field approximation," they mean they approximated ; the formula 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 with respect to temperature: since , we get , which is negative (because for stability), so is concave in . Take two derivatives with respect to volume: since , we get , which is positive (because ), so is convex in . 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 has one intensive natural variable () and two extensive ones (). The concavity in and convexity in 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 , a straight-ish line whose slope is (steeper for higher-entropy phases). The stable phase at a given temperature is the one with the lowest . 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 via the ordered phase to minimizing it via the disordered phase. This is why ice melts at C (above it, liquid water's higher entropy makes its 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 , 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.