Massachusetts Institute of Technology, Cambridge ...

8
Spatial noise filtering through error correction for quantum sensing David Layden and Paola Cappellaro Research Laboratory of Electronics and Department of Nuclear Science and Engineering, Massachusetts Institute of Technology, Cambridge, Massachusetts 02139, USA Quantum systems can be used to measure various quantities in their environment with high preci- sion. Often, however, their sensitivity is limited by the decohering effects of this same environment. Dynamical decoupling schemes are widely used to filter environmental noise from signals, but their performance is limited by the spectral properties of the signal and noise at hand. Quantum error correction schemes have therefore emerged as a complementary technique without the same limi- tations. To date, however, they have failed to correct the dominant noise type in many quantum sensors, which couples to each qubit in a sensor in the same way as the signal. Here we show how quantum error correction can correct for such noise, which dynamical decoupling can only partially address. Whereas dynamical decoupling exploits temporal noise correlations in signal and noise, our scheme exploits spatial correlations. We give explicit examples in small quantum devices and demonstrate a method by which error-correcting codes can be tailored to their noise. INTRODUCTION Quantum sensors exploit the strong sensitivity of quan- tum systems to external disturbances. They typically measure an external quantity—a DC signal in the most common scenario—whose value is manifest as a parame- ter in the sensor’s Hamiltonian. This parameter can then be estimated by preparing the sensor in a superposition of two energy eigenstates and letting them acquire a rela- tive phase that depends on the unknown quantity, which is then read out 1 . This strong sensitivity of quantum systems to their environment is a double-edged sword, however, as it also brings about decoherence. For quantum sensors, deco- herence means that not only the relative phase—but also the phase uncertainty—between energy eigenstates grows with time. The competing contributions of phase (signal) and phase uncertainty (noise) both stemming from a sen- sor’s environment fundamentally limit the precision with which it can measure external quantities. A central way to improve the sensitivity of a quantum sensor is there- fore to operate it in a way that filters out environmental disturbances which constitute noise, leaving those which constitute signal. Dynamical decoupling (DD) sequences provide a fam- ily of such filters, which are ubiquitous in quantum sens- ing experiments 1–3 . They comprise a series of control pulses (or continuous controls) applied to a sensor, which modify its response to perturbations of different frequen- cies. This allows them to filter noise from signal in a quantum sensor on the basis of frequency; typically, by forming an effective narrow-band filter around an AC sig- nal, thus letting the signal imprint on the sensor while suppressing much of the noise outside the main passband. Since DD sequences act as filters in the frequency do- main, their main limitations for quantum sensing have to do with the spectra of signal and noise: First, DD- based sensors can only measure a narrow frequency band of the signal at a time. Moreover, they cannot directly measure DC signals, as DD suppresses both noise and signal at low frequencies. Second, they remain vulnera- ble to high-frequency noise components, which limit the sensitivity they can achieve 4 . A complementary family of filters based instead on quantum error correction has recently emerged, which do not suppress noise on the ba- sis of frequency, and therefore do not share these same limitations 5–8 . The canonical scheme for error-corrected quantum sensing (ECQS), illustrated here with a Lindblad descrip- tion, is: (i) to prepare a superposition of logical energy eigenstates, (ii) to let the sensor evolve for a time Δt under the Liouvillian L = -iH + D, where the Hamilto- nian superoperator H(ρ)=[H, ρ] is proportional to the parameter one wants to estimate (that is, the signal 9 ), and (iii) to apply a recovery operation R which seeks to correct the effects of the noise from D(ρ)= X i L i ρL i - 1 2 {L i L i }, (1) where {L i } are the Lindblad error operators describ- ing decoherence, which can be interpreted as quantum jumps 10 . (The recovery is approximated as being instan- taneous.) Steps (ii) and (iii) are repeated until (iv) the final state is read out after a total time t. In the limit where (ii)–(iii) are fast and repeated many times (Δt 0 with t finite), the sensor evolves stroboscopically as L eff = -iRH + RD + O ( ||L|| Δt ) (2) according to Chernoff’s theorem (ref. 11 p. 241, see also ref. 12). If RD = 0 but RH 6 = 0 on logical states then ECQS can approach a noiseless sensing limit by making Δt sufficiently short compared to the noise strength. For ECQS to provide such a noiseless Δt 0 limit (RD| code = 0), the error operators for the sensor must satisfy the usual Knill-Laflamme condition 13,14 : PL i L j P P (3) for all i, j 0, where P = P projects onto the codespace and L 0 := I . For the signal to survive in this limit arXiv:1708.06729v2 [quant-ph] 17 Jul 2018

Transcript of Massachusetts Institute of Technology, Cambridge ...

Spatial noise filtering through error correction for quantum sensing

David Layden and Paola CappellaroResearch Laboratory of Electronics and Department of Nuclear Science and Engineering,

Massachusetts Institute of Technology, Cambridge, Massachusetts 02139, USA

Quantum systems can be used to measure various quantities in their environment with high preci-sion. Often, however, their sensitivity is limited by the decohering effects of this same environment.Dynamical decoupling schemes are widely used to filter environmental noise from signals, but theirperformance is limited by the spectral properties of the signal and noise at hand. Quantum errorcorrection schemes have therefore emerged as a complementary technique without the same limi-tations. To date, however, they have failed to correct the dominant noise type in many quantumsensors, which couples to each qubit in a sensor in the same way as the signal. Here we show howquantum error correction can correct for such noise, which dynamical decoupling can only partiallyaddress. Whereas dynamical decoupling exploits temporal noise correlations in signal and noise,our scheme exploits spatial correlations. We give explicit examples in small quantum devices anddemonstrate a method by which error-correcting codes can be tailored to their noise.

INTRODUCTION

