# Practical Limits of Error Correction for Quantum Metrology

Nathan Shettell1,2, William J. Munro3,2, Damian Markham1,4 and Kae Nemoto2,4 1
Laboratoire d’Informatique de Paris 6, CNRS, Sorbonne Université, 4 place
Jussieu, 75005 Paris, France  2 National Institute of Informatics, 2-1-2
Hitotsubashi, Chiyoda-ku, Tokyo 101-8430, Japan  3 NTT Basic Research
Laboratories & Research Center for Theoretical Quantum Physics,3-1 Morinosato-
Wakamiya, Atsugi, Kanagawa, 243-0198, Japan  4 Japanese-French Laboratory for
Informatics, CNRS, National Institute for Informatics, 2-1-2 Hitotsubashi,
Chiyoda-ku, Tokyo 101-8430, Japan<EMAIL_ADDRESS>Keywords: Quantum
Metrology, Quantum Error Correction, Heisenberg Scaling

###### Abstract

Noise is the greatest obstacle in quantum metrology that limits it achievable
precision and sensitivity. There are many techniques to mitigate the effect of
noise, but this can never be done completely. One commonly proposed technique
is to repeatedly apply quantum error correction. Unfortunately, the required
repetition frequency needed to recover the Heisenberg limit is unachievable
with the existing quantum technologies. In this article we explore the
discrete application of quantum error correction with current technological
limitations in mind. We establish that quantum error correction can be
beneficial and highlight the factors which need to be improved so one can
reliably reach the Heisenberg limit level precision.

##  1 Introduction

Quantum metrology is an auspicious discipline of science where one makes high
precision estimates of unknown parameters [1, 2, 3, 4, 5]. The field has
numerous applications, including spectroscopy [6, 7], magnetometry [8, 9, 10,
11], thermometry [12, 13] and gravimetry [14, 15]. It has been known that
utilizing quantum resources including entanglement allows one to achieve a
gain in precision when compared to classical strategies [1, 16, 17, 18, 19,
20, 21, 22]. In fact quantum resources allows one to reach a level of
precision not possible in the classical situation [2, 23, 20, 21]. There is an
ultimate precision limit enabled by quantum mechanics called the Heisenberg
limit [24, 25, 2] which can only be achieved under idealized conditions.
However, in realistic experiments, noise and experimental imperfections limit
ones achievable precision and sensitivity [26, 27, 28, 29, 30]. In fact such
noise can, in principle, limit ones sensitivity to that achievable by
classical approaches [31].

Quantum error correction [32, 33, 34, 35, 36, 37], an essential tool from
quantum computation to protect quantum states from errors, is a potential
solution to circumvent the noise problem of quantum metrology [38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49]. A proof of principle for quantum error
correction enhanced magnetometry was outlined in [50], and further enhanced
with post selection in [51].

In the more recent results for quantum error correction enhanced quantum
metrology, it has been shown that if the signal and noise occur in orthogonal
directions [44, 45], then error correction can mitigate the effects of noise
without affecting the signal. Furthermore, it was shown that the Heisenberg
limit is recoverable when the time between error correction applications can
be taken as arbitrarily small. Unfortunately, this mathematical assumption is
impractical with our current quantum technologies: the timescale of current
error correction schemes are far from infinitesimally small, instead they are
comparable to that of the dephasing times for both spin qubit systems [52, 53]
and superconducting qubit systems [54, 55]. Moreover, a realistic error
correction strategy is hindered by other factors such as noisy ancillary
qubits and imperfect error correction.

In this article we consider a more pragmatic approach to incorporate error
correction into quantum metrology - by accounting for the impediments one
would face with current quantum technologies. We begin this article by
reviewing the fundamentals of phase estimation in a noisy environment without
error correction and compare it to a model enhanced with a parity check error
correction strategy. We derive the necessary conditions to achieve Heisenberg-
like precision, and unsurprisingly, we show that it is not permanently
achievable once one discards the assumption of being able to perform
arbitrarily fast error correction. Next, we derive the effects of noisy
ancillary qubits and imperfect error correction has on the precision. From
which, we investigate the limitations of current quantum technologies,
determining which factors need to be improved upon to enable Heisenberg-level
precision. Even though the results of this study are derived by examining a
specific error correction strategy, we conclude by suggesting that they can be
generalized to all error correcting codes.

##  2 Noisy Quantum Metrology

