# Weakly invasive metrology: quantum advantage and physical implementations

M. Perarnau-Llobet  Max-Planck-Institut für Quantenoptik, D-85748 Garching,
Germany.  Munich Center for Quantum Science and Technology (MCQST),
Schellingstrasse 4, D-80799 München  Département de Physique Appliquée,
Université de Genève, Genève, Switzerland  D. Malz  Max-Planck-Institut für
Quantenoptik, D-85748 Garching, Germany.  Munich Center for Quantum Science
and Technology (MCQST), Schellingstrasse 4, D-80799 München  J. I. Cirac  Max-
Planck-Institut für Quantenoptik, D-85748 Garching, Germany.  Munich Center
for Quantum Science and Technology (MCQST), Schellingstrasse 4, D-80799
München

###### Abstract

We consider the estimation of a Hamiltonian parameter of a set of highly
photosensitive samples, which are damaged after a few photons $N_{\rm abs}$
are absorbed, for a total time $T$. The samples are modelled as a two mode
photonic system, where photons simultaneously acquire information on the
unknown parameter and are absorbed at a fixed rate. We show that arbitrarily
intense coherent states can obtain information at a rate that scales at most
linearly with $N_{\rm abs}$ and $T$, whereas quantum states with finite
intensity can overcome this bound. We characterise the quantum advantage as a
function of $N_{\rm abs}$ and $T$, as well as its robustness to imperfections
(non-ideal detectors, finite preparation and measurement rates for quantum
photonic states). We discuss an implementation in cavity QED, where Fock
states are both prepared and measured by coupling atomic ensembles to the
cavities. We show that superradiance, arising due to a collective coupling
between the cavities and the atoms, can be exploited for improving the speed
and efficiency of the measurement.

##  1 Introduction

One exciting prospect of quantum technologies are more precise photonic
measurements through the use of quantum correlations [1, 2, 3, 4, 5]. Given a
fixed (average) photon number $N$, a variety of quantum states surpasses the
shot-noise limit imposed by coherent states, notably squeezed, NOON or twin
Fock states [6, 7, 8]. One of the motivations to limit $N$ is that some
photosensitive materials may be damaged when they absorb too many photons.
However, in this case it may be more meaningful to constrain the number of
photons absorbed by the sample $N_{\mathrm{abs}}$, instead of $N$. Examples of
delicate samples include biological [9, 10, 11, 12, 13, 14, 15], molecular
[16] and atomic systems [17, 18]. For the latter, the maximal $N_{\rm abs}$
that the sample can tolerate can be a few photons, as quantum states such as
the GHZ state can be extremely susceptible to noise.

The number of absorbed photons $N_{\mathrm{abs}}$ is not only determined by
the $N$ but also in general depends on the time that the sample is exposed to
light and its intrinsic properties. Still, for interferometric measurements
[18, 19, 12, 13], placing a constraint in $N_{\rm abs}$ becomes essentially
equivalent to fixing the total number of photons. Instead, in this work we
will consider frequency measurements in which photons are allowed to interact
continuously with the sample. In this case, we will show that constraining
$N_{\rm abs}$ instead of $N$ leads to qualitatively new results.

In frequency measurements, both the probe size (e.g. the number of photons
$N$) and the total time $T$ are resources for quantum metrology [8, 20, 21,
22], and interesting interplays between both appear when the probe is subject
to noise or decoherence [20, 21, 22, 23, 24, 25, 26, 27]. Optimal metrological
protocols for a fixed $N$ and $T$ have been considered for atomic measurements
[20, 21, 22, 23, 24, 25, 26, 27], non-linear photonic systems [28], many-body
open quantum systems [29], and time-dependent Hamiltonians [30, 31, 32]. Such
time-optimized protocols can lead to a supraclassical scaling with $N$ of the
measurement precision for specific types of correlated or directional noise
[23, 24, 33, 25, 34, 35, 36, 26, 27], and to a constant advantage for
uncorrelated noise [20, 37, 38, 39, 40].

Here, we investigate frequency measurements in a two-mode photonic system,
where one wishes to estimate the strength of a beamsplitter-like interaction.
This a common task when characterizing the coupling strength in devices such
as coupled cavity modes, nanophotonic lattices, superconducting resonators or
micromechanical resonators. In contrast to previous works (see, for example,
[28]), we shall not put the constraint on $N$, but on the energy that the
system can absorb ($N_{\rm abs}$). This subtle difference turns out to have
important consequences: quantum metrological protocols involving a small
amount $N\approx 5-10$ of photons and a finite amount of samples, can overcome
classical strategies using coherent states of (potentially) arbitrary
intensity and an arbitrarily large number of samples. We quantify the quantum
advantage as a function of $N_{\rm abs}$ and $T$, and also discuss robustness
to imperfections (non-ideal detectors, finite preparation and measurement
times).

In a second part of the article, we develop a proposal for realising such
enhancements in state-of-the-art technologies using a cavity or circuit QED
set-up [41, 42]. The key idea is to couple each cavity to an atomic ensemble,
and engineer the dynamics to both prepare and measure Fock states in the
cavity. The collective coupling between the atoms and the cavity leads to the
well-known phenomenon of Dicke superradiance [43], which has received renewed
attention in the last years due to the experimental progress in cavity QED
[44, 45, 46, 47, 48] and waveguide QED set-ups [49, 50, 51]. On the
theoretical side, superradiance has been exploited for several applications of
quantum photonic technologies [3, 4, 5, 52], including preparation of photonic
states [53, 54, 55, 56], quantum number-resolved measurements [57, 58, 59],
and quantum metrology [60, 61]. Here, we explore similar applications in the
context of cavity or circuit QED, and we argue that the collective coupling
can be exploited to increase the efficiency and speed of both the measurement
and preparation of Fock states.

##  2 Framework and physical setup

We model the “delicate sample” as a two-mode photonic system, $H=H_{0}+gH_{\rm
int}$ with $H_{0}=\omega(a^{\dagger}a+b^{\dagger}b)$ and $H_{\rm
int}=(a^{\dagger}b+ab^{\dagger})/2$. We wish to estimate the interaction
strength $g$ between modes ($g$ has units of frequency and we set $\hbar=1$).
The inference process is mediated by photons, which can also be absorbed by
the sample leading to its degradation. The latter process is modelled as a
Markovian dissipative process, so that the time evolution of the photonic
state $\rho$ reads:

$\displaystyle\dot{\rho}=-i[H_{0}+gH_{\rm
int},\rho]+\gamma(\mathcal{D}_{a}(\rho)+\mathcal{D}_{b}(\rho))$ (1)

with $\mathcal{D}_{x}(A)=xAx^{\dagger}-\frac{1}{2}\\{x^{\dagger}x,A\\}$. With
time, information on $g$ is encoded in $\rho$, but also photons are lost
(absorbed). These two dynamical processes decouple, so that the evolution can
be described as two independent channels: $\rho(t)=\mathcal{C}_{g,t}^{\rm
uni}\circ\mathcal{C}_{\gamma,t}^{\rm diss}[\rho_{0}]$, with $C_{\gamma,t}^{\rm
diss}[\rho]=e^{-\gamma t(\mathcal{D}_{a}+\mathcal{D}_{b})}[\rho]$ and
$C_{g,t}^{\rm uni}[\rho]=e^{-i(H_{0}+gH_{\rm int})t}\rho e^{i(H_{0}+gH_{\rm
int})t}$.

If the initial state $\rho_{0}$ contains $N$ photons, the (average) number of
absorbed photons is given by

$\displaystyle N_{\rm abs}(t)=\mathrm{Tr}[\rho(t)\hat{N}]=N(1-e^{-\gamma t}),$
(2)

where $\hat{N}=a^{\dagger}a+b^{\dagger}b$ counts the total number of photons.
We shall assume that the delicate sample is destroyed when $N_{\rm
abs}(t)=N_{\rm abs}$, which sets a maximum available time for information
acquisition. This constrains the possible estimation schemes and, to some
extent, $N_{\rm abs}$ can be seen as a resource: a larger $N_{\rm abs}$
enables us to obtain more information (and/or in a faster manner) from a
single sample.

In order to estimate $g$, we consider the following scenario: We have at our
disposal a large number of delicate samples that we can measure sequentially
for a total time $T$. The same estimation scheme, or test, is applied to each
sample. In each test, a photonic state $\rho_{0}$ is prepared, it evolves for
some time $t$ according to (1) reaching $\rho_{g}$, and is measured by an
observable $\Pi$, which yields the outcome $s_{j}$ with probability $p_{j}$.
The whole experiment consists of $\nu$ tests, with each test taking a time
$t=T/\nu$, which must satisfy $N_{\rm abs}(t)\leq N_{\rm abs}$. Then, the
uncertainty $\Delta^{2}g$ of an unbiased estimator of $g$ satisfies [62, 63,
64]:

$\displaystyle\Delta^{2}g\geq\frac{1}{\nu\mathcal{F}_{\rm
C}}\geq\frac{1}{\nu\mathcal{F}_{\rm Q}}.$ (3)

Here, $\mathcal{F}_{\rm C}=\sum_{j}p_{j}^{-1}\left(\partial p_{j}/\partial
g\right)^{2}$ is the Classical Fisher Information (CFI) and $\mathcal{F}_{\rm
Q}$ is the quantum Fisher Information (QFI), which will be defined later for
each case of interest, and characterizes the potential of $\rho_{g}$ for
estimating $g$ with an optimal measurement [64]. Our goal is to minimize (3)
for both coherent and quantum (e.g. Fock, NOON, or squeezed) states. In both
cases, we set the two constraints:

  * •

the total time $T$ of the experiment.

  * •

the maximal number of photons $N_{\rm abs}$ that a single sample can absorb.

For coherent states, we shall put no more constraints, so that the photon
number $N$ and the number of samples $\nu$ can be made arbitrarily large,
which contrasts with previous works, see e.g. [21]. On the other hand, for
quantum states, in Sec. 5 we will also constrain $N$ and the measurement
efficiency, and consider a finite rate of preparation and measurement of
quantum states.

It is worth pointing out that, defining $a_{\pm}\equiv(a\pm
b^{\dagger})/\sqrt{2}$, we can rewrite $H$ as
$H=(\omega+g)a^{\dagger}_{+}a_{+}+(\omega-g)a^{\dagger}_{-}a_{-}$, so an
alternative interpretation of this framework is that we are estimating the
frequency difference between two modes. In terms of the original modes $a$ and
$b$, both pictures are physically equivalent if a balanced beamsplitter is
applied to the input (and output) light. With this transformation, it is also
clear that the problem at hand can be formally mapped to standard Mach-Zehnder
interferometry with $\varphi=gt$, where photon absorption corresponds to a
symmetric (time-dependent) photon loss. This map naturally enables us to use
techniques and results developed in this context [1, 2, 3].

##  3 Optimal classical strategy

Let us first analyze the optimal strategy using coherent states. We consider
as an input state
$\rho_{0}=\left.\left|{g_{0}}\right.\right\rangle\left.\left\langle{g_{0}}\right.\right|$
with
$\left.\left|{g_{0}}\right.\right\rangle=\left.\left|{\cos(\theta)\sqrt{N},\sin(\theta)\sqrt{N}}\right.\right\rangle$.
The dissipative channel acts upon the initial state as
$\left.\left|{\phi}\right.\right\rangle=\mathcal{C}_{\gamma,t}^{\rm
diss}[g_{0}]=\left.\left|{\cos(\theta)\sqrt{e^{-\gamma
t}N},\sin(\theta)\sqrt{e^{-\gamma t}N}}\right.\right\rangle$. Since the state
remains pure, we can quantify the QFI of $\rho_{g}=\mathcal{C}^{\rm
uni}_{g,t}[\left.\left|{\phi}\right.\right\rangle\left.\left\langle{\phi}\right.\right|]$
as $\mathcal{F}_{\rm Q}=4t^{2}(\left.\left\langle{\phi}\right.\right|H_{\rm
int}^{2}\left.\left|{\phi}\right.\right\rangle-(\left.\left\langle{\phi}\right.\right|H_{\rm
int}\left.\left|{\phi}\right.\right\rangle)^{2})$ [64], obtaining:

$\displaystyle\mathcal{F}_{\rm Q}^{\rm coh}=t^{2}Ne^{-\gamma t},$ (4)

