Physics · Article
Partition functions
Normalize a six-state thermal model, then use temperature, field and particle derivatives to generate energy, entropy, fluctuations and responses with their physical controls kept explicit.
Previous article: Microcanonical, canonical, and grand canonical ensembles
Back to PhysicsAfter reading, you can
- Construct a dimensionless partition function from a complete physical state space and include degeneracy exactly once.
- Generate canonical energy, entropy, Helmholtz free energy, heat capacity and fluctuations with correctly held variables.
- Test factorization against interaction and state-space constraints and distinguish a field response from an auxiliary generating variable.
- Build a grand particle-sector sum and distinguish fixed-activity from fixed-chemical-potential derivatives.
- Use stable log weights and state measure, convergence and finite-versus-thermodynamic-limit conditions before interpreting a result.
Six states and one thermometer
Imagine a localized unit in a rigid sample that can occupy six orthogonal internal states. One state has energy 0, two have energy ε, and three have energy 2ε, where ε = 1.00×10⁻²¹ J is an assigned level spacing. The sample is in weak thermal contact with a large equilibrium reservoir at 100 K. Which energy reading is most likely, and how much energy does the unit hold on average?
A higher-energy individual state receives a smaller thermal weight. Yet an energy level can contain several states. The partition function adds all the allowed weights, so that we can normalize probabilities without losing the degeneracy. Its dependence on temperature then tells us much more than normalization: mean energy, entropy and heat capacity come from the same function.
The six alternatives are the complete spectrum of this illustrative finite model. The level spacing and the number of states stay fixed as temperature changes. They are not a measured molecular spectrum or a claim that every real material has only three levels. We assume a canonical equilibrium description; the weights alone do not prove that transitions occur, that all states are accessible, or how long equilibration takes.
Choose a reading path
On a first reading, follow the six-state normalization, the energy and heat-capacity comparison, the entropy and energy-zero checks, and the magnetic example. Then read the short particle-exchange example. The sections marked “Further” give derivative proofs, interaction and measure conditions, stable numerical computation, and the finite-size limit. Return to them after the small cases make sense.
Useful published preparation is “Algebra, functions, graphs, and logarithms” and “Physical systems, states, boundaries, and environments”. The optional “Integrals and multivariable calculus” helps with the advanced derivatives and integrals. We define the probability, temperature and energy notation locally. The adjacent ensemble subject explains why a reservoir produces the equilibrium weights; here the main question is what we can calculate once those weights apply.
Every derivative below names what is held fixed. A derivative compares nearby equilibrium distributions under changed controls. It is not a time derivative or a prediction of a relaxation rate.
Normalize each allowed state
Write kB = 1.380649×10⁻²³ J/K and β = 1/(kB T). Boltzmann’s constant is exact in SI; our energy spacing is an illustrative input. β has units J⁻¹, so βE is dimensionless. At positive temperature T, a canonical state i with energy Eᵢ has weight wᵢ = exp(−βEᵢ). The canonical partition function is Z = Σᵢ wᵢ, summed over the complete allowed fixed-particle-number state space.
The probability is pᵢ = wᵢ/Z. A weight need not lie between zero and one: its value depends on the energy reference. A probability must lie between zero and one, and the probabilities must sum to one. Z itself is dimensionless when the state count or integration measure has been specified consistently.
Let x = βε. For our states a, b1, b2, c1, c2 and c3, the weights are 1, e⁻ˣ, e⁻ˣ, e⁻²ˣ, e⁻²ˣ and e⁻²ˣ. Therefore Z = 1 + 2e⁻ˣ + 3e⁻²ˣ. At 100 K, x ≈ 0.724297 and Z ≈ 2.674031. Divide each individual weight by this one normalizer.
The labels identify orthogonal alternatives, not six copies of the same state. In a quantum description, Z = Tr exp(−βH), where H is the Hamiltonian and Tr means a sum over an orthonormal basis. Diagonalizing H gives the same energy-state sum. General coherent preparations need not be this equilibrium density operator.
| State | Energy / ε | Individual weight | Individual probability |
|---|---|---|---|
| a | 0 | 1.000000000 | 0.373967216 |
| b1 | 1 | 0.484665144 | 0.181248874 |
| b2 | 1 | 0.484665144 | 0.181248874 |
| c1 | 2 | 0.234900302 | 0.087845012 |
| c2 | 2 | 0.234900302 | 0.087845012 |
| c3 | 2 | 0.234900302 | 0.087845012 |
Degeneracy changes an energy reading
Degeneracy gᵣ is the number of distinct allowed states with the same energy εᵣ. Summing over energies instead of individual states gives Z = Σᵣ gᵣ exp(−βεᵣ). The probability of the whole level is Pᵣ = gᵣ exp(−βεᵣ)/Z. The probability of one specified state in that level is exp(−βεᵣ)/Z. These are different questions.
For the three levels, g = 1, 2, 3. Their total weights at 100 K are about 1.000000, 0.969330 and 0.704701. The ground energy is slightly more probable than ε, although there are twice as many states at ε. Degeneracy competes with the Boltzmann suppression; it does not automatically make the highest level most likely.
Predict before changing T: will warming make all three energy readings equally likely? At very high T within this fixed six-state model, all six individual states approach probability 1/6. The three energy probabilities approach 1/6, 2/6 and 3/6. Equal microscopic weights do not imply equal energy-level weights. The first figure compares the unnormalized level weights and their normalized probabilities on separate honest scales.
Include degeneracy exactly once. If you enumerate all six individual states, do not multiply every listed b or c state by its degeneracy again. If a degeneracy changes with a control because levels split, use the actual resolved spectrum rather than a discontinuously relabeled count.
Normalize the complete level weights
Three energy levels collect six individual alternatives at 100 K. Compare the complete weights with the resulting probabilities; their vertical scales have different meanings.
- 0ε: one state, circle
- ε: two states, square
- 2ε: three states, triangle
Total level weights at 100 K
Normalized energy probabilities
- Weight scale 0 to 1.2; true zero
- Probability scale 0 to 1; true zero
- Divide all weights by the same Z = 2.674031193.
- Count degeneracy once; a level probability sums its individual states.
- ε = 1.00×10⁻²¹ J; T = 100 K; fixed six-state spectrum.
- Bar labels show values rounded to three decimals; the complete original table follows.
The complete three-level weight table below is the equivalent for both panels.
Read the values as a table
Complete energy-level weights and probabilities at 100 K; this is the sum of the six-state table, not another microscopic state list.Each panel preserves readable labels; scroll this figure locally on a narrow screen.
| Energy / ε | Degeneracy | Total level weight | Level probability |
|---|---|---|---|
| 0 | 1 | 1.000000000 | 0.373967216 |
| 1 | 2 | 0.969330288 | 0.362497749 |
| 2 | 3 | 0.704700905 | 0.263535035 |
Average energy and thermal response
The mean energy U = ⟨E⟩ is the probability-weighted average Σᵢ pᵢEᵢ. Angle brackets mean an ensemble average. A mean need not be an allowed outcome in one measurement. Here U/ε = P₁ + 2P₂, where P₁ and P₂ are the probabilities of the ε and 2ε levels. At 100 K, U ≈ 0.889568ε = 8.89567820E-22 J.
For a temperature-independent Hamiltonian at fixed volume V, particle number N and other external parameters, U = −(∂ln Z/∂β). Differentiating the sum brings down −Eᵢ; dividing by Z forms the weighted average. A second derivative gives Var(E) = ⟨E²⟩−U² = ∂²ln Z/∂β². The variance is a spread in possible readings, not an uncertainty in the definition of an energy level.
The heat capacity for those same fixed controls is C_(V,N) = (∂U/∂T)_(V,N). Since dβ/dT = −1/(kB T²), C_(V,N) = Var(E)/(kB T²) = kB β²Var(E). At 100 K, Var(E)/ε² ≈ 0.625307 and C_(V,N)/kB ≈ 0.328040. This canonical identity enforces a nonnegative heat capacity for the stated temperature-independent spectrum.
At low T the unique ground state dominates, so there is little thermal energy to redistribute. At intermediate T, changing the populations costs energy and produces a heat-capacity hump. At high T this finite spectrum approaches equal state probabilities and U approaches (4/3)ε; C tends to zero again. The hump is a smooth response of this finite model. It is not by itself evidence of a phase transition.
The temperature plots keep Kelvin on a linear horizontal axis. The energy and heat-capacity panels have separate vertical units and both include their true zero. Their complete sampled tables retain every plotted point; they are different from the shorter comparison below.
Temperature changes populations and thermal response
Mean energy rises toward the finite-spectrum high-temperature limit, while the heat capacity has a smooth hump. The two panels use their own vertical units.
- U / ε: solid cyan, circles
- C / kB: dashed amber, squares
Mean energy per unit
Heat capacity at fixed spectrum
- U / ε → 4/3 as T → ∞ in this model.
- C → 0 at low and high T; the hump is smooth.
- Plotted T = 20 to 1000 K; both vertical scales include zero.
- Fixed V, N and T-independent spectrum; ε = 1.00×10⁻²¹ J.
- C / kB = (βε)² Var(E) / ε²; this is an equilibrium response.
- A finite heat-capacity hump alone is not a phase transition.
- Lines join 99 sampled temperatures in 10 K steps; markers identify every tenth row and the final row. The sampled hump does not identify its exact maximum.
Read all 99 plotted temperatures and both response values in the complete equivalent.
Read the values as a table
Show the complete plotted data table
| T (K) | U / ε | C / kB |
|---|---|---|
| 20.0 | 0.0547321329677 | 0.731845239052 |
| 30.0 | 0.188585512269 | 1.12448190787 |
| 40.0 | 0.346425714877 | 1.11620937343 |
| 50.0 | 0.489728089309 | 0.949204930347 |
| 60.0 | 0.60794733808 | 0.766273552984 |
| 70.0 | 0.702683797499 | 0.611844080521 |
| 80.0 | 0.778461255049 | 0.491147011507 |
| 90.0 | 0.83960834337 | 0.398770374046 |
| 100.0 | 0.889567819587 | 0.328039932925 |
| 110.0 | 0.930928007321 | 0.273394414247 |
| 120.0 | 0.965606426311 | 0.230656685471 |
| 130.0 | 0.995026240279 | 0.196791588391 |
| 140.0 | 1.0202530826 | 0.169609159356 |
| 150.0 | 1.04209425975 | 0.14752261036 |
| 160.0 | 1.06116913149 | 0.12937152751 |
| 170.0 | 1.07795888235 | 0.114297579386 |
| 180.0 | 1.09284190348 | 0.101658133497 |
| 190.0 | 1.10611917717 | 0.0909661795748 |
| 200.0 | 1.11803268969 | 0.0818482756661 |
| 210.0 | 1.12877894314 | 0.0740148332034 |
| 220.0 | 1.13851898703 | 0.0672388951426 |
| 230.0 | 1.14738595114 | 0.0613408095046 |
| 240.0 | 1.15549076439 | 0.0561770361 |
| 250.0 | 1.16292654176 | 0.0516318818737 |
| 260.0 | 1.16977198291 | 0.0476113338427 |
| 270.0 | 1.17609402972 | 0.0440384105058 |
| 280.0 | 1.18194996258 | 0.0408496239607 |
| 290.0 | 1.18738906773 | 0.0379922626364 |
| 300.0 | 1.19245397367 | 0.0354222861563 |
| 310.0 | 1.19718173027 | 0.0331026810208 |
| 320.0 | 1.20160468607 | 0.0310021662374 |
| 330.0 | 1.20575120618 | 0.0290941669207 |
| 340.0 | 1.20964626336 | 0.0273559947119 |
| 350.0 | 1.21331192752 | 0.0257681890252 |
| 360.0 | 1.21676777332 | 0.0243139842481 |
| 370.0 | 1.22003122125 | 0.0229788762597 |
| 380.0 | 1.22311782463 | 0.0217502677636 |
| 390.0 | 1.22604151209 | 0.0206171765561 |
| 400.0 | 1.22881479335 | 0.0195699943388 |
| 410.0 | 1.23144893467 | 0.0186002863538 |
| 420.0 | 1.233954109 | 0.0177006241633 |
| 430.0 | 1.23633952495 | 0.0168644454769 |
| 440.0 | 1.238613538 | 0.016085936159 |
| 450.0 | 1.24078374673 | 0.0153599305069 |
| 460.0 | 1.24285707631 | 0.0146818266476 |
| 470.0 | 1.24483985129 | 0.0140475144987 |
| 480.0 | 1.24673785911 | 0.0134533142103 |
| 490.0 | 1.24855640577 | 0.012895923387 |
| 500.0 | 1.25030036474 | 0.0123723716906 |
| 510.0 | 1.25197422001 | 0.011879981671 |
| 520.0 | 1.25358210416 | 0.0114163348692 |
| 530.0 | 1.25512783204 | 0.0109792423998 |
| 540.0 | 1.25661493062 | 0.0105667193493 |
| 550.0 | 1.25804666562 | 0.0101769624376 |
| 560.0 | 1.2594260652 | 0.00980833047541 |
| 570.0 | 1.2607559411 | 0.0094593272271 |
| 580.0 | 1.26203890762 | 0.00912858634581 |
| 590.0 | 1.26327739861 | 0.00881485810066 |
| 600.0 | 1.26447368274 | 0.00851699765665 |
| 610.0 | 1.26562987727 | 0.00823395470365 |
| 620.0 | 1.26674796041 | 0.00796476426003 |
| 630.0 | 1.26782978258 | 0.00770853850166 |
| 640.0 | 1.26887707652 | 0.00746445948789 |
| 650.0 | 1.26989146648 | 0.00723177267384 |
| 660.0 | 1.27087447659 | 0.00700978111361 |
| 670.0 | 1.27182753842 | 0.00679784027155 |
| 680.0 | 1.27275199789 | 0.00659535337003 |
| 690.0 | 1.27364912159 | 0.00640176721123 |
| 700.0 | 1.27452010253 | 0.00621656841867 |
| 710.0 | 1.27536606538 | 0.00603928005103 |
| 720.0 | 1.27618807131 | 0.00586945854673 |
| 730.0 | 1.27698712239 | 0.00570669096292 |
| 740.0 | 1.27776416563 | 0.00555059247702 |
| 750.0 | 1.27852009674 | 0.00540080412254 |
| 760.0 | 1.27925576354 | 0.00525699073454 |
| 770.0 | 1.27997196908 | 0.00511883908288 |
| 780.0 | 1.2806694746 | 0.00498605617381 |
| 790.0 | 1.2813490022 | 0.00485836770291 |
| 800.0 | 1.2820112373 | 0.00473551664414 |
| 810.0 | 1.28265683097 | 0.0046172619614 |
| 820.0 | 1.28328640202 | 0.00450337743082 |
| 830.0 | 1.283900539 | 0.00439365056277 |
| 840.0 | 1.28449980201 | 0.00428788161434 |
| 850.0 | 1.28508472438 | 0.00418588268353 |
| 860.0 | 1.2856558143 | 0.00408747687759 |
| 870.0 | 1.28621355623 | 0.00399249754867 |
| 880.0 | 1.2867584123 | 0.0039007875906 |
| 890.0 | 1.28729082356 | 0.00381219879135 |
| 900.0 | 1.28781121118 | 0.00372659123606 |
| 910.0 | 1.28831997756 | 0.00364383275632 |
| 920.0 | 1.28881750735 | 0.00356379842158 |
| 930.0 | 1.28930416842 | 0.00348637006904 |
| 940.0 | 1.28978031279 | 0.00341143586879 |
| 950.0 | 1.29024627743 | 0.00333888992114 |
| 960.0 | 1.29070238508 | 0.00326863188354 |
| 970.0 | 1.29114894501 | 0.00320056662448 |
| 980.0 | 1.29158625366 | 0.00313460390241 |
| 990.0 | 1.29201459537 | 0.0030706580673 |
| 1000.0 | 1.29243424293 | 0.00300864778342 |
Each panel preserves readable labels; scroll this figure locally on a narrow screen.
| T (K) | Z | U / ε | Var(E) / ε² | C_(V,N) / kB | S / kB | F / ε |
|---|---|---|---|---|---|---|
| 20 | 1.05563141 | 0.05473213 | 0.05580149 | 0.73184524 | 0.25235069 | -0.01494941 |
| 50 | 1.63533506 | 0.48972809 | 0.45234163 | 0.94920493 | 1.20126493 | -0.33953453 |
| 100 | 2.67403119 | 0.88956782 | 0.62530698 | 0.32803993 | 1.62789849 | -1.35798861 |
| 200 | 3.84635335 | 1.11803269 | 0.62407400 | 0.08184828 | 1.75201941 | -3.71981500 |
| 500 | 4.97570981 | 1.25030036 | 0.58960279 | 0.01237237 | 1.78568581 | -11.07672627 |
| 1000 | 5.45569400 | 1.29243424 | 0.57350593 | 0.00300865 | 1.79027047 | -23.42491703 |
Entropy and Helmholtz free energy
For the normalized physical microstate probabilities, Gibbs entropy is S = −kB Σᵢ pᵢ ln pᵢ. These logarithms are natural. Substituting ln pᵢ = −βEᵢ−ln Z gives S = kB(ln Z+βU). The result includes the entropy within a degenerate energy level because the sum is over the actual microstates.
Helmholtz free energy is F = U−TS = −kB T ln Z. It is the equilibrium thermodynamic potential for fixed T, V and N. At fixed N, dF = −S dT−p dV for ordinary pressure-volume work; any additional field and its conjugate force must also be included. Thus S = −(∂F/∂T)_(V,N) and p = −(∂F/∂V)_(T,N) when the model includes the corresponding volume dependence.
At 100 K our unit has S/kB ≈ 1.627898 and F/ε ≈ -1.357989. Using only the three level probabilities in −Σᵣ Pᵣ ln Pᵣ would miss Σᵣ Pᵣ ln gᵣ, the entropy of the alternatives within each level. Energy measurements do not resolve that internal label, but the partition function still counts it.
“Free” does not mean all of U can be converted to work in every process. For an isothermal process with the appropriate environment and work conventions, a decrease in F bounds the available non-expansion work under the corresponding constraints. An energy-reference change also shifts F, so its absolute sign is not a universal stability test. The thermodynamic-potentials subject develops the work and equilibrium criteria in detail.
Shift the energy zero consistently
Suppose every state in this fixed six-state model is assigned Eᵢ′ = Eᵢ+c, with c = 5ε independent of T and all external controls. Every weight gains the same factor e⁻ᵝᶜ. Hence Z′ = e⁻ᵝᶜZ, but pᵢ′ = pᵢ. Absolute Z changes even though every prediction for the relative populations stays the same.
The derivative formulas give U′ = U+c and F′ = F+c, while S′ = S and C′ = C. Energy differences, variances and forces are unchanged for this common constant shift. With the original zero at the ground state, Z ≥ 1 and F ≤ 0; shifting the zero can remove both inequalities. They were reference-dependent facts, not general requirements on a partition function.
Keep the scope of “constant” explicit. If c depends on a field or volume, its derivative changes the associated force. If an effective spectrum depends on temperature, differentiating it adds extra terms. If the shift is c per particle in a grand ensemble, it is cN rather than a common state-independent constant: the chemical-potential reference must shift by c as well to preserve the same probabilities.
| Quantity | Original | After Eᵢ → Eᵢ+5ε |
|---|---|---|
| Z | 2.674031193 | exp(−5βε)Z |
| U / ε | 0.889567820 | 5.889567820 |
| F / ε | -1.357988606 | 3.642011394 |
| S / kB; C / kB | 1.627898493; 0.328039933 | Same as original |
Further: what the derivatives generate
For fixed energy values, ∂Z/∂β = −Σᵢ Eᵢe⁻ᵝᴱⁱ, so ∂ln Z/∂β = −U. Differentiating again gives (ZΣᵢ Eᵢ²e⁻ᵝᴱⁱ−[Σᵢ Eᵢe⁻ᵝᴱⁱ]²)/Z² = ⟨E²⟩−U². The subtraction removes the square of the mean, which is why derivatives of ln Z generate connected moments or cumulants rather than just raw moments.
The same idea can generate an observable A without confusing it with energy. For a specified classical or commuting observable, define Z_A(t) = Σᵢ exp(−βEᵢ+tAᵢ), with tA dimensionless. Then (∂ln Z_A/∂t) at t=0 is ⟨A⟩ and its second derivative is Var(A). This auxiliary t need not be an experimentally tunable field. A physical response requires knowing how the Hamiltonian actually changes.
If a diagonal energy Eᵢ(λ) depends on a physical control λ, define its conjugate generalized force Xᵢ = −∂Eᵢ/∂λ. At fixed T, ∂F/∂λ = −⟨X⟩. Differentiating the normalized probabilities gives ∂⟨X⟩/∂λ = βVar(X)−⟨∂²E/∂λ²⟩. The pure variance formula requires a linear coupling Eᵢ = Eᵢ⁰−λXᵢ with Xᵢ independent of λ.
These finite-state derivatives hold with the state space and measure fixed. The simple equal-time variance expression is for classical variables or a commuting/diagonal quantum family. For noncommuting quantum operators, response involves the appropriate operator correlations; replacing every classical product by an operator product is not a derivation.
Temperature dependence also matters. If a reduced effective H itself depends on β, then −∂ln Z/∂β generates ⟨H+β∂H/∂β⟩, not simply ⟨H⟩. Such models can arise after eliminating environment degrees of freedom and require a consistent definition of physical energy and entropy. For the numerical examples here, H and the state measure are independent of T, so this extra term is absent.
| Generating function | Derivative | Generated quantity | Held fixed / condition |
|---|---|---|---|
| ln Z | −∂β | Mean energy U | N, V, other Hamiltonian parameters; no explicit T dependence |
| ln Z | ∂β² | Energy variance | Same fixed spectrum and measure |
| F = −kB T ln Z | −∂T | Entropy S | N, V, other external controls |
| F | −∂λ | Mean generalized force | T, N, other controls; actual E(λ) |
| ln Z_A(t) | ∂t and ∂t² at t=0 | Mean A and variance of A | Auxiliary commuting/classical observable; tA dimensionless |
A field derivative measures a moment
Take a separate localized binary magnetic unit σ = ±1. Its assigned moment magnitude is m₀ = 1.00×10⁻²³ J/T and its energy is Eσ = −m₀Bσ in magnetic field B, measured in tesla. The symbol m₀ is a magnetic moment, not chemical potential. This simple diagonal model has Z_B = eᵝᵐ⁰ᴮ+e⁻ᵝᵐ⁰ᴮ = 2 cosh y, where y = βm₀B.
The mean moment is M = −(∂F/∂B)_T = m₀ tanh y. Here tanh y = [exp(y)−exp(−y)]/[exp(y)+exp(−y)]. A positive field favors σ=+1, which has lower energy; reversing B reverses M. At B=0 the two states are equally weighted and M=0, but the individual moment still has values ±m₀. A zero mean does not mean zero fluctuation.
The susceptibility to B is χ_B = (∂M/∂B)_T = βm₀² sech²y. Here sech y = 1/cosh y. The moment variance is m₀² sech²y, so χ_B = βVar(m) for this linear coupling. The units of χ_B are J/T². This is the response to our specified B, with no change of variable to a different magnetic field convention.
The plot compares M/m₀ at 1 K and 2 K with a signed vertical axis from −1 to 1 and a field axis from −2 to 2 T. The warmer curve is less polarized at the same nonzero field. Saturation is approached smoothly; no finite field makes one state mathematically impossible. Circle/solid and square/dashed styles distinguish the temperatures as well as color.
A field derivative generates a magnetic moment
Compare the same assigned binary magnetic unit at 1 K and 2 K. Reversing the field reverses the mean moment; a warmer unit is less polarized.
- 1 K: solid cyan, circles
- 2 K: dashed amber, squares
Mean moment in the binary magnetic model
- At B = 0, M = 0 while Var(m) = m₀².
- Signed vertical scale −1 to 1; saturation is approached, not reached at finite B.
- Eσ = −m₀Bσ; σ = ±1; m₀ = 1.00×10⁻²³ J/T.
- M = −(∂F/∂B)T; χB = β Var(m) for this linear coupling.
- The moment and state space are fixed; the derivative holds T fixed.
- Lines join all 101 sampled fields in 0.04 T steps; markers identify every tenth row and the final row.
Read all 101 fields and both temperature curves in the complete equivalent.
Read the values as a table
Show the complete plotted data table
| B (T) | M / m₀ at 1 K | M / m₀ at 2 K |
|---|---|---|
| -2 | -0.895414529537 | -0.619563941598 |
| -1.96 | -0.889520088078 | -0.610558371541 |
| -1.92 | -0.883313887331 | -0.60139209157 |
| -1.88 | -0.876781788553 | -0.592064711083 |
| -1.84 | -0.869909280952 | -0.582575963205 |
| -1.8 | -0.862681504571 | -0.572925709507 |
| -1.76 | -0.855083278028 | -0.56311394465 |
| -1.72 | -0.847099131533 | -0.553140800926 |
| -1.68 | -0.838713345605 | -0.543006552662 |
| -1.64 | -0.829909995905 | -0.532711620504 |
| -1.6 | -0.820673004584 | -0.522256575516 |
| -1.56 | -0.810986198548 | -0.511642143118 |
| -1.52 | -0.800833374993 | -0.500869206802 |
| -1.48 | -0.790198374518 | -0.489938811636 |
| -1.44 | -0.779065162107 | -0.478852167524 |
| -1.4 | -0.767417916147 | -0.467610652191 |
| -1.36 | -0.755241125641 | -0.456215813897 |
| -1.32 | -0.742519695601 | -0.444669373827 |
| -1.28 | -0.729239060569 | -0.432973228174 |
| -1.24 | -0.715385306018 | -0.421129449864 |
| -1.2 | -0.700945297286 | -0.409140289923 |
| -1.16 | -0.685906815517 | -0.397008178461 |
| -1.12 | -0.670258699897 | -0.384735725259 |
| -1.08 | -0.653990995287 | -0.372325719944 |
| -1.04 | -0.637095104173 | -0.359781131732 |
| -1 | -0.619563941598 | -0.347105108731 |
| -0.96 | -0.60139209157 | -0.3343009768 |
| -0.92 | -0.582575963205 | -0.321372237932 |
| -0.88 | -0.56311394465 | -0.308322568177 |
| -0.84 | -0.543006552662 | -0.295155815086 |
| -0.8 | -0.522256575516 | -0.281875994678 |
| -0.76 | -0.500869206802 | -0.268487287914 |
| -0.72 | -0.478852167524 | -0.254994036705 |
| -0.68 | -0.456215813897 | -0.241400739427 |
| -0.64 | -0.432973228174 | -0.227712045968 |
| -0.6 | -0.409140289923 | -0.213932752305 |
| -0.56 | -0.384735725259 | -0.200067794622 |
| -0.52 | -0.359781131732 | -0.186122242984 |
| -0.48 | -0.3343009768 | -0.172101294579 |
| -0.44 | -0.308322568177 | -0.158010266534 |
| -0.4 | -0.281875994678 | -0.143854588352 |
| -0.36 | -0.254994036705 | -0.129639793954 |
| -0.32 | -0.227712045968 | -0.115371513381 |
| -0.28 | -0.200067794622 | -0.101055464161 |
| -0.24 | -0.172101294579 | -0.0866974423773 |
| -0.2 | -0.143854588352 | -0.0723033134647 |
| -0.16 | -0.115371513381 | -0.0578790027617 |
| -0.12 | -0.0866974423773 | -0.0434304858544 |
| -0.08 | -0.0578790027617 | -0.0289637787424 |
| -0.04 | -0.0289637787424 | -0.0144849278618 |
| 0 | 0 | 0 |
| 0.04 | 0.0289637787424 | 0.0144849278618 |
| 0.08 | 0.0578790027617 | 0.0289637787424 |
| 0.12 | 0.0866974423773 | 0.0434304858544 |
| 0.16 | 0.115371513381 | 0.0578790027617 |
| 0.2 | 0.143854588352 | 0.0723033134647 |
| 0.24 | 0.172101294579 | 0.0866974423773 |
| 0.28 | 0.200067794622 | 0.101055464161 |
| 0.32 | 0.227712045968 | 0.115371513381 |
| 0.36 | 0.254994036705 | 0.129639793954 |
| 0.4 | 0.281875994678 | 0.143854588352 |
| 0.44 | 0.308322568177 | 0.158010266534 |
| 0.48 | 0.3343009768 | 0.172101294579 |
| 0.52 | 0.359781131732 | 0.186122242984 |
| 0.56 | 0.384735725259 | 0.200067794622 |
| 0.6 | 0.409140289923 | 0.213932752305 |
| 0.64 | 0.432973228174 | 0.227712045968 |
| 0.68 | 0.456215813897 | 0.241400739427 |
| 0.72 | 0.478852167524 | 0.254994036705 |
| 0.76 | 0.500869206802 | 0.268487287914 |
| 0.8 | 0.522256575516 | 0.281875994678 |
| 0.84 | 0.543006552662 | 0.295155815086 |
| 0.88 | 0.56311394465 | 0.308322568177 |
| 0.92 | 0.582575963205 | 0.321372237932 |
| 0.96 | 0.60139209157 | 0.3343009768 |
| 1 | 0.619563941598 | 0.347105108731 |
| 1.04 | 0.637095104173 | 0.359781131732 |
| 1.08 | 0.653990995287 | 0.372325719944 |
| 1.12 | 0.670258699897 | 0.384735725259 |
| 1.16 | 0.685906815517 | 0.397008178461 |
| 1.2 | 0.700945297286 | 0.409140289923 |
| 1.24 | 0.715385306018 | 0.421129449864 |
| 1.28 | 0.729239060569 | 0.432973228174 |
| 1.32 | 0.742519695601 | 0.444669373827 |
| 1.36 | 0.755241125641 | 0.456215813897 |
| 1.4 | 0.767417916147 | 0.467610652191 |
| 1.44 | 0.779065162107 | 0.478852167524 |
| 1.48 | 0.790198374518 | 0.489938811636 |
| 1.52 | 0.800833374993 | 0.500869206802 |
| 1.56 | 0.810986198548 | 0.511642143118 |
| 1.6 | 0.820673004584 | 0.522256575516 |
| 1.64 | 0.829909995905 | 0.532711620504 |
| 1.68 | 0.838713345605 | 0.543006552662 |
| 1.72 | 0.847099131533 | 0.553140800926 |
| 1.76 | 0.855083278028 | 0.56311394465 |
| 1.8 | 0.862681504571 | 0.572925709507 |
| 1.84 | 0.869909280952 | 0.582575963205 |
| 1.88 | 0.876781788553 | 0.592064711083 |
| 1.92 | 0.883313887331 | 0.60139209157 |
| 1.96 | 0.889520088078 | 0.610558371541 |
| 2 | 0.895414529537 | 0.619563941598 |
Each panel preserves readable labels; scroll this figure locally on a narrow screen.
| B (T) | M / m₀ at 1 K | M / m₀ at 2 K |
|---|---|---|
| -2 | -0.895414530 | -0.619563942 |
| -1 | -0.619563942 | -0.347105109 |
| -0.5 | -0.347105109 | -0.179120864 |
| 0 | 0.000000000 | 0.000000000 |
| 0.5 | 0.347105109 | 0.179120864 |
| 1 | 0.619563942 | 0.347105109 |
| 2 | 0.895414530 | 0.619563942 |
Further: factorization has conditions
For two distinguishable subsystems with a Cartesian-product allowed state space and additive energy Eᵢⱼ = Eᵢᴬ+Eⱼᴮ, Z_AB = Σᵢⱼ e⁻ᵝᴱⁱᴬe⁻ᵝᴱʲᴮ = Z_AZ_B. Their canonical probabilities factor too. Therefore ln Z, F, U and S add, and independent energy variances add. For L identical independent localized units, Z_total = Z_unitᴸ; we use L for their count to avoid confusing it with a fluctuating particle number.
Both hypotheses matter. A fixed total excitation count restricts compatible pairs and destroys the unrestricted product sum, even when the energy is additive. A fixed-total-energy microcanonical count instead sums compatible products over energy divisions. An interaction energy can also prevent factorization even when all product labels remain available.
For a small counterexample, take two binary localized units with E = −h(σ₁+σ₂)−Jσ₁σ₂. The controls h and J have units of energy. Enumerating the four alternatives gives Z_pair = 2eᵝᴶ cosh(2βh)+2e⁻ᵝᴶ. At J=0 this becomes [2 cosh(βh)]². At h=0 but J≠0, Z_pair = 4 cosh(βJ), which differs from the product 4 for two uncoupled zero-field units.
At T=100 K, h=0 and J=0.5ε, the aligned alternatives each have probability about 0.336776 and the opposite alternatives each have probability 0.163224. Both single-unit marginals remain 1/2, but ⟨σ₁σ₂⟩ = tanh(βJ) ≈ 0.347105 is nonzero. Equal marginals do not establish independence.
Factorization across physically distinct modes can be useful, but identical mobile particles require their correct many-particle state space. An arbitrary extra N! division or multiplication is not justified by the word “independent”. Classical gas integration and Bose/Fermi occupation rules have their own later subjects.
| (σ₁, σ₂) | E / ε | Weight | Probability |
|---|---|---|---|
| (1, 1) | -0.5 | 1.436412270 | 0.336776277 |
| (1, -1) | 0.5 | 0.696178960 | 0.163223723 |
| (-1, 1) | 0.5 | 0.696178960 | 0.163223723 |
| (-1, -1) | -0.5 | 1.436412270 | 0.336776277 |
Choose the right partition function
The canonical Z_N normalizes a fixed-N state space at specified T and V. A microcanonical shell count Ω(E,V,N;δE) instead counts states in a specified energy shell; it is not the same object as Z_N. An inverse-energy density of states ω(E) can be integrated as Z_N = ∫ω(E)e⁻ᵝᴱ dE when the measure and the continuous approximation are appropriate. If a discrete shell contains g states, summing them directly avoids an arbitrary shell-width factor.
For energy and particle exchange, define the activity or fugacity z = exp(βμ_c), where μ_c is the chemical potential in joules per particle. The grand partition function is Ξ(T,V,μ_c) = Σ_N zᴺ Z_N(T,V). Each Z_N uses the physical state count for that sector. A sum over sectors is not a partition function evaluated at the mean N.
The grand potential is Ω_G = −kB T ln Ξ. This symbol Ω_G denotes a thermodynamic potential, while Ω(E,V,N;δE) above denotes a count. Their roles and units differ. With ordinary volume work, dΩ_G = −S dT−p dV−⟨N⟩dμ_c. Only under the additional homogeneous extensive thermodynamic assumptions can one replace Ω_G by −pV; the finite adsorption cell below is not being assigned a bulk pressure equation.
Other controls require other normalizers. A pressure reservoir permits volume exchange and introduces an E+pV weight with a specified volume measure. Multiple species introduce exp[βΣ_a μ_a N_a] and the allowed joint sectors. Charge, reaction and conservation constraints must be applied rather than summing every number independently. The ensemble subject develops those boundary choices.
| Object | Definition or weight | What is specified |
|---|---|---|
| Microcanonical count Ω | Number or normalized measure in the stated energy shell | E or shell, V, N; any extra exact constraints |
| Canonical Z_N | Σ fixed-N states exp(−βEᵢ) | T, V, N and other external controls |
| Grand Ξ | Σ_N exp(βμ_c N) Z_N | T, V, μ_c; all physically allowed number sectors |
A particle-sector generating function
Consider one adsorption cell of fixed volume. It may be empty, with one state of energy 0, or hold one particle in any of three orthogonal internal states, all of energy ε. Capacity zero or one is an imposed cell constraint, not a deduction of Bose or Fermi statistics. There are four complete states, and no N≥2 sector is allowed.
The canonical sector functions are Z₀ = 1, Z₁ = 3e⁻ᵝᵋ and Z_N = 0 for N≥2. Thus Ξ = 1+3eᵝ⁽ᵘᶜ⁻ᵋ⁾. Let q = 3exp[β(μ_c−ε)] denote the total occupied weight. The occupation probability is f = q/(1+q), so ⟨N⟩=f and Var(N)=f(1−f). The empty probability is 1−f; each individual occupied alternative has probability f/3.
At T=100 K and μ_c=ε, q=3 and Ξ=4. All four individual states then have probability 1/4, yet the total occupation probability is 3/4. Setting the chemical potential equal to the occupied energy does not give a half-filled cell when the occupied sector has degeneracy three. Half filling occurs at μ_c = ε−kB T ln 3.
Differentiating at fixed T and V gives ⟨N⟩ = (1/β)∂ln Ξ/∂μ_c = z∂ln Ξ/∂z and Var(N) = (1/β²)∂²ln Ξ/∂μ_c². Consequently ∂⟨N⟩/∂μ_c = βVar(N). At the central example the variance is 3/16, although the instantaneous number is only 0 or 1. The chemical-potential plot shows this smooth change of weights and marks the central 3/4 value.
The cell saturates at one particle as μ_c increases because its capacity was built into the model. The limit is not a universal open-system law. A sector with arbitrarily many particles has a different sum and may restrict the allowed chemical potentials for convergence.
Generate an occupation from number sectors
One empty alternative competes with three degenerate occupied alternatives. Increasing chemical potential changes the weights; capacity one is an explicit model constraint.
- ⟨N⟩ = q / (1+q): solid green, circles
Occupation of one finite-capacity adsorption cell
- μc = ε: three occupied states give ⟨N⟩ = 3/4.
- Half occupation occurs at μc = ε − kB T ln 3.
- Ξ = Z₀ + z Z₁ = 1 + 3 exp[β(μc−ε)].
- Var(N) = f(1−f); ∂⟨N⟩/∂μc = β Var(N).
- T = 100 K; fixed ε = 1.00×10⁻²¹ J; capacity N = 0 or 1.
- True-zero occupation scale 0 to 1; no negative or extra particle sectors.
- The line joins all 101 sampled chemical potentials in steps of 0.04ε; markers identify every tenth row and the final row. The diamond marks μc = ε.
Read all 101 plotted chemical potentials, occupations and number variances.
Read the values as a table
Show the complete plotted data table
| μc / ε | Mean ⟨N⟩ | Variance Var(N) |
|---|---|---|
| -1 | 0.413386831016 | 0.242498158959 |
| -0.96 | 0.420429639305 | 0.243668557699 |
| -0.92 | 0.427504991958 | 0.244744473809 |
| -0.88 | 0.434610126042 | 0.245724164384 |
| -0.84 | 0.441742230228 | 0.246606032261 |
| -0.8 | 0.448898449091 | 0.247388631495 |
| -0.76 | 0.456075887566 | 0.248070672347 |
| -0.72 | 0.463271615538 | 0.248651025775 |
| -0.68 | 0.470482672561 | 0.249128727381 |
| -0.64 | 0.477706072671 | 0.249502980804 |
| -0.6 | 0.484938809304 | 0.249773160535 |
| -0.56 | 0.492177860274 | 0.24993881413 |
| -0.52 | 0.499420192817 | 0.249999663824 |
| -0.48 | 0.506662768662 | 0.249955607514 |
| -0.44 | 0.513902549131 | 0.249806719128 |
| -0.4 | 0.521136500234 | 0.249553248358 |
| -0.36 | 0.528361597753 | 0.249195619773 |
| -0.32 | 0.535574832285 | 0.248734431308 |
| -0.28 | 0.542773214237 | 0.248170452144 |
| -0.24 | 0.54995377875 | 0.247504619989 |
| -0.2 | 0.557113590533 | 0.246738037776 |
| -0.16 | 0.564249748598 | 0.245871969805 |
| -0.12 | 0.571359390871 | 0.244907837335 |
| -0.08 | 0.578439698667 | 0.243847213673 |
| -0.04 | 0.585487901024 | 0.242691818778 |
| 0 | 0.592501278863 | 0.241443513409 |
| 0.04 | 0.599477168979 | 0.240104292852 |
| 0.08 | 0.606412967845 | 0.238676280274 |
| 0.12 | 0.613306135211 | 0.237161719724 |
| 0.16 | 0.620154197508 | 0.235562968821 |
| 0.2 | 0.626954751023 | 0.233882491193 |
| 0.24 | 0.633705464863 | 0.232122848666 |
| 0.28 | 0.640404083681 | 0.230286693286 |
| 0.32 | 0.647048430174 | 0.228376759183 |
| 0.36 | 0.653636407341 | 0.226395854339 |
| 0.4 | 0.660166000505 | 0.224346852282 |
| 0.44 | 0.666635279086 | 0.222232683764 |
| 0.48 | 0.673042398145 | 0.220056328444 |
| 0.52 | 0.679385599677 | 0.217820806628 |
| 0.56 | 0.685663213672 | 0.215529171089 |
| 0.6 | 0.691873658935 | 0.213184499007 |
| 0.64 | 0.698015443682 | 0.210789884063 |
| 0.68 | 0.704087165906 | 0.208348428713 |
| 0.72 | 0.710087513516 | 0.205863236665 |
| 0.76 | 0.716015264275 | 0.2033374056 |
| 0.8 | 0.721869285517 | 0.200774020144 |
| 0.84 | 0.727648533674 | 0.198176145116 |
| 0.88 | 0.733352053604 | 0.195546819079 |
| 0.92 | 0.738978977747 | 0.192889048195 |
| 0.96 | 0.744528525092 | 0.190205800416 |
| 1 | 0.75 | 0.1875 |
| 1.04 | 0.755392790855 | 0.184774522379 |
| 1.08 | 0.760706368583 | 0.18203218938 |
| 1.12 | 0.765940285034 | 0.179275764796 |
| 1.16 | 0.771094171238 | 0.176507950321 |
| 1.2 | 0.776167735556 | 0.173731381838 |
| 1.24 | 0.78116076172 | 0.170948626069 |
| 1.28 | 0.786073106785 | 0.168162177574 |
| 1.32 | 0.790904699004 | 0.165374456098 |
| 1.36 | 0.795655535618 | 0.162587804259 |
| 1.4 | 0.800325680599 | 0.159804485573 |
| 1.44 | 0.804915262331 | 0.157026682797 |
| 1.48 | 0.809424471251 | 0.154256496591 |
| 1.52 | 0.813853557451 | 0.151495944475 |
| 1.56 | 0.818202828264 | 0.148746960085 |
| 1.6 | 0.822472645821 | 0.146011392697 |
| 1.64 | 0.826663424604 | 0.143291007026 |
| 1.68 | 0.830775629001 | 0.140587483259 |
| 1.72 | 0.834809770853 | 0.137902417341 |
| 1.76 | 0.838766407027 | 0.13523732147 |
| 1.8 | 0.842646136995 | 0.132593624802 |
| 1.84 | 0.846449600441 | 0.129972674354 |
| 1.88 | 0.850177474899 | 0.127375736073 |
| 1.92 | 0.85383047342 | 0.124803996079 |
| 1.96 | 0.857409342279 | 0.122258562051 |
| 2 | 0.860914858725 | 0.119740464751 |
| 2.04 | 0.864347828775 | 0.117250659667 |
| 2.08 | 0.86770908506 | 0.114790028765 |
| 2.12 | 0.870999484718 | 0.112359382339 |
| 2.16 | 0.87421990735 | 0.109959460943 |
| 2.2 | 0.877371253026 | 0.10759093739 |
| 2.24 | 0.88045444035 | 0.105254418818 |
| 2.28 | 0.883470404594 | 0.102950448801 |
| 2.32 | 0.886420095879 | 0.100679509501 |
| 2.36 | 0.889304477435 | 0.0984420238491 |
| 2.4 | 0.892124523912 | 0.0962383577466 |
| 2.44 | 0.894881219763 | 0.0940688222786 |
| 2.48 | 0.897575557684 | 0.091933675932 |
| 2.52 | 0.900208537128 | 0.0898331268102 |
| 2.56 | 0.90278116287 | 0.0877673348372 |
| 2.6 | 0.90529444365 | 0.0857364139464 |
| 2.64 | 0.907749390868 | 0.0837404342471 |
| 2.68 | 0.910147017345 | 0.0817794241633 |
| 2.72 | 0.912488336148 | 0.0798533725418 |
| 2.76 | 0.914774359474 | 0.0779622307232 |
| 2.8 | 0.917006097589 | 0.076105914574 |
| 2.84 | 0.919184557833 | 0.0742843064748 |
| 2.88 | 0.921310743676 | 0.072497257263 |
| 2.92 | 0.923385653835 | 0.0707445881269 |
| 2.96 | 0.925410281436 | 0.069026092449 |
| 3 | 0.927385613239 | 0.0673415375966 |
Each panel preserves readable labels; scroll this figure locally on a narrow screen.
| μ_c / ε | Ξ | Mean occupation ⟨N⟩ | Variance Var(N) | U / ε | Ω_G / ε |
|---|---|---|---|---|---|
| -1 | 1.70470090 | 0.41338683 | 0.24249816 | 0.41338683 | -0.73642392 |
| 0 | 2.45399543 | 0.59250128 | 0.24144351 | 0.59250128 | -1.23943275 |
| 0.5 | 3.08853688 | 0.67622210 | 0.21894577 | 0.67622210 | -1.55695439 |
| 1 | 4.00000000 | 0.75000000 | 0.18750000 | 0.75000000 | -1.91398592 |
| 1.5 | 5.30923681 | 0.81164901 | 0.15287489 | 0.81164901 | -2.30492185 |
| 2 | 7.18984063 | 0.86091486 | 0.11974046 | 0.86091486 | -2.72356349 |
| 3 | 13.77137568 | 0.92738561 | 0.06734154 | 0.92738561 | -3.62087931 |
Further: grand derivatives and the chemical reference
At fixed μ_c, the exponent is −β(E−μ_cN). Therefore −(∂ln Ξ/∂β)_μc = ⟨E−μ_cN⟩, not U alone. Recover U by adding μ_c⟨N⟩. At fixed z instead, the factors zᴺ are constant during differentiation and −(∂ln Ξ/∂β)_z = U. Holding z fixed as T changes requires μ_c = kB T ln z to change; these are different paths through the controls.
For the four-state cell at μ_c=ε, the fixed-μ_c derivative is zero because E−μ_cN=0 in every state. The mean energy is nevertheless U=(3/4)ε. This is a compact check on what the derivative actually generates. Its entropy is S = kB[ln Ξ+β(U−μ_c⟨N⟩)] = kB ln 4 at this point, consistent with the four equal probabilities.
The grand heat response at fixed μ_c is also not the canonical variance formula with a new label. With a T-independent spectrum and number assignment, (∂U/∂T)_μc,V = [Var(E)−μ_c Cov(E,N)]/(kB T²). Here Cov(E,N) = ⟨EN⟩−U⟨N⟩. A changing particle population contributes to the energy response. The later fluctuation-and-response subject develops coupled derivatives systematically.
Chemical potential can also be read from fixed-N free energies. For a large smooth system, μ_c=(∂F/∂N)_T,V; for a small discrete cell, use the finite addition difference F₁−F₀ = ε−kB T ln 3. Matching the reservoir μ_c to that difference makes the two number sectors equally probable. It does not make each microscopic alternative equally probable. A reference shift c per particle changes both this addition free energy and μ_c by c.
Our chemical-potential formulas assume conserved particle-number sectors compatible with the equilibrium model. In a quantum description the familiar joint energy-number trace uses [H,N]=0. If reactions or exchange permit only certain combinations of species numbers, retain those sector constraints and the corresponding chemical or electrochemical potentials.
Further: measures, infinite sums and cutoffs
A discrete quantum trace counts each orthogonal state once. A classical phase-space integral instead needs a physical dimensionless measure: Z = ∫exp[−βH(Γ)]dν(Γ). The symbol Γ denotes the chosen phase-space coordinates and dν the specified measure. A raw integral with units cannot be inserted into ln Z without its reference convention.
For suitable dilute identical-particle gas models, the semiclassical measure includes the appropriate powers of Planck’s constant and the particle-label correction. Those factors must follow the physical state counting; they are not universal decorations for a lattice or adsorption-site list. The multiplicity subject explains the measure distinction, and “Classical ideal gases” develops its gas application.
An infinite state space must give a finite partition function at the controls used. For example, one fixed distinguished harmonic mode with excitation energies nε, n=0,1,…, has Z = Σ_n e⁻ᵝⁿᵋ = 1/(1−e⁻ᵝᵋ) at βε>0, after choosing zero at the ground excitation energy. If a physical zero-point energy ε/2 is retained, multiply Z by e⁻ᵝᵋ⁄² and shift U and F accordingly. This is one mode, not an identical-particle gas.
A numerical cutoff n≤K replaces that exact sum by Z_K = [1−r^(K+1)]/(1−r), with r=e⁻ᵝᵋ. The omitted partition weight is r^(K+1)/(1−r), and its fraction of the full Z is r^(K+1). A small missing normalization fraction does not automatically bound every high-energy moment: an observable growing with n needs its own tail bound. State the cutoff and check convergence of the requested quantity.
Differentiating an infinite sum or integral also requires enough convergence to exchange differentiation and summation/integration. A finite number of particles need not mean a finite number of energy levels. Conversely, our finite six-state and four-state examples converge for every finite positive T and every finite assigned field or chemical potential.
Further: compute with log weights
Partition functions can be enormous or tiny even when all normalized probabilities are well behaved. For level weights, use ℓᵣ = ln gᵣ−βεᵣ, m = maxᵣ ℓᵣ and ln Z = m+ln Σᵣ exp(ℓᵣ−m). The largest shifted exponential is one and the others are at most one. The normalized level probability is exp(ℓᵣ−m)/Σ_s exp(ℓ_s−m). This real maximum shift is the log-sum-exp method.
As a numerical stress test, lower the six-state unit to 1 K and add the same offset 1000ε to every state. Its log weights are finite, but direct binary64 exponentials underflow to zero for all three levels, producing a useless zero normalizer. The shifted calculation gives ln Z ≈ -72429.705160399. The offset cancels from the probabilities, just as the energy-zero argument predicts.
The excited-level probabilities at 1 K remain positive: about 7.001784E-32 and 3.676874E-63. A display rounded to zero would not make those states forbidden. This example distinguishes a numerical underflow from a physical exclusion. No logarithmic graph is used to disguise a zero or clip a tail.
Shifting improves the range of a computation; it does not make finite-precision arithmetic exact. Very small contributions can still be lost when added to one, and subtracting nearly equal raw moments can lose variance accuracy. Compute variances from centered differences when useful, retain log probabilities for extreme tails, and check precision or tail bounds for the observable of interest. The comparison tables show rounded values; the complete curve tables retain every plotted sample.
Further: finite models and thermodynamic limits
For a finite fixed spectrum with smoothly analytic energy dependence on controls, Z is a finite sum of positive analytic Boltzmann terms at T>0. It cannot vanish on the physical real-temperature domain. Thus ln Z and the derivatives used here are smooth there. A sharp-looking finite heat-capacity hump or rapid occupation crossover is not a genuine nonanalytic phase transition.
A thermodynamic limit concerns a specified growing family, often N,V→∞ at fixed density for suitable stable interactions. One studies an intensive quantity such as f = lim F_N/N or lim (ln Z_N)/N. A limit of analytic finite-size functions need not remain analytic; limits and derivatives may fail to commute. Existence of the limit and its physical constraints must be established, not inferred from a large number.
For L independent copies of our six-state unit, Z_L=Z_unitᴸ and F_L/L=F_unit exactly. Taking L→∞ does not create a transition in this model. Interactions and competing collective states can make a different limit singular, but neither a large power nor an entropy-energy competition alone guarantees it. Phase transitions and critical phenomena have later primary homes.
The zero-temperature endpoint is a separate limit. Our unique ground state gives U→0 and S→0 as T→0⁺. A strictly degenerate g₀-dimensional ground subspace under the equal-weight canonical limit instead gives residual S→kB ln g₀; lifting the degeneracy or changing the preparation can change that conclusion. Do not extend a positive-temperature derivative through T=0 or claim a universal residual entropy from an incomplete level model.
Use the generator with a physical question
A partition function packages a specified state space and equilibrium weighting rule. Start by identifying the sample, spectrum, degeneracies, measure and controls. Normalize before comparing events. Generate the desired mean, fluctuation or conjugate response with a derivative whose held variables match the experiment or model.
For a spectroscopic few-level sample, the level spectrum predicts population and thermal-response trends within its validity range. For an adsorbing cell, the grand sector sum predicts how chemical potential changes occupation. In either application, interactions, missing levels, reservoir conditions and actual measurement dynamics can limit the model before the algebra becomes difficult.
The adjacent ensemble subject supplies the reservoir and equivalence arguments. “Classical ideal gases” and “Bose–Einstein and Fermi–Dirac statistics” develop different many-particle state spaces. “Fluctuations and response functions”, “Phase transitions and order parameters”, and “Critical phenomena, scaling, and renormalization” extend the response and limit questions. Their permanent map topics remain the follow-on path until actual English articles are available.
Worked examples
Normalize once, sum the right event
At 100 K, what are the probability of state b1 and the probability of energy ε?
- Use x=ε/(kB T)≈0.724297 and the full sum Z=1+2e⁻ˣ+3e⁻²ˣ≈2.674031.
- State b1 has weight e⁻ˣ≈0.484665. Dividing by Z gives p(b1)≈0.181249.
- The energy ε event contains b1 and b2. Add their equal probabilities, or use the total level weight 2e⁻ˣ.
p(b1)≈0.181249, while P(E=ε)≈0.362498. Degeneracy is included once.
Find a mean that is not a level
Find U at 100 K from the three level probabilities.
- Use P₀≈0.373967, P₁≈0.362498 and P₂≈0.263535. They sum to one before rounding.
- U/ε=0P₀+1P₁+2P₂≈0.889568.
- Multiply by ε=10⁻²¹ J. One measurement still reports 0, ε or 2ε; the mean summarizes the distribution.
U≈8.89567820×10⁻²² J; it need not be an allowed individual reading.
Check the thermal derivative using a spread
At 100 K, how does the energy variance determine the heat capacity?
- Compute the centered sum Var(E)/ε²=Σᵣ Pᵣ(r−U/ε)²≈0.625307.
- Keep the spectrum, V and N fixed. Use C/kB=x² Var(E)/ε² with x≈0.724297.
- The result is about 0.328040. Its positivity follows from a variance, not from an assumed shape of the graph.
C≈0.328040 kB for this fixed canonical spectrum.
Recover the entropy hidden within energy labels
Why is the entropy not just −kBΣᵣPᵣlnPᵣ over three levels?
- A level r contains gᵣ equal-weight microstates, each with probability Pᵣ/gᵣ.
- Summing −(Pᵣ/gᵣ)ln(Pᵣ/gᵣ) over its gᵣ states gives −PᵣlnPᵣ+Pᵣln gᵣ.
- Sum over levels, or use S/kB=lnZ+x(U/ε)≈1.627898.
Add the within-level contribution ΣᵣPᵣln gᵣ; the full entropy at 100 K is about 1.627898 kB.
Change the zero without changing the preparation
What happens at 100 K if every state energy increases by 5ε?
- All weights multiply by e⁻⁵ˣ, so the same factor appears in Z′ and cancels from each probability.
- U′/ε≈5.889568 and F′/ε≈3.642011. F has changed sign without a change of populations.
- The common constant drops out of the variance and the temperature derivative of the offset; S and C are unchanged.
Probabilities, entropy and heat capacity stay fixed; U and F each increase by 5ε.
Zero mean, nonzero response
At B=0 and T=1 K, what are M, Var(m) and χ_B for the binary magnetic unit?
- The two energies coincide, so each moment value ±m₀ has probability 1/2.
- M=0, while ⟨m²⟩=m₀², giving Var(m)=m₀².
- The linear-coupling identity gives χ_B=m₀²/(kB T). The units are (J/T)²/J = J/T².
M=0, Var(m)=m₀² and χ_B=m₀²/(kB T)>0. A zero mean is compatible with a finite susceptibility.
Test factorization rather than assume it
For the binary pair at h=0 and J=0.5ε, can Z be replaced by 2×2?
- Aligned states have E=−J and opposite states E=+J. There are two of each.
- Z_pair=2eᵝᴶ+2e⁻ᵝᴶ=4cosh(βJ)≈4.265182 at 100 K.
- The uncoupled product 4 ignores the interaction energy. Uniform single-spin marginals do not remove the correlation.
No. The actual normalizer is about 4.265182, and ⟨σ₁σ₂⟩≈0.347105.
Count a degenerate occupied sector
For the adsorption cell at μ_c=ε and 100 K, find its occupation and addition free energy.
- The empty weight is 1; each of the three occupied states has weight eᵝ⁽ᵘᶜ⁻ᵋ⁾=1.
- Ξ=4 and f=3/4. F₁−F₀=−kB T ln(3e⁻ᵝᵋ)=ε−kB T ln3.
- Half filling requires equal total sector weights, so it occurs at μ_c=F₁−F₀, rather than at ε.
At μ_c=ε the cell is occupied with probability 3/4; its canonical addition free energy is ε−kB T ln3.
A zero derivative need not mean zero energy
At μ_c=ε in the cell, why does −(∂βlnΞ)_μc vanish while U is positive?
- Every allowed state has E−μ_cN=0 at this control, including the empty state.
- The fixed-μ_c derivative generates ⟨E−μ_cN⟩=0.
- Add μ_c⟨N⟩=3ε/4 to recover U. A fixed-z derivative would generate U directly but follows a different control path.
The derivative is the mean of E−μ_cN, not E; U=3ε/4.
Check an infinite sum before truncating it
For the distinguished harmonic mode with r=e⁻ᵝᵋ, what fraction of Z is omitted by n≤K?
- The full sum is Z=1/(1−r) for 0<r<1.
- The tail is Σ_(n=K+1)^∞rⁿ=r^(K+1)/(1−r).
- Divide the tail by the full sum to obtain r^(K+1). An energy moment weights its tail by n and needs another bound.
The omitted normalization fraction is exactly r^(K+1); this alone is not a universal relative error bound for U or C.
Try it yourself
At very high T in the fixed six-state model, what are p(c1) and P(E=2ε)?
Show the answer and reasoning
1/6 and 1/2 respectively.
There are six equally weighted individual alternatives and three belong to the highest energy. The limit concerns this fixed finite spectrum.
A learner writes Z=1+e⁻ˣ+e⁻²ˣ for the opening model. What was omitted?
Show the answer and reasoning
The degeneracies two and three.
That sum would describe three nondegenerate states. The actual state list gives Z=1+2e⁻ˣ+3e⁻²ˣ.
A learner enumerates b1,b2,c1,c2,c3 individually and also multiplies each by its level degeneracy. Is that correct?
Show the answer and reasoning
No; degeneracy has been counted twice.
Either enumerate each allowed state once, or sum one term per energy multiplied by its degeneracy.
Does a computed Z prove that a trapped unit reaches the canonical populations?
Show the answer and reasoning
No.
The weights describe an equilibrium measure under its access and reservoir assumptions. Transition dynamics and observation time require additional physics.
Can a detector report exactly U≈0.889568ε in a single ideal energy measurement of the opening model?
Show the answer and reasoning
No; its individual energy outcomes are 0, ε and 2ε.
The non-level mean is a weighted average across the preparation, not an additional energy eigenvalue.
At 20 K the six-state model has Var(E)/ε² ≈ 0.05580149. Estimate C/kB with V, N and the spectrum fixed, and explain the sign.
Show the answer and reasoning
C/kB ≈ 0.731845; the heat capacity is positive.
Use x=ε/(kB T)≈3.621485 and C/kB=x² Var(E)/ε². Multiplication gives about 0.731845. This nonnegative response follows from the variance for a fixed T-independent canonical spectrum; it is not a universal statement about every ensemble or control path.
At 100 K, F/ε ≈ −1.357988606. Add the common constant 5ε to every state energy. Find F′/ε and explain whether its new sign changes the normalized preparation.
Show the answer and reasoning
F′/ε ≈ 3.642011394; the normalized probabilities are unchanged.
F′=F+5ε, so add five to the displayed ratio. Every weight and Z gain the same exp(−5βε) factor, which cancels from each probability. The sign of an absolute F depends on the common energy reference and is not a universal stability test.
If Eᵢ(λ) is nonlinear in λ, is ∂⟨X⟩/∂λ always βVar(X)?
Show the answer and reasoning
No; subtract ⟨∂²E/∂λ²⟩ for the stated diagonal/classical family.
X=−∂λE can itself change with λ. Differentiating both the observable and its probabilities produces the curvature term.
At the same positive B, which curve has the larger M/m₀: 1 K or 2 K?
Show the answer and reasoning
The 1 K curve.
The lower T has a larger βm₀B and hence a larger tanh value. This conclusion uses the same fixed moment and Hamiltonian.
At zero field, does M=0 imply that each moment is zero?
Show the answer and reasoning
No.
The two allowed moments remain ±m₀ with equal probability. Their mean cancels while their variance is m₀².
Can unrestricted subsystem partition functions be multiplied after imposing an exact fixed total excitation number?
Show the answer and reasoning
Not without enforcing the compatibility constraint.
The restricted state space is not the full Cartesian product. Sum the compatible products or use a generating variable and select the required sector.
At μ_c=0 and 100 K, calculate Ξ, ⟨N⟩ and Var(N) for the capacity-one cell with three occupied alternatives at energy ε.
Show the answer and reasoning
Ξ ≈ 2.45399543, ⟨N⟩ ≈ 0.59250128 and Var(N) ≈ 0.24144351.
The total occupied weight is q=3exp[−ε/(kB T)]≈1.45399543, while the empty weight is one. Thus Ξ=1+q, f=q/(1+q) and Var(N)=f(1−f). This sums the allowed integer sectors N=0 and N=1; substituting the noninteger mean into Z_N would lose their separate probabilities and fluctuations.
At what μ_c is the threefold-degenerate cell half occupied at fixed T?
Show the answer and reasoning
μ_c=ε−kB T ln3.
Set the total occupied weight 3exp[β(μ_c−ε)] equal to the empty weight 1. Equal total sector weights are the criterion.
What does −(∂βlnΞ)_μc generate when energies and N do not depend on T?
Show the answer and reasoning
⟨E−μ_cN⟩.
At fixed μ_c the chemical term is multiplied by the varying β too. At fixed activity z, the derivative instead generates U.
If every N-particle energy shifts by cN, how should μ_c shift to preserve the grand probabilities?
Show the answer and reasoning
Shift μ_c to μ_c+c.
Then (E+cN)−(μ_c+c)N=E−μ_cN. This is different from a common state-independent shift across every N sector.
For the 1 K stress test with the common 1000ε offset, explain how to recover the level probabilities when direct exponentials return zero for every level.
Show the answer and reasoning
Subtract the largest finite log weight before exponentiation, normalize the shifted weights, and keep tiny positive probabilities distinct from forbidden states.
Write ℓ_r=ln g_r−βε_r and m=max_r ℓ_r. At least one exp(ℓ_r−m) equals one, so divide each shifted exponential by their sum. The common energy offset cancels. Finite arithmetic can still lose small contributions; retain log probabilities or increase precision when the requested tail or moment requires it.
What additional model and limit would you need to examine before interpreting the six-state heat-capacity hump as a nonanalytic phase transition?
Show the answer and reasoning
Specify a growing family of physical systems and its thermodynamic limit, then test whether the limiting free energy becomes nonanalytic.
The fixed six-state model has a positive analytic Z at T>0, so its hump is a smooth redistribution of populations. A limit of analytic finite systems can be nonanalytic, but existence and the behavior of that limit require proof. L independent copies keep F_L/L=F_unit and do not create a transition.
For the harmonic-mode geometric sum, is the condition βε>0 optional?
Show the answer and reasoning
No.
The series converges only when r=e⁻ᵝᵋ has magnitude below one. Merely writing a trace or sum does not establish normalization.
What to carry forward
- Z normalizes individual equilibrium state weights; energy-level probabilities include their degeneracies once.
- For a fixed T-independent canonical Hamiltonian, derivatives of ln Z generate U and Var(E), while F=−kB T ln Z generates S and conjugate forces.
- A common constant energy shift changes Z, U and F consistently while leaving normalized probabilities, S and C unchanged.
- Multiplication of partition functions requires both additive energy and a compatible product state space; interactions or exact joint constraints can prevent it.
- Ξ sums physical number sectors; the derivative at fixed μ_c generates E−μ_cN, and the derivative at fixed activity generates E.
- Stable computation, a defined state measure and convergence checks preserve the meaning of probabilities; smooth finite-size responses do not by themselves establish a phase transition.
References
Sources for the concepts and teaching approaches in this article.
- Statistical PhysicsDavid TongCourse notesFundamentals: partition functions and thermodynamic derivativesPhase transitions: finite sums and thermodynamic limits
- Accurate Computation of the Log-Sum-Exp and Softmax Functions (2019 manuscript)Pierre Blanchard, Desmond J. Higham and Nicholas J. HighamResearch paper
- The seven defining constants of the SIBureau International des Poids et MesuresReference guide