Quantum sensors exploit the strong sensitivity of quan-tum systems to external disturbances. They typicallymeasure an external quantity—a DC signal in the mostcommon scenario—whose value is manifest as a parame-ter in the sensor’s Hamiltonian. This parameter can thenbe estimated by preparing the sensor in a superpositionof two energy eigenstates and letting them acquire a rela-tive phase that depends on the unknown quantity, whichis then read out1.

This strong sensitivity of quantum systems to theirenvironment is a double-edged sword, however, as it alsobrings about decoherence. For quantum sensors, deco-herence means that not only the relative phase—but alsothe phase uncertainty—between energy eigenstates growswith time. The competing contributions of phase (signal)and phase uncertainty (noise) both stemming from a sen-sor’s environment fundamentally limit the precision withwhich it can measure external quantities. A central wayto improve the sensitivity of a quantum sensor is there-fore to operate it in a way that filters out environmentaldisturbances which constitute noise, leaving those whichconstitute signal.

Dynamical decoupling (DD) sequences provide a fam-ily of such filters, which are ubiquitous in quantum sens-ing experiments1–3. They comprise a series of controlpulses (or continuous controls) applied to a sensor, whichmodify its response to perturbations of different frequen-cies. This allows them to filter noise from signal in aquantum sensor on the basis of frequency; typically, byforming an effective narrow-band filter around an AC sig-nal, thus letting the signal imprint on the sensor whilesuppressing much of the noise outside the main passband.Since DD sequences act as filters in the frequency do-main, their main limitations for quantum sensing haveto do with the spectra of signal and noise: First, DD-based sensors can only measure a narrow frequency bandof the signal at a time. Moreover, they cannot directlymeasure DC signals, as DD suppresses both noise and

signal at low frequencies. Second, they remain vulnera-ble to high-frequency noise components, which limit thesensitivity they can achieve4. A complementary familyof filters based instead on quantum error correction hasrecently emerged, which do not suppress noise on the ba-sis of frequency, and therefore do not share these samelimitations5–8.

The canonical scheme for error-corrected quantumsensing (ECQS), illustrated here with a Lindblad descrip-tion, is: (i) to prepare a superposition of logical energyeigenstates, (ii) to let the sensor evolve for a time ∆tunder the Liouvillian L = −iH+D, where the Hamilto-nian superoperator H(ρ) = [H, ρ] is proportional to theparameter one wants to estimate (that is, the signal9),and (iii) to apply a recovery operation R which seeks tocorrect the effects of the noise from

D(ρ) =∑

i

LiρL†i −

1

2{L†iLi, ρ}, (1)

where {Li} are the Lindblad error operators describ-ing decoherence, which can be interpreted as quantumjumps10. (The recovery is approximated as being instan-taneous.) Steps (ii) and (iii) are repeated until (iv) thefinal state is read out after a total time t. In the limitwhere (ii)–(iii) are fast and repeated many times (∆t→ 0with t finite), the sensor evolves stroboscopically as

Leff = −iRH+RD +O(||L||∆t

)(2)

according to Chernoff’s theorem (ref. 11 p. 241, see alsoref. 12). If RD = 0 but RH 6= 0 on logical states thenECQS can approach a noiseless sensing limit by making∆t sufficiently short compared to the noise strength.

For ECQS to provide such a noiseless ∆t → 0 limit(RD|code = 0), the error operators for the sensor mustsatisfy the usual Knill-Laflamme condition13,14:

PL†iLjP ∝ P (3)

for all i, j ≥ 0, where P = P † projects onto the codespaceand L0 := I. For the signal to survive in this limit

arX

iv:1

708.

0672

9v2

[qu

ant-

ph]

17

Jul 2

018

2

(RH|code 6= 0), however, H must not be fully correctable:

PHP 6∝ P. (4)

Naturally then, H must not be a linear combination of

L†iLj terms. Indeed, it was recently proven that thereexists a code with projector P satisfying these ECQSconditions, Eqs. (3) and (4), if and only if H /∈ Swhere S = span{I, Li, L

†i , L†iLj} is the so-called Lind-

blad span15,16.An archetypal example of ECQS to measure a DC sig-

nal ω was proposed in refs. 7, 8, and 17: it involves athree-qubit sensor with H =

∑3i=1

ω2 Zi subject to inde-

pendent bit-flip errors on each qubit (Li = Xi). Ini-tializing the sensor in |+l〉 = 1√

2(|0l〉 + |1l〉), where

|0l〉 = |000〉 and |1l〉 = |111〉, the errors can be de-tected and corrected by the bit-flip code recovery R (ref.18), while the signal ω imprints through H as a rela-tive phase in the encoded state. The signal is unimpededby the frequent applications of R as it couples to thequbits through a different operator than the noise, giv-ing H /∈ S, and hence RD = 0 but RH 6= 0 on logi-cal states. Therefore, the scheme enables near-noiselesssensing of ω for short ∆t. To our knowledge, all explicitECQS schemes to date for multi-qudit sensors operatesimilarly, correcting only for noise which couples to thesensor via different operators than the signal5–8,17,19–26.If instead the jump operators were Li = Zi (that is, ifthe noise coupled to each qubit in the same way as thesignal), Eqs. (3) and (4) could not be satisfied, as no codecould filter noise from signal since H ∈ S.