which is the shot-noise-limit. Using $N_{\rm abs}=N(1-e^{-\gamma t})$ and
$t=T/\nu$, the accumulated QFI in a time $T$ reads:
$\mathcal{\nu}\mathcal{F}_{\rm Q}^{\rm coh}=T^{2}N_{\rm abs}e^{-\gamma
T/\nu}/(1-e^{-\gamma T/\nu})\nu.$ This expression increases monotonically with
$\nu$, so its maximum $\left(\Delta g\right)_{\rm
coh}^{-2}\equiv\max_{\nu}(\mathcal{\nu}\mathcal{F}_{\rm Q}^{\rm coh})$ is
obtained for $\nu\rightarrow\infty$:

$\displaystyle\left(\Delta g\right)_{\rm coh}^{-2}=\frac{T}{\gamma}N_{\rm
abs}.$ (5)

Strictly speaking, this bound can be saturated by testing
$\nu\rightarrow\infty$ samples, each for an infinitesimally small time
$t\rightarrow 0$ using a number $N\rightarrow\infty$ of photons, in such a way
that both $N_{\rm abs}=\gamma tN$ and $T=\nu t$ remain constant. We call this
theoretical limit ($N,\nu\rightarrow\infty$ and $t\rightarrow 0$, with both
$N_{\rm abs}=\gamma tN$ and $T=\nu t$ fixed) the _Poisson limit_ , which will
play a relevant role in this work. The importance of the classical bound (5)
is that it remains finite –being limited by both $T$ and $N_{\rm abs}$–
despite using an unbounded photon number (at each test) and an arbitrarily
large number of tests. We also note that optimality of fast measurements has
also been found in frequency measurements of atomic ensembles [20, 23, 24, 25,
26, 27].

##  4 Quantum strategies

We now move to quantum resources. We begin by deriving an upper bound on
$\mathcal{F}_{Q}$ given arbitrary quantum states. We use the results of Refs
[65, 66, 37, 38, 39], where the upper bound $\mathcal{F}_{\rm Q}\leq
N(1-\mu)/\mu$ is obtained for an optical interferometer with symmetric photon
loss in both arms, as quantified by $\mu$ (the probability of photon loss in
each arm of the interferometer). In the context studied here this translates
as:

$\displaystyle\mathcal{F}_{\rm Q}\leq t^{2}N(1-\mu)/\mu$ (6)

with $\mu=1-e^{-\gamma t}$ and $N_{\rm abs}=\mu N$. In analogy with the
classical derivation, an upper bound on the accumulated QFI for a given
$N_{\rm abs}$ and $T$ can now be easily obtained using $T=t\nu$:

$\displaystyle\nu\mathcal{F}_{\rm Q}\leq\frac{T^{2}N_{\rm abs}e^{-\gamma
T/\nu}}{\nu(1-e^{-\gamma T/\nu})^{2}}.$ (7)

This expression also increases monotonically with $\nu$, and for $\nu\gg\gamma
T$ it simplifies to:

$\displaystyle\nu\mathcal{F}_{\rm Q}\leq\nu\frac{N_{\rm abs}}{\gamma^{2}}.$
(8)

Approximating $N_{\rm abs}=N(1-e^{-\gamma T/\nu})$ as $N_{\rm
abs}\approx\gamma TN/\nu$ for $\nu\gg\gamma T$, we can express (8) in terms of
$N$ as:

$\displaystyle\nu\mathcal{F}_{\rm Q}\leq\frac{T}{\gamma}N.$ (9)

Comparing (9) with (5), we note that in principle an arbitrarily large
advantage over the classical bound can be obtained in the Poisson limit (where
$N\rightarrow\infty$ and $\nu\rightarrow\infty$ with $T$ and $N_{\rm abs}$
constant). For finite but large $N$, the quantum advantage scales as $N/N_{\rm
abs}$. To understand intuitively this large advantage, we note that
$\mathcal{F}_{Q}\sim t^{2}N^{2}$ for states featuring Heisenberg scaling,
which remains constant in the Poisson limit111In the Poisson limit, Heisenberg
scaling may be preserved as $N_{\rm abs}/N\rightarrow 0$ when
$N\rightarrow\infty$. This observation is not in contradiction with the well-
known fact that quantum states lose Heisenberg scaling as $N\rightarrow\infty$
for $\mu>0$ constant [65, 66, 37, 38, 39], as in this case $N_{\rm abs}/N$
remains finite as $N\rightarrow\infty$. These heuristic considerations will be
made more precise for specific states in what follows. .

While the previous observations illustrate that large quantum advantages are
possible in the Poisson limit, two very relevant questions appear: (i) how
close specific quantum states can get to the upper bound Eq (8), and, more
importantly: (ii) whether the classical bound (5) can be overcome in realistic
scenarios where $N$ is small and imperfections are present (non-ideal
measurements, finite time of preparation of quantum states). In what follows,
we address (i) by computing $\mathcal{F}_{Q}$ for relevant quantum states in
the Poisson limit. Question (ii) will be addressed in Sec. 5.

We start by the paradigmatic case of twin-Fock states (TFS) [7, 67, 68]. In
this case, we have
$\rho_{0}=\left.\left|{\phi_{0}}\right.\right\rangle\left.\left\langle{\phi_{0}}\right.\right|$
with
$\left.\left|{\phi_{0}}\right.\right\rangle=\left.\left|{n,n}\right.\right\rangle$
and $N=2n$. This state evolves for a time $t$ according to (1), which we
recall can be split in two independent channels: a unitary one which encodes
$g$, and a dissipative one where photons are lost with probability
$\mu=1-e^{-\gamma t}$. The state after a time $t$ can then be described as:

$\displaystyle\rho_{g}=\sum_{k,j}p_{k}p_{j}\left.\left|{\phi_{k,j}(t)}\right.\right\rangle\left.\left\langle{\phi_{k,j}(t)}\right.\right|$
(10)

where $\left.\left|{\phi_{k,j}(t)}\right.\right\rangle=e^{-itgH_{\rm
int}}\left.\left|{n-k,n-j}\right.\right\rangle$, and $p_{k}$ is the
probability of absorving $k$ photons after a time $t$, which is given by:
$p_{k}=\binom{n}{k}\mu^{k}(1-\mu)^{n-k}$. To compute the QFI of this state, it
is convenient to note that given
$\rho_{g}=\sum_{s}q_{s}\left.\left|{\phi_{s}(t)}\right.\right\rangle\left.\left\langle{\phi_{s}(t)}\right.\right|$,
with $\left.\left|{\phi_{s}(t)}\right.\right\rangle=e^{-itgH_{\rm
int}}\left.\left|{\phi_{s}}\right.\right\rangle$ and
$\langle\phi_{s}|\phi_{l}\rangle=\delta_{sl}$; the QFI reads $\mathcal{F}_{\rm
Q}=4t^{2}[\sum_{i}q_{i}(\Delta H_{i})^{2}-\sum_{i\neq
j}2q_{i}q_{j}|H_{ij}|^{2}(q_{i}+q_{j})^{-1}],$ with $(\Delta
H_{i})^{2}=\left.\left\langle{\phi_{i}}\right.\right|H^{2}_{\rm
int}\left.\left|{\phi_{i}}\right.\right\rangle-(\left.\left\langle{\phi_{i}}\right.\right|H_{\rm
int}\left.\left|{\phi_{i}}\right.\right\rangle)^{2}$ and
$|H_{ij}|^{2}=|\left.\left\langle{\phi_{i}}\right.\right|H_{\rm
int}\left.\left|{\phi_{j}}\right.\right\rangle|^{2}$ [64, 69]. For TFS, we
hence obtain,

$\displaystyle\mathcal{F}_{\rm Q}^{\rm
TFS}=4t^{2}\sum_{ij}^{n}p_{i}p_{j}(n-i)(n-j+1)\left(\frac{1}{2}-\frac{1}{1+\frac{(n-j+1)(i+1)}{j(n-i)}}\right).$
(11)

Now, taking the Poisson limit of (11) ($t\rightarrow 0$ with $2n\gamma
t=N_{\rm abs}$), yields

$\displaystyle\mathcal{F}_{\rm Q}^{\rm TFS}=\frac{N_{\rm
abs}^{2}}{\gamma^{2}}\sum_{ij}^{\infty}p_{i}p_{j}\left(\frac{1}{2}-\frac{j}{i+1+j}\right)\equiv\frac{\mathcal{G}(N_{\rm
abs})}{\gamma^{2}},$ (12)

with

$\displaystyle p_{k}=\frac{(N_{\rm abs}/2)^{k}e^{-N_{\rm abs}/2}}{k!}.$ (13)

For $N_{\mathrm{abs}}\gg 1$, the Poisson distribution (13) is strongly peaked
around $k=N_{\mathrm{abs}}/2$, such that the sum in (12) is dominated by
$i=j=N_{\mathrm{abs}}/2$. In this regime,
$\mathcal{G}(N_{\mathrm{abs}})\approx N_{\mathrm{abs}}/2$, which is half of
the upper bound (8). In contrast, as $N_{\mathrm{abs}}\to 0$,
$\mathcal{G}(N_{\mathrm{abs}})\approx N_{\mathrm{abs}}^{2}/2$. In general, a
global measurement on both modes is needed to saturate the QFI (12) [69]. The
$\mathcal{F}_{C}$ has been considered for more realistic photon number-
resolved measurements (NRM) [70, 68, 71, 72], and we study it in the Poisson
limit in Sec. B of the Appendix. For $g\approx 0$, we find
$\mathcal{F}_{C}^{\rm NRM}|_{g=0}=N_{\rm abs}^{2}e^{-N_{\rm
abs}/2}/2\gamma^{2}$. The exponential decay with $N_{\rm abs}$ can be avoided
by suitably optimising over the interaction strength $g$, leading to a quasi-
linear growth of $\mathcal{F}_{C}|_{g=g*}$ with $N_{\rm abs}$ (see Fig. 1).

Figure 1: $\mathcal{F}_{Q}$ for TFS and NOON states (Eqs. (12) and (14)), and
$\mathcal{F}_{C}$ for TFS at $g=0$ and $g=g*$ using photon number resolved
measurements, $\mathcal{F}_{C}$ for optimised two mode squeezed states with
number-resolved measurements (details in Sec. A of the Appendix). All
quantities are computed in the Poisson limit ($N\rightarrow\infty$,
$t\rightarrow 0$), so that only states with Heisenberg scaling can yield non-
zero information in this plot. Parameters: $\gamma=1$.

We now consider NOON states. In particular, we take as an initial state
$\rho_{0}=\left.\left|{\rm
NOON}\right.\right\rangle\\!\\!\left.\left\langle{\rm NOON}\right.\right|$
with $\left.\left|{\rm
NOON}\right.\right\rangle=(\left.\left|{0,N}\right.\right\rangle+\left.\left|{N,0}\right.\right\rangle)/\sqrt{2}$.
In this case, $\mathcal{F}_{Q}^{\rm NOON}$ is given by $N^{2}t^{2}$ times the
probability of not losing any photon which, in the Poisson limit, is given by
$p_{0}^{2}$ in (13). Hence,

$\displaystyle\mathcal{F}_{Q}^{\rm NOON}=\frac{N^{2}_{\rm
abs}}{\gamma^{2}}e^{-N_{\rm abs}}.$ (14)

For $N_{\rm abs}\ll 1$, NOON perform twice as good as TFS, but this advantage
is exponentially suppressed for larger $N_{\rm abs}$. In fact, NOON states are
optimal for $N_{\rm abs}\ll 1$, which means that the bound (8) can not be
saturated in this regime. In the regime $N_{\rm abs}\gg 1$, the upper bound
(8) can be saturated using two mode squeezed states and number-resolved
measurements [73, 74], which we show in Sec. A of the Appendix. The
performance of TFS, squeezed and NOON states in the Poisson limit is
summarised in Fig. 1. In the regime $N_{\rm abs}=\mathcal{O}(1)$, the
performance can be improved by considering more general states, such as the
optimal states discussed in [75, 76, 77, 78, 66, 79, 80, 81].

Summarising, quantum photonic states (TFS, squeezed or NOON states) can
provide an arbitrarily large advantage over the classical bound (5) in the
Poisson limit, which however requires $N\rightarrow\infty$ and $t\rightarrow
0$ (i.e. arbitrarily fast measurements). In the next section, we explore
quantum advantages in realistic scenarios with small $N$ and finite $t$, and
also consider the presence of non-idealities in the preparation and
measurement steps.