The canonical example of a noisy quantum metrology scheme involves $n$ qubits
governed by two interactions. The first is a signal $\omega$ which causes a
detuning in each of the qubits, represented by
$H=\frac{\hbar\omega}{2}\sum_{m=1}^{n}Z_{m}$. The second, an interaction with
the environment which causes dephasing (with rate $\gamma$ in the $X$
direction. Here $(Z_{m},X_{m})$ are the usual Pauli operators for the $m$th
qubit. Lastly, the qubit evolves in accordance to its natural resonance
frequency, which we assume is known to a high degree of precision. In the
rotating reference frame, where the natural frequency of the qubit is
suppressed, the Lindbladian master equation can be written as [56]

$\frac{d\rho}{dt}=-\frac{i}{\hbar}[H,\rho]+\gamma\sum_{m=1}^{n}(X_{m}\rho
X_{m}-\rho).$ (1)

The master equation can be further generalized to include a dephasing term
which commuted with the signal. However, these errors cannot be efficiently
corrected because one cannot differentiate between the signal and those errors
[44, 45]. Hence, for off-axis Markovian noise, we can only correct its
perpendicular component. In the non-Markovian case, where the noise commutes
with the signal but is spatially correlated, one can implement more
complicated error correction strategies [46, 47] to mitigate the effects of
noise; we do not consider these noise models in this work.

The protocol of the quantum metrology scheme is to let the system evolve for
time $t$, after which an appropriate measurement is performed. The likelihood
of the measurement outcomes will be dependent on $\omega$, so by repeating the
prepare and measure protocol many times one can precisely establish the value
of $\omega$ [4]. As the noisy system continues to evolve it becomes
significantly more difficult to distinguish the effects of the signal
Hamiltonian and the effects of the noise; increasing the uncertainty of the
estimate.

The quantum Fisher information (QFI) is a quantity which is inversely
proportional to the minimum uncertainty of the estimate [57, 58]. If initial
quantum state is an $n$ qubit Greenberger–Horne–Zeilinger (GHZ) state, then in
a noiseless environment after sensing time $t$ the QFI is given by [2]

$\mathcal{Q}_{\text{noiseless}}=n^{2}t^{2}.$ (2)

This quadratic scaling in $n$ is known as the Heisenberg limit, the ultimate
precision quantum physics allows. However, in a noisy environment, the
achievable precision is ultimately bounded because of said noise. It is
straightforward to compute (see Appendix A) the QFI in the noisy case

$\mathcal{Q}_{\text{noisy}}=n^{2}t^{2}\Big{(}1-\big{(}2-\frac{4}{3n}\big{)}\gamma
t\Big{)}+\mathcal{O}(\gamma^{2}t^{4}).$ (3)

Hence in the short time limit ($\gamma t\ll 1$) where the first two non-zero
terms of the Taylor expansion dominate the behaviour of the QFI, we observe
that the Heisenberg limit is lost once the quantity $2\gamma t$ becomes large.
This is not a practical time scale.

##  3 Error Correction Enhanced Quantum Metrology

Figure 1: Schematic illustration of the error correction enhanced quantum
metrology. The input state $\rho_{\text{in}}$, is composed of $n$ sensing
qubits and one ancillary qubit. The sensing qubits evolve according to the
signal $\omega$ and noise $\gamma$. The parity check code, denoted by
$\mathcal{C}$, is repeatedly applied after a given time $\tau$. The final
quantum state used for parameter estimation, $\rho_{\text{out}}$, undergoes
$t/\tau$ rounds of error correction. The scheme can easily be generalized;
allowing for arbitrary input states, error correction strategies and more
ancillary qubits.

With the issue of noise in mind, let us now incorporate error correction
protocols into the quantum metrology scheme as a potential solution. Current
literature suggests that noise which is perpendicular to the signal can be
mitigated by performing discrete applications of error correction in rapid
succession [44, 45]. However, to successfully mitigate the noise and recover
the Heisenberg limit, the time between applications of error correction is
taken to be arbitrarily small. Further, these studies include the assumption
of perfect error correction and access to noiseless ancillary qubits. These
assumptions are implausible for near term implementations of repeated error
correction [52, 53, 54, 55].

A practical approach is to make no assumptions regarding the time it takes to
perform error correction; similar to what was done in one of the original
formulations of error correction and quantum metrology [38]. Unfortunately,
higher order error terms in [38] are disregarded, which is similarly
presumptuous regarding the current ability of quantum technologies. We
overcome these restrictions by finding an exact solution of a specific error
correction strategy: a parity check error correction code [59, 60, 61]
involving a single ancillary qubit, depicted in Fig. 1. This scheme could be
implemented for instance in a hybrid quantum system involving an
electron/nuclear spin system. Here the electron spin could be used a sensing
qubit while the nuclear spin would act as an ancillary qubit [52, 53, 62]. The
parity check code is composed of two components. The first is $n$ non-
destructive parity measurements between individual sensing qubits and the
ancillary qubit. The second is the correction to any qubits in which an error
is detected [63].

In our model, the quantum state is initialized as an $n+1$ qubit GHZ where $n$
qubits are used for sensing while the remaining one is used as an ancilla for
error correction. The sensing qubits are influenced by a signal $\omega$, as
well as the noise $\gamma$. The parity check code is applied after time $\tau$
to mitigate the effects of the noise; the procedure is then repeated $t/\tau$
times where $t$ is the total sensing. Let us now determine the criteria to
achieve the Heisenberg limit. Initially we assume the ancillary qubit is
noiseless and error correction is perfect, after which we consider the
scenarios without these assumptions.

###  3.1 Noiseless Ancilla and Perfect Error Correction

(a)

(b)

Figure 2: Plot of $\mathcal{Q}/\tau^{2}$ for an $n=25$ qubit GHZ state after
undergoing repeated error correction with (a) a noiseless ancilla and perfect
error correction, (b) a noisy ancilla ($\xi/\gamma=10^{-4}$) and imperfect
error correction, and (c) a noiseless ancilla and imperfect error correction
($p=0.01$), with total sensing times $t/\tau=10^{3},10^{6}$. The
characteristics of a noisy state without the inclusion of a quantum error
correction code (QECC) after sensing time $\tau$ is also displayed. Note that
these curves are cutoff when $\mathcal{Q}/\tau^{2}=1$ for clarity purposes.
Additionally, we illustrate the corresponding normalized QFI curves,
$\mathcal{Q}/(nt)^{2}$, in plots (d), (e) and (f) respectfully, to emphasize
the deviation from the Heisenberg limit.

(a)

(b)

Figure 3: An alternative perspective on illustrating the tendencies of
$\mathcal{Q}/\tau^{2}$ for an $n=25$ qubit GHZ state after undergoing repeated
error correction. Here, the total sensing time $\gamma t$ is held constant and
deviations from the linear curve on the log-log plot represent the QFI tending
away from the Heisenberg limit and towards a QFI of zero. Once again we plot
the three scenarios: (a) a noiseless ancilla and perfect error correction, (b)
a noisy ancilla ($\xi/\gamma=10^{-4}$) and imperfect error correction, and (c)
a noiseless ancilla and imperfect error correction ($p=0.01$). Note that
without any error correction, the QFI after total sensing times $\gamma
t=100,1000,10000$ is effectively zero.

In the ideal error correction scenario (noiseless ancilla and perfect error
correction), after $t/\tau$ rounds of error correction, the quantum state can
be expressed as a bipartite mixed state

$\rho=\frac{1+r^{nt/\tau}}{2}\outerproduct*{\psi_{+}}{\psi_{+}}+\frac{1-r^{nt/\tau}}{2}\outerproduct*{\psi_{-}}{\psi_{-}},$
(4)

where

$\ket*{\psi_{\pm}}=\frac{1}{\sqrt{2}}\big{(}\ket{0}^{\otimes n+1}\pm e^{in\phi
t/\tau}\ket{1}^{\otimes n+1}\big{)},$ (5)

and

$re^{\pm
i\phi}=e^{-\gamma\tau}\Big{(}\cos\big(\Delta\tau\big{missing})+\frac{\gamma\pm
i\omega}{\Delta}\sin\big(\Delta\tau\big{missing})\Big{)},$ (6)

with $\Delta=\sqrt{\omega^{2}-\gamma^{2}}$. As we are considering the quantum
state immediately after the $t/\tau$th application of error correction, we of
course obtain a mixture of GHZ-like states. The derivation of Eq. (4) can be
found in Appendix B. It is important to note that $r^{2}<1$ if $\gamma\tau>0$.
Consequently, the quantum state becomes more mixed (and less useful for
quantum metrology) once the quantity $nt/\tau$ becomes very large. In Appendix
B, we show that the QFI of such a quantum state can be written in the form

$\mathcal{Q}_{1}=n^{2}t^{2}r^{2nt/\tau}f,$ (7)

where for small times $\tau$,

$f=1-2\gamma\tau+\mathcal{O}\big{(}\gamma^{2}\tau^{2}\big{)}.$ (8)

We immediately observe that that a Heisenberg level of precision is obtained
if two conditions are met. The first condition is that $2\gamma\tau\ll 1$; it
was derived in [44, 45] and is synonymous to the noisy scenario without error
correction given in Eq. (3). The second condition is that $r^{2nt/\tau}\approx
1$, which suggests that the Heisenberg limit cannot be maintained indefinitely
in a noisy environment ($r^{2}<1$) and that the QFI will eventually tend to
zero. For small $\tau$ we have

$r^{2nt/\tau}=1-\frac{4}{3}n(\omega\tau)^{2}\gamma
t+\mathcal{O}\big{(}\gamma^{3}\tau^{3}\big{)},$ (9)

meaning we can re-write the second condition as
$\frac{4}{3}n\omega^{2}\tau^{2}\gamma t\ll 1$. This second condition is of
second order with respect to $\tau$, which is the reason it was overlooked in
previous studies [44, 45].

Both conditions are clearly illustrated in Fig. 2a and Fig. 2d, where we have
two different family of curves plotted for a $n=25$ qubit GHZ state. The first
family of curves is with $\omega/\gamma=20$, and shows the Heisenberg limit
level of precision is lost once $r^{2nt/\tau}$ begins to tend to zero. The
second family of curves is for $\omega/\gamma=1/20$, and the Heisenberg limit
level of precision is lost once $\gamma\tau\approx 10^{-2}$, regardless of if
$t=10^{3}\tau$ or $t=10^{6}\tau$. The two conditions are similarly illustrated
in Fig. 3(a), where a deviation from the Heisenberg limit is again caused by
the $r^{2nt/\tau}\approx 1$ condition when $\omega/\gamma=20$, and by the
$2\gamma\tau\ll 1$ condition when $\omega/\gamma=1/20$. Additionally, we
observes that once the QFI begins to tend away from the Heisenberg limit, the
rate at which the QFI tends to zero is faster for larger values of $\gamma t$.

The reason for the stark contrast in the two families of curves
($\omega^{2}\gg\gamma^{2}$ versus $\omega^{2}\ll\gamma^{2}$), is due to larger
deviations from the ideal case when $\omega^{2}\gg\gamma^{2}$. Information
about $\omega$ is stored in the relative phase, $n\phi t/\tau$, and if an
error does occur between applications of error correction, the phase will
deviate further from the ideal case. Thus, each round of error correction
introduces a small amount of variance to the phase, and this variance is
larger for larger values of $\omega$.

In the noisy scenario without error correction, it has been shown that the
optimal sensing time (which maximizes the QFI) is $t_{\text{opt}}\approx
1/(n\gamma)$ [29]. We can compute a similar quantity in the scenario with
error correction by first noting that
$\frac{\partial}{\partial_{t}}f=\mathcal{O}\big{(}(\gamma\tau)^{2}\big{)}$.
Thus, one can approximate the optimal sensing time by maximizing the quantity
$t^{2}r^{2nt/\tau}$. In doing so one obtains

$t_{\text{opt}}=\frac{1}{\frac{2}{3}n\gamma\omega^{2}\tau^{2}+\mathcal{O}\big{(}\gamma^{2}\tau^{3}\big{)}}.$
(10)

As expected, $t_{\text{opt}}$ increases as $\tau$ decreases, and decreases as
$n$ increases. The dependence on $\omega$ can once again be linked to
effective variance in the phase of the quantum state.

###  3.2 Noisy Ancilla and Perfect Error Correction

To further augment the reality of our quantum metrology scheme we impede the
error correction by adding a dephasing rate, $\xi$, to the ancillary qubit.
This modification results in a QFI of the form

$\mathcal{Q}_{2}=n^{2}t^{2}r^{2nt/\tau}(f-g\xi)+\mathcal{O}\big{(}\xi^{2}\tau^{2}t^{2}\big{)},$
(11)

where $g$ is bounded by (see Appendix B)

$\Big{(}\frac{2}{3}-7\gamma\tau\Big{)}t\leq
g+\mathcal{O}\big{(}\gamma\tau^{2}\big{)}\leq\frac{5}{2}(t+\tau),$ (12)

which we can interpret as a third condition that is needed to be satisfied to
obtain Heisenberg-like scaling: $\xi t\ll 1$. This is not very surprising;
once $\xi t$ becomes significantly large, the ancillary qubit will be too
noisy for practical error correction. This additional condition is displayed
in Fig. 2b and Fig. 2e, where we set the ancillary qubit to have a dephasing
rate of $\xi/\gamma=10^{-4}$. As expected, the noisy ancilla causes the
Heisenberg limit to be lost sooner when compared to the case with a noiseless
ancilla. The impact is much more prominent for the curve with
$\omega/\gamma=1/20$ and $t=10^{6}\tau$, where the loss of the Heisenberg
limit is due to $\xi t$ becoming too large instead of $\gamma\tau$. In Fig.
3(b), where the total sensing time $\gamma t$ is static (and thus $\xi t$ is
static), we observe a noticeable decrease in the achievable QFI when the total
sensing time is largest, $\gamma t=10000$, when compared to the same set of
curves in Fig. 3(a), where the ancillary qubit is noiseless. The additional
decrease due to a noisy ancillary qubit can be overcome by occasionally re-
initializing the ancillary qubit before it gets too noisy.

###  3.3 Noiseless Ancilla and Imperfect Error Correction

The second hindrance we explore is the inclusion of imperfect error
correction. We simulate this by adding a probability $p$ that a parity check
outputs the wrong outcome, which results in an unnecessary bit-flip correction
(or lack there of). In this scenario, the QFI can be written as

$\mathcal{Q}_{3}=n^{2}t^{2}(rq)^{2nt/\tau}h,$ (13)

with

$q^{2nt/\tau}=1-4p(1-p)\omega^{2}t\tau+\mathcal{O}\big{(}\gamma^{2}\tau^{2}\big{)},$
(14)

and

$h=(1-2p)^{2}f+4p\Big{(}\frac{1-p}{n}+1-2p\Big{)}\frac{\tau}{t}+\mathcal{O}\big{(}\gamma^{2}\tau^{2}\big{)}.$
(15)

Notice that the inclusion of imperfect error correction makes the Heisenberg
limit unattainable; $\mathcal{Q}\rightarrow n^{2}t^{2}(1-2p)^{2}$ as
$\tau\rightarrow 0$. The multiplicative factor $(1-2p)^{2}$ is is due to
uncertainty in the error correction propagating to the uncertainty in the
parameter estimation.

The additional conditions are illustrated in Fig. 2c, Fig. 2f and Fig. 3c,
where we have set $p=0.01$. Firstly, as $\gamma\tau\rightarrow 0$,
$\mathcal{Q}/(nt)^{2}\rightarrow(1-2p)^{2}\approx 0.96$. Secondly, the
additional condition $q^{2nt/\tau}\approx 1$ is again associated with
additional variance being added to the relative phase because of the imperfect
error correction. The impact of which is much more influential when
$\omega/\gamma=20$, as opposed to when $\omega/\gamma=1/20$.

###  3.4 Limitations of Current Quantum Technologies

(a)

(b)

Figure 4: Normalized QFI in the small signal regime $\omega/\gamma=0.01$.
Using values from today’s quantum technologies ($\gamma^{-1}=\tau=10^{-6}$s,
$\xi^{-1}=5\times 10^{-4}$s, and $p=0.06$) [52, 53] ( ) a QFI of $\sim 20\%$
of the Heisenberg limit can be achieved for sensing times $t=10^{1}\tau$. With
improved error correction fidelity and a noiseless ancilla ( ) this can be
sustained for a sensing time $t=10^{3}\tau$. The QFI is significantly improved
when $\gamma\tau=0.1$ ( ).

In [52, 53], the electron spin of a nitrogen-vacancy center is entangled to
carbon-13 nuclear spins, the nuclear spins act as ancillary qubits, and error
correction is performed on the electorn spin. The reported dephasing rates are
$\gamma^{-1}\sim 10^{-6}$s and $\xi^{-1}\sim 5\times 10^{-4}$s. The error
correction is being performed on a similar timescale of $\tau\sim 10^{-6}$s,
with infidelity reported at $p=0.06$ [53]. In Fig. 4, we benchmark the sensing
capability of a single qubit systems when $\omega^{2}\ll\gamma^{2}$, using the
listed values. As expected, the Heisenberg limit is unattainable. Moreover, it
is still unattainable if one performs near perfect error correction
($p=0.001$) and uses noiseless ancillary qubits ($\xi=0$) which can be
approximately achieved by frequently re-initializing the ancilla before it
becomes too noisy. Notably though, when the quantity $\gamma\tau$ decreases by
a factor of ten, one attains a QFI of $\sim 80\%$ of the Heisenberg limit for
a total sensing time $t=10^{5}\tau$; greatly outclassing the precision
achieved in current experiments [9, 10, 11] using spin systems. Of course,
this result should be used with caution. A realistic metrology scheme is
hindered by other factors not discussed in this study, such as imperfect
resources and noise parallel to the signal, which cannot be suppressed with
error correction.

##  4 Other Error Correction Strategies

Until now, we have only discussed one possible error correction protocol,
whereas [44, 45] make no assumptions regarding the error correction strategy.
Although a completely general result is more satisfying, it is unfeasible with
our solution method. However, using our mathematical methodology, one can
substitute any specific error correction strategy in place of the parity check
error correction code. Alternatively, one could consider a continuous error
correction strategy [64, 65, 66] by appropriately modifying the master
equation, Eq. (1). Note that continuous error correcting codes are difficult
to implement [66] and were thus not considered in this work. Finally, one
could forego error correction altogether and adapt our model to one of
dynamical decoupling [67, 68] or reservoir engineering [69].

We conjecture that, just as with discrete applications of the parity check
code, for any noise mitigation strategy, the QFI will depend on term similar
to $r^{2nt/\tau}$: one which suggests that there exist a critical time where
the QFI begins to tend to zero. In fact, we show in Appendix C that using the
$n$ qubit bit flip code [36] yields the results

$\mathcal{Q}=n^{2}t^{2}r^{2nt/\tau}f+\mathcal{O}\big{(}(\gamma\tau)^{\frac{n-1}{2}}\big{)}.$
(16)

Hence, for large $n$ the QFI using the bit flip code is effectively the same
as if one utilizes the parity check code. The reasoning supporting the
aforementioned conjecture is that any errors which occur will cause the
relative phase to deviate from the ideal value, and the deviation will remain
even after performing a correction. Thus, after each round of error
correction, the variance in the phase will increase, which propagates to an
increase in variance in the eventual estimate of $\omega$. This conjecture is
easily extended to any realistic noise model; as one expects the relative
phase to deviate from the ideal value after performing error correction,
regardless of the noise model.

We are not suggesting that the parity check code is the most efficient noise
mitigation strategy, for orthogonal noise, at retaining the Heisenberg limit.
For example, if one performs adaptive parameter estimation [70, 71], one could
supplement the error correction strategy with an inverse Hamiltonian to
correct some of the phase deviations. This strategy is more difficult to
implement, but most likely outperforms the parity check code. However, it
would still fail to perfectly correct all of the deviations in the phase. To
do so, and hence maintain the Heisenberg limit indefinitely, would require
knowledge of the exact time errors occur at, as well as exact knowledge of
$\omega$ (note that the latter requirement defeats the purpose of quantum
metrology). Of course, as quantum technologies continue to improve, and the
frequency at which these noise mitigation tools can be applied increases, so
too does our ability to maintain the Heisenberg limit for increased sensing
times.

##  5 Remarks

In this article we analysed the ability of an error correction protocol to
recover the Heisenberg limit in noisy quantum metrology. As expected from
previous results [44, 45], the Heisenberg limit can be achieved for longer
duration’s when compared to a similar scheme without error correction and is
conditioned on the fact that $2\gamma\tau\ll 1$. Notably though, our results
suggest that the Heisenberg limit is not permanently achievable, and is lost
once the quantity $nt/\tau$ becomes too large. This previously undiscussed
requirement is due to the fact that a small amount of variance is introduced
to the relative phase after each round of error correction; eventually the
total variance is too large to overcome. We also showed that any uncertainty
in the error correction will propagate to the QFI, making the actual
Heisenberg limit unachievable, regardless of the speed of the frequency of
error correction. Moreover, the uncertainty of error correction increases the
added variance to the relative phase.

A more practical figure of merit for quantum metrology is the Fisher
information [58] (instead of quantum Fisher information). However, the Fisher
information is dependent on a specific measurement strategy, whereas the QFI
is optimized over all measurement strategies. Thus, to obtain analytic results
that are not strategy dependent, we compute the QFI. Nonetheless, we provide
sufficient mathematical results in the Appendix to compute the Fisher
information for a given measurement strategy. Furthermore, we show in Appendix
D that there exists a measurement strategy using single qubit measurements
such that the Fisher information is approximately equal to the QFI for the
error correction enhanced quantum metrology scheme.

We chose to specifically analyse the effects of repeated error correction in
the scenario when the quantum state used for sensing is initialized in an $n$
qubit GHZ state. The logical generalization would be to expand the results to
a broader scope of initial states; such as squeezed states [72], symmetric
states [73], or graph states [74]. It is possible that these quantum states
(which do not achieve the Heisenberg limit, but do achieve a quantum
advantage) are more robust to the effects of noise and can maintain a quantum
advantage for a longer total sensing time.

## Acknowledgements

Nathan Shettell and Damian Markham acknowledge support of the ANR through the
ANR-17-CE24-0035 VanQuTe. Nathan Shettell would also like to acknowledge the
support of the NII international internship program.

##  Appendix A The QFI of a Noisy GHZ without Error Correction

We wish to solve the matrix equation

$\frac{d\rho}{dt}=-\frac{i}{\hbar}[H,\rho]+\gamma\sum_{m=1}^{n}(X_{m}\rho
X_{m}-\rho),$ (17)

with $H=\frac{\hbar\omega}{2}\sum_{m=1}^{n}Z_{m}$. Without loss of generality,
we can assume that the solution is of the form

$\rho=\sum_{j,k}\alpha_{j,k}\outerproduct{j}{k},$ (18)

where $j,k\in\\{0,1\\}^{\otimes n}$ are bit strings of length $n$. To obtain a
solution, we instead consider Eq. (17) as a set of linear differential
equations and solve for the amplitudes $\alpha_{j,k}$. Since we are
considering the scenario where the quantum state is initialized in a GHZ
state, the only non-zero of the amplitudes are those of the form
$\alpha_{j,j}$ or $\alpha_{j,\bar{j}}$ (where $\ket{\bar{j}}=X^{\otimes
n}\ket{j}$.

We set $\vec{a}$ to be the vector of size $2^{n}$ containing all amplitudes of
the form $\alpha_{j,j}$. Similarly, we set $\vec{b}$ to be the vector of size
$2^{n}$ containing all amplitudes of the form $\alpha_{j,\bar{j}}$. Both
vectors are ordered with respect to ascending values of $j$. This framework
transforms Eq. (17) into two separate matrix differential equations, i)
$\frac{d\vec{a}}{dt}=A\vec{a}$, and ii) $\frac{d\vec{b}}{dt}=B\vec{b}$, where

