Fundamentals / Physics / Thermodynamics and statistical physics

Design a thermometer with a countable energy spectrum

How precisely can a single equilibrated degree of freedom measure temperature? Derive the reading distribution from the canonical ensemble, find the gap that makes it most informative, and analyse a detector that records no excitations at all.

Start with how the instrument is read

Bring a two-level probe into weak thermal contact with a large bath at an unknown positive temperature \(T\). Its lower energy is set to zero and its upper energy is \(\Delta>0\); both levels are nondegenerate. Wait for equilibration, then measure which energy level the probe occupies. Repeat with independent equilibrium preparations, either by waiting for full rethermalisation between measurements or by using many identical probes. The data consist of \(N\) binary outcomes. They are not a direct measurement of the average energy of an infinitely large sample.

Weak coupling lets us use a fixed calibrated Hamiltonian for the probe while treating the bath as a reservoir. In a canonical ensemble the ratio of excited to ground weights is \(e^{-\Delta/(k_BT)}\). Write \(x=\Delta/(k_BT)\). Normalising the two weights gives excited probability \(p=1/(1+e^x)\), partition function \(Z=1+e^{-x}\), and mean energy \(U=\Delta p\). The arbitrary zero of energy drops out of all three measurable statements about populations, energy differences and temperature sensitivity.

One low-energy observation can occur both in a very cold bath and in a relatively warm one. One upper-state observation likewise gives only partial information. Counting \(k\) excitations across \(N\) preparations produces a binomial distribution. Its dependence on \(T\) enters entirely through \(p(T)\). A histogram of measured energies has only two bars, yet the relative heights carry a continuous parameter. Keeping track of the total number of shots is essential: the same 10 per cent excited fraction is a different measurement when it came from ten shots and when it came from ten thousand.

Invert the count and treat the boundaries as part of the problem

The likelihood of a hypothesised temperature is proportional to \(p^k(1-p)^{N-k}\). At an interior maximum the derivative of its logarithm with respect to \(p\) vanishes, giving \(\hat p=k/N\). For \(0<k<N/2\), inversion yields

\[\hat T=\frac{\Delta}{k_B\ln[(N-k)/k]}.\]

This inverse is nonlinear. Doubling the excited fraction does not simply double the temperature, and errors on the two sides of a temperature estimate need not be equal. At \(k=0\) the maximum lies at the limiting temperature \(T\to0^+\); it does not prove that the bath has reached absolute zero. At \(k/N\ge1/2\), the likelihood on the positive-temperature model is maximised as \(T\to\infty\). A finite sample can cross one half by chance even when the equilibrium bath temperature is positive. Before inferring population inversion check statistical uncertainty, uncorrected readout bias and the assumptions about degeneracy.

For numerical work use \(\ln L=-kx-N\ln(1+e^{-x})+\mathrm{const}\). Working with log probabilities keeps a sequence of unlikely but possible observations from being rounded to zero. Plotting the likelihood normalised to its largest value on a temperature grid makes its shape visible. This curve is not automatically a probability density over \(T\); a Bayesian posterior would additionally require a prior and normalisation in the chosen temperature coordinate.

Derive the temperature resolution twice

Differentiate the occupation with respect to temperature. Since \(dp/dx=-p(1-p)\) and \(dx/dT=-x/T\), the thermal response is

\[dp/dT=x p(1-p)/T.\]

The observed fraction has variance \(p(1-p)/N\). When its statistical width is small enough that the inverse calibration is locally linear, propagate a small fluctuation through the inverse function:

\[\frac{\sigma_T}{T}\simeq\frac{1}{x\sqrt{Np(1-p)}}.\]

A second derivation identifies an information limit. For one observation \(X\in\{0,1\}\), the logarithmic likelihood derivative is \((X-p)p'/[p(1-p)]\). Squaring and averaging uses \(\operatorname{var}X=p(1-p)\) and gives Fisher information \(F_T=(p')^2/[p(1-p)]\). Information adds across independent trials. For a locally unbiased regular estimator the Cramér–Rao bound is \(\operatorname{var}\hat T\ge1/(NF_T)\). The preceding propagated width equals that bound asymptotically for an interior occupation probability. It does not guarantee the performance of the finite-sample inverse at a boundary.

The same expression has a thermodynamic interpretation. The energy variance is \(\Delta^2p(1-p)\), while \(C=\partial U/\partial T=k_B x^2p(1-p)\). Therefore \(F_T=C/(k_BT^2)\). A large equilibrium heat capacity means that the energy histogram moves appreciably for a small temperature change compared with its own thermal width. This identity extends to an equilibrium system with a temperature-independent Hamiltonian when its full energy is measured. Coarsening energy into fewer detector bins, changing the Hamiltonian with \(T\), or using correlations across repeated trials changes what can be inferred from the data.

Where should a designer place the gap?