This example illustrates a deficiency in ECQS schemesto date, of both practical and fundamental importance.In many quantum sensors, noise which couples throughthe same operators as the signal is the dominant source ofdecoherence (often by several orders of magnitude27–32),and thus imposes the main limit on achievable sensitiv-ity. Schemes which do not protect against such a centralnoise source can offer only a limited advantage in prac-tice. More fundamentally, the outsized importance ofsuch noise derives from a tension at the core of quan-tum sensing: A good sensor must couple strongly to thequantity it is to measure. Such strong coupling, in turn,renders the device highly sensitive to fluctuations in thisquantity, thus bounding the duration of coherent sensing.While DD can suppress certain frequency components ofthis noise, explicit ECQS schemes to date cannot ad-dress it at all, to our knowledge. Moreover, refs. 15 and16 make no pronouncements as to whether, or when, itis possible to correct for noise that couples to a sensorthrough the same operator in its Hamiltonian as the sig-nal. This potential Achilles’ heel would seem to largelydetermine the practical value of error correction in manyquantum sensors.

We propose a general error-correction scheme to filterout noise which couples to each qubit in a quantum sensoridentically to the signal. Our scheme is not frequency-selective, and therefore does not share the same limita-tions of dynamical decoupling. The key insight is that

Eqs. (3) and (4) can be viewed not only as a conditionon how signal and noise couple to the sensor, as with ex-isting codes, but also as a condition on the spatial profilesof each in the sensor. Indeed, we show that quantum er-ror correction can filter noise from signal on the basis oftheir respective spatial correlations, much like DD filtersbased on temporal correlations (i.e., frequency profiles).

RESULTS

We first consider the task of measuring a DC signalω0, inaccessible through DD, in the presence of back-ground noise δω. We assume a generic sensor compris-ing N qubits, each coupled locally to the external fieldω(~x, t) = ω0 + δω(~x, t) as

H(t) =1

2

N∑

i=1

ω(~xi, t)Zi (5)

in a suitable reference frame, where ~xj is the positionof qubit j and δω describes zero-mean stationary fluc-tuations. We take δω to be Gaussian white noise withstrength ∼1/T2, for both mathematical convenience andto highlight the ability of error correction to filter high-frequency background noise beyond the reach of DD. Weallow, however, for general spatial correlations betweenthe fluctuations at positions ~xi and ~xj :

⟨δω(~xi, t) δω(~xj , 0)

⟩=

2δ(t)

T2cij . (6)

Thus, any qubit prepared in the state |+〉 will precessabout its z-axis at a rate ω0 and lose phase coher-

ence as |〈σ(j)+ 〉| = exp(−t/T2) (ref. 33). The coefficients

cij ∈ [−1, 1] describe the noise correlations between po-sitions ~xi and ~xj : The extreme values of cij = ±1, forinstance, describe identical (+1) or opposite (−1) fluctu-ations in ω at either position, whereas cij = 0 means nocorrelation. Naturally cii = 1. Note that while this noiseis external to the sensing degrees of freedom, it may stillarise from within the experimental device, e.g., from thesurrounding nuclear bath in the case of spin qubits.

It is convenient to express the sensor’s dynamics as amaster equation ρ = L(ρ), where

L(ρ) = −i[H0, ρ] +1

2T2

N∑

i,j=1

cij

(ZiρZj −

1

2{ZiZj , ρ}

)

(7)

and H0 = ω0

2

∑Ni=1 Zi (refs. 34 and 35). Eq. (7) can

be cast in the form of (1), thus removing dissipativecross terms, by diagonalizing the correlation matrix C =

(cij)i,j≥1 to yield operators Li =√λi~vi · ~Z. Here,

C~vi = λi~vi and ~Z = (Z1, . . . , ZN ). These Li’s can be in-terpreted as the sensor’s quantum jumps, while the Zi’sin (7) cannot10. Crucially, the ECQS conditions, (3) and(4), deal with the quantum jump operators Li’s, not the

3

bare Zi’s. This distinction is critical because it opensthe possibility of engineering a sensor such that C has avanishing eigenvalue λk = 0, thus suppressing Lk. Gener-ically, the Lindblad span S will then fail to contain H0

due to this “missing” jump operator, opening the doorfor ECQS.

The requirement that H0 /∈ S for conditions (3) and(4) can be restated for signal and noise which coupleidentically to the sensor (in the sense of Eq. (5)) as

~h /∈ col(C), (8)

where ~h = (1, . . . , 1) ∈ RN so that H0 = ω0

2~h · ~Z, and

col(C) is the column space of C. A full proof is given inthe Methods; we note here simply that Eq. (8) enforcestwo things: (i) that det(C) = 0 and thus Lk = 0 forsome k, and (ii) that H0 is not composed only of non-vanishing Li’s. It ensures that the signal and noise canbe fully distinguished by the recovery operation on thebasis of their respective spatial profiles (a requirement wewill later relax).

Consider for example N = 3 sensing qubits positionedso that the fluctuations satisfy cij = −γ/2 for each pairi 6= j, where γ ∈ [0, 1] describes the noise correlationstrength. (Specifically, γ = 0 produces vanishing correla-tions whereas γ = 1 gives the strongest correlations pos-

sible.) Notice that for γ = 1, C~h = ~0, and so ~h /∈ col(C).The jump operators in the ECQS conditions are not Z1,Z2 and Z3, but rather

L1 =

√2 + γ

2(Z1 − Z3),

L2 =

√2 + γ

12(Z1 − 2Z2 + Z3), (9)

L3 =

√1− γ

3(Z1 + Z2 + Z3),

found by diagonalizing C. Observe that the global noisemode, L3, becomes subdominant for larger values of γ,until it vanishes completely when γ = 1, at which pointH0 /∈ S as expected. Notice also that P = |0l〉〈0l| +|1l〉〈1l| with logical states

|0l〉 =1√3

(|100〉+ |010〉+ |001〉

)(10)

|1l〉 =1√3

(|011〉+ |101〉+ |110〉

)