$\displaystyle A$ $\displaystyle=\sum_{m=0}^{n-1}\begin{pmatrix}1&0\\\
0&1\end{pmatrix}^{\otimes m}\otimes\begin{pmatrix}-\gamma&\gamma\\\
\gamma&-\gamma\end{pmatrix}\otimes\begin{pmatrix}1&0\\\
0&1\end{pmatrix}^{\otimes n-m-1},$ (19) $\displaystyle B$
$\displaystyle=\sum_{m=0}^{n-1}\begin{pmatrix}1&0\\\ 0&1\end{pmatrix}^{\otimes
m}\otimes\begin{pmatrix}-i\omega-\gamma&\gamma\\\
\gamma&i\omega-\gamma\end{pmatrix}\otimes\begin{pmatrix}1&0\\\
0&1\end{pmatrix}^{\otimes n-m-1}.$ (20)

The solutions of the differential matrix equations are

$\vec{a}=e^{At}\vec{a}_{0}=e^{-n\gamma t}\begin{pmatrix}\cosh(\gamma
t)&\sinh(\gamma t)\\\ \sinh(\gamma t)&\cosh(\gamma t)\end{pmatrix}^{\otimes
n}\vec{a}_{0},$ (21)

and

$\displaystyle\vec{b}=e^{Bt}\vec{b}_{0}$ $\displaystyle=e^{-n\gamma
t}\begin{pmatrix}\cos(\Delta t)-i\frac{\omega}{\Delta}\sin(\Delta
t)&\frac{\gamma}{\Delta}\sin(\Delta t)\\\\[5.0pt]
\frac{\gamma}{\Delta}\sin(\Delta t)&\cos(\Delta
t)+i\frac{\omega}{\Delta}\sin(\Delta t)\end{pmatrix}^{\otimes n}\vec{b}_{0}$
(22) $\displaystyle=e^{-n\gamma t}\begin{pmatrix}x_{-}&y\\\
y&x_{+}\end{pmatrix}^{\otimes n}\vec{b}_{0},$