For fixed bath temperature and number of independent preparations, maximise \(x^2p(1-p)=x^2/[4\cosh^2(x/2)]\). Its logarithmic derivative is \(2/x-\tanh(x/2)\). The optimum positive root solves

\[x\tanh(x/2)=2,\qquad x_{\rm opt}\simeq2.39936 .\]

The product grows monotonically on the positive axis, so this root is unique. At small \(x\) the two measured outcomes occur almost equally often but very weakly depend on temperature. At very large \(x\) a rare excitation carries substantial energy yet nearly every trial gives the same result. The maximum balances the thermal slope against the fluctuations and availability of both outcomes. Its location assumes two nondegenerate levels; increasing a level's degeneracy changes both its equilibrium weight and the optimum.

For a probe designed to work near 4.0 K the optimal gap divided by \(k_B\) is about 9.60 K. The expected excited fraction is only 0.0832. With 400 independent shots the local bound on relative standard error is about 7.54 per cent, or 0.30 K. The default notebook seed happens to yield 24 excitations and a maximum-likelihood estimate near 3.49 K. A known simulation input and a fitted parameter need not coincide in one finite record. Change the seed before changing the temperature to observe which scatter is expected from the instrument itself.

Two-level excited probability and scaled heat capacity versus gap, alongside the likelihood from a finite sample of binary energy readings.Open full-size diagram
An energy gap near 2.4 times thermal energy maximises local information for a nondegenerate two-level probe. The likelihood on the right comes from one reproducible sample. Its maximum can move even when the bath temperature stays fixed.
Try it · Thermometer

Change the inputs and compare the recalculated curves with the preceding derivation and baseline figure. The axes give the units; the numerical readout states the model assumptions and any limiting cases. Reset the inputs to return to the reference setting.

Download the corresponding editable notebook. The browser recalculates the reduced equations directly; the notebook exposes the full calculation and its checks.

Use a gap of 0.4 K at the same 4 K bath temperature, then a gap of 40 K. In the first experiment the hot side of a likelihood plot can be extremely broad. In the second, most records are entirely in the ground state. Optimising around one known operating point also has a cost: if temperature may lie anywhere across several orders of magnitude, the best single design locally can be an insensitive probe elsewhere. One strategy is to make a coarse first measurement with one gap, then tune the second gap using that estimate and analyse the two independent batches with their own known calibration settings.

Recover an interval when zero events were observed

For \(k=0\), the exact probability of such a record at a proposed \(p\) is \((1-p)^N\). A one-sided 95 per cent frequentist upper limit \(p_u\) solves \((1-p_u)^N=0.05\). The transformation to \(T\) is monotone on the positive-temperature interval, so invert \(p_u\) using the same level gap whenever \(p_u<1/2\). This confidence construction concerns repeated experiments with the stated coverage, rather than the probability that a particular fixed temperature belongs to an already observed interval.

With 400 shots and zero excitations one finds \(p_u\simeq0.00746\). With \(\Delta/k_B=9.60\) K this implies an upper temperature near 1.96 K. The comparison with the typical record at 4 K shows how a seemingly uninformative blank histogram can rule out part of parameter space. If the detector sometimes misses excitations, however, the same blank record need not imply as cold a bath. Detection efficiency changes the observation law and must be calibrated separately or estimated using more than one preparation.

Tutorial on uncertainty, design and a defective detector

A probe with \(\Delta/k_B=6.0\) K gives 30 excitations in 300 independent preparations. Estimate the temperature and the local relative standard error.

Work through the solution

Here \(\hat p=0.10\), so \(x=\ln9=2.197\) and \(\hat T\simeq2.73\) K. Substituting this interior estimate gives \(1/[\ln9\sqrt{300(0.1)(0.9)}]\simeq0.0876\). The approximate standard error is 0.24 K. The finite-count likelihood is available if asymmetric uncertainty matters for a particular decision.

At the optimal gap how many independent observations are needed for a local relative standard deviation of one per cent? What happens if every recorded observation is simply copied twice?

Work through the solution

At the optimum \(x^2p(1-p)\simeq0.4392\). The design condition is \(N\gtrsim1/[0.01^2(0.4392)]\), approximately 22,800 independent observations. Duplicating each row leaves the experiment and its true uncertainty unchanged. Treating the copied rows as fresh preparations underestimates the standard error by a factor of \(\sqrt2\).

A readout labels an excited site correctly with probability 0.9 and incorrectly labels a ground-state site as excited with probability 0.02. What quantity must be inverted if 10 per cent of readings say excited?

Work through the solution

The recorded probability is

\[q=0.9p+0.02(1-p)=0.02+0.88p.\]

From \(q=0.10\) infer \(p=0.0909\) and \(x=\ln10\simeq2.303\). Inverting the raw 0.10 instead would give \(x=\ln9\) and a higher inferred temperature for the same positive gap. The derivative of the calibrated observation probability also carries the factor 0.88 when propagating uncertainty.

Further reading · L. A. Correa and collaborators · Individual quantum probes for optimal thermometry