satisfies the conditions (3) and (4) when γ → 1, despitethe signal and noise both coupling to each sensing qubitidentically. Contrast this with the usual phase-flip code,which corrects for Z1, Z2, Z3 and all linear combinationsthereof, including H0 (ref. 10). Eq. (10) instead definesa weakened version of the phase-flip code, which correctsfor linear combinations of L1 and L2, but not for ~v3 ·~Z ∝ Z1 + Z2 + Z3. Accordingly, as γ → 1 it can fullycorrect the noise (RD|code = 0) while allowing the signalto still imprint on the logical states (RH|code 6= 0). In

particular, the dynamics at logical level for ∆t → 0 aregenerated by the effective Hamiltonian Heff = ω0

2 Zl andthe effective Lindblad error operator

Leff =

√1− γ6T2

Zl, (11)

where Zl is the logical σz (ref. 16). Notice that Leff → 0for γ → 1, so the logical dynamics is less noisy forstronger correlations. A detailed calculation of the ef-fective Liouvillian for this example—as well as for an ex-ample with positive noise correlations—is provided in theSupplementary Information.

Another possible code for this C uses

|0′l〉 = |000〉 |1′l〉 = |111〉. (12)

When γ → 1 it also satisfies the ECQS condi-tions, although its recovery procedure is trivial becausespan{|0′l〉, |1′l〉} is a decoherence-free subspace (DFS)within which H0 acts non-trivially36. ECQS with thiscode is therefore a Greenberger-Horne-Zeilinger (GHZ)sensing scheme37. The performance of a quantum sensorcan be quantified by the sensitivity it achieves; that is,the smallest signal it can detect per unit time1. Sensi-tivity therefore also provides a way to benchmark ECQSschemes: a more effective scheme allows one to resolve asmaller signal per unit time, thus giving lower (i.e., bet-ter) sensitivity. The sensitivity offered by the codes inEqs. (10) and (12) is plotted in Fig. 1 as a function of γ.Both approach noiseless sensing when γ → 1.

0.0 0.2 0.4 0.6 0.8 1.0γ

0.00

0.25

0.50

0.75

1.00

1.25

1.50

Sop

t(u

nit

sof√

1/T

2)

Parallel

GHZ and Active ECQS

FIG. 1. The achievable sensitivity with different schemes fora 3-qubit sensor under noise correlations cij = −γ/2, for alli 6= j. Note that sensitivity is a measure of the smallestresolvable signal per unit time, so a smaller sensitivity in-dicates better performance. The active recovery and GHZschemes use codewords (10) and (12) respectively, whereasthe parallel scheme operates the qubits individually, withoutentanglement. The active and GHZ schemes give identicalperformance (in the regime of ∆t → 0 for the former), andboth outperform parallel sensing by a factor that grows withthe correlation strength γ. The details of this calculation areprovided in the Supplementary Information.

4

In general, a DFS is a code for which |0l〉 and |1l〉are degenerate eigenvectors of all Li. This means thatEP = µEP for all E ∈ S, immediately satisfying con-dition (3). For states within the DFS to be sensitiveto ω0 we also need |0l〉 and |1l〉 to be non-degenerateenergy eigenstates, so that HP 6∝ P , satisfying condi-tion (4). Such a DFS satisfies the ECQS conditions—accordingly, our discussion of general ECQS encompassesDFS-enhanced sensing as a special case.

DFS-enhanced sensing is only possible for a small fam-ily of correlation matrices C which we discuss below. Acode designed for some general C, in contrast, will usu-ally necessitate an active recovery R. Given a projec-tor P onto the code satisfying the ECQS conditions, anappropriate choice of R is the usual so-called transposechannel16,38. We summarize a standard way of imple-menting it in the Methods. For a logical state ρ = PρPthis recovery gives RD(ρ) = 0 and RH(ρ) = [Heff, ρ] 6= 0as desired, where Heff = PH0P (ref. 16). In otherwords, the sensor approaches noiseless evolution by Heff

in the limit of frequent error detection/correction (i.e.,∆t→ 0).

Conditions (3) and (4) seem to impose a stringent re-quirement on the C’s amenable to ECQS under signaland noise which are “parallel”, in that they couple to thesensor through the same operators (along the z direction,i.e., the qubits’ energy gaps, here). This need not be thecase, however, since error correction can enhance quan-tum sensing even if it does not give a strictly noiselesslimit. Notice in Fig. 1, for instance, that ECQS enhancessensitivity for all γ > 0, even though conditions (3) and(4) are only satisfied exactly when γ = 1. (Another ex-ample is analyzed in the Supplementary Information, asis the robustness of our scheme.) More generally, if in-

stead of satisfying (3) exactly, PL†iLjP = mijP + O(ε),then RD(ρ) = O(ε) for a logical ρ instead of vanish-ing exactly16. If the time between successive recover-ies is nonzero (∆t > 0) as in most experiments, thendecoherence will appear in the logical dynamics at or-der O(∆t/T2) in Leff. (We write O(t/T2) rather thanO(||L||∆t) to simplify notation, assuming ω0 to be asmall compared to 1/T2. If ω0 is not small, O(∆t/T2)should be taken to mean O(||L||∆t).) Provided ε �∆t/T2, then, small violations of condition (3) will notappreciably change the degree to which quantum errorcorrection suppresses noise in a sensor. This is true forgeneric ECQS schemes. When correcting noise whichcouples like the signal, in particular, allowing ε 6= 0 en-ables codes which—by design—do not correct for errorsLk with ||Lk|| ≈ 0, corresponding to an eigenvalue λk ofC which is small but not exactly zero. Therefore in thepresent setting, relaxing condition (3) reduces the needfor fine-tuned noise correlations.

For quantum error correction to filter noise from signalwhen ∆t/T2 is finite, R must suppress the former morethan the latter. Choosing |0l〉 and |1l〉 to be eigenstatesof Heff with E0 > E1, the effective Hamiltonian takesthe form Heff = αP + ωl