where $\vec{a}_{0}$ and $\vec{b}_{0}$ are the initial amplitude vectors and
$\Delta=\sqrt{\omega^{2}-\gamma^{2}}$. The symbolic representation of the
entries of the matrix $B$ ($x_{\pm}$ and $y$) is to add clarity in latter
computations.

The final quantum state can be expressed in the form

$\rho=\frac{1}{2}\sum_{j}\lambda_{j,+}\outerproduct*{\psi_{j,+}}{\psi_{j,+}}+\lambda_{j,-}\outerproduct*{\psi_{j,-}}{\psi_{j,-}},$
(23)

with

$\lambda_{j,\pm}=e^{-n\gamma t}\frac{s_{j}\pm r_{j}}{2},$ (24)

and

$\ket{\psi_{j,\pm}}=\frac{1}{\sqrt{2}}\big{(}e^{-i\theta_{j}/2}\ket{j}\pm
e^{+i\theta_{j}/2}\ket{\bar{j}}\big{)}.$ (25)

The factor of $1/2$ in front of the sum is to avoid double counting, because
$\lambda_{j,\pm}=\lambda_{\bar{j},\pm}$ and
$\ket{\psi_{j,\pm}}=\ket{\psi_{\bar{j},\pm}}$. The eigenvalues and
eigenvectors are parameterized by

$\displaystyle s_{j}$ $\displaystyle=\cosh^{n-h_{j}}(\gamma
t)\sinh^{h_{j}}(\gamma t)+\cosh^{h_{j}}(\gamma t)\sinh^{n-h_{j}}(\gamma t),$
(26) $\displaystyle r_{j}e^{\pm i\theta_{j}}$
$\displaystyle=x_{\pm}^{h_{j}}y^{n-h_{j}}+x_{\mp}^{n-h_{j}}y^{h_{j}},$ (27)

where $h_{j}$ is the Hamming weight (number of $1$’s) of $j$.

The QFI of a quantum state
$\sigma=\sum_{j}\lambda_{j}\outerproduct{\psi_{j}}{\psi_{j}}$, where
$\\{\ket{\psi_{j}}\\}$ form an orthonormal basis and $\sum_{j}\lambda_{j}=1$,
is [58]

$\mathcal{Q}=\sum_{\begin{subarray}{c}j\\\ \lambda_{j}\neq
0\end{subarray}}\frac{\dot{\lambda}_{j}^{2}}{\lambda_{j}}+2\sum_{\begin{subarray}{c}j,k\\\
\lambda_{j}+\lambda_{k}\neq
0\end{subarray}}\frac{(\lambda_{j}-\lambda_{k})^{2}}{\lambda_{j}+\lambda_{k}}\big{|}\innerproduct*{\dot{\psi}_{j}}{\psi_{k}}\big{|}^{2},$
(28)

where we have used the notation $\dot{\square}=\partial_{\omega}\square$ for
clarity. Combining this with the final quantum state $\rho$, one can obtain
the QFI of a noisy GHZ without error correction. We again float a factor of
$1/2$ in front of the sum to avoid double counting. In doing so one obtains

$\displaystyle\mathcal{Q}_{\text{noisy}}$
$\displaystyle=\frac{1}{2}\sum_{j}\Bigg{(}\frac{\dot{\lambda}_{j,+}^{2}}{\lambda_{j,+}}+\frac{\dot{\lambda}_{j,-}^{2}}{\lambda_{j,-}}+2\frac{(\lambda_{j,+}-\lambda_{j,-})^{2}}{\lambda_{j,+}+\lambda_{j,-}}\Big{(}\big{|}\innerproduct*{\psi_{j,+}}{\dot{\psi}_{j,-}}\big{|}^{2}+\big{|}\innerproduct*{\psi_{j,-}}{\dot{\psi}_{j,+}}\big{|}^{2}\Big{)}\Bigg{)}$
(29) $\displaystyle=\frac{e^{-n\gamma
t}}{2}\sum_{j}\frac{s_{j}\dot{r}_{j}^{2}}{s_{j}^{2}-r_{j}^{2}}+\frac{r_{j}^{2}}{s_{j}}\dot{\theta}_{j}^{2}$
$\displaystyle=n^{2}t^{2}\Big{(}1-\big{(}2-\frac{4}{3n}\big{)}\gamma
t\Big{)}+\mathcal{O}\big{(}\gamma^{2}t^{4}\big{)}.$

##  Appendix B The QFI of a Noisy GHZ Enhanced with Repeated Error Correction

Recall in the scenario enhanced with error correction, we let the system
evolve for a total time $\tau$, after which error correction is performed.
This processes is repeated until the system has evolved for total time $t$
(without loss of generality we assume that $t/\tau$ is a positive integer).
Additionally, an ancillary qubit is included into the dynamics, which we set
to have an index $m=n+1$.

We begin by solving a completely general scenario in which the ancilla is
noisy and the error correction is imperfect, from which we can obtain varying
results for all the combinations of noiseless/noisy ancilla and
perfect/imperfect error correction by taking the appropriate limits.

We model the noisy ancilla by subjecting it to dephasing in the $X$ direction
with rate $\xi$, this changes the matrix equations to be

$e^{A\tau}=e^{-(n\gamma+\xi)\tau}\begin{pmatrix}c_{\gamma}&s_{\gamma}\\\
s_{\gamma}&c_{\gamma}\end{pmatrix}^{\otimes
n}\otimes\begin{pmatrix}c_{\xi}&s_{\xi}\\\ s_{\xi}&c_{\xi}\end{pmatrix},$ (30)

and

$e^{B\tau}=e^{-(n\gamma+\xi)\tau}\begin{pmatrix}x_{-}&y\\\
y&x_{+}\end{pmatrix}^{\otimes n}\otimes\begin{pmatrix}c_{\xi}&s_{\xi}\\\
s_{\xi}&c_{\xi}\end{pmatrix}.$ (31)

Here we have recycled the same notation which we used in Appendix A. To be
concise we set $c_{\gamma}=\cosh(\gamma\tau)$, $s_{\gamma}=\sinh(\gamma\tau)$,
$c_{\xi}=\cosh(\xi\tau)$ and $s_{\xi}=\sinh(\xi\tau)$.

Recall that in the parity check code, a correction is made on a sensing qubit
if it has a different parity to the ancillary qubit. We simulate imperfect
error correction by adding a probability that the syndrome measurement outputs
an incorrect result with probability $p$, which would result in the incorrect
correction being applied. This operation can be represented as a the matrix

$E=\begin{pmatrix}1-p&1-p\\\ p&p\\\ \end{pmatrix}^{\otimes
n}\otimes\begin{pmatrix}1&0\\\ 0&0\\\ \end{pmatrix}+\begin{pmatrix}p&p\\\
1-p&1-p\\\ \end{pmatrix}^{\otimes n}\otimes\begin{pmatrix}0&0\\\ 0&1\\\
\end{pmatrix}.$ (32)