Figure 2: $(\Delta g)^{-2}\equiv\nu\mathcal{F}_{\rm Q}$ per unit of time as a
function of $N_{\rm abs}$ for twin Fock states (TFS) of low $N$, together with
the classical bound (5) for coherent states corresponding to the limit
$N\rightarrow\infty$, $\nu\rightarrow\infty$. The numerical results for TFS
are obtained by computing $\max_{\nu}(\nu\mathcal{F}_{\rm Q})$ given the
constraints $t\nu=T$ and $N_{\rm abs}(t)\leq N_{\rm abs}$ with $N_{\rm
abs}(t)$ in (2). The optimal $\nu$ for TFS, which satisfies
$\nu/T\gamma\approx N/N_{\rm abs}$, is shown in the inset. These results
confirm quantum advantages using low-photon entangled states over coherent
states of arbitrary intensity. Parameters: $T=10$ and $\gamma=1$, but
essentially the same results are obtained for larger $T$. Note that the bound
(3) becomes more accurate as $T$, and hence $\nu$, increases.

##  5 Quantum advantage in realistic scenarios

We first explore the presence of finite $N$. First, when $N$ is finite with
$N\gg 1$, we can use $N_{\rm abs}\approx N\gamma t$ and $\nu=T/t$ to
approximate $(\Delta g)^{-2}=\nu\mathcal{F}$ as

$\displaystyle(\Delta g)^{-2}\approx(\Delta g)^{-2}_{\rm coh}\frac{N}{N_{\rm
abs}^{2}}\mathcal{F},$ (15)

where $\mathcal{F}$ is any of the CFI or QFI shown in Fig. 1. This expression
can be compared with (5), where we note a linear increase of the quantum
advantage with $N$. Interestingly, quantum advantages are also observed when
$N$ is small, so that Eq. (15) is not necessarily valid. This is shown in Fig.
2, where we compute the QFI of TFS exactly using (11) for low $N<10$. Notably,
we see that even quantum states with $N=2$ can outperform arbitrary classical
strategies for sufficiently small $N_{\rm abs}$. Importantly, the number of
repetitions of the experiment $\nu/\gamma T\approx N/N_{\rm abs}$ is also
small in such scenarios (see inset of Fig. 2 ). While these considerations are
promising, the results of Fig. 2 are obtained assuming perfect preparation and
measurement devices, which motivates the analysis of noise robustness in what
follows.

Let us consider the main practical limitations: measurement devices with
efficiency $\eta<1$, and an extra time $t_{\rm ext}$ to prepare and measure
quantum states [22]. More precisely, we model photon loss in the measurement
process through a beamsplitter interaction with vacuum of each mode $a$, $b$:

$\displaystyle a\rightarrow\sqrt{\eta}a+\sqrt{1-\eta}e_{1}$ $\displaystyle
b\rightarrow\sqrt{\eta}b+\sqrt{1-\eta}e_{2}$ (16)

so that there is a probability $1-\eta$ of losing a photon. Since $\eta$ is
the same in both modes, this beam splitter interaction commutes with $H_{\rm
int}$, so that this operation can be applied either before (imperfect state
preparation) or after (imperfect detector) the acquisition of information of
$g$. In particular, we can generalise $\mu$ as: $\mu=1-e^{-\gamma t}\eta$,
where $\eta$ is independent of the time of the process, and where we recall
that $N_{\rm abs}=N(1-e^{-\gamma t})$ (i.e. the photons loss in the vacuum do
not damage the sample). Indeed, $\eta$ quantifies the efficiency of the
detector. On the other hand, we also assume the existence of an extra time
$t_{\rm ext}$ to prepare and measure quantum states of light. The total time
of the process is hence generalised to:

$\displaystyle T=\nu(t+t_{\rm ext}),$ (17)

where $t$ is the time used in the interference process.

Figure 3: (a) $(\Delta g)^{-2}/\gamma T$ as a function of $N_{\rm abs}$ for
TFS of different $N$ with $\eta=0.96$ and $\gamma t_{\rm ext}=0.04$, together
with the classical bound (5). The numerical results for TFS are obtained by
computing $\max_{\nu}(\nu\mathcal{F}_{\rm Q}^{\rm TFS})$ (using the exact
expression (11)) given the constraints $t\nu=T$ and $N_{\rm abs}(t)\leq N_{\rm
abs}$ with $N_{\rm abs}(t)$ in (2). The optimal $\nu$ is well approximated by
$\nu/T\gamma\approx N/N_{\rm abs}$. (b) In grey, region where quantum
advantages are not possible with TFS of any $N$ and with $N_{\rm abs}=1$. The
curves are implicitly defined by $(\Delta g)^{2}_{\rm TFS}/(\Delta g)^{2}_{\rm
coh}=1$ given TFS of different photon number. That is, they are defined by the
values of $\\{t_{\rm ext},1-\eta\\}$ for which $(\Delta g)^{2}_{\rm
TFS}/(\Delta g)^{2}_{\rm coh}=1$, and hence delimit regions where quantum
advantages are possible given TFS of different $N$ (on the left of the
curves). In the grey region, no quantum advantages are possible, regardless of
the value of $N$.

Given this model, we first illustrate in Fig. 3 (a) that TFS with low $N$ can
overcome the bound (5) when $N_{\rm abs}$ is small, even in the presence of
imperfections (in the figure, we take $\eta=0.96$ and $\gamma t_{\rm
ext}=0.04$). These results can be compared with the ideal scenario ($\eta=1$
and $\gamma t_{\rm ext}=0$) shown in Fig. 2, which illustrates that
imperfections become most relevant as $N$ increases. Similar results are found
for NRM (see Sec. C of the Appendix). Importantly, in both cases the
corresponding protocol requires measuring a finite number of samples,
$\nu/T\gamma\approx N/N_{\rm abs}$, making it feasible in practice.

Second, the robustness of such quantum advantages to finite detector
efficiency ($\eta$) and extra times ($t_{\rm ext}$) is analysed in Fig. 3 (b)
for TFS and $N_{\rm abs}=1$. In particular, we plot the values of $\\{\gamma
t_{\rm ext},1-\eta\\}$ for which $(\Delta g)^{2}_{\rm TFS}/(\Delta g)^{2}_{\rm
coh}=1$ for different $N$. That is, on the left of the curves of Fig. 3 (b),
quantum advantages are possible (i.e., $(\Delta g)^{2}_{\rm TFS}/(\Delta
g)^{2}_{\rm coh}\geq 1$), and on the right, they are not. In the grey region,
no quantum advantages are possible regardless of $N$. Whereas for $t_{\rm
ext}=0$ or $\eta=1$ increasing $N$ is generally favourable, we find that TFS
of low $N$ ($N\approx 8-20$) are most robust to noise when both $t_{\rm
ext}>0$ and $1-\eta$ are non-negligible. In particular, for TFS of $N=8$, the
quantum advantage prevails for $\eta>0.9$ and $\gamma t_{\rm ext}<0.12$.

In Sec. C of the Appendix, we provide an extended discussion of noise
robustness, including upper bounds on general states. We find that, while the
presence of $\eta$ and $t_{\rm ext}$ severely restricts the maximal possible
quantum advantage, the main practical conclusion of our paper remains: In
frequency measurements of delicate samples, few-photon quantum states (TFS,
NOON, or squeezed) can overcome classical strategies using arbitrarily intense
coherent states and an arbitrarily large number of samples when $N_{\rm abs}$
is low.

##  6 Implementation in Cavity QED

Although quantum advantages can be obtained already for low $N$ and can
tolerate imperfections (see Fig. 3 and Sec. C of the Appendix), it is crucial
to devise implementations where quantum states are prepared and measured fast,
and with high efficiency. Recent examples include the preparation of Fock
states in the motional states of trapped ions [82]. Here, we take an
alternative route and outline a protocol based on cavity QED [41] or circuit
QED [42] capable of generating and observing Fock states of light in cavities,
inspired by recent progress on metrology and number-resolved measurements in
waveguide QED [53, 83, 61, 59]. The key idea is to engineer an interaction of
the cavity with a set of resonant qubits/atoms. More precisely, in addition to
Eq. (1), the two cavities are each coupled to a collection of $N_{\rm at}$
resonant atoms via

$H_{\mathrm{Dicke}}(t)=\sum_{\alpha=a,b}\sum_{i}^{N_{\rm
at}}\left[\omega\sigma^{z}_{i,\alpha}+J(t)(\sigma^{-}_{i,\alpha}\alpha^{\dagger}+\mathrm{H.c.})\right],$
(18)

such that the total Hamiltonian of the system reads
$H(t)=H_{0}+H_{\mathrm{int}}+H_{\mathrm{Dicke}}$. In our protocol we require
that the collectively enhanced atom–cavity coupling $J(t)$ is tuneable and
much faster than the cavity decay rate. Strong coupling, together with control
of the atom–cavity interaction is routinely achieved in experiment [84, 48],
in particular to generate or absorb individual photons [85]. Extending this
level of control to ensembles of atoms the cavity and combining this with
sufficiently high quality readout is challenging, but actively investigated
[44, 86].

Initially, all $2N_{\rm at}$ atoms are excited, and each cavity is set to the
ground state: $n=0$, where $n$ is the number photons in each cavity. Through
the atom-cavity (AC) Dicke interaction (18), the excitations are transformed
into photons in the cavity. In general, we can diagonalize exactly Eq. (18) to
find the state evolution (see Appendix D). Yet, here we provide an analytical
solution in the linear regime where $n\ll N_{\rm at}$ along the evolution,
which turns out to also be relevant for the implementation. In this case, we
can linearize the spin operator around the state with all atoms excited,
obtaining $\sum_{i}\sigma^{-}_{\alpha}\simeq\sqrt{N_{\rm
at}}c_{\alpha}^{\dagger}$, where $c_{\alpha}$ is a bosonic annihilation
operator. Thus, Eq. (18) transforms into

$H_{\mathrm{Dicke}}\simeq\sum_{\alpha=a,b}\sum_{i=1}^{N_{\rm
at}}[\omega\sigma_{i,\alpha}^{z}+(J(t)\sqrt{N_{\rm
at}}c^{\dagger}_{\alpha}\alpha^{\dagger}+\mathrm{H.c.})].$ (19)

The time evolution is therefore a two-mode squeezing operation
$e^{-iHt}=e^{-\zeta\alpha^{\dagger}c^{\dagger}+\zeta^{*}\alpha c}$, with
$\zeta=i\sqrt{N_{\rm at}}Jt=re^{i\phi}$. Under this evolution,

$\displaystyle\langle\alpha^{\dagger}\alpha\rangle=\sinh^{2}r=\sinh^{2}(\sqrt{N_{\rm
at}}Jt)$ (20)
$\displaystyle\langle\alpha^{\dagger}\alpha^{\dagger}\alpha\alpha\rangle=\sinh^{2}(r)[\cosh(2r)-\sinh^{2}(r)].$

with $\alpha=a,b$. In particular, the optimal time scale to obtain on average
$n$ photons in each cavity is

$t_{\mathrm{prep}}=\frac{\sinh^{-1}(\sqrt{n})}{\sqrt{N_{\rm at}}J}.$ (21)

On the other hand, the probability of obtaining $k_{\alpha}$ photons in one
cavity at time $t$ is given by:
$q(k_{\alpha})=(\tanh\sqrt{N_{\rm\alpha}}Jt)^{2k_{\alpha}}/(\cosh\sqrt{N_{\rm\alpha}}Jt)^{2}$.
For the time (21), it reads:

$\displaystyle
q(k_{\alpha})\approx\frac{n^{k_{\alpha}}}{(n+1)^{k_{\alpha}+1}},$ (22)

which we recall holds in the regime $N_{\rm at}\gg n$.

Given these considerations, for a given target photon number $n$, the state
preparation protocol consists of the following steps.

  1. 1.

Starting from an initial state of all atoms and both cavities in the ground
state, all atoms are excited.

  2. 2.

The cavity-atom interaction is turned on, $J(t)=J$, for a time
$t_{\mathrm{prep}}$.

  3. 3.

The cavity-atom interaction is turned off and the number of remaining excited
atoms is measured.