2 Zl, where Zl = |0l〉〈0l|− |1l〉〈1l|

and P acts as I on the code. Just as ε and ∆t/T2 de-scribe the extent to which noise is suppressed throughfrequent error correction, the ratio Aω = ωl

ω0describes

the signal gain; that is, the fraction of the physical signalthat survives at the logical level. Together with previousarguments about (3), we arrive at sufficient conditions interms of this signal gain for error correction to enhance

quantum sensing: PL†iLjP = mijP +O(ε), and Aω � ε.There is an analogy with dynamical decoupling to bedrawn here: both quantum error correction and DD cansignificantly enhance sensing by partially filtering noisefrom the signal—they need not remove the noise entirelyto be useful.

This analogy goes further: Just as DD sequences mustbe tailored to sense in a particular frequency band ofinterest, error-correcting codes must be tailored to C and~h for a sensor to measure only in a particular spatial“mode”, in order to correct for noise which couples locallyin the same way as the signal. That is, a particular δωand arrangement of sensing qubits (likely determined atthe time of fabrication) will require a unique P . This isbecause the scheme depends on a code not correcting for

~vk · ~Z with λk ∼ 0, thus allowing the component of H0

along ~vk · ~Z to affect the logical states. Therefore, weexpect that in experiment, codes will need to be tailoredfor individual devices, much like control sequences mustbe. We present here a robust method of doing so.

When ~h /∈ col(C), refs. 15 and 16 provide recipes forcodes which exactly satisfy the ECQS conditions, al-though these may require the sensor to contain up toN noiseless ancilla qubits which do not couple to ω, inaddition to the N sensing qubits. Here we take a differentapproach which naturally tolerates small violations of theECQS conditions, such as those discussed above. Thatis, it allows one to find codes which enhance sensitivity,irrespective of whether they provide a noiseless limit intheory. In contrast with several previous works15,16, ourapproach does not require the overhead of additional an-cillas as part of the code. Specifically, for a given C, wemap the task of finding a P for (3) and (4) to an op-timization problem, whose solutions are codes satisfying

PL†iLjP = mijP +O(ε) for some M = M†, and giving aminimum signal gain of Aω,min that is freely adjustable:

Minimize Ftot =∑

E∈SFE (13)

subject to FG > A2ω,min and 〈x|y〉 = δxy,

where G := 12~h · ~Z = H0/ω0 and

FE

(|x〉, |y〉

)=∣∣〈x|E|x〉 − 〈y|E|y〉

∣∣2 + 4∣∣〈x|E|y〉

∣∣2. (14)

Notice that Ftot is non-negative with zeros where P =|x〉〈x| + |y〉〈y| satisfies condition (3). In fact, solutionsto Ftot = 0 with Aω,min = 0 exactly satisfy the ECQSconditions and vice versa. Relaxing these conditionsslightly, one can find codes approximately satisfying (3)and (4) by using Ftot ≤ ε2 as a convergence criterion and

5

Aω,min � ε. Note that the resulting codes can be quitegeneral; for instance, they need not be stabilizer codes.Further details are provided in the Methods.

For a two-qubit sensor, C has a zero eigenvalue only

when c12 = ±1. The c12 = 1 case has ~h ∈ col(C)and is therefore not amenable to ECQS. The c12 = −1

case, on the other hand, has ~h /∈ col(C). Therefore,N = 2 sensing qubits under strongly anti-correlated noise(c12 ≈ −1) can benefit from ECQS—in fact, they can beused for DFS-enhanced sensing. (Both c12 ≈ +1 and−1, however, could be useful for gradiometry, i.e., tomeasure a mean difference between the energy gap ofeach qubit.) For a three-qubit sensor a much broaderfamily of C’s can satisfy the ECQS conditions. Usingthe mapping described above, the C’s for which Eq. (13)yielded codes approximately satisfying conditions (3) and(4) with no ancillas are shown in Fig. 2. Notice that DFS-enhanced sensing with N = 3 qubits is only possible fora small family C’s. Therefore, while such schemes maybe powerful39–42, it could be exceedingly difficult to en-gineer the spatial noise correlations they require in manydevices. Codes with active recoveries, in contrast, aremuch more broadly applicable. A scheme to measure Cin experiments is given in the Methods.

We have assumed for simplicity so far that the cou-pling strength of each qubit to the external field ω, pa-rameterized by hi = 1, is the same for all qubits i. Thisassumption is of course not necessary; the results pre-sented here hold (with trivial adjustments) for arbitraryvalues h′i 6= 0 which may vary across qubits. Moreover,whether or not ECQS conditions can be satisfied dependsonly on the spatial profile of δω and on the locations of

the qubits, not on the coupling strengths ~h′. We reservethe proof for the Methods section.

DISCUSSION

We have shown how error-corrected quantum sensingcan filter noise from a signal when both couple to a sen-sor locally through the same operators. This stands incontrast with earlier explicit ECQS schemes, which havebeen limited to correcting noise separate from the quan-tity to be measured, in that it couples differently to thesensor. In many quantum sensors such noise is sub-dominant, while the type of noise considered here is thelimiting source of decoherence, and can only be partiallyfiltered through DD. Our scheme relies on the observa-tion that Eqs. (3) and (4) can be viewed as a conditionon the spatial correlations of the signal and noise. Thisview raises a close parallel between ECQS and DD: forsignal and noise which couple identically to a sensor (inthe sense of Eq. (5)), ECQS and DD can enhance sen-sitivity by acting as filters in the spatial and frequencydomains, respectively. However, since these two schemesseparate noise from signal on totally separate grounds,they are complementary, in that the limitations of oneare not shared by the other. Finally, we proposed a nu-