Combining the evolution matrices, $e^{A\tau}$ and $e^{B\tau}$, and the error
correction matrix, $E$, we obtain an expression for the amplitudes of the
final quantum state

$\displaystyle\vec{a}=\big{(}Ee^{A\tau}\big{)}^{t/\tau}\vec{a}_{0}=e^{-\xi
t}\Bigg{(}$ $\displaystyle\begin{pmatrix}1-p&1-p\\\ p&p\end{pmatrix}^{\otimes
n}\otimes\begin{pmatrix}c_{\xi}&s_{\xi}\\\ 0&0\end{pmatrix}$ (33)
$\displaystyle+$ $\displaystyle\begin{pmatrix}p&p\\\
1-p&1-p\end{pmatrix}^{\otimes n}\otimes\begin{pmatrix}0&0\\\
s_{\xi}&c_{\xi}\end{pmatrix}\Bigg{)}^{t/\tau}\vec{a}_{0},$

and

$\displaystyle\vec{b}=\big{(}Ee^{B\tau}\big{)}^{t/\tau}\vec{b}_{0}=r^{nt/\tau}e^{-\xi
t}\Bigg{(}$ $\displaystyle\begin{pmatrix}(1-p)e^{-i\phi}&(1-p)e^{i\phi}\\\
pe^{-i\phi}&pe^{i\phi}\end{pmatrix}^{\otimes
n}\otimes\begin{pmatrix}c_{\xi}&s_{\xi}\\\ 0&0\end{pmatrix}$ (34)
$\displaystyle+$ $\displaystyle\begin{pmatrix}pe^{-i\phi}&pe^{i\phi}\\\
(1-p)e^{-i\phi}&(1-p)e^{i\phi}\end{pmatrix}^{\otimes
n}\otimes\begin{pmatrix}0&0\\\
s_{\xi}&c_{\xi}\end{pmatrix}\Bigg{)}^{t/\tau}\vec{b}_{0},$

where we define

$re^{\pm
i\phi}=e^{-\gamma\tau}(x_{\pm}+y)=e^{-\gamma\tau}\Big{(}\cos(\Delta\tau)+\frac{\gamma\pm
i\omega}{\Delta}\sin(\Delta\tau)\Big{)}.$ (35)

It easy to show that from Eq. (33) that the final amplitude corresponding to
the outer product $\outerproduct{j0}{j0}$ is equal to
$\frac{(1-p)^{n-h_{j}}p^{h_{j}}}{2}$, and similarly the amplitude
corresponding to the outer product $\outerproduct{\bar{j}1}{\bar{j}1}$ is also
equal to $\frac{(1-p)^{n-h_{j}}p^{h_{j}}}{2}$. Recall that we have set the
final qubit to be the ancillary qubit, and the first $n$ to be the sensing
qubits. Therefore, in this scenario $h_{j}$ is the Hamming weight of the bit
string of the sensing qubits. The solution to Eq. (34) is more complex.
However, after the first round of error-correction (and each subsequent
round), the amplitude corresponding to the outer product
$\outerproduct{j0}{\bar{j}1}$ is of the form
$\frac{(1-p)^{n-h_{j}}p^{h_{j}}Re^{-i\theta}}{2}$, and the amplitude
corresponding to the outer product $\outerproduct{\bar{j}1}{j0}$ is of the
form $\frac{(1-p)^{n-h_{j}}p^{h_{j}}Re^{i\theta}}{2}$. Therefore, one can
simplify the problem of solving for the final values of $Re^{\pm i\theta}$.
This can be done by constructing a recurrence relation from Eq. (34). By
setting $N=n(t/\tau-1)$, we obtain

$\displaystyle\begin{pmatrix}Re^{-i\theta}\\\ Re^{+i\theta}\end{pmatrix}$
$\displaystyle=r^{nt/\tau}e^{-\xi
t}\begin{pmatrix}c_{\xi}q_{-}&s_{\xi}q_{+}\\\ s_{\xi}q_{-}&c_{\xi}q_{+}\\\
\end{pmatrix}^{N}\begin{pmatrix}\upsilon_{-}\\\ \upsilon_{+}\end{pmatrix}$
(36) $\displaystyle=r^{nt/\tau}e^{-\xi
t}\left(\frac{\mu_{+}\mu_{-}^{N}-\mu_{-}\mu_{+}^{N}}{\mu_{+}-\mu_{-}}\begin{pmatrix}1&0\\\
0&1\end{pmatrix}+\frac{\mu_{+}^{N}-\mu_{-}^{N}}{\mu_{+}-\mu_{-}}\begin{pmatrix}c_{\xi}q_{-}&s_{\xi}q_{+}\\\
s_{\xi}q_{-}&c_{\xi}q_{+}\\\
\end{pmatrix}\right)\begin{pmatrix}\upsilon_{-}\\\ \upsilon_{+}\end{pmatrix},$

with

$q_{\pm}=(1-p)e^{\pm i\phi}+pe^{\mp i\phi},$ (37)
$\mu_{\pm}=c_{\xi}\cos\phi\pm\sqrt{q_{+}q_{-}s_{\xi}^{2}-(1-2p)^{2}c_{\xi}^{2}\sin^{2}\phi},$
(38)

and

$\upsilon_{\pm}=c_{\xi}e^{\pm in\phi}+s_{\xi}e^{\mp in\phi}.$ (39)

Therefore, in the general case with a noisy ancilla and imperfect error
correction, the quantum state after $t/\tau$ rounds of error correction can be
written as

$\rho=\sum_{j}\lambda_{j,+}\outerproduct{\psi_{j,+}}{\psi_{j,+}}+\lambda_{j,-}\outerproduct{\psi_{j,-}}{\psi_{j,-}},$
(40)

where

$\lambda_{j,\pm}=(1-p)^{n-h_{j}}p^{h_{j}}\frac{1\pm R}{2},$ (41)

and

$\ket{\psi_{j,\pm}}=\frac{1}{\sqrt{2}}\big{(}e^{-i\theta/2}\ket{j0}\pm
e^{+i\theta/2}\ket{\bar{j}1}\big{)}.$ (42)

From which, we compute the QFI to be

$\displaystyle\mathcal{Q}$
$\displaystyle=\sum_{j}\Bigg{(}\frac{\dot{\lambda}_{j,+}^{2}}{\lambda_{j,+}}+\frac{\dot{\lambda}_{j,-}^{2}}{\lambda_{j,-}}+2\frac{(\lambda_{j,+}-\lambda_{j,-})^{2}}{\lambda_{j,+}+\lambda_{j,-}}\Big{(}\big{|}\innerproduct*{\psi_{j,+}}{\dot{\psi}_{j,-}}\big{|}^{2}+\big{|}\innerproduct*{\psi_{j,-}}{\dot{\psi}_{j,+}}\big{|}^{2}\Big{)}\Bigg{)}$
(43) $\displaystyle=\frac{\dot{R}^{2}}{1-R^{2}}+R^{2}\dot{\theta}^{2}.$

We can now determine the properties of the QFI in the varying scenarios.

Case 1: Noiseless Ancilla and Perfect Error Correction

In the simplest case with a noiseless ancilla ($\xi=0$) and perfect error
correction ($p=0$), we obtain that $Re^{\pm i\theta}=\big{(}re^{\pm
i\phi}\big{)}^{nt/\tau}$. Therefore, we can write that

$\mathcal{Q}_{1}=n^{2}t^{2}r^{2nt/\tau}f,$ (44)

where

$f=\frac{1}{\tau^{2}}\Big{(}\frac{1}{1-r^{2nt/\tau}}\frac{\dot{r}^{2}}{r^{2}}+\dot{\phi}^{2}\Big{)}=1-2\gamma\tau+\frac{7\gamma^{2}\tau^{2}}{3}+\frac{4\gamma\tau^{2}}{3nt}+\mathcal{O}\big{(}\gamma^{3}\tau^{3}\big{)},$
(45)

and

$r^{2nt/\tau}=1-\frac{4}{3}nt\gamma\omega^{2}\tau^{2}+\mathcal{O}\big{(}\gamma^{3}\tau^{3}\big{)}.$
(46)

It is easy to verify that $r^{2}<1$ when $\gamma\tau>0$ (assuming $\omega\neq
0$), implying that the QFI will eventually tend to zero in a noisy
environment. Note that we can write

$r^{2}=e^{-2\gamma\tau}\Big{(}1+\frac{\gamma}{\Delta}\sin\big(2\Delta\tau\big{missing})+\frac{2\gamma^{2}}{\Delta^{2}}\sin^{2}\big{(}\Delta\tau\big{)}\Big{)}.$
(47)

Suppose that $\omega^{2}-\gamma^{2}\geq 0$, then we have that
$\Delta=|\Delta|$ is real, as well as $\sin(\Delta\tau)\leq\Delta\tau$ and
$\sin(2\Delta\tau)\leq 2\Delta\tau$. Thus we have the inequality

$r^{2}\leq e^{-2\gamma\tau}\Big{(}1+2\gamma\tau+2\gamma^{2}\tau^{2}\Big{)},$
(48)

where on the right hand side of the above inequality is strictly decreasing
(with respect to $\gamma\tau$) and equal to one when $\gamma\tau=0$. The other
possible case is that $\omega^{2}-\gamma^{2}<0$, then we have that
$\Delta=i|\Delta|$, as well as