Conditional on the measurement outcome $N_{\rm at}-k_{\alpha}$, the cavity is
projected in a Fock state with $k_{\alpha}$ photons, which takes place with
probability $q(k_{\alpha})$ given in Eq. (22). This process can be done in
parallel for both cavities, and on average $N=2n$ photons are created.

Figure 4: (a) Error probability in the absorption process, i.e., probability
that the photons are not absorbed by the atoms. We take as an initial state
for the cavity a Fock state with $n$, which interacts with the atomic array
(the atoms start in the ground state) through (18) for a time $t_{\rm meas}$.
In dashed lines, we show the same for two repetitions of the absorption
process, leading to $p_{\rm error}\approx 0$ (b) Measurement precision
$(\Delta g)^{-2}_{\rm AC}$ for probabilistic TFS prepared through the atom-
cavity coupling at $g\approx 0$, using NRM and with $N_{\rm abs}=1$. Details
on the calculation of $(\Delta g)^{-2}_{\rm AC}$ are provided in Sec. D of the
Appendix. Parameters for both plots: $J=1$ and $\omega=1$.

After this preparation stage, we let the photonic system evolve according to
Eq. (1) for some time $t$, which is the time relevant for our discussion in
the rest of the article. The number of photons involved in the process is $N$.
In the mean time, the remaining $N_{\rm at}-k_{\alpha}$ atoms need to be reset
to the ground state in order to prepare them for the final measurement.

To measure the final photon distribution in the cavity, we again turn on the
atom-cavity coupling $J(t)$, which allows the atoms to reabsorb photons from
the cavity. In contrast to the preparation stage, the atoms are now prepared
in the ground state, whereas the photonic state contains at most $2n$ photons.
As in the preparation stage, we can linearize the spin operator (now around
the ground state) obtaining $\sum_{i}\sigma^{-}_{\alpha}\simeq\sqrt{N_{\rm
at}}c_{\alpha}$, where $c_{\alpha}$ is a bosonic annihilation operator. Thus,
Eq. (18) can now be transformed as

$H_{\mathrm{Dicke}}\simeq\sum_{\alpha=a,b}\sum_{i=1}^{N_{\rm
at}}[\omega\sigma_{i,\alpha}^{z}+(J(t)\sqrt{N_{\rm
at}}c_{\alpha}\alpha^{\dagger}+\mathrm{H.c.})].$ (23)

The time evolution is therefore a standard beam splitter interaction with
oscillations with period $T=\pi/J\sqrt{N_{\rm at}}$. We take $t_{\rm
meas}=T/2$, i.e.

$\displaystyle t_{\rm meas}=\frac{\pi}{2J\sqrt{N_{\rm at}}},$ (24)

to maximise the probability that all photons are absorbed. Given a $n$-photon
state in the cavity as an initial state, this absorption process has an error
probability $p_{\rm error}=\mathcal{O}(n/N_{\rm at})^{2}$, where $1-p_{\rm
error}$ is the probability that all photons are absorbed. In order to relate
it to the efficiency $\eta$ of the detector, we can identify:

$\displaystyle 1-p_{\rm error}\equiv\eta^{n}.$ (25)

Note that, strictly speaking, the $\eta$ introduced here is not the same as
the one introduced in (5) (in the sense that they arise through different
physical processes), but their meaning is essentially the same: $1-\eta$ the
probability of not losing a photon in the detection process. In particular, a
small $p_{\rm error}$ guarantees $\eta\approx 1$, as desired. The error
probability $p_{\rm error}$ is shown in Fig. 4 for different $N_{\rm at}$.
From the figure, it becomes clear that for $N_{\rm at}>20$ already very high
efficiencies can be obtained, so that quantum advantages are possible
according to Fig. 3. Furthermore, we note that, if $p_{\rm error}$ is non-
negligible, the absorption process can be repeated, which substantially
reduces $p_{\rm error}$, as also shown in Fig. 4. In this case, adding up the
total number of excitations observed in the measurements yields the
measurement result, thus implementing a number-resolved measurement (NRM) in
each cavity.

In practice, the following constraints need to be satisfied for the successful
implementation of this scheme:

  1. 1.

$p_{\rm error}=\mathcal{O}(n/N_{\rm at})^{2}\ll 1$, i.e., a high detector
efficiency in the NRM, and

  2. 2.

$t_{\rm ext}=(t_{\rm prep}+t_{\rm meas})\propto 1/J\sqrt{N_{\rm
at}}\ll\gamma^{-1}$, so that $t_{\rm ext}$ can be neglected.

The linear regime where $N_{\rm at}\gg n$ is hence convenient for the
implementation of this protocol, and it is also useful to engineer a strong
atom-cavity coupling $J\gg\gamma$. Experimental requirements needed for the
successful implementation of this proposal are discussed in the Sec. D of the
Appendix, where we argue that both cavity QED [87, 88, 44] and circuit QED
[89, 90, 91] appear as promising platforms.

Even when both conditions are met, the discussed preparation scheme does not
produce TFS, but rather Fock states distributed according to $q(k_{\alpha})$.
Furthermore, the NRM in each cavity is in general not optimal for metrology,
i.e., the corresponding CFI does not saturate $\mathcal{F}_{\rm Q}$ (see Fig.
1, Appendix B, and Refs. [70, 71, 72]). While both effects lead to a reduction
for the quantum advantages reported in Fig. 3, we find that quantum advantages
can be obtained for $N=2n\approx 4-20$, and $N_{\rm at}\approx 20-100$ with
the discussed implementation, as shown in Fig. 4 for $N_{\rm abs}=1$. Details
on the calculation of $(\Delta g)^{-2}_{\rm AC}$ for the atom-cavity (AC)
implementation, as well as an analysis to robustness to non-idealities
($\eta>1$ and $t_{\rm ext}>0$), is provided in Appendix D.

##  7 Conclusions

While quantum advantages in photonic metrology are well established when the
(average) photon number is fixed [3, 4, 5], in specific situations, other
constraints might be more meaningful. For example, when non-linear effects or
quantum backaction limit the light intensity, a more sophisticated analysis
has to take these effects into account [92]. Here, we study a complimentary
situation, where photosensitive samples imply that the number of absorbed
photons $N_{\rm abs}$ is limited [18, 12, 13, 14, 15]. While in
interferometric measurements this coincides with the traditional constraint on
$N$, we have shown that it leads to qualitatively new results in frequency
measurements. In this case, finite quantum resources for metrology (finite
photon number, finite number of samples, finite time) can become more powerful
than infinite classical resources (unbounded photon number, unlimited number
of samples, finite time). We have characterized these advantages as a function
of $N_{\rm abs}$ and $T$ for a model of two coupled oscillators, but our
results suggest similar advantages in frequency measurements of delicate
samples where photon absorption can be modelled as a Markovian process.

In a second part of the article, we have discussed a possible implementation
of these advantages in a cavity QED set-up. The key idea is to couple cavities
to a set of resonant atoms. By suitably controlling the atoms, we have devised
strategies to prepare and measure Fock states in a fast and efficient way. In
particular, we showed that superradiance, arising due to the collective atom-
cavity coupling, can be exploited to enhance the quality of the measurement
and preparation of photonic states. These results illustrate the potential of
superradiance for applications in quantum metrology and information [52, 3, 4,
5].

Acknowledgements. We thank J. Kołodyński and M. W. Mitchell for insightful
discussions. M. P.-L. acknowledges funding from Swiss National Science
Foundation (Ambizione PZ00P2-186067). D.M. and J.I.C. acknowledge funding from
ERC Advanced Grant QENOCOBA under the EU Horizon 2020 program (Grant Agreement
No. 742102).

