{'fraction_non_alphanumeric': 0.05940516668620784, 'fraction_numerical': 0.0184468675499277, 'mean_word_length': 4.400590966652596, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Global Quantum Thermometry

A paradigm shift in quantum thermometry is proposed. To date, thermometry has relied on local estimation, which is useful to reduce statistical fluctuations once the temperature is very well known. In order to estimate temperatures in cases where few measurement data or no substantial prior knowledge are available, we build instead a theory of global quantum thermometry. Based on scaling arguments, a mean logarithmic error is shown here to be the correct figure of merit for thermometry. Its full minimisation provides an operational and optimal rule to post-process measurements into a temperature reading, and it establishes a global precision limit. We apply these results to the simulated outcomes of measurements on a spin gas, finding that the local approach can lead to biased temperature estimates in cases where the global estimator converges to the true temperature. The global framework thus enables a reliable approach to data analysis in thermometry experiments.

A paradigm shift in quantum thermometry is proposed. To date, thermometry has relied on local estimation, which is useful to reduce statistical fluctuations once the temperature is very well known. In order to estimate temperatures in cases where few measurement data or no substantial prior knowledge are available, we build instead a theory of global quantum thermometry. Based on scaling arguments, a mean logarithmic error is shown here to be the correct figure of merit for thermometry. Its full minimisation provides an operational and optimal rule to post-process measurements into a temperature reading, and it establishes a global precision limit. We apply these results to the simulated outcomes of measurements on a spin gas, finding that the local approach can lead to biased temperature estimates in cases where the global estimator converges to the true temperature. The global framework thus enables a reliable approach to data analysis in thermometry experiments.
Quantum thermometry aims to improve precision standards for temperature sensing in the quantum regime [1][2][3]. It can inform the design of nanoscale probes [4,5], the choice of measurement [6][7][8][9] and, as we shall see, the post-processing of measured data into an optimal temperature reading. Precision thermometry is rooted in the old problem of interpreting temperature fluctuations-in practice, temperature cannot be accessed directly but rather, estimated from the statistics of observable properties [10][11][12][13][14]. More generally, estimation theory allows to devise feasible strategies that can approach the fundamental precision limits of thermometry. Improving thermometric accuracy is not only relevant for quantum thermodynamics [2], but also in any practical application in which precise temperature control is necessary.
Strategies for temperature estimation may be classified as follows. Let T denote a true but unknown temperature, and let θ ∈ [θ 1 , θ 2 ] represent a hypothesis about the value of T . Local estimation schemes assume that θ 2 /θ 1 ∼ 1. If no such a priori hypothesis is required, the scheme is said to be global [15]. One readily sees that, if θ 2 /θ 1 ∼ 1 and T ∈ [θ 1 , θ 2 ], then θ ∼ T . Consequently, local strategies allow to reduce statistical fluctuations once the temperature is well known [16], but they cannot address the estimation of unknown temperatures in full generality. Currently, most literature on quantum thermometry focuses on local protocols [1][2][3][4][5][6][7][8][9]. This is partly due to the widespread use of the Cramér-Rao bound (CRB) [17,18] as the precision benchmark. The standard CRB assumes unbiased estimators, i.e., that the temperature estimates average to T , and it is exactly saturable only for a special class of probability models-the exponential family [16,19]. To accommodate a wider model set, one can employ local unbiased estimators [20] which are appropriate when the unknown temperature lies initially on a very narrow interval [16]. More generally, the CRB is approached using asymptotically large data sets [19,21], which in turn reduces the estimation error down to a regime in which local strategies become optimal. The applicability of the CRB thus leads to schemes that are useful only in a local sense, excluding cases where little is known about the temperature a priori, or where only few measurements can be performed. Furthermore, even if an exact saturation of the CRB were possible, the bound often depends explicitly on the unknown T [3]. In general, local thermometry is thus far too restrictive.
This Letter puts forward a new theory for global quantum thermometry, that is, a theory applicable to estimates based on small data sets even if θ lies on a broad range. Here the problem of global temperature estimation is formulated, and fully solved, within the Bayesian framework [22][23][24]. We achieve this by assigning a prior probability reflecting the initial state of information about temperature, and identifying an appropriate measure of uncertainty (an averaged 'cost' or 'deviation'). The latter must also respect the scale invariance of the problem, and turns out to be a type of mean logarithmic error. Equipped with this measure of uncertainty, we are able to derive analytical expressions for the optimal temperature estimator and its uncertainty, both of which make no 'unbiasedness' assumptions. Under certain conditions, local thermometry is recovered as a special case of this global formalism.
As a means of illustration, we apply the global theory to a non-interacting gas of n spin-1/2 particles. For this example, local thermometry is found unable to predict the true precision scaling when n 10 7 (with 5% tolerance). Moreover, the estimator identified as optimal in the local regime can in principle yield a much larger uncertainty than its global counterpart. To demonstrate the potential usefulness of the global approach in the analysis of experimental data, we also simulate and post-process measurement outcomes for this n-spin gas. The global estimator is then found to converge to the true temperature after µ 10 2 trials. In contrast, a local analysis can lead to a biased temperature estimate even for large µ. These results show that a paradigm shift towards Bayesian techniques may allow a more robust and significantly enhanced optimisation of thermometric protocols, especially in cases where the data are limited [21,25,26].
Scale invariance and logarithmic error.-Consider a system in equilibrium, where the true temperature T is well defined but unknown. To infer it, one can perform energy measurements, which return the value E, given T , according to some conditional probability distribution. This plays the role of a arXiv:2011.13018v3 [quant-ph] 28 Sep 2021 likelihood function [19,22], as it links the measurement process with the unknown parameter. We denote such function by p(E|θ), where we recall that θ is our hypothesis for the true temperature T . Instead of assuming that θ ∼ T , as local thermometry does, we introduce a prior probability p(θ) as a proxy for our initial state of information about T . It is then instructive to adopt the limit of complete ignorance, opposite to (and more general than) local estimation.
Naively, one would represent complete ignorance as p(θ) ∝ 1. However, the conditional probability p(E|θ) only depends on θ through the dimensionless ratio E/(k B θ), i.e., for some function f and where k B is Boltzmann's constant. This implies that we are dealing with a scale estimation problem [22,23,27]. Given that T is, at this stage, completely unknown, so is the scale of the problem. Consistency thus demands our initial state of information to be invariant under transformations E → E = γE and θ → θ = γθ [11,22], where γ is a dimensionless constant. In turn, this means that our prior must satisfy p(θ)dθ = p(θ )dθ , which leads to the functional equation p(θ) = γ p(γθ) with solution p(θ) ∝ 1/θ [22,23]. Indeed, note that the problem could have been equivalently formulated in terms of the inverse temperature β = 1/k B θ. Such choice should not alter our prior knowledge and yet, taking p(θ) ∝ 1 gives p(β) ∝ 1/β 2 , while p(θ) ∝ 1/θ correctly leads to p(β) ∝ 1/β [11].
To map a measurement outcome E into a temperature, we build a point estimatorθ(E). Its quality is assessed via some deviation function D[θ(E), θ] gauging the deviation ofθ(E) from θ. Since all the required information is contained in the joint probability p(E, θ) = p(θ)p(E|θ) ∝ p(E|θ)/θ we write the average uncertainty ofθ(E) as The integration over θ accounts for all the available prior information and makes Eq. (2) temperature-independent. This is a key feature that, unlike the local approach, leads to wellposed optimisation problems [22]. Our next step is to establish the form of the deviation function D. Let the dimensionless scalar x ∈ (−∞, ∞), and let its prior be p(x) ∝ 1. As discussed, e.g., in [22], this is a translationally invariant estimation problem, for which a flat prior represents complete ignorance. The deviation of Here, ε 0 is an arbitrary constant with units of energy included merely for dimension neutralisation [28], while α is a proportionality factor. Therefore, which is a bona fide scale parameter deviation function: it is symmetric, i.e., D(θ, θ) = D(θ,θ); it respects the invariance of the problem, that is, D(γθ, γθ) = D(θ, θ); it reaches its absolute minimum atθ = θ where it vanishes; and it grows (decreases) monotonically from (towards) that minimum wheñ θ > θ (θ < θ). While there may be other functions compatible with these conditions, Eq. (3) is certainly a suitable choice for thermometry. Below we further show that for α = 1 and k = 2, the global framework can be reduced to local thermometry assuming one does have prior (local) information. For that reason, we will fix α = 1 and k = 2 in the following, and after Eq. (3) is inserted in Eq.
(2), we arrive at We call¯ mle mean logarithmic error.
Optimal global strategy.-Our goal is to find the temperature estimator that is optimal with respect to Eq. (4). To do this, we must minimise¯ mle over all possible estimators. Since¯ mle is a functional ofθ(E), i.e.,¯ mle = [θ(E)], this is achieved by solving the variational problem where plays the role of a Lagrangian. We find that the optimal estimatorθ(E) minimising Eq. (4) is given by where p(θ|E) = p(E, θ)/p(E) is the posterior probability, given by Bayes theorem, and p(E) = dθ p(E, θ) [29]. Inserting the optimal estimatorθ(E) asθ(E) in Eq. (4) further gives the optimal logarithmic error¯ opt . The latter can be interpreted intuitively when split as where¯ p := dθ p(θ) log 2 (θ p /θ) is the uncertainty prior to any measurement, with optimal (prior) estimate k Bθp /ε 0 = exp dθ p(θ) log (k B θ/ε 0 ) , and can be thought of as the maximal information provided by the measurement E, on average. The calculations leading to Eqs. (6) and (7) are given in the Supplemental Material. Eqs. (6) and (7) constitute our main result. The former gives an optimal estimator,θ(E), requiring no prior assumptions and directly applicable on a given dataset. Eq. (7) indicates the corresponding uncertainty,¯ opt . Since¯ opt is a true minimum, Eq. (7) also serves as a generalised precision 'bound' for temperature estimation [30]. Unlike the CRB [3], this holds for any estimator, biased or unbiased. In addition, these results, currently written for a single measurement with outcome E, can be trivially adapted to account for any number of repetitions, i.e., i.i.d. (E 1 , E 2 , . . . ) [25]. Global thermometry is thus able to build temperature estimates drawn from abitrary datasets, including cases with scarce data.
Recovery of local thermometry.-While, for the sake of generality, T was initially assumed to be completely unknown, one may insert a more localised prior p(θ) from Eq. (4) onwards [31,32]. In that case, the hypothesis θ will effectively lie in a narrow range and the estimatorθ(E) will be close to θ. One then has where (9) is the averaged noise-to-signal ratio ∆θ 2 /θ 2 weighted by the prior [33]. Since ∆θ 2 is the 'frequentist' mean square error [16], it may be lower bounded as [19,22] where we have introduced the Fisher information and the bias b(θ) Provided that b(θ) 0 as is assumed in the local approach [16], we see that Eqs. (9), (10), and p(θ)/θ 2 0 lead to the Cramér-Rao-like bound¯ Equality would hold only inasmuch as the assumptions underpinning Eq. (12) are fulfilled. Namely, b(θ) 0 and closeness ofθ(E) and θ, which makes¯ cr a local quantifier even when θ is integrated. Hence, we have derived a local form of thermometry as a limit of the global framework. Note that the quantifier¯ = dθ p(θ)F (θ) −1 has been proposed as an attempt to supersede the local paradigm [34,35]. Notwithstanding its merits-Ref. [35] reports results beyond standard local thermometry-such¯ is not scale invariant. This might be ignored if the prior is narrowly concentrated around some fixed θ , since then¯ cr [(θ ) 2 F (θ )] −1 and F (θ ) −1 . That is, one is left in both cases with the Fisher information. But this limiting assumption is unnecessary in our truly global and intrinsically scale invariant approach.
Example: Non-interacting spin gas.-We now turn to illustrate how to find the best thermometric precision one could possibly get. Let us consider a gas of n non-interacting spin-1/2 particles with energy gap ω in thermodynamic equilibrium. This could correspond, e.g., to a dilute cloud of impurities fully equilibrated with a co-trapped ultra-cold majority  12) (dot-dashed blue) for a gas of n non-interacting spin-1/2 particles in thermal equilibrium. As can be seen, the global optimum is lower than the local bound unless n → ∞, meaning that the local bound misses information when n is 'too small'. Eq. (14) gives an asymptotic expansion matching the global optimum when n 10 2 (dashed purple). b) Data analysis in global thermometry. We simulated the outcomes r = (r1, . . . , rµ) of µ energy measurements on the n-spin gas, with n = 150 and true temperature (solid red) kBT /( ω) = 4. We then post-processed r using the global estimator in Eq. (6) (dotted blue) and a local estimator initialised at kBθ0/( ω) = 3 [16,19] (dot-dashed black). The global estimate converges to the true temperature after µ 10 2 shots. In contrast, the local theory leads to a biased estimate even for µ 500. The global error is calculated via Eq. (4) but with average over the posterior p(θ|r) (see Supplemental Material). The standard CRB gives the local error [16,19]. gas, whose temperature needs to be measured precisely [36][37][38][39]. The probability of measuring the total energy E to be r ω, with r = 0, 1, . . . , n, is [12,40] p(r|θ) = n r where ] + 1} n is the partition function. Additionally, suppose that p(θ) ∝ 1/θ is defined, for instance, on the finite support k B θ/( ω) ∈ [0.1, 10], so that normalisation gives p(θ) = 1/[2θ log (10)].
The optimum¯ opt can be readily evaluated after inserting the prior p(θ) and the likelihood (13) into Eq. (7) [41]. The result, for n ranging from 10 to 10 5 , is shown in Fig. 1 a). The local limit of this error [cf. Fig. 1 a)] is shown to take the form¯ cr 51.7/n in the Supplemental Material. Comparing both, we observe convergence as n → ∞, confirming the emergence of local thermometry within the global theory. However, for finite n we see that¯ cr >¯ opt . That is, while the global estimator extracts all available information for any n, a local approach leads to information loss when n is small.
To gain analytical insight into the scaling of¯ opt with n, first we note that, in this specific example,¯ cr −¯ opt b n q . A numerical fit [42] renders the asymptotic expansion opt 51.7 n − 143 which, as shown in Fig. 1 a), matches the true optimum¯ opt when n 10 2 . This in turn allows to assess how large n needs to be for the (local) ∼ 1/n scaling to hold approximately. Consider the equation |¯ cr [n(τ )] −¯ opt [n(τ )]| = τ¯ opt [n(τ )] [32], where n(τ ) is the minimum number of spins which drives the relative error between the optimal and asymptotic curves below a tolerance τ . Using Eq. (14) gives the condition n(τ ) 58.5 (1 + 1/τ ) 4 . As expected, n(τ ) → ∞ when τ → 0. But, even when tolerating a 5% deviation, spin numbers of n ∼ 10 7 are required for local thermometry to give a correct scaling. Admittedly, the value of n(τ ) is protocol-dependent [21,32], but even a simple example suffices to illustrate the perils of the local frameworkinformation loss (Fig. 1 a)) and failure to produce a valid lown scaling (Eq. (14)).
We simulated the outcomes r arising from the aforementioned protocol, for a gas with n = 150 spins and true temperature k B T /( ω) = 4. The local estimateθ L ± ∆θ L , initialised with the 'hint' k B θ 0 /( ω) = 3, is shown in Fig. 1 b) (dot-dashed black) to be biased even when µ 1. This contrasts with the convergence of the global estimateθ ± ∆θ (dotted blue) to the true temperature (solid red). One could argue for a 'two-step' method where a part of the data is used to provide a better θ 0 prior to applying local thermometry. Yet, one cannot anticipate how many trials a good seed θ 0 requires, nor when such θ 0 is sufficiently close to the true temperature. The global framework is instead general, reliable and works at once. Further evidence is provided in the Supplemental Material, where a comparison between global thermometry and a histogram-fitting procedure demonstrates the potential gain of global techniques for experiments with limited data.
Conclusions.-We have demonstrated that local precision benchmarks are insufficient whenever few data or no substantial prior knowledge are available. On the contrary, a global approach is applicable to any temperature-estimation protocol regardless of the measurement record length, and can naturally account for any degree of prior information. For instance, it would be interesting to exploit Eq. (6) to postprocess data measured in the nanokelvin regime, which is experimentally accessible with ultracold Bose and Fermi gases [36,37,[44][45][46][47][48] and relevant for quantum simulation [49]. In addition, since Eq. (4) is deduced at the level of probability distributions (i.e., with no explicit consideration of the Born rule p(E|θ) = Tr[Π(E)ρ(θ)] [50]), Eq. (6) can be applied also to classical systems. Finally, note that the key assumption behind Eq. (4) is that the parameter is a scale, which makes it applicable beyond temperature estimation (e.g., to estimate biochemical rates in single-molecule experiments [51][52][53][54]).
From a fundamental perspective, combining Eq. (6)-the rule to calculate optimal estimates-with the theoretical optimum (7) provides a powerful tool to address open problems in thermometry. These include pushing precision limits further by optimising over the energy spectrum of the probe system [4,35], or over measured quantities beyond energy (see Supplemental Material). Moreover, the global formalism may be extended to accommodate for the non-equilibrium states [8,55,56] resulting from limited access to interacting thermalised probes, and gives the theoretical support needed to derive more fundamental energy-temperature uncertainty relations [57]. Global quantum thermometry has thus potential to become the new standard for thermometry in the quantum regime.

Optimisation of the mean logarithmic error
In this work we employ the mean logarithmic error as the figure of merit. To optimise it with respect to all possible estimators, first we solve the variational problem which is mathematically equivalent to require that [61] d dα By inserting Eq. (S1) in the left hand side of Eq. (S3), and using the fact that p(E, θ) = p(E)p(θ|E), we find that which vanishes for all variationsη(r) when dθ p(θ|E) log θ (E) be the probability, conditioned on the hypothesis θ, of measuring the total energy of a gas of n non-interacting spins-1/2 particles to be r ω [12,40], with r = 0, 1, . . . , n and partition function (S18) According to our results in the main text, the calculation of the Bayesian optimum in Eq. (S9) may be approximated as when n 1. In our case, the Fisher information becomes where we have used the identities with which can be found by differentiating where k B θ/( ω) := y and the value for the last integral has been found numerically. In summary, we have shown that, asymptotically,¯ opt ¯ cr = 51.7/n, as stated in the main discussion.
The likelihood function representing the information associated with this protocol is wherer := µ i=1 r i /µ.

Simulation of outcomes
For the purpose of illustrating how an analysis of experimental data would proceed using the global framework in this work, here we simulate the measurement outcomes (r 1 , . . . , r µ ). First we construct the discrete cumulative distribution where p(m|T ) is given by Eq. (S17), T is the true temperature, and 0 r n. By construction, 0 f n,T (r) 1. Next, we impose f n,T (r) = u, where u is a uniformly distributed random number between 0 and 1. Inverting this relationship we get where f −1 n,T is defined such that f −1 n,T (f n,T (x)) = x and f n,T (f −1 n,T (y)) = y. Finally, by generating a string of µ random numbers (u 1 , . . . , u µ ) between 0 and 1, we arrive at (r 1 , . . . , r µ ) = (f −1 n,T (u 1 ), . . . , f −1 n,T (u µ )).
The data in the main text was simulated with a numerical implementation of this procedure. We chose k B T /( ω) = 4, n = 150, and µ = 500, and the random numbers were produced using the rand function in MATLAB.

Global thermometry in experiments
Consider the logarithmic deviation function D[θ(r), θ] = log 2 [θ(r)/θ]. To the theorist who is searching for fundamental precision limits, both the correct hypothesis θ and the measurement outcomes r that a given scheme may produce are unknown. Hence, theoretical studies such as that in the first part of our work require that we average log 2 [θ(r)/θ] over both temperatures and outcomes weighted by the joint probability p(r, θ), which leads to the uncertainty quantifier [62] The situation an experimentalist faces is, however, different. Since, in experiments, the measurement outcomes r are known (here, because we simulated them), the uncertainty quantifier for this new situation is instead mle (r) := dθ p(θ|r) log 2 θ (r) θ , where p(θ|r) is the posterior probability given, in this case, by with k B θ/( ω) ∈ [0.1, 10]. As expected, the temperature is still integrated-it is unknown-, but the final error depends now on r. Note that the deviation function is still D[θ(r), θ] = log 2 [θ(r)/θ]. A natural question is whether the estimator in Eq. (S7) is optimal also with respect to the uncertainty quantifier in Eq. (S30). The next section answers in the affirmative-even when theorists and experimentalists need to evaluate their uncertainties differently because their initial information differs, both use the same deviation function and will find the same optimal estimator. For an extended discussion, see, e.g., sections 13.8 and 13.8 of Ref. [22], and section 3.2 of Ref. [24].

Optimal strategy
The first derivative of Eq. (S30) reads Imposing d¯ mle (r)/dθ(r) = 0 leads to which is the same estimator in Eq. (S7) but written in the notation of the spin gas. By inserting Eq. (S33) in the expression for the second derivative d 2¯ mle (r)/dθ(r) 2 , one further finds that the latter is positive. Therefore, the estimator in Eq. (S33) (or, equivalently, Eq. (S7)) leads to a minimal error and is thus optimal with respect to both the theory-motivated uncertainty in Eq. (S29), and the experiment-based uncertainty in Eq. (S30).

Data analysis in local thermometry
In the absence of an asymptotically large number of measurement outcomes (i.e., µ is finite and possibly small), local estimation leads to estimates of the form [16,19] where θ 0 is an initial 'hint' at the true temperature. From equation Eq. (S25) we see that By inserting this and the Fisher information (S20) in Eq. (S34), we find that the local estimate associated with the n-spin gas is with uncertainty The local estimator examined in the main text is based on the choice k B θ 0 /( ω) = 3, which is close to the true temperature k B T /( ω) = 4. All other simulation parameters were chosen as in indicated in the previous section. Specifically, these are found by inverting the relationship between variance σ and temperature θ in Eq. (S39). As can be observed, the global estimates oscillate around the true temperature (solid red) even when the number of trials µ is low. In contrast, the asymptotic estimates are biased towards larger temperatures unless µ 200. Plots (b-d) show the aforementioned histograms (red circles) together with the associated Gaussian fits (solid black). The uncertainty areas (shaded black) have been calculated by propagating the standard errors of the estimates for A and σ.

Thermometry beyond energy measurements
Scale-invariant global thermometry is not restricted to protocols that measure energy. For example, consider a harmonic oscillator with mass m, angular frequency ω and coordinate q. Measuring the position, the probability that the dimensionless position coordinate x := q mω/ lies between x and x + dx is given, in the canonical ensemble, by [63] p(x|θ)dx where We see that, even when energy is no longer the measured quantity, Eq. (S38) only depends on the ratio of energies ω/2 and k B θ. As such, the arguments leading to the prior p(θ) ∝ 1/θ and the deviation function D[θ(x), θ] = log 2 [θ(x)/θ] apply.