$\frac{\sinh\big{(}|\Delta|\tau)}{|\Delta|}<\frac{\sinh\big{(}\gamma\tau\big{)}}{\gamma},\;\;\text{and}\;\;\frac{\sinh\big{(}2|\Delta|\tau\big{)}}{|\Delta|}<\frac{\sinh\big{(}2\gamma\tau\big{)}}{\gamma}.$
(49)

From which we obtain a second inequality

$r^{2}<e^{-2\gamma\tau}\Big{(}1+2\sinh(\gamma\tau)+2\sinh^{2}(\gamma\tau)\Big{)}=1.$
(50)

Combining both results, assuming $\omega\neq 0$, we obtain that $r^{2}<1$ if
$\gamma\tau>0$.

Case 2: Noisy Ancilla and Perfect Error Correction

In the second case we have a noisy ancilla ($\xi\neq 0$) and perfect error
correction ($p=0$). The analytic expression for $Re^{\pm i\theta}$ is quite
complicated, so instead we expand with respect to $\xi$ to obtain

$Re^{\pm i\theta}=(1-\xi t)\big{(}re^{\pm
i\phi}\big{)}^{nt/\tau}+\xi\tau\frac{\sin(nt\phi/\tau)}{\sin(n\phi)}\big{(}re^{\mp
i\phi}\big{)}^{n}+\mathcal{O}\big{(}\xi^{2}\tau^{2}\big{)}.$ (51)

After expanding the QFI with respect to $\xi$, we obtain

$\mathcal{Q}_{2}=n^{2}t^{2}r^{2nt/\tau}(f-g\xi)+\mathcal{O}\big{(}\xi^{2}\tau^{2}t^{2}\big{)},$
(52)

where

$\displaystyle g=$ $\displaystyle\Big{(}\frac{n\omega t\big{(}1+3\cos(2n\omega
t)\big{)}+(n^{2}\omega^{2}t^{2}-2)\sin(2n\omega
t)}{n^{3}\omega^{3}t^{3}}+2\Big{)}t$ (53) $\displaystyle+\frac{2\big{(}n\omega
t\cos(n\omega t)-\sin(n\omega t)\big{)}^{2}}{n^{2}\omega^{2}t^{2}}\tau$
$\displaystyle+\Big{(}\frac{(4n\omega t-2n^{3}\omega^{3}t^{3})\cos(2n\omega
t)-(2-5n^{2}\omega^{2}t^{2})\sin(2n\omega
t)}{n^{3}\omega^{3}t^{3}}-4\Big{)}\gamma
t\tau+\mathcal{O}\big{(}\gamma\tau^{2}\big{)}.$

To simplify analysis, we utilize the following inequalities:

$\displaystyle\frac{2}{3}\leq\frac{n\omega t\big{(}1+3\cos(2n\omega
t)\big{)}+(n^{2}\omega^{2}t^{2}-2)\sin(2n\omega
t)}{n^{3}\omega^{3}t^{3}}+2\leq\frac{5}{2},$ (54) $\displaystyle
0\leq\frac{2\big{(}n\omega t\cos(n\omega t)-\sin(n\omega
t)\big{)}^{2}}{n^{2}\omega^{2}t^{2}}\leq\frac{5}{2},$ (55)
$\displaystyle-7\leq\frac{(4n\omega t-2n^{3}\omega^{3}t^{3})\cos(2n\omega
t)-(2-5n^{2}\omega^{2}t^{2})\sin(2n\omega t)}{n^{3}\omega^{3}t^{3}}-4\leq 0,$
(56)

from which it follows that

$\Big{(}\frac{2}{3}-7\gamma\tau\Big{)}t\leq
g+\mathcal{O}\big{(}\gamma\tau^{2}\big{)}\leq\frac{5}{2}(t+\tau).$ (57)

Case 3: Noiseless Ancilla and Imperfect Error Correction

In the third case we have a noiseless ancilla ($\xi=0$) and imperfect error
correction ($p\neq 0$). It is straightforward to obtain

$Re^{\pm i\theta}=\big{(}re^{\pm i\phi}\big{)}^{nt/\tau}\big{(}q_{\pm}e^{\mp
i\phi}\big{)}^{n(t/\tau-1)}.$ (58)

We compute the QFI to be of the form

$\mathcal{Q}_{3}=n^{2}t^{2}(rq)^{2nt/\tau}h,$ (59)

where we define $q^{2}=q_{+}q_{-}$, which when raised to the exponent
$nt/\tau$ satisfies

$q^{2nt/\tau}=1-4p(1-p)\omega^{2}t\tau+\mathcal{O}\big{(}\gamma^{2}\tau^{2}\big{)},$
(60)

and

$h=(1-2p)^{2}f+4p\Big{(}\frac{1-p}{n}+1-2p\Big{)}\frac{\tau}{t}+\mathcal{O}\big{(}\gamma^{2}\tau^{2}\big{)}.$
(61)

##  Appendix C The QFI when using the Bit Flip Code

Just as in Appendix A and B we solve for the final quantum state via matrix
equations. Note that the $n$ qubit bit flip code [36] does not have an
ancilla, thus the whole system is $n$ qubits. The bit flip code maps the outer
product $\outerproduct{j}{j}$ to $\outerproduct{0}{0}^{\otimes n}$ if
$h_{j}<n/2$ and $\outerproduct{1}{1}^{\otimes n}$ if $h_{j}>n/2$ (we assume
that $n$ is odd to avoid complications when $h_{j}=n/2$). Similarly, the outer
product $\outerproduct{j}{\bar{j}}$ is mapped to $\outerproduct{0}{1}^{\otimes
n}$ if $h_{j}<n/2$ and $\outerproduct{1}{0}^{\otimes n}$ if $h_{j}>n/2$. We
again define $E$ to be the error correction matrix, define $E^{(j,k)}$ to be
the entry of $E$ in the $j$th row and $k$th column, it follows from the above
that

$E^{(j,k)}=\begin{cases}1,\text{ if }h_{j}=0\text{ and }h_{k}<\frac{n}{2}\\\
1,\text{ if }h_{j}=n\text{ and }h_{k}>\frac{n}{2}\\\ 0,\text{
otherwise}\end{cases}.$ (62)

Using the same evolution described in Appendix A (thus no ancilla), we obtain
that the amplitudes of the final quantum state are given by

$\vec{a}=\Big{(}Ee^{A\tau}\Big{)}^{t/\tau}\vec{a}_{0},$ (63)

and,

$\vec{b}=\Big{(}Ee^{B\tau}\Big{)}^{t/\tau}\vec{b}_{0}.$ (64)

The solution of $\vec{a}$ is trivial where the only non-zero entries are the
first and last, both of which are equal to $1/2$. The solution for $\vec{b}$
is more complicated, but the only significant terms of the matrix are the four
corner entries. By discarding the other entries we obtain a reduced version of
the problem

$\vec{b}^{\prime}=\begin{pmatrix}\eta_{-}&\zeta_{+}\\\
\zeta_{-}&\eta_{+}\end{pmatrix}^{t/\tau}\begin{pmatrix}1/2\\\
1/2\end{pmatrix}$ (65)

where the first and second entry of $\vec{b}^{\prime}$ corresponds to the
amplitudes of $\outerproduct{0}{1}^{\otimes n}$ and
$\outerproduct{1}{0}^{\otimes n}$ respectively, and

$\eta_{\pm}=e^{-n\gamma t}\sum_{m=0}^{\lfloor
n/2\rfloor}\binom{n}{m}x_{\pm}^{n-m}y^{m},\;\;\;\;\;\;\;\zeta_{\pm}=e^{-n\gamma
t}\sum_{m=0}^{\lfloor n/2\rfloor}\binom{n}{m}x_{\pm}^{m}y^{n-m}.$ (66)

Notice that $\zeta_{\pm}\in\mathcal{O}\big{(}\tau^{\frac{n+1}{2}}\big{)}$,
therefore

$\begin{pmatrix}\eta_{-}&\zeta_{+}\\\
\zeta_{-}&\eta_{+}\end{pmatrix}^{t/\tau}=\begin{pmatrix}\eta_{-}+\zeta_{-}&0\\\
0&\eta_{+}+\zeta_{+}\end{pmatrix}^{t/\tau}+\mathcal{O}\big{(}(\gamma\tau)^{\frac{n-1}{2}}\big{)}.$
(67)

Additionally, we have that $\big{(}re^{\pm
i\phi}\big{)}^{n}=\eta_{\pm}+\zeta_{\pm}$. So it follows that for large $n$
the final quantum state in this scenario is very similar to the final quantum
state using the parity check code (with a noiseless ancilla and perfect error
correction). Mathematically, it is equivalent up to order
$(\gamma\tau)^{\frac{n-1}{2}}$, and therefore the QFI is similarly equivalent
up to the same order.

##  Appendix D Fisher Information versus Quantum Fisher Information

In the main text, we note that the QFI is inversely proportional to the
minimum uncertainty of the estimate [57, 58]. The minimization is taken over
all estimation strategies. The Fisher information bounds the uncertainty of
the estimate for a specific information. Because of the added specificity, it
can be a more meaningful quantity. For a positive operator value measure
(POVM), $\\{E_{j}\\}$, the associated Fisher information can be computed via

