Fundamentals / Physics / Thermodynamics and statistical physics / Notebooks

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.

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.

Save notebook (.ipynb)

Python runs on this device. The first run loads the scientific libraries.

A thermometer estimates a bath temperature by counting excitations of a small system with a calibrated gap. Select a gap, generate a repeatable data set and determine whether a count of zero means zero temperature.

Derive the likelihood from the canonical occupations

For independent preparations the event count follows a binomial law. We use a stable logarithm for each outcome to compare temperatures, including when one outcome was never recorded.

Compare the probability, thermal response and experimental likelihood

The sensitivity of an energy reading is governed by its variance together with the rate at which its mean changes. A gap that is very large gives almost identical readings on every trial. A very small gap produces many transitions but their probability barely changes with temperature.

Find the optimum and inspect a boundary outcome

The optimum solves x tanh(x/2) = 2. Bisection uses the monotonicity on the positive axis. If no excitations were seen, calculate an exact one-sided 95% upper limit on the excitation probability, then invert it if that limit lies below one half.