## References

  * Giovannetti  _et al._ [2011] V. Giovannetti, S. Lloyd, and L. Maccone, Nature Photonics 5, 222 (2011).
  * Tóth and Apellaniz [2014] G. Tóth and I. Apellaniz, Journal of Physics A: Mathematical and Theoretical 47, 424006 (2014).
  * Demkowicz-Dobrzański  _et al._ [2015] R. Demkowicz-Dobrzański, M. Jarzyna, and J. Kołodyński, in  _Progress in Optics_ (Elsevier, 2015) pp. 345–435.
  * Dowling and Seshadreesan [2015] J. P. Dowling and K. P. Seshadreesan, Journal of Lightwave Technology 33, 2359 (2015).
  * Polino  _et al._ [2020] E. Polino, M. Valeri, N. Spagnolo, and F. Sciarrino, AVS Quantum Science 2, 024703 (2020).
  * Caves [1981] C. M. Caves, Phys. Rev. D 23, 1693 (1981).
  * Holland and Burnett [1993] M. J. Holland and K. Burnett, Phys. Rev. Lett. 71, 1355 (1993).
  * Bollinger  _et al._ [1996] J. J. . Bollinger, W. M. Itano, D. J. Wineland, and D. J. Heinzen, Phys. Rev. A 54, R4649 (1996).
  * Neuman  _et al._ [1999] K. C. Neuman, E. H. Chadd, G. F. Liou, K. Bergman, and S. M. Block, Biophysical Journal 77, 2856 (1999).
  * Peterman  _et al._ [2003] E. J. Peterman, F. Gittes, and C. F. Schmidt, Biophysical Journal 84, 1308 (2003).
  * Cole [2014] R. Cole, Cell Adhesion & Migration 8, 452 (2014).
  * Taylor  _et al._ [2013] M. A. Taylor, J. Janousek, V. Daria, J. Knittel, B. Hage, H.-A. Bachor, and W. P. Bowen, Nature Photonics 7, 229 (2013).
  * Taylor  _et al._ [2014] M. A. Taylor, J. Janousek, V. Daria, J. Knittel, B. Hage, H.-A. Bachor, and W. P. Bowen, Phys. Rev. X 4, 011017 (2014).
  * Taylor and Bowen [2016] M. A. Taylor and W. P. Bowen, Physics Reports 615, 1 (2016).
  * Whittaker  _et al._ [2017] R. Whittaker, C. Erven, A. Neville, M. Berry, J. L. O’Brien, H. Cable, and J. C. F. Matthews, New Journal of Physics 19, 023013 (2017).
  * Pototschnig  _et al._ [2011] M. Pototschnig, Y. Chassagneux, J. Hwang, G. Zumofen, A. Renn, and V. Sandoghdar, Phys. Rev. Lett. 107, 063001 (2011).
  * Eckert  _et al._ [2007] K. Eckert, O. Romero-Isart, M. Rodriguez, M. Lewenstein, E. S. Polzik, and A. Sanpera, Nature Physics 4, 50 (2007).
  * Wolfgramm  _et al._ [2012] F. Wolfgramm, C. Vitelli, F. A. Beduini, N. Godbout, and M. W. Mitchell, Nature Photonics 7, 28 (2012).
  * Ono  _et al._ [2013] T. Ono, R. Okamoto, and S. Takeuchi, Nature Communications 4 (2013), 10.1038/ncomms3426.
  * Huelga  _et al._ [1997] S. F. Huelga, C. Macchiavello, T. Pellizzari, A. K. Ekert, M. B. Plenio, and J. I. Cirac, Phys. Rev. Lett. 79, 3865 (1997).
  * Shaji and Caves [2007] A. Shaji and C. M. Caves, Phys. Rev. A 76, 032111 (2007).
  * Hayes  _et al._ [2018] A. J. Hayes, S. Dooley, W. J. Munro, K. Nemoto, and J. Dunningham, Quantum Science and Technology 3, 035007 (2018).
  * Matsuzaki  _et al._ [2011] Y. Matsuzaki, S. C. Benjamin, and J. Fitzsimons, Phys. Rev. A 84, 012103 (2011).
  * Chin  _et al._ [2012] A. W. Chin, S. F. Huelga, and M. B. Plenio, Phys. Rev. Lett. 109, 233601 (2012).
  * Chaves  _et al._ [2013] R. Chaves, J. B. Brask, M. Markiewicz, J. Kołodyński, and A. Acín, Phys. Rev. Lett. 111, 120401 (2013).
  * Brask  _et al._ [2015] J. B. Brask, R. Chaves, and J. Kołodyński, Phys. Rev. X 5, 031010 (2015).
  * Smirne  _et al._ [2016] A. Smirne, J. Kołodyński, S. F. Huelga, and R. Demkowicz-Dobrzański, Phys. Rev. Lett. 116, 120801 (2016).
  * Woolley  _et al._ [2008] M. J. Woolley, G. J. Milburn, and C. M. Caves, New Journal of Physics 10, 125018 (2008).
  * Beau and del Campo [2017] M. Beau and A. del Campo, Phys. Rev. Lett. 119, 010403 (2017).
  * Naghiloo  _et al._ [2017] M. Naghiloo, A. N. Jordan, and K. W. Murch, Phys. Rev. Lett. 119, 180801 (2017).
  * Pang and Jordan [2017] S. Pang and A. N. Jordan, Nature Communications 8 (2017), 10.1038/ncomms14695.
  * Sun  _et al._ [2020] L. Sun, X. He, C. You, C. Lv, B. Li, S. Lloyd, and X. Wang, arXiv preprint arXiv:2004.01216 (2020).
  * Dorner [2012] U. Dorner, New Journal of Physics 14, 043011 (2012).
  * Dür  _et al._ [2014] W. Dür, M. Skotiniotis, F. Fröwis, and B. Kraus, Phys. Rev. Lett. 112, 080801 (2014).
  * Kessler  _et al._ [2014] E. M. Kessler, I. Lovchinsky, A. O. Sushkov, and M. D. Lukin, Phys. Rev. Lett. 112, 150802 (2014).
  * Arrad  _et al._ [2014] G. Arrad, Y. Vinkler, D. Aharonov, and A. Retzker, Phys. Rev. Lett. 112, 150801 (2014).
  * Escher  _et al._ [2011] B. Escher, R. de Matos Filho, and L. Davidovich, Nature Physics 7, 406 (2011).
  * Demkowicz-Dobrzański  _et al._ [2012] R. Demkowicz-Dobrzański, J. Kołodyński, and M. Guţă, Nature Communications 3 (2012), 10.1038/ncomms2067.
  * Kołodyński and Demkowicz-Dobrzański [2013] J. Kołodyński and R. Demkowicz-Dobrzański, New Journal of Physics 15, 073043 (2013).
  * Knysh  _et al._ [2014] S. I. Knysh, E. H. Chen, and G. A. Durkin, arXiv preprint arXiv:1402.0495 (2014).
  * Haroche and Raimond [2006] S. Haroche and J.-M. Raimond,  _Exploring the Quantum_, Vol. 5 (Oxford University Press, 2006) p. 11.
  * Blais  _et al._ [2020] A. Blais, S. M. Girvin, and W. D. Oliver, Nature Physics 16, 247 (2020).
  * Dicke [1954] R. H. Dicke, Phys. Rev. 93, 99 (1954).
  * Haas  _et al._ [2014] F. Haas, J. Volz, R. Gehr, J. Reichel, and J. Esteve, Science 344, 180 (2014).
  * Norcia  _et al._ [2016] M. A. Norcia, M. N. Winchester, J. R. K. Cline, and J. K. Thompson, Science Advances 2, e1601231 (2016).
  * Hosseini  _et al._ [2017] M. Hosseini, Y. Duan, K. M. Beck, Y.-T. Chen, and V. Vuletić, Phys. Rev. Lett. 118, 183601 (2017).
  * Kim  _et al._ [2018] J. Kim, D. Yang, S.-h. Oh, and K. An, Science 359, 662 (2018).
  * Frisk Kockum  _et al._ [2019] A. Frisk Kockum, A. Miranowicz, S. De Liberato, S. Savasta, and F. Nori, Nature Reviews Physics 1, 19 (2019), arXiv:1807.11636 .
  * Mlynek  _et al._ [2014] J. A. Mlynek, A. A. Abdumalikov, C. Eichler, and A. Wallraff, Nat. Commun. 5, 5186 (2014).
  * Goban  _et al._ [2015] A. Goban, C.-L. Hung, J. Hood, S.-P. Yu, J. Muniz, O. Painter, and H. Kimble, Phys. Rev. Lett. 115, 063601 (2015).
  * Solano  _et al._ [2017] P. Solano, P. Barberis-Blostein, F. K. Fatemi, L. A. Orozco, and S. L. Rolston, Nature Communications 8, 1857 (2017).
  * O'Brien  _et al._ [2009] J. L. O'Brien, A. Furusawa, and J. Vučković, Nature Photonics 3, 687 (2009).
  * González-Tudela  _et al._ [2017] A. González-Tudela, V. Paulisch, H. J. Kimble, and J. I. Cirac, Phys. Rev. Lett. 118, 213601 (2017).
  * Paulisch  _et al._ [2018] V. Paulisch, H. J. Kimble, J. I. Cirac, and A. González-Tudela, Phys. Rev. A 97, 053831 (2018).
  * Uria  _et al._ [2020] M. Uria, P. Solano, and C. Hermann-Avigliano, Phys. Rev. Lett. 125, 093603 (2020).
  * Groiseau  _et al._ [2020] C. Groiseau, A. E. Elliott, S. J. Masson, and S. Parkins, arXiv preprint arXiv:2012.00246 (2020).
  * Romero  _et al._ [2009] G. Romero, J. J. García-Ripoll, and E. Solano, Physical Review Letters 102, 173602 (2009).
  * Peropadre  _et al._ [2011] B. Peropadre, G. Romero, G. Johansson, C. M. Wilson, E. Solano, and J. J. García-Ripoll, Physical Review A 84, 063834 (2011).
  * Malz and Cirac [2020] D. Malz and J. I. Cirac, Phys. Rev. Research 2, 033091 (2020).
  * Paulisch  _et al._ [2019a] V. Paulisch, M. Perarnau-Llobet, A. González-Tudela, and J. I. Cirac, Physical Review A 99, 043807 (2019a).
  * Perarnau-Llobet  _et al._ [2020] M. Perarnau-Llobet, A. González-Tudela, and J. I. Cirac, Quantum Science and Technology 5, 025003 (2020).
  * Helstrom [1976] C. W. Helstrom,  _Quantum Detection and Estimation Theory_ (Elsevier Science, 1976).
  * Holevo [1982] A. S. Holevo,  _Probabilistic and Statistical Aspects of Quantum Theory (Statistics & Probability) (English and Russian Edition)_ (Elsevier Science, 1982).
  * Braunstein and Caves [1994] S. L. Braunstein and C. M. Caves, Phys. Rev. Lett. 72, 3439 (1994).
  * Fujiwara and Imai [2008] A. Fujiwara and H. Imai, Journal of Physics A: Mathematical and Theoretical 41, 255304 (2008).
  * Knysh  _et al._ [2011] S. Knysh, V. N. Smelyanskiy, and G. A. Durkin, Phys. Rev. A 83, 021804 (2011).
  * Campos  _et al._ [2003] R. A. Campos, C. C. Gerry, and A. Benmoussa, Phys. Rev. A 68, 023810 (2003).
  * Datta  _et al._ [2011] A. Datta, L. Zhang, N. Thomas-Peter, U. Dorner, B. J. Smith, and I. A. Walmsley, Phys. Rev. A 83, 063836 (2011).
  * Paris [2009] M. G. A. Paris, International Journal of Quantum Information 07, 125 (2009).
  * Kim  _et al._ [1998] T. Kim, O. Pfister, M. J. Holland, J. Noh, and J. L. Hall, Phys. Rev. A 57, 4004 (1998).
  * Pezzé and Smerzi [2013] L. Pezzé and A. Smerzi, Phys. Rev. Lett. 110, 163604 (2013).
  * Zhong  _et al._ [2017] W. Zhong, Y. Huang, X. Wang, and S.-L. Zhu, Phys. Rev. A 95, 052304 (2017).
  * Yurke  _et al._ [1986] B. Yurke, S. L. McCall, and J. R. Klauder, Phys. Rev. A 33, 4033 (1986).
  * Olivares and Paris [2007] S. Olivares and M. G. A. Paris, Optics and Spectroscopy 103, 231 (2007).
  * Šafránek and Fuentes [2016] D. Šafránek and I. Fuentes, Phys. Rev. A 94, 062313 (2016).
  * Huver  _et al._ [2008] S. D. Huver, C. F. Wildfeuer, and J. P. Dowling, Phys. Rev. A 78, 063828 (2008).
  * Dorner  _et al._ [2009] U. Dorner, R. Demkowicz-Dobrzanski, B. J. Smith, J. S. Lundeen, W. Wasilewski, K. Banaszek, and I. A. Walmsley, Phys. Rev. Lett. 102, 040403 (2009).
  * Demkowicz-Dobrzanski  _et al._ [2009] R. Demkowicz-Dobrzanski, U. Dorner, B. J. Smith, J. S. Lundeen, W. Wasilewski, K. Banaszek, and I. A. Walmsley, Phys. Rev. A 80, 013825 (2009).
  * Cable and Durkin [2010] H. Cable and G. A. Durkin, Phys. Rev. Lett. 105, 013603 (2010).
  * Calsamiglia  _et al._ [2016] J. Calsamiglia, B. Gendra, R. Muñoz-Tapia, and E. Bagan, New Journal of Physics 18, 103049 (2016).
  * Matsubara  _et al._ [2019] T. Matsubara, P. Facchi, V. Giovannetti, and K. Yuasa, New Journal of Physics 21, 033014 (2019).
  * Wolf  _et al._ [2019] F. Wolf, C. Shi, J. C. Heip, M. Gessner, L. Pezzè, A. Smerzi, M. Schulte, K. Hammerer, and P. O. Schmidt, Nature Communications 10 (2019), 10.1038/s41467-019-10576-4.
  * Paulisch  _et al._ [2019b] V. Paulisch, M. Perarnau-Llobet, A. González-Tudela, and J. I. Cirac, Phys. Rev. A 99, 043807 (2019b).
  * Walther  _et al._ [2006] H. Walther, B. T. H. Varcoe, B.-G. Englert, and T. Becker, Reports on Progress in Physics 69, 1325 (2006).
  * Hennrich  _et al._ [2000] M. Hennrich, T. Legero, A. Kuhn, and G. Rempe, Physical Review Letters 85, 4872 (2000).
  * Mivehvar  _et al._ [2021] F. Mivehvar, F. Piazza, T. Donner, and H. Ritsch,  (2021), arXiv:2102.04473 .
  * Zhang  _et al._ [2012] H. Zhang, R. McConnell, S. Ćuk, Q. Lin, M. H. Schleier-Smith, I. D. Leroux, and V. Vuletić, Physical Review Letters 109, 133603 (2012).
  * Hume  _et al._ [2013] D. B. Hume, I. Stroescu, M. Joos, W. Muessel, H. Strobel, and M. K. Oberthaler, Physical Review Letters 111, 253001 (2013), arXiv:1307.7598 .
  * Jeffrey  _et al._ [2014] E. Jeffrey, D. Sank, J. Y. Mutus, T. C. White, J. Kelly, R. Barends, Y. Chen, Z. Chen, B. Chiaro, A. Dunsworth, A. Megrant, P. J. J. O’Malley, C. Neill, P. Roushan, A. Vainsencher, J. Wenner, A. N. Cleland, and J. M. Martinis, Physical Review Letters 112, 190504 (2014).
  * Walter  _et al._ [2017] T. Walter, P. Kurpiers, S. Gasparinetti, P. Magnard, A. Potočnik, Y. Salathé, M. Pechal, M. Mondal, M. Oppliger, C. Eichler, and A. Wallraff, Physical Review Applied 7, 054020 (2017).
  * Dassonneville  _et al._ [2020] R. Dassonneville, T. Ramos, V. Milchakov, L. Planat, Dumur, F. Foroughi, J. Puertas, S. Leger, K. Bharadwaj, J. Delaforce, C. Naud, W. Hasch-Guichard, J. J. García-Ripoll, N. Roch, and O. Buisson, Physical Review X 10, 11045 (2020).
  * Mitchell [2017] M. W. Mitchell, Quantum Science and Technology 2, 044005 (2017).
  * Thompson  _et al._ [1992] R. J. Thompson, G. Rempe, and H. J. Kimble, Physical Review Letters 68, 1132 (1992).
  * Brune  _et al._ [1996] M. Brune, F. Schmidt-Kaler, A. Maali, J. Dreyer, E. Hagley, J. M. Raimond, and S. Haroche, Physical Review Letters 76, 1800 (1996).
  * Yoshie  _et al._ [2004] T. Yoshie, A. Scherer, J. Hendrickson, G. Khitrova, H. M. Gibbs, G. Rupper, C. Ell, O. B. Shchekin, and D. G. Deppe, Nature 432, 200 (2004).
  * Wallraff  _et al._ [2004] A. Wallraff, D. I. Schuster, A. Blais, L. Frunzio, R.-S. Huang, J. Majer, S. Kumar, S. M. Girvin, and R. J. Schoelkopf, Nature 431, 162 (2004).
  * Reithmaier  _et al._ [2004] J. P. Reithmaier, G. Sęk, A. Löffler, C. Hofmann, S. Kuhn, S. Reitzenstein, L. V. Keldysh, V. D. Kulakovskii, T. L. Reinecke, and A. Forchel, Nature 432, 197 (2004).
  * Chiorescu  _et al._ [2004] I. Chiorescu, P. Bertet, K. Semba, Y. Nakamura, C. J. P. M. Harmans, and J. E. Mooij, Nature 431, 159 (2004).
  * Reiserer and Rempe [2015] A. Reiserer and G. Rempe, Reviews of Modern Physics 87, 1379 (2015).