c12

−1.0−0.5

0.00.5

1.0

c 23

−1.0

−0.5

0.0

0.5

1.0

c13

−1.0

−0.5

0.0

0.5

1.0

Active DFS No ECQS

FIG. 2. Values of c12, c23 and c13 for which there exists athree-qubit code satisfying the ECQS conditions to a toler-ance of ε = 10−5 and Aω,min = 10−1, and not requiringnoiseless ancillas. The points (c12, c23, c13) approximately sat-isfying conditions (3) and (4) form a tetrahedron-like surface.The portions of the surface in blue denote C’s for which ECQSis possible with an active (i.e., non-trivial) recovery. The redregions (enlarged for visibility) denote C’s for which DFS-enhanced sensing is possible, and the white regions denoteC’s for which the optimization in Eq. (13) failed to convergeto within the specified tolerance, either because the achiev-able signal gain is too small, or because of poor local min-ima in Ftot. The continuous red band comprises C’s forwhich noise on a pair of qubits is perfectly anti-correlated(cij = −1). Notice that ECQS is generically possible for bothpositive and negative noise correlations; it fails here only whencij ≈ 1 for some pair of qubits (i 6= j), since this gives a miss-ing/subdominant jump operator orthogonal to H0.

merical method of tailoring ECQS codes to the noise ob-served in specific devices. It yields not just codes thatcorrect noise perfectly in the ∆t→ 0 limit, but also codeswhich can more generally improve sensitivity. We appliedthis method to sensors comprising 2 and 3 qubits—withno extra ancillas in the code—and showed how our er-ror correction scheme could provide an advantage evenin relatively small devices.

Both ECQS and DD filter noise which couples locallylike the signal by exploiting correlations in it: spatial cor-relations in the case of ECQS, and temporal correlationsfor DD. Accordingly, the effectiveness of both schemesdepends on the degree to which noise in a sensor canmade to have suitable correlations. (Note that differ-ent spatial noise correlations may lend themselves bestto different sensing tasks. For instance, uniform positivecorrelations yield a dominant noise mode proportionalto H0. This makes them them ill-suited for measuringsmall field values through ECQS, but well-suited for gra-diometry.) Engineering appropriate spatial noise corre-lations is likely to be highly implementation-dependent,as it is with temporal correlations43. This is because

6

the main sources of noise can be entirely different in dif-ferent types of quantum sensors. While an analysis ofachievable noise correlations in various types of sensors isbeyond the scope of the present work, we note here sim-ply that strong spatial correlations have been reportedalready in several experiments, e.g., refs. 39, 40, 44–47.

The scheme presented here exploits spatial correlationsto extract signal from a noisy background, which generi-cally causes dephasing. (Of course, the signal and noise inquestion need not couple to the sensor via σz; in general,the qubits could be damped along any axis.) A similarapproach may be possible with generalized amplitude-damping (T1-type) errors, which are second only to phaseerrors as the dominant decoherence mode in many quan-tum sensors. That is, a sensor with qubits made tothermalize collectively, rather than individually, could beamenable to quantum error correction. The approachpresented here could be combined with such a scheme—or with previous ECQS schemes—raising the intrigu-ing prospect of a quantum sensor that is error-correctedagainst noise in all three spatial directions. While corre-lated errors can often be detrimental to error-correctedquantum computation (see, e.g., ref. 48), they may provea valuable resource for error-corrected quantum sensing.

METHODS

Proof: Equivalence of Eq. (8) and ECQS conditions

We show here that Eq. (8) is equivalent to H0 /∈ Sfor the background noise described in Eq. (7), where Sis the Lindblad span. Let {~vi} ⊂ RN be an orthonormal

eigenbasis of C such that C~vi = λi~vi, and define Li :=

~vi · ~Z = L†i and Li :=√λiLi = L†i . Notice that 〈Li, I〉 =

