Compressibility and Number-Fluctuation Relation
Open a small imaginary box inside a gas and count the molecules inside it. The number is never quite fixed: molecules wander in and out across the invisible boundary, so the count fluctuates from instant to instant around some mean . How big are these fluctuations? Remarkably, their size is not an independent property of the gas — it is locked to a purely thermodynamic quantity you can measure with a piston: the isothermal compressibility . This is the compressibility–number-fluctuation relation, . The result is a fluctuation–response theorem, one member of a family (energy fluctuations tie to heat capacity, magnetization fluctuations to susceptibility). It says that a system which is easy to compress — soft, near a phase transition — will also show large spontaneous density fluctuations, and vice versa. The grand canonical ensemble, which lets particle number vary at fixed chemical potential , makes the derivation almost automatic: differentiating twice with respect to delivers both and in three lines. The relation has a dramatic consequence. As a fluid approaches its critical point, , so diverges: density fluctuations grow to macroscopic size, scattering light and turning the fluid milky. This is critical opalescence, the visible fingerprint of a diverging compressibility. The same quantity, written as the long-wavelength limit of the static structure factor , is exactly what X-ray and neutron scattering measure — making density fluctuations a laboratory observable, not just a theorist's device.
- The number of particles in an open subvolume fluctuates; the variance is .
- Both forms come from differentiating the grand partition function twice with respect to — a clean fluctuation–response identity.
- For an ideal classical gas , so (Poisson statistics) and the relative fluctuation is — negligible for a macroscopic box, dominant for a nanoscale one.
- The long-wavelength structure factor is measured directly by X-ray and neutron scattering.
- Near a critical point , so density fluctuations diverge and scatter light — this is critical opalescence.
- Key idea: density fluctuations are not free parameters — they are fixed by the compressibility, a macroscopic response function, through .
Spontaneous fluctuations in the number of particles inside an open subvolume are rigidly tied to the isothermal compressibility, a bulk thermodynamic response: . A soft, easily compressed fluid fluctuates strongly; a stiff one barely fluctuates. The variance is generated by two -derivatives of .
Where this lives today
Number and density fluctuations are a working tool across condensed matter and soft matter. Small-angle X-ray and neutron scattering (SAXS/SANS) routinely extract and, near phase transitions, the growing correlation length from the -dependence of . In cold-atom experiments, in-situ imaging counts atoms in optical-lattice subregions and measures directly, using the fluctuation–compressibility relation as a thermometer and as a probe of quantum statistics (sub-Poissonian for a band insulator, super-Poissonian near a superfluid transition). The same machinery underlies "fluctuation microscopy" of glasses and the interpretation of density-fluctuation spectra in simulations. Wherever a compressibility diverges — critical fluids, the liquid–gas endpoint, the onset of phase separation — this relation says the density fluctuations diverge with it.
The physical picture
Picture a fixed region of space — say a cube on a side — drawn inside a much larger gas. It has no walls; molecules cross its faces freely. At one instant it holds a few million molecules; a moment later, a few thousand more or fewer. The average occupancy is set by the density, but the spread around that average is the question. The grand canonical ensemble is built exactly for this: it fixes , , and (the reservoir's chemical potential) and lets float. The payoff is that the spread is not arbitrary. If you could grab the whole gas with a piston and squeeze, the ease with which its volume gives way is the compressibility . A gas near condensation is soft — a tiny pressure change moves a lot of volume — and that same softness shows up microscopically as big, easily-excited density fluctuations in your imaginary box. Stiffness and quietness go together; softness and jitter go together.
The second figure is the punchline: plot the relative fluctuation and the compressibility together as a fluid is cooled toward its critical point. Both climb, then blow up at . The molky glow of critical opalescence is this divergence made visible — the density fluctuations grow to the wavelength of light and scatter it.
The core equations
The grand canonical ensemble weights each microstate by and sums over all particle numbers. The grand partition function generates the moments of : one -derivative gives the mean, a second gives the variance. This is the whole engine of the relation.
where: ; — chemical potential fixed by the reservoir; the double sum runs over particle number and, for each , over microstates . The first -derivative of pulls down a factor , so it returns the mean occupancy. Differentiating a second time turns the mean into the variance. This is the fluctuation–response step: the response of to a shift in equals the fluctuation .
where: the middle form is the raw second cumulant of ; the right form rewrites it as times a susceptibility. Reading it physically: how strongly the mean number responds to a chemical-potential nudge is exactly how strongly it spontaneously fluctuates. To reach the compressibility we convert the -susceptibility into a mechanical one. Using the Gibbs–Duhem relation and , the density derivative becomes the isothermal compressibility.
where: — isothermal compressibility (units ), the fractional volume change per unit pressure at fixed . A large (soft fluid) means large density fluctuations. This is the compressibility–fluctuation relation. The same content, expressed as scattering physicists use it, is the long-wavelength limit of the static structure factor — the dimensionless normalized variance.
where: — the forward () static structure factor, measured directly by X-ray/neutron scattering; — number density. For an ideal gas ; correlations push it above or below unity.
The goal is to show, from first principles and with no thermodynamic input yet, that the variance of the particle number in an open system equals times the susceptibility . The strategy is purely generating-function algebra: write as the first logarithmic derivative of with respect to , then differentiate once more and recognize the second cumulant. This is the cleanest example of a fluctuation–response identity, and it needs only that is a sum of Boltzmann–Gibbs weights.
Step 1. Start from the grand-canonical probability of a microstate, . The mean particle number is . Because each weight carries the factor , taking of brings down exactly inside the average.
Step 2. Therefore , which is equation (1).
Step 3. Differentiate once more: . But the left side is also the second cumulant of the generating function, , because a second derivative of always produces the variance of the conjugate variable. Why this works. The logarithm is the key: the first derivative of is a mean, the second is a variance, the third a skewness — cumulants, not moments. This is why (not ) is the natural object.
Step 4. Equate the two expressions for : , hence , which is equation (2).
Step 5. Test on the ideal classical gas, where with fugacity and single-particle . Then , , and again, so — the Poisson result. Verified: symbolic differentiation of gives , and , all confirmed in verify_aq-sm-compressibility-number-fluctuations.py.
Go deeper · Derivation B · 1 minFrom the μ-susceptibility to the isothermal compressibility
The goal is to convert the microscopic susceptibility into the macroscopic, piston-measurable compressibility , arriving at the boxed relation (3). The bridge is the Gibbs–Duhem relation at fixed , which ties changes in to changes in pressure, together with the fact that at fixed the chemical potential depends on only through the density .
Step 1. At fixed and , is a function of the density alone (intensive), so .
Step 2. The Gibbs–Duhem relation at fixed reads , i.e. . Substituting, .
Step 3. Express through the compressibility. Since at fixed , a density change is a volume change: — carefully, gives after using . Why the density trick. Holding fixed and varying is thermodynamically equivalent to holding and varying — both change the density — so the mechanical compressibility (a -derivative) can stand in for the number susceptibility (an -derivative).
Step 4. Combine: . Insert into equation (2): , the boxed result (3).
Step 5. Consistency on the ideal gas: and give . It reproduces the Poisson answer of the previous card — the two routes agree. Verified: substituting , into returns exactly symbolically (verify script), and for the ideal gas.
Limiting cases
The relation interpolates between quiet macroscopic samples and violent critical fluctuations; the same formula covers both.
| Case | Result | Meaning |
|---|---|---|
| Ideal classical gas | , | Poisson statistics; particles independent, no correlations. |
| Large box, | Relative fluctuations vanish — the thermodynamic limit; densities are sharp. | |
| Nanoscale box, | relative fluctuation | Fluctuations dominate; "the density" of a few molecules is not well defined. |
| Approach to critical point | , | Density fluctuations diverge; critical opalescence, scattering blows up. |
| Incompressible liquid, | Stiff systems barely fluctuate; (strong short-range order). |
Worked examples
Example 1 — Counting fluctuations in a micron cube of argon (enumerate, apply, boundary number). Take argon at STP (, ) and a fixed open box .
Step 1. Mean occupancy from the ideal-gas law, . Numerically molecules.
Step 2. Because argon at STP is nearly ideal, , so the standard deviation is molecules.
Step 3. Relative fluctuation , i.e. about . The count is sharp to four significant figures — this is why "density" is a well-defined field for macroscopic samples.
Step 4. Boundary number: shrink the box to . Then — on average the box is empty, and the relative fluctuation is order unity. At the nanoscale, number fluctuations are the whole story.
Example 2 — Reading the compressibility off scattering. A neutron-scattering experiment on a simple liquid reports a forward structure factor at and number density .
Step 1. Invert equation (4): .
Step 2. Numerically .
Step 3. Interpret: tells you the liquid is far stiffer than an ideal gas at the same density — strong short-range repulsion suppresses density fluctuations, and the measured (sub-nanopascal) confirms it. Scattering has measured a bulk mechanical property without ever touching a piston.
Origins · 1 minstructure factor and how this was discovered
The static structure factor is the Fourier transform of the density–density correlation function of a fluid, and its forward limit is precisely the normalized number-fluctuation variance . It is what a diffraction experiment actually measures: shine X-rays or neutrons on a sample and the scattered intensity at small angle is proportional to . This turns an abstract statistical quantity — the variance of particle counts in an imaginary box — into a hard laboratory number, and it is the reason critical opalescence (a diverging ) is not just calculable but visible to the eye as the fluid turns milky near its critical point.
Going further
References. Pathria & Beale, Statistical Mechanics, 4th ed., §4.5 (density fluctuations in the grand canonical ensemble) and §3.6 · Landau & Lifshitz, Statistical Physics Part 1, §112–114 (fluctuations) · Reif, Fundamentals of Statistical and Thermal Physics, §7.7 · Hansen & McDonald, Theory of Simple Liquids, Ch. 3 (structure factor) · Chaikin & Lubensky, Principles of Condensed Matter Physics, Ch. 2.
Provenance. The two forms and are standard (Pathria §4.5, Landau–Lifshitz §114). A verifier should confirm: (i) two -derivatives of give ; (ii) substituting , into returns ; (iii) the numeric for a argon box at STP, relative fluctuation ; (iv) the vdW critical isotherm has at , , forcing . All checks are in verify_aq-sm-compressibility-number-fluctuations.py. Constants: .
Builds on: Grand Canonical Ensemble · Grand Partition Function · Gibbs Factor and Chemical Potential · Heat Capacity and Fluctuation-Response Relation · Thermodynamic Quantities from the Partition Function Leads to: Energy Fluctuations in the Canonical Ensemble · Helmholtz Free Energy from the Partition Function · Critical Opalescence
Why use the grand canonical ensemble instead of the canonical one?
Because number fluctuations only exist when is allowed to vary. The canonical ensemble fixes exactly, so by construction there. The grand canonical ensemble fixes the chemical potential of a reservoir and lets float, which is exactly the physical situation of an open subvolume inside a larger fluid. The two ensembles give identical thermodynamics in the thermodynamic limit, but only the grand canonical one can talk about density fluctuations at all.
Is ⟨ΔN²⟩=⟨N⟩ always true, or only for ideal gases?
Only for the ideal classical gas, where particles are statistically independent and follows a Poisson distribution. Interactions change it: repulsive short-range forces (like in a dense liquid) suppress fluctuations, giving and ; attractive correlations and proximity to a critical point enhance them, giving and . The general statement is always ; the Poisson case is just the ideal-gas value of .
What exactly diverges at the critical point?
The isothermal compressibility diverges because the critical isotherm is flat there: , so . Through equation (3), diverges with it. Physically, the free-energy cost of a density fluctuation vanishes, so fluctuations of all sizes proliferate, correlations become long-ranged, and the fluid scatters light of every wavelength — the milky glow of critical opalescence.
How is this a "fluctuation–response" theorem?
Equation (2), , has a spontaneous fluctuation on the left and a driven response on the right: the left is how much jitters on its own; the right is how much shifts when you push on . They are equal. This is the same structure as (energy fluctuation = heat-capacity response) and (magnetization fluctuation = susceptibility). All are avatars of the fluctuation–dissipation theorem, valid in equilibrium.
Does the compressibility have to be positive?
Yes, for a thermodynamically stable phase: is a stability requirement (a stable system contracts when squeezed). Through equation (3) this guarantees — the variance is manifestly non-negative, as it must be. A formally negative signals a mechanically unstable state (the interior loop of a van der Waals isotherm), which is not a real equilibrium phase and is removed by the Maxwell construction. The fluctuation relation and thermodynamic stability are two faces of the same positivity.
Can I measure these fluctuations directly?
Yes, in two very different arenas. Scattering (X-ray, neutron, light) measures , hence , in bulk fluids and near critical points — this is decades-old technology. More recently, quantum-gas microscopes literally image and count atoms in subregions of an optical lattice, giving site by site; the measured fluctuations serve as an in-situ thermometer and reveal quantum statistics (sub-Poissonian for a Mott insulator). The imaginary counting box of the derivation has become a real, imaged region of atoms.
Why does the variance scale with ⟨N⟩² times κ_T rather than just ⟨N⟩?
The two factors of and the combine to give , i.e. . So the variance is extensive — it scales linearly with — while is the intensive, per-particle factor set by correlations. Writing it as makes the compressibility explicit; writing it as makes the extensivity explicit. They are the same statement.