##  Appendix A Squeezed states

Squeezed states also enable Heisenberg scaling [73, 74], and hence can provide
a finite amount of information in the Poisson limit $t\rightarrow 0$ and
$N\rightarrow\infty$. This is explored in this section.

We take as an initial state a vacuum-squeezed state together with a coherent-
squeezed state:
$\left.\left|{\phi_{0}}\right.\right\rangle=D_{a}(\alpha)S_{a}(s)S_{b}(r)\left.\left|{0}\right.\right\rangle$
with $D_{a}(\alpha)=e^{-\alpha(a^{\dagger}-a)}$, and
$S_{y}(x)=e^{\frac{x}{2}(y^{2}-(y^{\dagger})^{2})}$, $x=s,r$ and $y=a,b$; and
we take $\alpha,r>0$ and $s<0$. The average total number of photons is:

$\displaystyle N=\alpha^{2}+\sinh^{2}r+\sinh^{2}s,$ (26)

and it is convenient to define: $\beta_{x}=\sinh^{2}x/N$, $x=r,s$. We consider
number-resolved measurements in the output states. Following [74], the
$\mathcal{F}_{C}$ in the regime $N\gg 1$ is given by (the extra factor $t^{2}$
comes from the fact that we are measuring a frequency):

$\displaystyle\mathcal{F}_{C}^{\rm
sq}=\frac{N^{2}t^{2}(1-2\beta_{r})^{2}}{N\frac{1-e^{-\gamma t}}{e^{-\gamma
t}}+\frac{1}{4}\left(\frac{1}{\beta_{r}}+\frac{\beta_{r}}{\beta_{s}}-3\right)}.$
(27)

Taking the Poisson limit ($t\rightarrow 0$ with $Nt\gamma=N_{\rm abs}$), leads
to

$\displaystyle\mathcal{F}_{C}^{\rm sq}=\frac{N_{\rm
abs}^{2}}{\gamma^{2}}\frac{4(1-2\beta_{r})^{2}}{4N_{\rm
abs}+\left(\beta_{r}^{-1}+\beta_{r}2\beta_{s}^{-1}-3\right)}.$ (28)

At this point one can maximise this expression with respect to $\beta_{x}$,
with the constraints $0<\beta_{x}<1$ and $\beta_{a}+\beta_{b}\leq 1$, in order
to optimise the measurement precision. For $N_{\rm abs}\ll 1$, we find that
$\mathcal{F}_{C}^{\rm sq}\approx N_{\rm abs}^{2}/\gamma^{2}$, hence squeezed
states perform close to NOON states in this regime. On the other hand, for
$N_{\rm abs}\gg 1$, we have $\mathcal{F}_{C}^{\rm sq}\approx N_{\rm
abs}/\gamma^{2}$, thus saturating the upper bound presented in the main text.
For intermediate values of $N_{\rm abs}$, a numerical optimisation is
presented in Fig. 1 of the main text. It remains an interesting question
whether more generalised Gaussian states and/or measurement schemes [75, 81]
can outperform this proposal in this regime.

##  Appendix B Classical Fisher Information for number-resolved measurements

In this section we compute the classical Fisher information,

$\displaystyle\mathcal{F}_{\rm C}=\sum_{j}\frac{1}{q_{j}}\dot{q}_{j}^{2},$
(29)

where $q_{j}$ is the probability to obtain outcome $j$, for number resolved
measurements in the set-up described in the main text. Because of the map
between our framework and Mach-Zehnder interferometry with symmetric (time-
dependent) photon loss, we can follow similar derivations in that context, see
e.g. Refs. [70, 71, 72]. Let us first compute the probabilities of the photon-
number measurements for the initial Fock state
$\left.\left|{k,m}\right.\right\rangle$ and unitary
$U_{g}=e^{-itH_{0}}e^{-itH_{\rm int}}$. First of all we note that
$e^{-itH_{0}}$ commutes with the initial state (with a well defined photon
number in each arm) and hence can be ignored for the number-resolved
statistics. We first compute:

$\displaystyle
P(k,m,q,g)\equiv|\left.\left\langle{k-q,m+q}\right.\right|e^{-igtH_{\rm
int}}\left.\left|{k,m}\right.\right\rangle|^{2}$ (30)

with
$\left.\left|{k,m}\right.\right\rangle=\frac{1}{\sqrt{k!m!}}(a^{\dagger})^{k}(b^{\dagger})^{m}\left.\left|{0,0}\right.\right\rangle$
and $q\in[-m,k]$. Noting that:

$\displaystyle a^{\dagger}_{g}\equiv e^{-igtH_{\rm
int}}a^{\dagger}e^{igtH_{\rm
int}}=a^{\dagger}\cos\left(\frac{tg}{2}\right)+ib^{\dagger}\sin\left(\frac{tg}{2}\right)$
$\displaystyle b^{\dagger}_{g}\equiv e^{-igtH_{\rm
int}}b^{\dagger}e^{igtH_{\rm
int}}=b^{\dagger}\cos\left(\frac{tg}{2}\right)+ia^{\dagger}\sin\left(\frac{tg}{2}\right),$
(31)

we obtain

$\displaystyle
P(k,m,q,g)=\frac{(m+q)!(k-q)!}{m!k!}\left(\tan\theta\right)^{2q}\left(\sum_{j=0}^{m}\binom{m}{j}\binom{k}{j+q}(-1)^{j}\left(\cos\theta\right)^{k+m-2j}\left(\sin\theta\right)^{2j}\right)^{2}$
(32)

where we defined $\theta\equiv tg/2$, and $q\in[-m,k]$. This can also be
expressed as:

$\displaystyle P(k,m,q,g)=$
$\displaystyle\frac{(m+q)!(k-q)!}{m!k!}\left(\tan\theta\right)^{2q}$
$\displaystyle\bigg{(}(-1)^{k}\binom{m}{k+1}\binom{k}{k+q+1}\frac{(\sin\theta)^{2k+2}}{(\cos\theta)^{2-m-k}}\,_{3}F_{2}\left(1,-m+k+1,q+1;k+2,k+q+2;-\tan^{2}(\theta)\right)$
$\displaystyle+\binom{k}{q}(\cos\theta)^{m+k}\,_{2}F_{1}\left(-m,q-k;q+1;-\tan^{2}(\theta)\right)\bigg{)}^{2},$
(33)

where ${}_{p}F_{q}(a;b;z)$ is the generalized hypergeometric function.

Next, we compute the probability to obtain outcomes $\\{k,m\\}$ for the state:

$\displaystyle\rho=\sum_{k,j}p_{k}p_{j}\left.\left|{n-k,n-j}\right.\right\rangle\left.\left\langle{n-k,n-j}\right.\right|$
(34)

with

$\displaystyle p_{k}=\mu^{k}(1-\mu)^{n-k}\binom{n}{k},\hskip
28.45274pt\mu=1-e^{-\gamma t}.$ (35)

It is convenient to introduce:

$\displaystyle n_{\rm loss}\equiv 2n-(k+m)$ $\displaystyle q\equiv n-k$ (36)

Then, we have for (34)

$\displaystyle P^{\rm Fock}(n_{\rm loss},q,g)=\sum_{l=0}^{n_{\rm
loss}}p_{l}p_{n_{\rm loss}-l}P(n-l,n+l-n_{\rm loss},q-l,g)$ (37)

The only remaining step is to compute the classical Fisher information using
(29):

$\displaystyle\mathcal{F}_{\rm C}^{\rm TFS}(g)=\sum_{n_{\rm
loss}=0}^{2n}\quad\sum_{q=n_{\rm loss}-n}^{n}\frac{\left(\partial_{g}P^{\rm
Fock}(n_{\rm loss},q,g)\right)^{2}}{P^{\rm Fock}(n_{\rm loss},q,g)}$ (38)

To gain some analytical insight for this expression, we can compute it in the
limit $g\rightarrow 0$. Following [71, 61], we can expand the probabilities
around $g\approx 0$ up to order $\mathcal{O}(g^{2})$, and realise that only
instances where $n+1$ photons are measured in one of the modes contribute to
the CFI. This leads to the following analytical expression for the CFI [68]:

$\displaystyle\lim_{g\rightarrow 0}\mathcal{F}_{\rm C}^{\rm
TFS}(g)=2t^{2}(n+1)n(1-\mu)^{n+1},$ (39)

which shows an exponential decay with $n=N/2$. This is hence far from
$\mathcal{F}_{\rm Q}$ for large $N$, while still better than NOON states. For
future convenience, we also give the corresponding expression when the initial
state is
$\rho=\sum_{k,j}p_{k}p_{j}\left.\left|{n-k,m-j}\right.\right\rangle\left.\left\langle{n-k,m-j}\right.\right|$:

$\displaystyle\lim_{g\rightarrow 0}\mathcal{F}_{\rm
C}^{n,m}(g)=t^{2}\left((1-\mu)^{n+1}(n+1)m+(1-\mu)^{m+1}(m+1)n\right).$ (40)

Finally, we numerically compute (38) for different $g$, $\mu$ and $N$ for the
state (34) (and setting $t=1$). An example is shown in Fig. 5, from it we see
that in general the dependence of $\mathcal{F}_{\rm C}$ with $g$ is non-
trivial, and so is the point where it is maximized. The figure also shows that
indeed (29) does not saturate $\mathcal{F}_{\rm Q}$ for number-resolved
measurements. In Fig. 5 we also show (38) as a function of $N$, where it
becomes apparent the importance of maximizing $\mathcal{F}_{\rm C}$ with
respect to $g$ for the number-resolved-measurements as $N$ increases. The
numerical results suggest that a systematic improvement with respect to the
Shot-Noise-Limit can be obtained for any $N$ with suitably optimized number-
resolved-measurements.

Figure 5: (a) CFI, QFI, and SNL vs $\phi$. Parameters: $N=12$, $\mu=0.2$, and
$t=1$. (b) $\mathcal{F}_{\rm Q}$ and $\mathcal{F}_{\rm C}$ vs $N$ for
$\mu=0.2$ and $t=1$.

Let us now look at the Poisson limit $N\rightarrow\infty$, $t\rightarrow 0$
while satisfying $2\gamma tn\rightarrow N_{\rm abs}$. First, from (39), we can
study the Poisson limit $2\gamma tn\rightarrow N_{\rm abs}$, where we obtain:

$\displaystyle\lim_{g\rightarrow 0}\mathcal{F}_{\rm C}^{\rm TFS}=\frac{N_{\rm
abs}^{2}}{2\gamma^{2}}e^{-N_{\rm abs}/2}.$ (41)

To obtain similar analytical expression for arbitrary $g$ is challenging due
to the complexity of obtaining asymptotic expressions for the generalized
hypergeometric functions. Yet, we can obtain numerical results for rather
large $N\approx 100-1000$. To do this, it is useful to approximate
$\mathcal{F}_{\rm C}$ in (38) as:

$\displaystyle\mathcal{F}_{\rm C}^{\rm TFS}(g)\approx\sum_{n_{\rm
loss}=0}^{N_{\rm loss}^{\rm max}}\quad\sum_{q=-q_{\rm max}}^{q_{\rm
max}}\frac{\left(\partial_{g}P^{\rm Fock}(n_{\rm loss},q,g)\right)^{2}}{P^{\rm
Fock}(n_{\rm loss},q,g)}$ (42)