$\mathcal{I}=\sum_{j}\frac{\Tr\big(E_{j}\dot{\rho}\big{missing})^{2}}{\Tr\big(E_{j}\rho\big{missing})}.$
(68)

Recall that the quantum state after perfect error correction with a noiseless
ancilla is of the form

$\rho=\frac{1+R}{2}\outerproduct*{\psi_{+}}{\psi_{+}}+\frac{1-R}{2}\outerproduct*{\psi_{-}}{\psi_{-}},$
(69)

with

$\ket*{\psi_{\pm}}=\frac{1}{\sqrt{2}}\big{(}\ket{0}^{\otimes n+1}\pm
e^{i\theta}\ket{1}^{\otimes n+1}\big{)}.$ (70)

The measurement strategy involves measuring in the basis spanned the quantum
states $\\{\ket{\alpha_{+}},\ket{\alpha_{-}}\\}^{\otimes(n+1)}$, where

$\ket{\alpha_{\pm}}=\frac{1}{\sqrt{2}}\big{(}\ket{0}\pm
e^{i\alpha}\ket{1}\big{)}.$ (71)

Due to the symmetry of $\rho$, one only needs to consider the corresponding
POVMs

$E_{j}=\outerproduct{\alpha_{+}}{\alpha_{+}}^{\otimes
n+1-j}\outerproduct{\alpha_{-}}{\alpha_{-}}^{\otimes j},$ (72)

for $0\leq j\leq n+1$.

Prior to computing the Fisher information, we note that

$\Tr\big(E_{j}\rho\big{missing})=\frac{1+(-1)^{j}R\cos\big(\theta-\alpha\big{missing})}{2^{n+1}}.$
(73)

Plugging the above into Eq. (68), one obtains

$\mathcal{I}=\sum_{j=0}^{n+1}\binom{n+1}{j}\frac{\Tr\big(E_{j}\dot{\rho}\big{missing})^{2}}{\Tr\big(E_{j}\rho\big{missing})}=\frac{\Big{(}\dot{R}\cos\big(\theta-\alpha\big{missing})-R\dot{\theta}\sin\big(\theta-\alpha\big{missing})\Big{)}^{2}}{1-R^{2}\cos\big(\theta-\alpha\big{missing})}.$
(74)

Observe that if $\alpha$ is chosen such that
$\cos\big(\theta-\alpha\big{missing})\approx 0$, then

$\mathcal{I}=\mathcal{Q}+\mathcal{O}\big{(}\tau^{2}\big{)}.$ (75)

Of course, this requires exact knowledge of $\omega$ to implement perfectly,
and as previously mentioned, would defeat the purpose of quantum metrology.
However, with adaptive estimation strategies [70, 71], this can be effectively
achieved.

## References