〈Li, LjL`〉 = 0 under 〈A,B〉 = tr(A†B), so S can bedecomposed into orthogonal subspaces as S = S1 ⊕ S2

where S1 := span{Li}i≥1 and S2 := span{I, LiLj}i,j≥1.Having diagonalized C, we can express H0 in terms of

Li’s (rather than Zi’s) as H0 =∑N

i=1 αiLi for unique

coefficients αi = 2−N tr(LiH0) = ω0

2 ~vi · ~h, implying thatH0 ⊥ S2. Therefore, H0 /∈ S if and only if (iff) H0 /∈ S1.This happens iff there is a k such that λk = Lk = 0 and

αk 6= 0, or equivalently, iff ~vk ·~h 6= 0 for some ~vk ∈ ker(C).Finally, since C = C> we have col(C) ⊕ ker(C) = RN ,

and so H0 /∈ S iff ~h /∈ col(C).

Recovery Channel

We describe here a standard way of implementing theso-called transpose recovery channel, following refs. 16

and 38. Given a known P such that PL†iLjP = mijP ,we have P (Li − m0iI)†(Lj − m0jI)P = mijP for some

Hermitian M = (mij)i,j≥1. Let W be a unitary ma-

trix such that W †MW = diag(d1, d2, . . . ), and Ei :=

∑j wji(Lj − mj0I). For di 6= 0 one can find a unique

unitary Ui such that EiP =√diUiP via polar decom-

position. The channel R can then be implemented byperforming a projective measurement in {P0, P1, P2, . . . },where Pi := UiPU

†i and P0 := P , then applying U†i for

outcome i, where U0 := I. (N.b., if rank(M) = 1 thisprocedure is trivial, so the code forms a DFS.)

Numerical Code Search

The objective function Ftot may have several distinctzeros satisfying the constraints with Aω,min = 0; for in-stance, the logical states in Eq. (10) and (12). (In otherwords, there can be more than one P exactly satisfyingEqs. (3) and (4).) On the other hand, it will have no

such zeros when ~h ∈ col(C). More generally, for givenε, Aω,min ≥ 0 there may exist multiple regions whereFtot ≤ ε2 subject to the constraints, or there may ex-ist none for C not amenable to ECQS with N sensingqubits.

A similar approach to finding codes was recently usedin ref. 49, although to our knowledge it has not previouslybeen used for ECQS. The factor of 4 in Eq. (14) was in-cluded specifically for the purpose of finding codes forsensing: While this factor is irrelevant for enforcing thatE ∈ S be corrected, a simple calculation shows that FG

for a code gives exactly its signal gain squared. There-fore, requiring that FG > A2

ω,min and Ftot ≤ ε2 for someAω,min � ε is a transparent way of demanding that quan-tum error correction suppress noise much more stronglythan the signal.

Measuring C

In an experiment, finding an appropriate code forECQS first requires knowledge of the noise correlationsencoded in C. For qubits i and j, the coefficient cij canbe inferred by preparing the GHZ state 1√

2(|0i〉|0j〉 +

|1i〉|1j〉) and measuring its pure dephasing rate Γij , whichis related to cij through Γij = 2

T2(1+cij), after subtract-

ing the dephasing due to any relaxation that might alsobe present in practice. Note that while we arrived atEq. (7) by considering a signal with a noisy background,the physical source of dephasing is largely immaterial; allthat matters is its spatial correlation profile C.

Proof: Independence from Coupling Strengths

We show here that whether Eq. (8), and therefore alsothe ECQS conditions, is satisfied does not depend onthe coupling strength of each qubit to the external field.

Defining D = diag(~h′), the Lindblad equation for general

coupling strengths ~h′ has H ′0 = ω0

2~h′ · ~Z and C ′ = DCD.

7

Observe that ~h′ = D~h and ker(C ′) = {D−1~x | ~x ∈ker(C)}, so ~h′ /∈ col(C ′) if and only if ~h /∈ col(C).

Code availability

The optimization in Eq. (13) was performed using theSciPy Python library (v0.17). We employed a basin-hopping global optimization algorithm, which ran a se-quential least squares programming (SLSQP) local opti-mization at each step. The full computer code used togenerate these results is available from the correspondingauthor upon request.

Data availability

The numerical datasets generated during and/oranalysed during the current study are available from thecorresponding author on reasonable request.

Supplementary information is available at the npjQuantum Information website.

ACKNOWLEDGEMENTS

We wish to thank Cedric Beny, Liang Jiang, and SisiZhou for insightful discussions.

COMPETING INTERESTS

The authors declare no competing financial interests.

CONTRIBUTIONS

D.L. and P.C. conceived the novel QEC scheme forsensing. D.L. developed the theory and performed thecomputations. All authors discussed the results and con-tributed to the final manuscript.

FUNDING

This work was supported in part by the U.S. ArmyResearch Office through grant No. W911NF-15-1-0548,by the NSF PHY0551153 and 1641064 grants, and by theNSERC PGS-D program.

REFERENCES

1 Degen, C. L., Reinhard, F. & Cappellaro, P. Quantumsensing. Rev. Mod. Phys. 89, 035002 (2017).

2 Viola, L. & Lloyd, S. Dynamical suppression of decoher-ence in two-state quantum systems. Phys. Rev. A 58,2733–2744 (1998).

3 Ban, M. Photon-echo technique for reducing the deco-herence of a quantum bit. Journal of Modern Optics 45,2315–2325 (1998).

4 Biercuk, M. J., Doherty, A. C. & Uys, H. Dynamicaldecoupling sequence construction as a filter-design prob-lem. Journal of Physics B: Atomic, Molecular and OpticalPhysics 44, 154002 (2011).

5 Arrad, G., Vinkler, Y., Aharonov, D. & Retzker, A. In-creasing sensing resolution with error correction. Phys.Rev. Lett. 112, 150801 (2014).

6 Kessler, E. M., Lovchinsky, I., Sushkov, A. O. & Lukin,M. D. Quantum error correction for metrology. Phys. Rev.Lett. 112, 150802 (2014).

7 Ozeri, R. Heisenberg limited metrology using quan-tum error-correction codes. Preprint at arXiv:1310.3432(2013).

8 Dur, W., Skotiniotis, M., Frowis, F. & Kraus, B. Improvedquantum metrology using quantum error correction. Phys.Rev. Lett. 112, 080801 (2014).

9 Giovannetti, V., Lloyd, S. & Maccone, L. Quantum metrol-ogy. Phys. Rev. Lett. 96, 010401 (2006).

10 Lidar, D. & Brun, T. Quantum Error Correction (Cam-bridge University Press, New York, NY, USA, 2013).

11 Chernoff, P. R. Note on product formulas for operatorsemigroups. J. Funct. Anal. 2, 238 – 242 (1968).

12 Layden, D., Martın-Martınez, E. & Kempf, A. Universalscheme for indirect quantum control. Phys. Rev. A 93,040301 (2016).

13 Knill, E. & Laflamme, R. Theory of quantum error-correcting codes. Phys. Rev. A 55, 900–911 (1997).

14 Beny, C. Perturbative quantum error correction. Phys.Rev. Lett. 107, 080501 (2011).

15 Demkowicz-Dobrzanski, R., Czajkowski, J. & Sekatski,P. Adaptive quantum metrology under general markoviannoise. Phys. Rev. X 7, 041009 (2017).

16 Zhou, S., Zhang, M., Preskill, J. & Jiang, L. Achievingthe heisenberg limit in quantum metrology using quantumerror correction. Nat. Commun. 9, 78 (2018).

17 Reiter, F., Sørensen, A. S., Zoller, P. & Muschik, C. Dissi-pative quantum error correction and application to quan-tum sensing with trapped ions. Nat. Commun. 8, 1822(2017).

18 Oreshkov, O. & Brun, T. A. Continuous quantum errorcorrection for non-markovian decoherence. Phys. Rev. A76, 022318 (2007).

19 Herrera-Martı, D. A., Gefen, T., Aharonov, D., Katz, N.& Retzker, A. Quantum error-correction-enhanced magne-tometer overcoming the limit imposed by relaxation. Phys.Rev. Lett. 115, 200501 (2015).

20 Plenio, M. B. & Huelga, S. F. Sensing in the presence ofan observed environment. Phys. Rev. A 93, 032123 (2016).

21 Gefen, T., Herrera-Martı, D. A. & Retzker, A. Parameterestimation with efficient photodetectors. Phys. Rev. A 93,032133 (2016).

22 Bergmann, M. & van Loock, P. Quantum error correctionagainst photon loss using noon states. Phys. Rev. A 94,012311 (2016).

23 Sekatski, P., Skotiniotis, M., Ko lodynski, J. & Dur, W.Quantum metrology with full and fast quantum control.Quantum 1, 27 (2017).

8

24 Unden, T. et al. Quantum metrology enhanced by repet-itive quantum error correction. Phys. Rev. Lett. 116,230502 (2016).

25 Cohen, L., Pilnyak, Y., Istrati, D., Retzker, A. & Eisen-berg, H. S. Demonstration of a quantum error correctionfor enhanced sensitivity of photonic measurements. Phys.Rev. A 94, 012324 (2016).

26 Matsuzaki, Y. & Benjamin, S. Magnetic-field sensing withquantum error detection under the effect of energy relax-ation. Phys. Rev. A 95, 032303 (2017).

27 Biercuk, M. J. et al. Optimized dynamical decoupling in amodel quantum memory. Nature 458, 996–1000 (2009).

28 Witzel, W. M., Carroll, M. S., Morello, A., Cywinski, L.& Das Sarma, S. Electron spin decoherence in isotope-enriched silicon. Phys. Rev. Lett. 105, 187602 (2010).

29 Bluhm, H. et al. Dephasing time of gaas electron-spinqubits coupled to a nuclear bath exceeding 200 µs. NaturePhysics 7, 109–113 (2011).

30 Doherty, M. W. et al. The nitrogen-vacancy colour centrein diamond. Physics Reports 528, 1 – 45 (2013). Thenitrogen-vacancy colour centre in diamond.

31 Muhonen, J. T. et al. Storing quantum information for 30seconds in a nanoelectronic device. Nature nanotechnology9, 986–991 (2014).

32 Orgiazzi, J.-L. et al. Flux qubits in a planar circuit quan-tum electrodynamics architecture: Quantum control anddecoherence. Phys. Rev. B 93, 104518 (2016).

33 Kubo, R. Generalized cumulant expansion method. Jour-nal of the Physical Society of Japan 17, 1100–1120 (1962).

34 Cheng, Y. C. & Silbey, R. J. Stochastic liouville equationapproach for the effect of noise in quantum computations.Phys. Rev. A 69, 052325 (2004).

35 Cheng, Y. C. & Silbey, R. J. Microscopic quantum dynam-ics study on the noise threshold of fault-tolerant quantumerror correction. Phys. Rev. A 72, 012320 (2005).

36 Lidar, D. A., Chuang, I. L. & Whaley, K. B. Decoherence-free subspaces for quantum computation. Phys. Rev. Lett.

81, 2594–2597 (1998).37 Greenberger, D. M., Horne, M. A. & Zeilinger, A. Go-

ing Beyond Bell’s Theorem, 69–72 (Springer Netherlands,Dordrecht, 1989).

38 Nielsen, M. A. & Chuang, I. L. Quantum Computation andQuantum Information (Cambridge University Press, NewYork, NY, USA, 2000).

39 Roos, C. F., Chwalla, M., Kim, K., Riebe, M. & Blatt, R.’designer atoms’ for quantum metrology. Nature 443, 316(2006).

40 Chwalla, M. et al. Precision spectroscopy with two corre-lated atoms. Applied Physics B 89, 483–488 (2007).

41 Dorner, U. Quantum frequency estimation with trappedions and atoms. New Journal of Physics 14, 043011 (2012).

42 Jeske, J., Cole, J. H. & Huelga, S. F. Quantum metrologysubject to spatially correlated markovian noise: restoringthe heisenberg limit. New Journal of Physics 16, 073039(2014).

43 Ajoy, A., Liu, Y. & Cappellaro, P. Dc magnetometry atthe T2 limit. Preprint at arXiv:1611.04691 (2016).

44 Fortunato, E. M., Viola, L., Hodges, J., Teklemariam, G.& Cory, D. G. Implementation of universal control ona decoherence-free qubit. New Journal of Physics 4, 5(2002).

45 Monz, T. et al. 14-qubit entanglement: Creation and co-herence. Phys. Rev. Lett. 106, 130506 (2011).

46 Schindler, P. et al. Experimental repetitive quantum errorcorrection. Science 332, 1059–1061 (2011).

47 Romach, Y. et al. Spectroscopy of surface-induced noiseusing shallow spins in diamond. Phys. Rev. Lett. 114,017601 (2015).

48 Aharonov, D., Kitaev, A. & Preskill, J. Fault-tolerantquantum computation with long-range correlated noise.Phys. Rev. Lett. 96, 050504 (2006).

49 Albert, V. V. et al. Performance and structure of single-mode bosonic codes. Phys. Rev. A 97, 032346 (2018).