since only terms with $q=\mathcal{O}(1)$ and $N^{\rm max}_{\rm
loss}=\mathcal{O}(N_{\rm abs})$ contribute to the sum in the Poisson limit
(other terms are exponentially small). In our numerical simulations, we take
$q_{\rm max}=10$ and $N^{\rm max}_{\rm loss}=4N_{\rm abs}$, and the results
become in practice indistinguishable when these parameters are varied.
Numerical results are shown in Fig. 2 of the main text.

###  B.0.1 Optimal measurement

Finally, we note that the optimal measurement $L$ where the classical Fisher
info (29) saturates $Q$ is given by [69]:

$\displaystyle L$
$\displaystyle=i\sum_{k,l}\frac{\tilde{p}_{k}\tilde{p}_{l}-\tilde{p}_{k-1}\tilde{p}_{l+1}}{\tilde{p}_{k}\tilde{p}_{l}+\tilde{p}_{k-1}\tilde{p}_{l+1}}\sqrt{k(l+1)}\bigg{(}\left.\left|{k,l}\right.\right\rangle\left.\left\langle{k-1,l+1}\right.\right|+\left.\left|{l,k}\right.\right\rangle\left.\left\langle{l+1,k-1}\right.\right|\bigg{)}$
$\displaystyle=i\sum_{k,l}\frac{(n-k+1)(l+1)-k(n-l)}{n(l+k+1)+k(n-l)}\sqrt{k(l+1)}\bigg{(}\left.\left|{k,l}\right.\right\rangle\left.\left\langle{k-1,l+1}\right.\right|+\left.\left|{l,k}\right.\right\rangle\left.\left\langle{l+1,k-1}\right.\right|\bigg{)}.$
(43)

with $\tilde{p}_{k}=p_{n-k}$. In the presence of photon loss (i.e. $p_{0}\neq
1$), this does not correspond to a number resolved measurement of the two
modes, but to a global measurement involving both modes.

##  Appendix C Robustness to imperfections: Photon loss in the detection
process and finite time for preparation and measurement of quantum states

In this section, we discuss how $(\Delta g)^{-2}\equiv\nu\mathcal{F}$ of
general quantum states decreases due to: finite $N$, photon loss in the
measurement process, and an extra-time $t_{\rm ext}$ of
preparation/measurement of quantum resources. We then also discuss the
particular case of twin Fock states (TFS), both with optimal measurements
($\mathcal{F}_{\mathcal{Q}}^{\rm TFS}$) and with photon number-resolved
measurements (NRM) ($\mathcal{F}_{\mathcal{C}}^{\rm TFS}$).

We start by giving general bounds on $\nu\mathcal{F}_{\mathcal{Q}}$ for any
quantum state given different constraints:

Figure 6: Here we illustrate regions where quantum advantages become possible
in principle. For that, we plot the values of $\\{t_{\rm ext},1-\eta\\}$ for
which the upper bound $\mathcal{J}(t)$, defined in (50), satisfies
$\mathcal{J}(t)=1$. Recall that if $\mathcal{J}(t)<1$ then no quantum
advantage is possible (using any state). This is shown in grey, by maximising
(50) over any $t$ (and hence $N$). On the other hand, for the different
colourful curves $t$ is fixed implicitly by $N_{\rm abs}=N(1-e^{-\gamma t})$,
which provide upper bounds for a state with $N$ photons.

Figure 7: Similarly to Fig. 6, we plot the values $\\{1-\eta,t_{\rm ext}\\}$
for which $(\Delta g)^{-2}_{\rm coh}/(\Delta g)^{-2}_{\rm TFS}=1$ (left) or
$(\Delta g)^{-2}_{\rm coh}/(\Delta g)^{-2}_{\rm NRM}=1$ (right) for TFS of
different $N$ and $N_{\rm abs}=1$. In other words, lower values of
$\\{1-\eta,t_{\rm ext}\\}$ enable quantum advantages with TFS. For NRM, we
consider $g\approx 0$.

  * •

_Finite N_. Let us first assume finite $N$, but $\eta=1$ and $t_{\rm ext}=0$.
Using the upper bound of [65, 66, 37, 38, 39], we have:

$\displaystyle\mathcal{F}_{\mathcal{Q}}\leq t^{2}N\frac{e^{-\gamma
t}}{1-e^{-\gamma t}}\leq\frac{tN}{\gamma},$ (44)

where the factor $t^{2}$ comes from the fact that we are measuring a
frequency-like quantity. Considering now $\nu=T/t$ measurements, we obtain:

$\displaystyle(\Delta
g)^{-2}_{N}\equiv\nu\mathcal{F}_{\mathcal{Q}}\leq\frac{TN}{\gamma}=\frac{N}{N_{\rm
abs}}(\Delta g)^{-2}_{\rm coh}.$ (45)

Since any $\eta<1$ or $t_{\rm ext}>0$ can only decrease $(\Delta g)^{-2}_{N}$,
this bound also holds for any $\eta$ and $t_{\rm ext}$.

  * •

_Photon loss_. Let us now assume $0<\eta<1$. The starting point is now:
$\mathcal{F}_{\mathcal{Q}}\leq t^{2}N\eta e^{-\gamma t}/(1-\eta e^{-\gamma
t})$, which implies for the whole process with $\nu=T/t$ measurements:

$\displaystyle(\Delta g)^{-2}_{\eta}\equiv\nu\mathcal{F}_{\mathcal{Q}}\leq
T\eta N_{\rm abs}\frac{te^{-\gamma t}}{(1-e^{-\gamma t})(1-\eta e^{-\gamma
t})},$ (46)

which we expressed in terms of the constants $T$ and $N_{\rm abs}$. The right
hand side of (46) is maximised for $t\rightarrow 0$ (or equivalently
$N\rightarrow\infty$), leading to the bound:

$\displaystyle(\Delta g)^{-2}_{\eta}\leq(\Delta g)^{-2}_{\rm
coh}\frac{\eta}{1-\eta}.$ (47)

Hence the quantum advantage comes in the form of a better prefactor
$\eta/(1-\eta)$. This prefactor advantage takes the same form as the one
obtained in noisy photon interferometry when comparing coherent and quantum
states with a fixed $N$ [65, 66, 37, 38, 39].

  * •

_Extra time_. Let us now assume an extra time $t_{\rm ext}$ necessary to
prepare and measure using quantum resources. Let us consider the extreme case
$t_{\rm ext}>0$ but $\eta=1$ and no constraints on $N$. Taking $\eta=1$, we
have:

$\displaystyle(\Delta g)^{-2}_{t_{\rm
ext}}\equiv\nu\mathcal{F}_{\mathcal{Q}}\leq TN_{\rm abs}\frac{t^{2}e^{-\gamma
t}}{(t+t_{\rm ext})(1-e^{-\gamma t})^{2}}.$ (48)

This expression is again optimised in the limit $t\rightarrow 0$ (and hence
$N\rightarrow\infty$), yielding:

$\displaystyle(\Delta g)^{-2}_{t_{\rm ext}}\leq(\Delta g)^{-2}_{\rm
coh}\frac{1}{\gamma t_{\rm ext}}.$ (49)

Let us now consider the general case where $0<\eta<1$ and $t_{\rm ext}>0$. In
general we have,

$\displaystyle\frac{(\Delta g)^{-2}_{t_{\rm ext},\eta}}{(\Delta g)^{-2}_{\rm
coh}}\leq\frac{\gamma t^{2}\eta e^{-\gamma t}}{(t+t_{\rm ext})(1-e^{-\gamma
t})(1-\eta e^{-\gamma t})}\equiv\mathcal{J}(t).$ (50)

This expression is no longer optimised in general at $t\rightarrow 0$, and in
fact it does not allow for an analytical solution. We can still solve it
numerically for any value of the desired value of $\mathcal{J}(t)$, which
provides an upper bound on the quantum advantage. In particular, a quantum
advantage is impossible if $\mathcal{J}(t)=1$ $\forall t$. This condition is
plot in Fig. 6, where we compute the values of $\eta,t_{\rm ext}$ for which
$\max_{t}\mathcal{J}(t)=1$. In Fig. 6, we also plot the values $\eta,t_{\rm
ext}$ for which $\max_{t}\mathcal{J}(t)=1$ but by fixing $t$ implicitly by
$N_{\rm abs}=N(1-e^{-\gamma t})$, which provide upper bounds for a state with
$N$ photons. Interestingly, we find that the upper bound becomes more robust
to noise in the regime where both $t_{\rm ext}$ and $1-\eta$ are not close to
zero. This suggests that in realistic implementations few-photon quantum
states are desirable when $N_{\rm abs}$ is low.

Let us now move to the particular case of TFS by considering $(\Delta
g)^{-2}_{\rm TFS}\equiv\max_{\nu}(\nu\mathcal{F}_{\mathcal{Q}}^{\rm TFS})$ and
$(\Delta g)^{-2}_{\rm TFS}\equiv\max_{\nu}(\mathcal{F}_{\mathcal{C}}^{\rm
TFS})$. It is useful to point out that, as long as $N_{\rm abs}\leq N_{\rm
abs}^{*}$ ($N_{\rm abs}^{*}$ needs to be determined in each case, e.g.,
numerically), $\nu\mathcal{F}_{\rm Q}^{\rm TFS}$ (and $\nu\mathcal{F}_{\rm
C}^{\rm TFS}$) is maximised by testing each sample until it is damaged, that
is:

$\displaystyle T=t\nu$ $\displaystyle
t=\frac{-1}{\gamma}\ln\left(1-\frac{N_{\rm abs}}{N}\right)\approx\frac{N_{\rm
abs}}{\gamma N}$ (51)

for $N_{\rm abs}\leq N_{\rm abs}^{*}$ (otherwise, the choice (51) is taken
with $N_{\rm abs}=N_{\rm abs}^{*}$), and we recall that $N_{\rm abs}^{*}$
needs to be determined numerically for each case. Given this choice, we first
analyse the regions where quantum advantages are possible using TFS, which is
shown in Fig. 6. As expected, the regions are more restrictive than for the
upper bound shown in Fig. 7. On the other hand, an example of the quantum
advantage as a function of $N_{\rm abs}$ for different TFS and with
$\eta=0.95$ and $\gamma t_{\rm ext}=0.05$ is presented in Fig. 8. Similar
results are obtained when considering $\mathcal{F}_{\mathcal{C}}^{\rm TFS}$
with NRM, which is in general lower than $\mathcal{F}_{\mathcal{C}}^{\rm TFS}$
as expected from Fig. 5. This is shown in both Figs. 7 and 8 by considering
$g\approx 0$.

