{'fraction_non_alphanumeric': 0.04323803531401156, 'fraction_numerical': 0.013724487789531637, 'mean_word_length': 4.395035536225735, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Optimal cold atom thermometry using adaptive Bayesian strategies

Precise temperature measurements on systems of few ultracold atoms is of paramount importance in quantum technologies, but can be very resource-intensive. Here, we put forward an adaptive Bayesian framework that substantially boosts the performance of cold atom temperature estimation. Specifically, we process data from real and simulated release--recapture thermometry experiments on few potassium atoms cooled down to the microkelvin range in an optical tweezer. From simulations, we demonstrate that adaptively choosing the release--recapture times to maximise information gain does substantially reduce the number of measurements needed for the estimate to converge to a final reading. Unlike conventional methods, our proposal systematically avoids capturing and processing uninformative data. We also find that a simpler non-adaptive method exploiting all the a priori information can yield competitive results, and we put it to the test on real experimental data. Furthermore, we are able to produce much more reliable estimates, especially when the measured data are scarce and noisy, and they converge faster to the real temperature in the asymptotic limit. Importantly, the underlying Bayesian framework is not platform-specific and can be adapted to enhance precision in other setups, thus opening new avenues in quantum thermometry.


I. INTRODUCTION
Precise low-temperature thermometry is a key enabler for cold atom-based quantum technologies. In particular, analog quantum simulation in optical lattices [1,2], computation on large-scale programmable simulators [3,4], the study of thermalisation in closed quantum systems [5][6][7], or the realisation of thermodynamic cycles [8][9][10]. The most common thermometric technique for cold atoms is time-of-flight imaging, which infers temperature from the velocity distribution of a free-expanding atomic cloud. However, this is not sufficiently accurate in optical lattices. It also becomes unsuitable in more advanced setups like optical tweezers, which allow us to independently trap and manipulate only one or few atoms [3,4,[11][12][13]. In these cases, alternatives such as Raman sideband spectroscopy [12], release-recapture thermometry [14][15][16], or selective atom spilling [11] must be employed. Often, however, such techniques require a large number of experimental repetitions to be accurate, rendering thermometry expensive in terms of machine time.
On the theoretical side, the application of estimationtheoretic methods to low-temperature thermometry has consolidated into the novel field of 'quantum thermometry' [17,18]. Specifically, progress has been made on establishing fundamental scaling laws for the signal-to-noise ratio of low-temperatur estimates [19][20][21], or on the identification of design prescriptions that can make a probe more responsive to temperature fluctuations [22][23][24][25][26][27][28]. As a result, precision tuning in sensing applications with atomic impurities is starting to be informed by estimation theory [7,29,30].
Most of the existing literature on quantum thermometry relies on local estimation theory [17,18], and adopts the * J.Glatthard@exeter.ac.uk † J.Rubio-Jimenez@exeter.ac.uk ‡ G. Barontini@bham.ac.uk (quantum) Fisher information F as the figure of merit to be maximised [31]. Indeed, in the asymptotic limit of large number of measurements (i.e., µ → ∞), and for unbiased estimators, F controls the scaling of the best-case signal-to-noise ratio of temperature estimates, as per (T /δT ) 2 ∼ µ F T 2 . However, in the experimentally relevant scenario of finite measurement records, with just tens or hundreds of shots, F does not always capture-even qualitatively-the behaviour of optimal temperature estimates. In these cases, one must adopt the more general Bayesian framework [32][33][34]. This has recently led to a wealth of new results in quantum thermometry [35][36][37][38][39][40][41], although there had been earlier applications [42,43]. While experimental proposals haven been put forward within quantum thermometry [7,23,25,30,44,45], the field has remained eminently theoretical and mostly concerned with setting ultimate precision bounds [18]. With this work we want to take a more practical turn by exploiting the theory to process actual experimental data. This has been facilitated by the adoption of the Bayesian framework which, not only provides precision bounds as in local estimation theory, but also allows for the construction of optimal estimators from measurement outcomes [32][33][34]40].
By exploiting Bayesian methods, here we develop an adaptive strategy to optimally assess the temperature of single-or few-atom systems. Namely, given a set of measurement outcomes and a model for the experiment, we find the estimate which minimises, on average, a suitably defined error. Crucially, we can compute the expected information gain shot by shot, which allows us to adjust the experiment in real time so that each measurement is maximally informative.
We illustrate the benefits of our adaptive Bayesian protocol by optimising a release-recapture thermometry experiment on a few 41 K atoms tightly confined in an optical tweezer at µK temperatures. This is a particularly challenging system in which precise thermometry is usually exceedingly expensive in terms of the number of measurements needed. Indeed, as already advanced, single-shot procedures like time-of-flight absorption imaging cannot be used with a single or few atoms, due to the vanishing optical density. On the other hand, alternative methods like Raman sideband spectroscopy operate at far lower temperatures, which leaves release and recapture as the only option. Our aim here is to show how resource optimisation can help to overcome the two main weaknesses of release-recapture thermometry; namely, that it inherently needs many experimental repetitions, and that it is usually less accurate than other methods. To do so, we will use the light-off time of free expansion of the atoms as the control parameter in our optimisation.
Working with both real and simulated data, we show that our adaptive Bayesian protocols largely outperform conventional release-recapture thermometry in practice. Specifically, our methods showcase a much reduced estimate variability when applied to finite measurement records with equal number of data points. Our approach is thus more dependable. Furthermore, we find that, in the asymptotic limit of many data, the estimates from our Bayesian protocols converge faster to the true temperature than conventional estimates. Finally, we show how guiding data acquisition by information gain can substantially reduce the number of measurements needed for an estimate to converge to a stable value, thus helping to optimise resources. Ultimately, in this work we demonstrate in practice how quantum thermometry can provide concrete design prescriptions capable of making a difference in experiments.
This paper is structured as follows: In Sec. II A we introduce our Bayesian method. In Sec. II B we describe a simple analytical model for the recapture probability. Next, in Sec. II C, we describe three different thermometric protocols and compare their performance. These consist in the mere Bayesian processing of data captured at unoptimised times, the repeated measurement at the a priori optimal recapture time, and a fully adaptive method. Details on our experimental setup and on how real data are processed are given in Sec. III. In Sec. IV, we rank the protocols in terms of estimate variability and asymptotic convergence speed and show how information-maximisation reduces the required number of measurements for estimates to converge to a target precision. Finally, in Sec. V we draw our conclusions.

A. Bayesian data analysis and global thermometry
We start by outlining the Bayesian-global paradigm introduced by some of us in Refs. [35,40]. Even though we later focus on the specific release-recapture setup, this framework is fully applicable to any thermometry experiment in which temperature behaves as a 'scale parameter' [40,46]. For a more detailed account of this paradigm and why it applies to release-recapture thermometry, see Appendix A.
Our aim is to estimate a temperature T from a set of measurement outcomes n = (n 1 , . . . , n µ ) recorded in µ runs of a given experiment. In addition, we consider a controllable parameter t that we set to t = (t 1 , . . . , t µ ) in each subsequent run. In order to extract maximum information from these data, we need a likelihood function [33,34]. Assuming all shots to be independent, this amounts to finding a probability p(n i |T, t i ) for obtaining the outcome n i given t i and T . Furthermore, since the true temperature is unknown, we work with a hypothesis θ ∈ [θ min , θ max ] about its value.
The idea is then to assign a weight to the different θ in light of the measurement record (n, t). This is achieved by constructing the probability p(θ|n, t) [33,34]. Using Bayes theorem, such distribution can be cast as (cf. Appendix B) where p(n i |θ, t i ) is our likelihood model evaluated at θ, and p(θ) is a probability representing information about T prior to collecting the data.
Since one does not, in general, have any prior knowledge about T , we choose the distribution p(θ) corresponding to maximum ignorance within [θ min , θ max ] [33,47]. As we shall see next, the energy scale in which our model p(n i |T, t i ) for release-recapture thermometry is applicable is determined by the unknown temperature itself. We thus say that temperature is a scale parameter [35,40,42,46], and adopt Jeffreys's prior to represent maximum ignorance about it [33,34,48]. Having fixed p(θ) and p(n i , t i |θ), Eq. (1) is used as follows. Upon recording (n 1 , t 1 ), the likelihood p(n 1 |θ, t 1 ) is calculated as a function of θ. The functions p(θ) and p(n 1 |θ, t 1 ) are multiplied and the result normalised-this operation is interpreted as having updated the initial information with the first pair of data. Next, (n 2 , t 2 ) is recorded and the resulting probability, multiplied by p(n 2 |θ, t 2 ) and normalised. After µ iterations, one finally arrives at p(θ|n, t), which does encode all the available temperature information. That is why p(θ|n, t) is referred-to as 'posterior probability'.
At this point, one can already extract an estimate and its associated error. As shown in Ref. [35], whenever T behaves as a scale parameter, the optimal estimator is given bỹ where θ u simply neutralises the units within the logarithm [49] without affecting the value ofθ(n, t). In this work, we set θ u = 1 µK. In turn, the 'error bar' on the estimator (3) is where¯ mle (n, t) = dθ p(θ|n, t) log 2 θ (n, t) θ (4b) is the mean logarithmic error-a relative error-evaluated for the specific dataset at hand. Ultimately, we report Bayesian temperature estimates asθ(n, t) ± ∆θ(n, t).
We will also exploit the notion of mean information gain for a single shot. As per Ref. [35], this can be quantified as This will allow us to adaptively adjust the control parameter t so as to maximise K(t) at every step, thus making each measurement maximally informative. The Bayesian-global paradigm summarised here will suffice to optimise release-recapture experiments. Nevertheless, we note that alternative formulations of Bayesian thermometry [36,38,39,41,50] exist. For a perspective on when it is appropriate to employ these, see Refs. [35,40].

B. The release-recapture method
In a release-recapture thermometry experiment, the trap confining an ultracold gas at temperature T is switched off during a time t, so that the atoms expand ballistically. Upon reactivating the trap, the number of recaptured atoms n is measured by fluorescence imaging. The temperature is obtained by fitting measurement outcomes at different times to a model f (T, t) for the fraction of recaptured atoms [16].
Let us start with the simple case of a trap deterministically loaded with one atom, deferring the multi-atom scenario to Sec. III C. In that case, the probabilities for successfully recapturing or losing the atom after time t i are, respectively (7b) this gives us the required likelihood model. Next, we need to calculate the recaptured fraction f (T, t). The trapping potential is created by focusing a laser beam to a narrow waist, which produces tight confinement in the transverse x-y plane. This is described by where U 0 is the trap depth, w 0 is the beam waist, and r 2 = x 2 +y 2 . At low T , i.e., U 0 /k B T 1, Eq. (8) leads to [16,51] where g(s) = 1 − e −s , η = U 0 /(k B T ),t 2 = 4U 0 t 2 /(mw 2 0 ), m is the mass of the atom, and W (·) is the Lambert function, defined implicitly as W (s) e W (s) := s. By resorting to numerical simulations, one could further account for the axial motion of the atoms, i.e., their initial position distribution and the effect of gravity. However, Eq. (9) is in very good agreement with such simulations in the low-T regime (see Appendix C).
To estimate T in practice, one conventionally chooses a range of free-expansion times {t 1 , · · · , t ν } so that the decay of f (T, t) is well sampled [14,15]. At each time t i , α i independent photon-count measurements are performed, so as to infer the number of recaptured atoms {n ij } αi j=1 . Eventually, one records the average n i for every t i , and fits these to λf (T, t) via least squares. The light-off time t then acts as independent variable, while T and λ are fitting parameters [16].
In spite of the simplicity of the method, two issues must be noted. First, assuming that the empirical averagen i is close to its true value presupposes an indeterminate 'large' number of measurements α i . Hence, should α i not be 'large enough', the final estimate could become unreliable [52,53]. Secondly, the method discards most of the information available-the full measurement record {n ij } is known and yet, one chooses to work only with the averages {n i }, which likely leads to precision loss [33]. Here, i ∈ {1, · · · , ν} and j ∈ {1, · · · , α i }. Both issues are naturally bypassed by the Bayesian estimation framework of global thermometry [35] as discussed below.

C. Adaptive maximisation of the information gain
We now move on to discuss how Bayesian methods can be employed to process the data form conventional releaserecapture experiments and, more importantly, how Bayesian data analysis can inform the measurement strategy. Before we proceed, some remarks are in order.
First, we have just seen that the validity of Eq. (9) rests on the condition U 0 /(k B T ) 1, so that it is the unknown T itself which determines the energy scale in which our model for the fraction of recaptured atoms is applicable. Hence, we are dealing with a scale-estimation problem [40,46] for which Eqs. (2-5) are appropriate.
As for the range [θ min , θ max ], a conservative choice for the lower bound is 5% of the trap depth in units of the Boltzmann constant (i.e., U 0 /k B ), as the final cooling stage that the atoms undergo in the trap is not expected to reach such low temperatures (see Sec. III A). On the other hand, we choose θ max as the temperature at which Eq. (9) starts to break down (see Appendix C).

Unoptimised Bayesian protocol
Let us consider a release-recapture experiment such as those described in Sec. II B. In this case, the vector t of expansion times would be where the values t i would be chosen 'by eye' such that the decay of the survival probability (7)  First, a record with 30 measurements at 7 unoptimised expansion times was fitted to the recapture probability, as discussed in Sec. II B (red circles), as well as processed with our Bayesian-global technique (blue triangles). The time-optimised methods were also applied to the same overall number of data points (i.e., 210), simulated, respectively, at the optimal a priori recapture time ts (orange rhombs), and at adaptively chosen variable optimal times (green squares). Optimisation of the recapture times noticeably reduces the variability of the estimates. Note that there is no abscissa axis in the main plot; the estimates have been squeezed together to help visualise their variability. The insets (a-c) show the typical convergence of global estimates with the number of measurements k. As shown, time-optimised methods typically require much less data to converge, when compared with their unoptimised counterparts. Also, the final error bars are smaller in (b) and (c).
cessing the resulting measurement record (n, t) with Eqs. (2-5) may return slightly better estimates than the conventional least-squares fit of the recaptured-atom-averages {n i }, since we make use of all the available data (see Secs. II D and IV B).
Not all expansion times t i are equally informative, however. Intuitively, if the temperature is low, the recapture probability at short enough times is roughly constant, as the atoms have no time to move far-it is those measurements at longer times which carry most of the temperature information. The opposite is true if T is large. Hence, given that the temperature is unknown, by evenly sampling a time interval we are likely to generate and process many uninformative data points. Instead, as the temperature information is updated by feeding in measurement outcomes, efforts should be concentrated in sampling only those times t i which maximise information gain. As we shall see next, this speeds up the convergence of the temperature estimate and, more importantly, it largely reduces the spread of estimates drawn from small measurement records.

A priori optimisation of the expansion time
Even in the absence of measured data and starting from maximum ignorance about T , one can make the most of the available information-namely, the parameters of the trapin order to determine an optimal expansion time t s for the first shot of the protocol. This amounts to searching for the time at which K(t) in Eq. (5) is maximal, which can be calculated before any measurement is carried out. The simplest strategy would then consist in performing every subsequent measure-ment at the same recapture time t s , i.e., The intuition behind this approach is that, by keeping the uncertainty of the most uninformed shot-the first one-to a minimum, one can boost the convergence of the estimate to the true temperature as knowledge is updated, as per Eq. (1). This kind of a priori optimisation was first explored in Mach-Zehnder interferometry [54], and it has been proven informative also in distributed sensing [55]. For a discussion about the construction and application of single-shot optimised protocols, see Ref. [56].

Adaptive optimisation of the expansion time
Instead of continuing to measure at the a priori optimal time t s , we can change the recapture intervals at each step so as to maximise the information content of the posterior probability adaptively [37]. Specifically, 1. Given the prior p(θ) and the likelihood p(n|θ, t) for the first shot, maximise K(t) over t to find t 1 = t s .
2. Perform a measurement at t 1 = t s and record n 1 .
3. Normalise p(θ) p(n 1 |θ, t 1 ) and use it as the new 'prior' for a second run [33,34]. Then apply step 1 to find the optimal expansion time t 2 , and measure n 2 .

D. Performance comparison on single-atom simulations
Let us now make a preliminary analysis of how these Bayesian strategies compare to each other, and with the nonlinear fit described in Sec. II B. To that end, we simulated a trap loaded deterministically with one atom, choosing a trap depth of U 0 /k B = 290 µK and a beam waist w 0 = 1.971 µm. In these simulations, the temperature was set to T = 40 µK. The parameters are taken to be the same as in our actual experiment.
For the non-linear fit and the unoptimised Bayesian protocol, we generated 30 measurement outcomes at each of the seven expansion times (5,10,20,30,50,70, 100) µs. The a priori optimised and fully adaptive protocols were applied on simulated records with the same number of entries as the other two methods (i.e., 210). All three Bayesian strategies used Jeffreys's prior in Eq. (2), with support between θ min = 14.5 µK and θ max = 125 µK. For these parameters, the a priori optimal expansion time evaluates to t s = 14 µs. Fig. 1 illustrates the estimate variability of each method. The advantage of time optimisation seems clear, as both the a priori and adaptively optimised methods (rhombs and squares, respectively) yield much more accurate estimates than the fits to data collected at unoptimised recapture times (circles and triangles). Furthermore, in the insets (a-c) we show how the time-optimised protocols converge to the true temperature with significantly less data than their unoptimised counterpart. In the next two sections we shall put these preliminary observations on a more solid basis.

A. The experimental setup
We now apply our Bayesian framework on actual experimental data. Details on our experimental setup can be found in [57]. In this work, 41 K atoms are loaded into an optical tweezer from a dark magneto-optical trap. The number of atoms transferred into the tweezer can be controlled by varying the magneto-optical trap loading time. The tweezer is realised by focusing a beam at 790 nm, produced by a Ti:sapphire laser, to a waist of 1.9 µm using a 20× apoplanar infinity corrected objective. This realises an elongated tweezer trap, with a radial-to-axial dimension ratio of 1 : 249. As discussed in Sec. II B, such setup can be described by the model in Eq. (9) to a very good approximation. The temperature of the few-atom system is determined by the depth of the optical tweezer. Evaporation cooling brings down the temperature from its initial higher value of the atom source.
The release-recapture protocol is realised by switching off the tweezer's light for a variable amount of time and then switching it on again. To measure the number of atoms left in the tweezer, we utilise fluorescence imaging switching on a series of dedicated resonant beams. The light emitted by the recaptured atoms is collected with the same microscope objective that is used to create the tweezer, and detected with a sCMOS camera. In order to avoid anti-trapping while ima-ging [58], we chop the tweezer and imaging lights out of phase at 1 MHz for the duration of the measurement. Once the detection is completed, the 41 K atoms are lost. A new batch of atoms needs to be loaded in the tweezer, and the process above is repeated.

B. Mapping photon counts into atom numbers
The experimental measurement record is a list of photon counts n p,i at each shot at time t i . We must, however, convert each photon count into a number of recaptured atoms n i to be fed into the vector n. To do so, we take a set of calibration fluorescence images. The histogram of the resulting photon counts produces a multimodal distribution, where each peak is associated with a different number of atoms in the trap. Applying a multimodal Gaussian fit to these data gives us the position m of the peak corresponding to an empty trap, as well as the spacing ∆ between the (equispaced) peaks. Hence, the photon-count-to-atom conversion is simply that is, we map each photon-count measurement to the atom number associated to the nearest peak.

C. Multi-atom model
Although the initial atom number can be controlled to some degree, our assumption of deterministic single-atom loading certainly needs to be relaxed before we can process experimental data. This can be achieved simply by upgrading the measurement model p(n i |T, t i ) in Eq. (7).
Assuming distinguishable atoms with negligible mutual interactions, the probability for recapturing n i of them during the i-th run, given that the trap was loaded with N 0 atoms, can be cast as where B(n i |N 0 , q) is the binomial distribution with success probability q = f (T, t i ), as defined in Eq. (9). N 0 appears here as a nuisance parameter and thus needs to be marginalised over. To do so, we first note that, in this type of problem, the probability of starting with N 0 atoms can be described by a Poisson distribution [59,60], denoted where λ is the mean initial atom number. In practice, this can be inferred from a sufficiently large set of calibration measurements at zero recapture time (i.e., on unreleased atoms). In such case (cf. Appendix D), The model for the multi-atom scenario is thus a Poisson distribution with mean equal to λf (T, t i ). With the sole exception of this change, the Bayesian protocols from Sec. II C can be directly applied to experimental data.

IV. RESULTS AND DISCUSSION
A. Processing real data at unoptimised recapture times Let us start by analysing experimental measurement records taken at unoptimised light-off times. We shall apply the conventional method of least-squares fitting, as well as our Bayesian technique. Specifically, we shall work on two sets of measurements on 41 K atoms, which were performed in a shallow and a deep trapping potential. These had depth U 0 /k B = 110 µK and 290 µK, respectively. For the shallow configuration, we performed 50 measurements of the number of recaptured atoms at each of the expansion times t a = (5,10,15,20,30,40,50) µs, plus 100 calibration measurements without release. In turn, for the deep trap, we took 30 measurements at expansion times t b = (5, 10, 20, 30, 50, 70, 100) µs, and 60 calibration measurements at zero expansion time.
Let us now process these data via the non-linear fit to the mean number of recaptured atoms (cf. Sec. II B). We note that the average atom number at t = 0 is also a point for the fit. This returns temperature estimates of (15.8 ± 3.2) µK and (57 ± 11) µK for the shallow and deep configurations, respectively. The fits are shown in Fig. 2 (solid red).
We next apply our Bayesian methods to the same data. From the calibration measurements, we find the initial mean atom numbers λ = 1.88 and λ = 1.65 for the shallow and the deep trap, respectively. As discussed in Sec. II A, the support of our prior p(θ) is set to 5.5 µK ≤ θ ≤ 30 µK (shallow) and 14.5 µK ≤ θ ≤ 125 µK (deep). Following the Bayesian procedure we arrive at the estimates (15.0 ± 1.7) µK and (45 ± 7) µK (dashed blue in Fig. 2).
Although the Bayesian and non-Bayesian estimates seem roughly comparable, we note that the Bayesian temperature estimate for the deep-trap experiment does fall below the error bars of the conventional method. Indeed, some discrepancy could have been expected in the second experiment, due to the smaller number of measurements performed. It is precisely in these cases when the Bayesian analysis pays off.

B. Finding the most reliable strategy
Since the analysis above has shown that conventional and Bayesian processing of the same experimental data can yield different temperature estimates, we need to establish which one is more dependable and should thus be trusted. To that end, we now simulate multiple runs of the deep-trap experiment (see Fig. 3 for details), setting the temperature to 40 µK.
Let us start by focusing on the red circles and blue triangles in Fig. 3 (b), which correspond to ten simulated deep-trap experiments processed with the conventional and Bayesian methods, respectively. Each run thus consists of 30 data points simulated at each of the 7 recapture times in t b , plus 60 calibration measurements, at t = 0. As we can see, the estimate variability is substantial, although the Bayesian estimates have a narrower spread and more consistent error bars.
To quantify such variability, we use the empirical error [61]. Varθ/ θ 2 of a set of estimates, where For these parameters, and considering 100 simulated runs, the variability of the conventional least-squares method evaluated to 0.064, while the Bayesian analysis proved slightly more reliable, with Varθ/ θ 2 = 0.057.   Fig. 2 (b), and the true temperature is set to 40 µK (dashed grey). In (a), the mean number of atoms loaded into the trap is assumed to be known, and equal to λ = 1.65. In each case, 10 independent runs of the experiment are simulated, consisting of 30 measurements generated at each of the 7 unoptimised recapture times t b . The estimates are calculated via the conventional least-squares method (red circles) and the Bayesian approach (blue triangles). Since λ is known, the least-squares method becomes a one-parameter fit. Orange rhombs and green squares correspond to estimates drawn from the a priori optimised and fully adaptive protocols, respectively. These also run on datasets of 210 measurements. The a priori optimal recapture time is here ts = 22 µs. In (b) λ is not known (its true value continues to be λ = 1.65). A calibration set of 60 measurements at t = 0 is thus needed, in addition to the 210 data points. In this case, the least-squares method becomes again a two-parameter fit in T and λ. For all three Bayesian variants, λ is recalculated at every run from a fresh calibration set. Hence, the λ used for estimation differs slightly between independent simulations. The overall variability of the estimates thus increases. This is particularly apparent for both the a priori optimised and adaptive protocol, as the optimisations are done with the estimated λ, resulting in slightly off optimal times. Markers in (b) are the same as in (a).
However, the full potential of the Bayesian method is unleashed when the light-off times are picked to maximise information gain. Back to Fig. 3 (b), we now turn our attention to the results for the a priori optimised and fully adaptive protocols (orange rhombs and green squares, respectively). These use datasets of the same length as the unoptimised schemes (i.e., 210 points and 60 calibration measurements). In order to evaluate the information gain in Eq. (5), we must truncate the Poisson distribution (11) for the number of atoms initially loaded into the trap. Specifically, we set N 0 = 7 as the maximum, since the probability of loading more atoms is negligible for λ = 1.65 which is the true value of the initial number of atoms in our simulations. It is important to emphasise that λ is assumed unknown when processing data and thus, needs to be re-calculated from the calibration data at every simulated run (see caption of Fig. 3). Furthermore, in order to account for the finite resolution when adjusting the recapture times in the lab, in our calculations we replace the exact optimal times by integer multiples of a minimum resolution of 2 µs.
As it could be expected in light of Fig. 1, the fully adaptive protocol is the most dependable, visibly outperforming its unoptimised counterparts. In terms of variability, Varθ/ θ 2 = 0.034 for 100 runs. That is a 40% improvement with respect to the Bayesian processing of unoptimised data, and over 50%, with respect to the conventional method. Interestingly, the a priori optimised protocol is comparable in variability to the fully adaptive one and yet, it is much simpler to implement. This is our first main result, and it supports using the a priori optimised protocol as the new default when it comes to practical release-recapture thermometry.
The fact that the initial average number of atoms in the tweezer is unknown certainly interferes with estimate variability. Namely, the empirical average of the simulated calibration data differs slightly from run to run, even if λ is fixed in the simulation. In order to single out the temperature-estimation aspect of the calculations, we also run variability checks, treating λ as a known parameter. As we can see in Fig. 3 (a), the overall variability is much smaller in this case, but the hierarchy among the protocols is maintained.
As an alternative, we might want to adapt our Bayesianglobal processing to a multi-parameter scenario, so that both λ and T can be estimated. The procedure is summarised in Appendix E. Although this certainly deserves further investigation, Bayesian multi-parameter adaptive estimation seems, at this stage, too time-consuming to be practical.

C. Assessing convergence speed
So far we have shown that taking release-recapture data at the fixed a priori optimal expansion time t s , and processing them with our global thermometry technique yields a clear advantage-in terms of reliability-over the conventional unoptimised protocol. However, in order to optimise the experimental resources it is also important to consider the 'speed of convergence'; that is, the amount of data needed for the variability to settle into an asymptotic regime, and the rate at which the variability is reduced once in that limit.
In Fig. 4 we compare the conventional non-linear-fit method and our a priori optimised Bayesian-global protocol in terms of convergence. We do this using the same parameters as in Sec. IV B. Specifically, we compute the estimate variability from Eq. (13) for 5000 simulated runs of the experiment, and gradually increase the number of measurements per run k. As it can be seen in the figure, as k grows the variability of both protocols eventually scales as where F is a free parameter [62]. To get a rough idea of the onset of this scaling, we take the logarithm of the calculated variabilities and fit it to −a log k − log F . We start from the largest k and work backwards, adding points at lower k to  The measurement count k excludes any calibration measurements at t = 0. Specifically, (2/7) k calibration outcomes were generated for each run. All other parameters are the same as in Fig. 3. The conventional non-linear-fit release-recapture (red circles) is compared to our a priori optimised protocol (orange rhombs). Note the vast superiority of the optimised method for low k, i.e., scarce data. Asymptotically, the variability takes the form ∼ 1/(kF ). This occurs for k > 350 for the conventional protocol and k > 200 for the optimised one. The dashed and dot-dashed lines highlight the asymptotic variability scaling for both methods. The offset between these lines indicates that the asymptotic convergence speed to the true temperature is roughly twice as fast for the a priori optimised protocol. The insets zooms into the region in which our Bayesian technique enters the asymptotic regime.
the fit. We then search for the number of shots at which the exponent a first deviates from 1 by more than 2.5%. This gives k c 350 for the coventional method and k ap 200 for our a priori optimised protocol. Hence, for k > k c we can be certain that both protocols have entered the asymptotic regime in k. From their ratio we find that the a priori optimised method affords a 43% variability reduction with respect to the common practice in releaserecapture, even in the asymptotic limit. We have thus shown that our method is not only more reliable when processing short data sets, but that it also requires less measurements to attain the same precision as the conventional protocol. In our experimental setup, this roughly translates into halving the number of measurements needed to hit any target precision. This is our second main result.

D. Time optimisation on an individual experiment
We now illustrate what an a priori optimised releaserecapture experiment might look like (cf. Fig. 5). To that end, we retrospectively analyse the data from the shallow-trap experiment processed in Fig. 2 (a). Just like in Sec. IV B, we cap the distribution of initial atom numbers in the trap at N 0 = 7, which allows us to compute t s = 42 µs (see inset in Fig. 5). We then process, with our Bayesian-global technique, those measurement outcomes captured at the times closest to t s . In this case, those would be the 50 measurements at 40 µs. The a priori optimised method from Sec. II C 2 would demand to  Fig. 2 (a), reordered to mimic the a priori optimised protocol (orange). The optimal recapture time ts = 42 µs was calculated as per Sec. II C 2. The a priori information gain K as a function of the recapture time is shown in the inset for this model (grey dots). The gray line is a mere guide to the eye. The 50 measurements at the closest recorded time (40 µs) were moved to the top of the list. The set of measurements at the second closest recorded time (50 µs) were picked next, and so forth, until exhausting the 350 available data. The estimate and error bars of that exact same list, but processed in the reverse order are shown in blue, for comparison. As we can see, the orange curve already converges to the final estimate by processing the 200 most informative data. At that point, the estimate is (14.7 ± 1.7) µK. The remaining 150 data carry practically no information, since the estimate drawn from the full measurement record is (15.0 ± 1.7) µK.
continue measuring at the same time. However, having run out of data, we move on to process the measurements at the second closest time in the dataset (i.e., 50 µs), and so on.
The estimate and error bars resulting from the Bayesian processing of the first k entries of the reordered record are plotted in orange in Fig. 5. We observe that over 100 points seemingly add no information about temperature, and could thus have been spared. That is, by aiming to uniformly sample the decay of the survival probability, nearly 30% of the experimental resources were wasted. To further emphasise the important difference that time-optimisation can make to the convergence of the estimate, we overlay (in blue) a similar plot, in which the measurement record was ordered from lowest to largest information gain per entry.
Hence, the effect of optimising over the recapture time to increase information gain is threefold. First, it produces more reliable estimates when data is scarce. Secondly, it ensures a faster convergence towards the true temperature in the asymptotic limit of many measurements. Finally, it allows to significantly reduce the number of data points needed for the point estimate to converge (i.e. to stabilise at a certain value) in a single experimental run. The latter observation is the final main result of this work.  Figure 6. A priori optimised vs. adaptive protocol. Comparison between the a priori optimised (orange rhombs) and fully adaptive (green squares) protocols. Ten independent runs of the deep-trap experiment were simulated for each method. All parameters are the same as in Fig. 3 (b), except for θmin, which is set here to 0.5% of the trap depth U0/kB (see Sec. IV E). The inset shows the optimal expansion time as a function of k for one of the simulated measurement records (solid green). The a priori optimal recapture time for this wider hypothesis support is indicated by the orange dashed line. In contrast, the a priori optimal time for the narrower support used in Figs.1-5 is the orange dot-dashed line. Our observation that the a priori optimised method seems to perform equally well than the arguably superior fully adaptive scheme is explained by the fact that, for the narrower prior, ts almost coincides with the true optimum for most of the experiment.

E. A priori optimised versus fully adaptive protocol
As illustrated in Sec. IV B, the a priori optimised and the adaptive protocols can have almost identical estimate variability. This advised to focus on the former, due to its simplicity. In some situations, however, the effort of adaptively recalculating optimal expansions in real time might pay off. To see this, we go back to the deep-trap configuration of Fig. 2 (b), to make another showdown between these two protocols. Proceeding exactly as in Sec. IV B, we simulate 10 independent experiments for each method but, in this case, we work with a wider support for our prior, stretching it by one order of magnitude into colder temperatures. Namely, 1.45 µK ≤ θ ≤ 125 µK.
As we can see in Fig. 6, the adaptive protocol exhibits here a reduced variability with respect to the a priori optimised method. This is due to the fact that the a priori optimal time is nearly 60 µs, while the true optimal release-recapture delay stabilises around 20 µs after few measurements (see inset in Fig. 6). This quickly renders the a priori optimised method inefficient when it comes to information acquisition. The fully adaptive protocol, however, does not share this problem.

V. CONCLUSIONS
In this paper we have demonstrated how temperature measurements can be substantially improved in practice by actively exploiting Bayesian-global thermometry techniques. We do so on a concrete experimental setup; namely, releaserecapture measurements on few tightly confined 41 K atoms at µK temperatures. The conventional protocol samples the frac-tion of recaptured atoms evenly and fits the data to a model for the recapture probability. Instead, we propose to choose the delay between release and recapture so as to maximise information gain, and to process the measured data with our Bayesian technique [35].
Working with real experimental data as well numerical simulations, we have shown that our method has three important advantages. First, the variability of estimates extracted from small data sets is largely reduced when compared to the conventional protocol. This results in much more dependable thermometry. Second, time optimisation also leads to a faster convergence towards the true temperature in the asymptotic limit of many measurements. Finally, the optimisation of the recapture time substantially reduces the number of measurements needed for estimates to stabilise to a final temperature reading. Put differently, the conventional approach wastes resources by performing and processing a sizeable proportion of uninformative measurements.
We have also demonstrated that the best results are obtained with a fully adaptive approach, in which each new releaserecapture interval takes in all previous measurements. Interestingly, a simpler protocol can yield surprisingly competitive estimates; namely, measuring repeatedly at a single expansion time-the a priori optimal one. That is, the delay that maximises the information gain in the first measurement. This follows from the parameters of the experiment and the range of temperatures being probed. Other than an arbitrarily broad temperature range, we have assumed no prior knowledge about the temperature.
We have shown how quantum thermometry can deliver practical solutions leading to quantifiable precision enhancements, once the quantum-Fisher-information based 'local' paradigm [18] is abandoned in favour of the global framework. While the former has proven useful when studying fundamental precision limits and maximising the responsiveness of temperature sensors, the more general Bayesian framework can, in addition to that [40,47], process finite experimental records optimally. Importantly, the exact same fundamental principles can be applied to other techniques in different temperature ranges and experimental platforms, which opens a new exciting avenue in quantum thermometry.

Temperature as a scale parameter
Let us first examine the multi-atom measurement model for our experiment. That is, the probability function p(n i |T, t i ) for recapturing n i atoms after time t i during the i-th run, given that their temperature is T . As shown in Secs. II B and III C and in Appendix C, p(n i |T, t i ) takes the form Since both temperature and the other dimensioned quantities appear only within the fraction of recaptured atoms, we can base our analysis on the function f (T, t) alone. This implies that the discussion in this appendix also applies to the singleatom model in the main text.
Let us now define the kinetic energy of an atom having moved by the characteristic length scale l = w 0 / √ 2 at time t. Using this, the fraction of recaptured atoms can be cast as That is, our statistics is invariant under transformations U 0 → γU 0 , E k → γE k and T → γT , where γ is an arbitrary positive constant. This implies that temperature sets the energy scale of the problem, and so it is scale parameter from the point of view of estimation theory [33,35,40,42,46].

Protocol optimisation
This work optimises release-recapture experiments in two ways. First, by constructing an estimator function mapping the measurement outcomes n = (n 1 , . . . , n µ ) and the release times t = (t 1 , . . . , t µ ) to the optimal temperature estimateθ(n, t), where µ is the number of experimental runs. Secondly, by identifying the most informative values for the release times t = (t 1 , . . . , t µ ).
Given that T is unknown, both optimisations need be carried out with respect to a temperature-independent measure of uncertainty. In addition, they need be performed before the experiment is run (see Sec. II C), meaning that the uncertainty must also be outcome-independent. We thus use the uncertainty quantifier¯ where¯ (n, t) = dθ p(θ|n, t) D[θ(n, t), θ].
Here, θ is a hypothesis about the true value of T ,θ(n, t) is a generic temperature estimator, and D[θ(n, t), θ] is a deviation function gauging the deviation ofθ(n, t) from θ. Furthermore, p(n|t) = dθ p(θ) p(n|θ, t), while the probabilities p(θ), p(n|θ, t) and p(θ|n, t) are defined in the main text and in Appendix B.
To find the optimal release times t, we first insert the estimator above into the expression for¯ mle (t), arriving at the fundamental lower bound¯ mle (t) ≥¯ p − K(t) [35,40]. Such a bound is the result of taking the uncertainty prior to performing the experiment, denoted by¯ p , and subtracting the mean information gain K(t) associated with the measurement protocol under consideration. The expression for K(t) is given in the main text for a single shot, while that for¯ p can be found in Refs. [35,40]. For our purposes, the key property of¯ p is its lack of dependence on the release times t. Given this, if we wish to optimise our protocol by minimising the bound above for a single shot, as done in this work, we simply need to replace t → t and maximise K(t) with respect to t.
We finally note that, once the optimal strategy has been found, the theoretical error in Eq. (A4) ceases to be relevant from an experimental point of view. Indeed, since our final goal is processing real data, the associated error bars must rely on a temperature-independent but outcome-dependant uncertainty, i.e., that in Eq. (A6).
We now note that the expansion times t = (t 1 , . . . , t µ ) do not (by themselves) inform how likely different hypothesis θ about T are. Hence, we take p(θ|t) → p(θ). Assuming statistical independence between measurements further leads to But we also see that expansion times other than t i do not inform the likelihood for number of recaptured atoms n i recorded in the i-th measurement. One thus finally arrives at as stated in the main text. The normalisation factor A is found by integrating over the hypothesis range [θ min , θ max ], i.e., p(n i |θ, t i ).

Appendix C: Calculation of the recaptured fraction
For the sake of completeness, we summarise the main steps of the derivation of Eq. (9) as given in Ref. [51]. Let us load N 0 atoms of mass m at low temperature, i.e., k B T U 0 , into the tweezer trap. Specifically, the temperature is low enough so that the atoms are well localised at the centre of the trap. Furthermore, we shall neglect interatomic interactions, the influence of gravity, and the movement along the z-axis. After a free expansion time t, the trap is re-activated. An atom may only be recaptured then if, where r is the distance from the center of the trap (see Sec. II B). One then defines r max as the distance which saturates the above inequality. It is convenient to introduce the dimensionless variablesr 2 = 2r 2 /w 2 0 andt 2 = 4U 0 t 2 /(mw 2 0 ), so thatt 2 =r 2 max exp r 2 max or, equivalently,r 2 max = W (t 2 ), where where W (· · · ) is the product-logarithm or Lambert-W function defined in the main text. Hence, r 2 max = w 2 0 W (t 2 )/2, so the maximal speed of a recaptured atom is v 2 max (t) = Only those particles with velocity below v max (0) = 2U 0 /m would be initially captured by the trap. On the other hand, only those with velocity under v max (t) would be recaptured after free expansion during time t. Therefore, the recapture fraction simply writes as where F (v) = mv k B T exp −mv 2 /(2k B T ) is the Maxwell-Boltzmann distribution in 2D, g(s) = 1 − e −s , and η = U 0 /(k B T ). Eq. (C1) follows from u 0 dv F (v) = g mu 2 2k B T .
Eq. (C1) is useful due to its simplicity. However, we may loosen most of the underlying assumptions by simulating many individual trajectories of atoms. At low-enough temperatures, these can be sampled from a Gaussian distribution in position as well as in velocity in spite of the anharmonicity of the trap. The effects of gravity and the subsequent axial motion can also be included.
As we can see in Fig. 7, our simple model from Eq. (C1) is in very good agreement with the numerically calculated recaptured fraction over a broad range of temperatures and recapture times. As expected, some deviations start to be appreciated as the temperature nears U 0 /k B .
It must be noted that limiting ourselves to the regime in which Eq. (9) is applicable is not as restrictive as it might seem. As we can see, the numerically calculated recaptured fraction becomes almost independent of T when model and simulation start to diverge. Hence, when Eq. (9) ceases to apply, release-recapture thermometry itself becomes inefficient.
where we recall that q = f (T, t i ). Given that N 0 n i = 0 for N 0 < n i , we only need to sum from N 0 = n i , i.e., Next, we introduce the new variable j = N 0 − n i , so that But the remaining sum is just the Taylor expansion of the exponential function e x around x = 0. Therefore, p(n i |T, t i ) = (λq) ni e −λ n i ! e λ(1−q) = (λq) ni e −λq n i ! = P (n i |λq), which is a Poisson distribution with mean λq = λf (T, t i ).

Appendix E: Bayesian multi-parameter estimation
Our calculations assume that λ in the likelihood model p(n i |T, t i ) = P [n i |λf (T, t i )] is perfectly known. Yet, our value for λ comes from calibration measurements, and its uncertainty has not been taken into account explicitly. While, as shown in Sec. IV B, our results would remain unchanged even if λ were exactly known, here we summarise, for the sake of completeness, how our global-Bayesian technique can be generalised for multi-parameter estimation.
Firstly, we must think about the likelihood as a twoparameter model, i.e., p(n i |λ, T, t i ) = P [n i |λf (T, t i )]. The corresponding posterior would then be constructed as in which we additionally allow for uncertainty in λ through p(θ, λ). λ may be then treated as a nuisance parameter, which leads to the temperature estimator ϑ(n, t) = θ u exp dλdθ p(λ, θ|n, t) log θ θ u , with mean logarithmic error mle (n, t) = dλdθ p(λ, θ|n, t) log 2 θ (n, t) θ .
If we instead wish to estimate λ, we can do so by marginalising over θ in Eq. (E1).