## References

  * [1] Vittorio Giovannetti, Seth Lloyd, and Lorenzo Maccone.  Quantum-enhanced measurements: beating the standard quantum limit.  Science, 306(5700):1330–1336, 2004.
  * [2] Vittorio Giovannetti, Seth Lloyd, and Lorenzo Maccone.  Quantum metrology.  Physical Review Letters, 96(1):010401, 2006.
  * [3] Vittorio Giovannetti, Seth Lloyd, and Lorenzo Maccone.  Advances in quantum metrology.  Nature Photonics, 5(4):222, 2011.
  * [4] Géza Tóth and Iagoba Apellaniz.  Quantum metrology from a quantum information science perspective.  Journal of Physics A: Mathematical and Theoretical, 47(42):424006, 2014.
  * [5] Christian L Degen, F Reinhard, and Paola Cappellaro.  Quantum sensing.  Reviews of Modern Physics, 89(3):035002, 2017.
  * [6] D Leibfried, Murray D Barrett, T Schaetz, J Britton, J Chiaverini, Wayne M Itano, John D Jost, Christopher Langer, and David J Wineland.  Toward heisenberg-limited spectroscopy with multiparticle entangled states.  Science, 304(5676):1476–1478, 2004.
  * [7] Simon Schmitt, Tuvia Gefen, Felix M Stürner, Thomas Unden, Gerhard Wolff, Christoph Müller, Jochen Scheuer, Boris Naydenov, Matthew Markham, Sebastien Pezzagna, et al.  Submillihertz magnetic spectroscopy performed with a nanoscale quantum sensor.  Science, 356(6340):832–837, 2017.
  * [8] Jonatan Bohr Brask, Rafael Chaves, and Jan Kołodyński.  Improved quantum magnetometry beyond the standard quantum limit.  Physical Review X, 5(3):031010, 2015.
  * [9] JM Taylor, Paola Cappellaro, L Childress, Liang Jiang, Dmitry Budker, PR Hemmer, Amir Yacoby, R Walsworth, and MD Lukin.  High-sensitivity diamond magnetometer with nanoscale resolution.  Nature Physics, 4(10):810–816, 2008.
  * [10] Wojciech Wasilewski, Kasper Jensen, Hanna Krauter, Jelmer Jan Renema, MV Balabas, and Eugene Simon Polzik.  Quantum noise limited and entanglement-assisted magnetometry.  Physical Review Letters, 104(13):133601, 2010.
  * [11] Luca Razzoli, Luca Ghirardi, Ilaria Siloi, Paolo Bordone, and Matteo GA Paris.  Lattice quantum magnetometry.  Physical Review A, 99(6):062330, 2019.
  * [12] Philipp Neumann, Ingmar Jakobi, Florian Dolde, Christian Burk, Rolf Reuter, Gerald Waldherr, Jan Honert, Thomas Wolf, Andreas Brunner, Jeong Hyun Shim, et al.  High-precision nanoscale temperature sensing using single defects in diamond.  Nano Letters, 13(6):2738–2742, 2013.
  * [13] Luis A Correa, Mohammad Mehboudi, Gerardo Adesso, and Anna Sanpera.  Individual quantum probes for optimal thermometry.  Physical Review Letters, 114(22):220405, 2015.
  * [14] Sofia Qvarfort, Alessio Serafini, Peter F Barker, and Sougato Bose.  Gravimetry through non-linear optomechanics.  Nature Communications, 9(1):1–11, 2018.
  * [15] Michail Kritsotakis, Stuart S Szigeti, Jacob A Dunningham, and Simon A Haine.  Optimal matter-wave gravimetry.  Physical Review A, 98(2):023629, 2018.
  * [16] Carlton M Caves.  Quantum-mechanical noise in an interferometer.  Physical Review D, 23(8):1693, 1981.
  * [17] Susanna F Huelga, Chiara Macchiavello, Thomas Pellizzari, Artur K Ekert, Martin B Plenio, and J Ignacio Cirac.  Improvement of frequency standards with quantum entanglement.  Physical Review Letters, 79(20):3865, 1997.
  * [18] William J Munro, Kae Nemoto, Gerard J Milburn, and Sam L Braunstein.  Weak-force detection with superposed coherent states.  Physical Review A, 66(2):023819, 2002.
  * [19] Roland Krischek, Christian Schwemmer, Witlef Wieczorek, Harald Weinfurter, Philipp Hyllus, Luca Pezzé, and Augusto Smerzi.  Useful multiparticle entanglement and sub-shot-noise sensitivity in experimental phase estimation.  Physical Review Letters, 107(8):080504, 2011.
  * [20] Philipp Hyllus, Wiesław Laskowski, Roland Krischek, Christian Schwemmer, Witlef Wieczorek, Harald Weinfurter, Luca Pezzé, and Augusto Smerzi.  Fisher information and multiparticle entanglement.  Physical Review A, 85(2):022321, 2012.
  * [21] Luca Pezze and Augusto Smerzi.  Quantum theory of phase estimation.  arXiv preprint arXiv:1411.5164, 2014.
  * [22] Luca Pezze, Augusto Smerzi, Markus K Oberthaler, Roman Schmied, and Philipp Treutlein.  Quantum metrology with nonclassical states of atomic ensembles.  Reviews of Modern Physics, 90(3):035005, 2018.
  * [23] John J Bollinger, Wayne M Itano, David J Wineland, and Daniel J Heinzen.  Optimal frequency measurements with maximally correlated states.  Physical Review A, 54(6):R4649, 1996.
  * [24] Bernard Yurke, Samuel L McCall, and John R Klauder.  Su (2) and su (1, 1) interferometers.  Physical Review A, 33(6):4033, 1986.
  * [25] MJ Holland and K Burnett.  Interferometric detection of optical phase shifts at the heisenberg limit.  Physical Review Letters, 71(9):1355, 1993.
  * [26] BM Escher, RL de Matos Filho, and Luiz Davidovich.  General framework for estimating the ultimate precision limit in noisy quantum-enhanced metrology.  Nature Physics, 7(5):406–411, 2011.
  * [27] Rafał Demkowicz-Dobrzański, Jan Kołodyński, and Mădălin Guţă.  The elusive heisenberg limit in quantum-enhanced metrology.  Nature Communications, 3:1063, 2012.
  * [28] Jan Kołodyński and Rafał Demkowicz-Dobrzański.  Efficient tools for quantum metrology with uncorrelated noise.  New Journal of Physics, 15(7):073043, 2013.
  * [29] R Chaves, JB Brask, Marcin Markiewicz, J Kołodyński, and A Acín.  Noisy metrology beyond the standard quantum limit.  Physical Review Letters, 111(12):120401, 2013.
  * [30] Jan F Haase, Andrea Smirne, SF Huelga, J Kołodynski, and R Demkowicz-Dobrzanski.  Precision limits in quantum metrology with open quantum systems.  Quantum Measurements and Quantum Metrology, 5(1):13–39, 2016.
  * [31] Alex W Chin, Susana F Huelga, and Martin B Plenio.  Quantum metrology in non-markovian environments.  Physical Review Letters, 109(23):233601, 2012.
  * [32] Peter W Shor.  Scheme for reducing decoherence in quantum computer memory.  Physical Review A, 52(4):R2493, 1995.
  * [33] Andrew M Steane.  Error correcting codes in quantum theory.  Physical Review Letters, 77(5):793, 1996.
  * [34] A Robert Calderbank and Peter W Shor.  Good quantum error-correcting codes exist.  Physical Review A, 54(2):1098, 1996.
  * [35] Raymond Laflamme, Cesar Miquel, Juan Pablo Paz, and Wojciech Hubert Zurek.  Perfect quantum error correcting code.  Physical Review Letters, 77(1):198, 1996.
  * [36] Daniel Gottesman.  Stabilizer codes and quantum error correction.  arXiv preprint quant-ph/9705052, 1997.
  * [37] Simon J Devitt, William J Munro, and Kae Nemoto.  Quantum error correction for beginners.  Reports on Progress in Physics, 76(7):076001, 2013.
  * [38] Eric M Kessler, Igor Lovchinsky, Alexander O Sushkov, and Mikhail D Lukin.  Quantum error correction for metrology.  Physical Review Letters, 112(15):150802, 2014.
  * [39] Wolfgang Dür, Michalis Skotiniotis, Florian Froewis, and Barbara Kraus.  Improved quantum metrology using quantum error correction.  Physical Review Letters, 112(8):080801, 2014.
  * [40] Gilad Arrad, Yuval Vinkler, Dorit Aharonov, and Alex Retzker.  Increasing sensing resolution with error correction.  Physical Review Letters, 112(15):150801, 2014.
  * [41] Xiao-Ming Lu, Sixia Yu, and CH Oh.  Robust quantum metrological schemes based on protection of quantum fisher information.  Nature communications, 6(1):1–7, 2015.
  * [42] Thomas Unden, Priya Balasubramanian, Daniel Louzon, Yuval Vinkler, Martin B Plenio, Matthew Markham, Daniel Twitchen, Alastair Stacey, Igor Lovchinsky, Alexander O Sushkov, et al.  Quantum metrology enhanced by repetitive quantum error correction.  Physical Review Letters, 116(23):230502, 2016.
  * [43] Pavel Sekatski, Michalis Skotiniotis, Janek Kołodyński, and Wolfgang Dür.  Quantum metrology with full and fast quantum control.  Quantum, 1:27, 2017.
  * [44] Rafał Demkowicz-Dobrzański, Jan Czajkowski, and Pavel Sekatski.  Adaptive quantum metrology under general markovian noise.  Physical Review X, 7(4):041009, 2017.
  * [45] Sisi Zhou, Mengzhen Zhang, John Preskill, and Liang Jiang.  Achieving the heisenberg limit in quantum metrology using quantum error correction.  Nature Communications, 9(1):1–11, 2018.
  * [46] David Layden and Paola Cappellaro.  Spatial noise filtering through error correction for quantum sensing.  npj Quantum Information, 4(1):1–6, 2018.
  * [47] David Layden, Sisi Zhou, Paola Cappellaro, and Liang Jiang.  Ancilla-free quantum error correction codes for quantum metrology.  Physical Review Letters, 122(4):040502, 2019.
  * [48] Yao Ma, Mi Pang, Libo Chen, and Wen Yang.  Improving quantum parameter estimation by monitoring quantum trajectories.  Physical Review A, 99(3):032347, 2019.
  * [49] Wojciech Górecki, Sisi Zhou, Liang Jiang, and Rafał Demkowicz-Dobrzański.  Optimal probes and error-correction schemes in multi-parameter quantum metrology.  Quantum, 4:288, 2020.
  * [50] David A Herrera-Martí, Tuvia Gefen, Dorit Aharonov, Nadav Katz, and Alex Retzker.  Quantum error-correction-enhanced magnetometer overcoming the limit imposed by relaxation.  Physical review letters, 115(20):200501, 2015.
  * [51] Yuichiro Matsuzaki and Simon Benjamin.  Magnetic-field sensing with quantum error detection under the effect of energy relaxation.  Physical Review A, 95(3):032303, 2017.
  * [52] MV Gurudev Dutt, L Childress, L Jiang, E Togan, J Maze, F Jelezko, AS Zibrov, PR Hemmer, and MD Lukin.  Quantum register based on individual electronic and nuclear spin qubits in diamond.  Science, 316(5829):1312–1316, 2007.
  * [53] Tim Hugo Taminiau, Julia Cramer, Toeno van der Sar, Viatcheslav V Dobrovitski, and Ronald Hanson.  Universal control and error correction in multi-qubit spin registers in diamond.  Nature Nanotechnology, 9(3):171, 2014.
  * [54] Julia Cramer, Norbert Kalb, M Adriaan Rol, Bas Hensen, Machiel S Blok, Matthew Markham, Daniel J Twitchen, Ronald Hanson, and Tim H Taminiau.  Repeated quantum error correction on a continuously encoded qubit by real-time feedback.  Nature Communications, 7(1):1–7, 2016.
  * [55] Nissim Ofek, Andrei Petrenko, Reinier Heeres, Philip Reinhold, Zaki Leghtas, Brian Vlastakis, Yehan Liu, Luigi Frunzio, SM Girvin, Liang Jiang, et al.  Extending the lifetime of a quantum bit with error correction in superconducting circuits.  Nature, 536(7617):441–445, 2016.
  * [56] Angel Rivas and Susana F Huelga.  Open quantum systems, volume 13.  Springer, 2012.
  * [57] Carl W Helstrom and Carl W Helstrom.  Quantum detection and estimation theory, volume 3.  Academic press New York, 1976.
  * [58] Samuel L Braunstein and Carlton M Caves.  Statistical distance and the geometry of quantum states.  Physical Review Letters, 72(22):3439, 1994.
  * [59] Min-Hsiu Hsieh, Todd A Brun, and Igor Devetak.  Entanglement-assisted quantum quasicyclic low-density parity-check codes.  Physical Review A, 79(3):032340, 2009.
  * [60] Yuichiro Fujiwara, Alexander Gruner, and Peter Vandendriessche.  High-rate quantum low-density parity-check codes assisted by reliable qubits.  IEEE Transactions on Information Theory, 61(4):1860–1878, 2015\.
  * [61] Joschka Roffe, David Headley, Nicholas Chancellor, Dominic Horsman, and Viv Kendon.  Protecting quantum memories using coherent parity check codes.  Quantum Science and Technology, 3(3):035010, 2018.
  * [62] Gerald Waldherr, Y Wang, S Zaiser, M Jamali, T Schulte-Herbrüggen, H Abe, T Ohshima, J Isoya, JF Du, P Neumann, et al.  Quantum error correction in a solid-state hybrid spin register.  Nature, 506(7487):204–207, 2014.
  * [63] To further simulate a realistic setting, one could divide $\tau$ into two parts: one accounting for the wait time between applications of the parity check code, and one accounting for the time between the syndrome measurement and the correction. this is beyond the scope of the current work.
  * [64] Juan Pablo Paz and Wojciech Hubert Zurek.  Continuous error correction.  Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences, 454(1969):355–364, 1998.
  * [65] Charlene Ahn, Andrew C Doherty, and Andrew J Landahl.  Continuous quantum error correction via quantum feedback control.  Physical Review A, 65(4):042301, 2002.
  * [66] Mohan Sarovar and Gerard J Milburn.  Continuous quantum error correction by cooling.  Physical Review A, 72(1):012306, 2005.
  * [67] Lorenza Viola, Emanuel Knill, and Seth Lloyd.  Dynamical decoupling of open quantum systems.  Physical Review Letters, 82(12):2417, 1999.
  * [68] Pavel Sekatski, Michalis Skotiniotis, and Wolfgang Dür.  Dynamical decoupling leads to improved scaling in noisy quantum metrology.  New Journal of Physics, 18(7):073034, 2016.
  * [69] SG Schirmer and Xiaoting Wang.  Stabilizing open quantum systems by markovian reservoir engineering.  Physical Review A, 81(6):062306, 2010.
  * [70] Richard D Gill and Serge Massar.  State estimation for large ensembles.  In Asymptotic Theory Of Quantum Statistical Inference: Selected Papers, pages 178–214. World Scientific, 2005.
  * [71] Akio Fujiwara.  Strong consistency and asymptotic efficiency for adaptive quantum estimation problems.  Journal of Physics A: Mathematical and General, 39(40):12489, 2006\.
  * [72] Christian Gross.  Spin squeezing, entanglement and quantum metrology with bose–einstein condensates.  Journal of Physics B: Atomic, Molecular and Optical Physics, 45(10):103001, 2012.
  * [73] Michal Oszmaniec, Remigiusz Augusiak, Christian Gogolin, Jan Kołodyński, Antonio Acin, and Maciej Lewenstein.  Random bosonic states for robust quantum metrology.  Physical Review X, 6(4):041044, 2016.
  * [74] Nathan Shettell and Damian Markham.  Graph states as a resource for quantum metrology.  Physical Review Letters, 124(11):110502, 2020.