Figure 8: Plot of $(\Delta g)^{-2}_{\rm TFS}=1$ (left) and $((\Delta
g)^{-2}_{\rm NRM}=1$ as a function of $N_{\rm abs}$ for TFS of different $N$.
For NRM, we consider $g\approx 0$. We take $\eta=0.95$ and $\gamma t_{\rm
ext}=0.05$

##  Appendix D Measurement precision in cavity QED implementation

In this section we discuss the implementation in cavity QED, and in particular
how to compute the measurement precision (both QFI and CFI).

At each run of the experiment, the preparation returns probabilistically a
Fock state $\left.\left|{m,l}\right.\right\rangle$, where the photon numbers
$m,l$ are known due to measurement of the remaining excited atoms, and are
distributed according to the known distribution $q(k)$ [Eq. (22)]. Given
$m,l$, the interaction time $t_{m,l}$ between cavities is taken such that on
average $N_{\rm abs}$ photons are absorbed, i.e.:

$\displaystyle N_{\rm abs}=(m+l)(1-e^{-\gamma t_{m,l}}).$ (52)

We then repeat the experiment as often as possible in the given finite maximum
time $T$, such that in the end $\sum_{m,l}\nu_{m,l}t_{m,l}\lesssim T$, where
we defined $\nu_{m,l}$ which is the number of times a certain combination
$m,l$ appeared in the experimental run. We are interested in the regime
$\nu\equiv\sum_{m,l}\nu_{m,l}\gg 1$ (i.e. $T/t_{m,l}\gg 1$), where the
statistics are dominated by typical sequences in which $\nu_{m,l}=q(m)q(l)\nu$
which, together with $T=\sum_{m,l}\nu_{m,l}t_{m,l}$, provides $\nu$.

Figure 9: Plot of $(\Delta g)^{-2}_{\rm AC}=1$ for TFS (dashed) and the atom-
cavity (AC) implementation (solid lines) as a function of $n$, and given
different values of $\eta$ (we take $t_{\rm ext}=0$). We take $N_{\rm at}=100$
for the AC implementation, and for both cases we consider NRM with $g\approx
0$.

Assuming a large number of runs of the experiment $\nu\gg 1$ (so that enough
statistics for each $m,l$ are obtained), the measurement uncertainty $(\Delta
g)^{-2}$ is bounded by

$\displaystyle(\Delta g)^{-2}_{\rm
AC,\mathcal{Q}}\equiv\sum_{m,l}\nu_{m,l}\mathcal{F}_{\rm
Q}^{m,l}=\frac{T}{\sum_{m,l}q(m)q(l)t_{m,l}}\sum_{m,l}q(m)q(l)\mathcal{F}_{\rm
Q}^{m,l}$ (53)

with $\mathcal{F}_{\rm Q}^{m,l}$ is the QFI for an initial Fock state
$\left.\left|{m,l}\right.\right\rangle$, and it reads (following the same
reasoning provided in the main text):

$\displaystyle\mathcal{F}_{\rm
Q}^{m,l}=2t^{2}_{m,l}\sum_{i}^{l}\sum_{j}^{m}p_{i,l}p_{j,m}$
$\displaystyle\left[(l-i)(m-j+1)\left(\frac{1}{2}-\frac{1}{1+\frac{(m-j+1)(i+1)}{j(l-i)}}\right)\right.$
(54)
$\displaystyle+\left.(m-j)(l-i+1)\left(\frac{1}{2}-\frac{1}{1+\frac{(l-i+1)(j+1)}{i(m-j)}}\right)\right].$

with $p_{j,m}=\binom{m}{j}\mu^{j}(1-\mu)^{n-j}$ and $\mu=1-e^{-\gamma t}$.

We can compute $(\Delta g)^{-2}_{\rm NRM}\equiv\nu\mathcal{F}_{\mathcal{C}}$
using NRM in a similar fashion. For simplicity, we focus on the case $g\approx
0$, which can be solved analytically, but the case of general $g$ can be
straightforwardly treated following our previous considerations for TFS.
Analogously with our previous considerations, we have,

$\displaystyle(\Delta g)^{-2}_{\rm
AC}=\frac{T}{\sum_{m,l}q(m)q(l)t_{m,l}}\sum_{m,l}q(m)q(l)\mathcal{F}_{\rm
C}^{m,l}$ (55)

with (see Eq. (40)),

$\displaystyle\mathcal{F}_{\rm
C}^{m,l}=t^{2}_{m,l}\left((1-\mu)^{l+1}(l+1)m+(1-\mu)^{m+1}(m+1)l\right)$ (56)

with $\mu=1-e^{-\gamma t}\eta$.

We show $(\Delta g)^{-2}_{\rm AC}$ in Fig. 9, where it is compared with TFS.
In our simulations, we compute $q(k)$ exactly by solving the Hamiltonian Eq.
(12) of the main text. As expected, the probabilistic preparation of Fock
states in our implementation diminishes its performance with respect to ideal
TFS. Yet, we see that already at $n\approx 6$, quantum advantages appear
possible, even in the presence of detector inefficiencies ($\eta<1$). The
tolerance to imperfections (both $\eta$ and $t_{\rm ext}$ of $(\Delta
g)^{-2}_{\rm AC}$ is shown in Fig. 10.

Figure 10: We plot the values $\\{\eta,t_{\rm ext}\\}$ for which $(\Delta
g)^{-2}_{\rm coh}/(\Delta g)^{-2}_{\rm AC}=1$ given different values of $n$,
so that lower values of $\\{\eta,t_{\rm ext}\\}$ lead to quantum advantages.
For NRM, we consider $g\approx 0$.

###  D.0.1 Error sources in the cavity QED and circuit QED implementation

In practice, there are several additional sources of error in this protocol
that ought to be considered.

First, we have assumed that all atoms/qubits are exactly on resonance with the
cavity. Realistically, they may have differing energies and be detuned from
the cavity, which makes the photon exchange between cavity and atoms less
efficient. However, measuring the number of excited atoms after the
interaction period still projects the cavity state onto a Fock state, such
that disorder only affects the probability distribution of the produced Fock
states, but not their fidelity.

Second, the fidelity of the generated Fock state is intrinsically limited by
measurement error in the atomic readout. High-fidelity atom readout has
already been demonstrated for large numbers of atoms in cavity QED [87, 88]
and for intermediate numbers of qubits in circuit QED [89, 90, 91].

Third, the atoms need to be reset to ground state in a time much faster than
$1/g$. This is feasible if the cavity coupling is tunable (e.g., via an
intermediate resonator in circuit QED) or if a fast decay channel is used
(e.g., a fast optical transition of the atom).

Fourth, no photons may be lost throughout the experiment. This requires ultra-
high finesse cavities or long qubit coherence times on the scale of $1/g$,
i.e., this requires the strong coupling regime, which has been achieved in
both cavity and circuit QED [93, 94, 95, 96, 97, 98]. While the measurement is
more challenging than the preparation, it relies on the same experimental
figures of merit. A large advantage of our scheme is that one can post-select
on successful runs of the experiment by requiring that at the end
$N_{a}+N_{b}$ excitations are measured.

As an illustration, let us take the parameters from the experiment by Haas et
al. [44]. These authors placed 40 atoms into a cavity of linewidth
$\kappa=2\pi 52$MHz with an atom–cavity coupling of $J=2\pi 170$MHz. Given a
time $\tau$, the probability that a photon leaks out of the cavity is hence
$1-e^{-\tau\kappa}$, and the efficiency $\eta$ defined in (5) is given by
$\eta=e^{-\tau\kappa}$. If we aim to prepare on average $n=8$ photons, Eq.
(21) gives a preparation time of $t_{\mathrm{prep}}=0.26$ns. The measurement
time is given by (24), which for $n=8$ gives $t_{\rm meas}\approx 0.89t_{\rm
prep}$. Hence, we have $\eta=e^{-(t_{\rm prep}+t_{\rm meas})\kappa}\approx
0.85$ for the overall process of preparation and measurement of 8 photons. On
top of that, there is a probability $p_{\rm error}\approx 0.04$ that one of
the photons stays in the cavity (c.f. Fig. 4), but from (25) we see this has a
negligible effect on the total efficiency $\eta$. Assuming that the atoms can
be measured perfectly (current experiments show more than 99% measurement
fidelity [87, 88]), this leads to an overall measurement efficiency of
$\eta\approx 0.85$. This can be contrasted with Fig. 10, where we note that
this experiment is on the verge of enabling quantum advantages in the proposed
set-up. In order to increase the value of $\eta$, a natural strategy is to
reduce the linewidth of the cavity (increasing the number of atoms would also
result in a larger $\eta$, as discussed in the main text). In this sense, we
should emphasize here that the experiment by Haas et al. does not include
tuneable atom–cavity coupling and thus cannot directly be used to implement
the scheme presented in the main text. To engineer a tuneable coupling, a
Raman scheme has to be employed, and correspondingly much narrower cavities
should be used [99], which will significantly enhance the preparation
fidelity.

###  D.0.2 Non-linear regime and optimal time scale

As a final comment, we note that it is in principle possible to use this
protocol in the non-linear regime $n=\mathcal{O}(N_{\rm at})$. Indeed, it
might be useful in particular experimental implementations to take most use of
the atoms at hand. We hence here discuss a few properties of $q(k)$ and
$t_{\rm prep}$ in this regime.

We start by investigating the average photon number $n(t)$ in the cavity
during the preparation stage. We see that $n(t)$ reaches its maximum value at
$n(t_{\rm opt})\approx 0.8N_{\rm at}$. The distribution $q(k)$ for that
optimal time is also illustrated in Fig. 11.

Figure 11: (a) Evolution of the average photon number $n(t)$ in the cavity
through the interaction (12). The initial state has $N_{\alpha}$ excited atoms
and cavity in the ground state. The photon number is maximized at a time
$t^{*}$ where $n(t^{*})/N_{\alpha}\approx 0.8$. Parameters: $J=1$,
$\omega_{0}=1$. (b) Probability distribution of the photon number at $t^{*}$
for $N_{\alpha}=50$. Parameters: $J=1$, $\omega_{0}=1$.

Let us now show that $t_{\mathrm{opt}}$ is well approximated by
$t_{\mathrm{opt}}\approx\log(4N_{\rm at})/(2J\sqrt{N_{\rm at}})$. Let us
consider the Hamiltonian

$H_{2}=\frac{1}{2}ab^{2}+\mathrm{H.c.},$ (57)

where $a,b$ are the annihilation operators for two harmonic oscillators. $a$
corresponds to what formerly was a spin, and $b$ is just the same cavity mode
as before. In the subspace spanned by the states
$\left.\left|{N-m}\right.\right\rangle_{a}\otimes\left.\left|{2m}\right.\right\rangle_{b}$,
where $\\{\left.\left|{m}\right.\right\rangle\\}$ are Fock states of an
oscillator, the Hamiltonian is a bi-diagonal matrix

$\mathcal{H}=\begin{pmatrix}0&a_{0}&0&\cdots\\\ a_{0}&0&a_{1}&\\\
0&a_{1}&0&\ddots\\\ \vdots&&\ddots&\ddots\end{pmatrix},$ (58)

where

$a_{m}=\sqrt{(N-m)(m+1/2)(m+1)}\approx(m+1)\sqrt{N-m}.$ (59)

For large $N-m$ these are essentially the same matrix elements as the actual
Hamiltonian (Eq. (12) in the main text) and one can check numerically that the
dynamics is very similar for large enough $N$. In the classical limit, we
replace the annihilation operators by the amplitudes of the corresponding
coherent states. The classical (mean field) equations of motion read

$\frac{d}{dt}\begin{pmatrix}\alpha\\\
\beta\end{pmatrix}=-i\begin{pmatrix}\beta^{2}/2\\\
\beta^{*}\alpha\end{pmatrix},$ (60)

with initial conditions $\beta(0)=1$, $\alpha(0)=\sqrt{N}$.

Figure 12: Comparison between the time scale obtained in mean field [Eq. (65)]
and the exact timescale calculated numerically.

Now we do a change of variables, taking $\alpha=a\exp(ix)$, $\beta=b\exp(iy)$,
such that

$\displaystyle\dot{a}$
$\displaystyle=-\frac{b^{2}}{2}\sin\phi,\qquad\dot{x}=-\frac{b^{2}}{2a}\cos\phi,$
(61a) $\displaystyle\dot{b}$
$\displaystyle=+ab\sin\phi,\qquad\dot{y}=-a\cos\phi,$ (61b)

where $\phi=x-2y$. Further defining the constant $K=a^{2}+b^{2}/2$, and the
variable $r=a^{2}-b^{2}/2$, we obtain the equations of motion

$\displaystyle\dot{\phi}$ $\displaystyle=-\frac{K+3r}{\sqrt{2(K+r)}}\cos\phi,$
(62a) $\displaystyle\dot{r}$ $\displaystyle=\sqrt{2(K+r)}(K-r)\sin\phi.$ (62b)

This defines a vector field in a two-dimensional plane, whose closed orbits
are the possible trajectories of the system. Since the phase $\phi$ is ill-
defined in the initial state, we can choose it to be $\phi=\pi/2$. In this
case, the system is governed only by

$\dot{r}=\sqrt{2(K+r)}(K-r),$ (63)

which is readily integrated to yield

$\left[\tanh^{-1}\sqrt{\frac{1+r/K}{2}}\right]_{r(t_{i})}^{r(t_{f})}=\sqrt{2K}(t_{f}-t_{i}).$
(64)

Since initially, $r/K\simeq 1-2/N$ and $K\simeq N$ (taking $\alpha=\sqrt{iN}$
and $\beta=1$), we conclude that the natural timescale for the switch is

$T\simeq\frac{1}{2\sqrt{N}}\tanh^{-1}\left(1-\frac{1}{4N}\right)\approx\frac{\log(4N)}{2\sqrt{N}}.$
(65)

This converges to the actual optimal time scale in the limit of large $N$ as
we show in Fig. 12.