Stabilized Cat in Driven Nonlinear Cavity: A Fault-Tolerant Error Syndrome Detector

In quantum error correction, information is encoded in a high-dimensional system to protect it from the environment. A crucial step is to use natural, low-weight operations with an ancilla to extract information about errors without causing backaction on the encoded system. Essentially, ancilla errors must not propagate to the encoded system and induce errors beyond those which can be corrected. The current schemes for achieving this fault-tolerance to ancilla errors come at the cost of increased overhead requirements. An efficient way to extract error syndromes in a fault-tolerant manner is by using a single ancilla with strongly biased noise channel. Typically, however, required elementary operations can become challenging when the noise is extremely biased. We propose to overcome this shortcoming by using a bosonic-cat ancilla in a parametrically driven nonlinear cavity. Such a cat-qubit experiences only bit-flip noise and is stabilized against phase-flips. To highlight the flexibility of this approach, we illustrate the syndrome extraction process in a variety of codes such as qubit-based toric codes, bosonic cat- and Gottesman-Kitaev-Preskill (GKP) codes. Our results open a path for realizing hardware-efficient, fault-tolerant error syndrome extraction.

In quantum error correction, information is encoded in a high-dimensional system to protect it from the environment. A crucial step is to use natural, low-weight operations with an ancilla to extract information about errors without causing backaction on the encoded system. Essentially, ancilla errors must not propagate to the encoded system and induce errors beyond those which can be corrected. The current schemes for achieving this fault-tolerance to ancilla errors come at the cost of increased overhead requirements. An efficient way to extract error syndromes in a fault-tolerant manner is by using a single ancilla with strongly biased noise channel. Typically, however, required elementary operations can become challenging when the noise is extremely biased. We propose to overcome this shortcoming by using a bosonic-cat ancilla in a parametrically driven nonlinear cavity. Such a cat-qubit experiences only bit-flip noise and is stabilized against phase-flips. To highlight the flexibility of this approach, we illustrate the syndrome extraction process in a variety of codes such as qubit-based toric codes, bosonic cat-and Gottesman-Kitaev-Preskill (GKP) codes. Our results open a path for realizing hardware-efficient, fault-tolerant error syndrome extraction.

I. INTRODUCTION
To perform useful large-scale quantum computation, fragile quantum states must be protected from errors, which arise due to their inevitable interaction with the environment. To achieve this, strategies for quantum error correction (QEC) are continuously being developed.
The key idea behind QEC is that natural errors and interactions generally involve low-weight operators. Therefore in order to protect quantum information, it is stored or encoded in a logical qubit using the non-local degrees of freedom of a high-dimensional system [1]. Here highweight operators imply many-body operators, arising for example in a system of several qubits or operators involving many energy levels of a single high-dimensional physical system, arising for example in a harmonic oscillator. The high-weight operators characterizing the code-space of quantum information are called stabilizers and are designed so that they commute with the logical qubit operators but anti-commute with the errors in the system [2][3][4][5][6]. In the absence of errors, the system lies in the +1 eigenspace of the stabilizer and after an error occurs it moves to the −1 eigenspace. Consequently, the location and type of errors can be determined from the result of measuring the stabilizers, which are also known as an error syndromes. Measurement of these high-weight stabilizers would require engineering highly un-natural, many-body interactions in the system which is undesirable for practical implementation. A more reasonable approach is to synthesize stabilizer measurements via naturally available couplings with an ancillary system [7]. However, interaction with the ancilla exposes the encoded system to more errors. In fact, if the measurement is not designed correctly, errors from the ancilla's noise channel can propagate to the encoded system and damage it beyond repair. Therefore for error correction to be successful such a catastrophic backaction must be eliminated.
To illustrate a typical approach for synthesizing stabilizer measurements, consider a system M (logical qubit) which encodes quantum information in N subsystems (physical qubits) and letŜ be a stabilizer. A code is defined by multiple stabilizers but, for simplicity we just consider one. LetM i , i = 1, 2, ..N be a set of low-weight operators which commute withŜ and can be used to synthesizeŜ through coupling with an ancilla. As an example, the four-qubit operatorσ z,1σz,2σz,3σz,4 is a stabilizer for surface codes [8], in which caseM i =σ z,i . On the other hand, the stabilizer for single-mode bosonic cat codes is the parity operatorP = exp(iπâ †â ), in which caseM =â †â [9][10][11]. Hereσ z is a Pauli operator, whilê a,â † are the photon annihilation and creation operators. The ancilla is typically a qubit which is coupled to the encoded system via the interaction Hamiltonian whereσ x is the Pauli operator of the ancilla qubit and g i are controllable interaction strengths. The evolution of arXiv:1807.09334v1 [quant-ph] 24 Jul 2018 the system is described by the unitary, (τ )dτ (2) = cos The couplings and duration of evolution are chosen [12,13] so that the above unitary (up to local rotations) at time T becomes, From Eq. (4) we see that the ancilla state undergoes a bit-flip at time T conditioned on whether the stabilizer is +1 or −1. Thus, measurement of the ancilla yields the error syndrome. Remarkably, even though the starting Hamiltonian in Eq. (1) was low-weight, its unitary evolution involves high-weight operators. During the time interval [0, T ], the ancilla and the encoded system are entangled and it is crucial that errors in the ancilla do not propagate as uncorrectable errors in the encoded data. Achieving this property, also referred to as faulttolerance is crucial for the success of QEC and would require that all possible errors in the ancilla commute withÛ (t) at all times. Note that the ancilla qubit's bitflip errorσ x satisfies this condition. Therefore if a bit-flip occurs at any time τ during the interval [0, T ], then at time T the state of the system is described by the unitarŷ U (T − τ )σ xÛ (τ ) =σ xÛ (T ) =σ x (1 +Ŝ)/2 + (1 −Ŝ)/2. It is clear that the ancilla's bit-flip channel only introduces an error in measurement of the syndrome without causing any backaction on the encoded system. In this case, the fidelity of syndrome extraction can be recovered by simply repeating the protocol multiple times and taking a majority vote over the measurement outcomes. Importantly, note that dephasingσ z and amplitude dampinĝ σ − errors in the ancilla do not commute withÛ (t). In fact, a singleσ z error on the ancilla propagates as a highweight error to the encoded system. There are primarily three approaches for fault-tolerant extraction of error syndromes developed by Shor [7], Steane [14], and Knill [15]. These methods are based on using several ancillas prepared in complex quantum states, several transversal (or bitwise) entangling gates between the data and ancilla qubits, followed by ancilla measurements. For example, in Shor's method, a single ancilla qubit is replaced with an w-qubit Greenberger-Horne-Zeilinger (GHZ) state, where w is the weight of the stabilizer. Steane's approach requires a whole extra ancillary code block prepared in the encoded |0 E and |1 E states. Knill's method, based on error correction by teleportation, requires two ancillary code blocks prepared in the encoded Bell state |0 E |0 E + |1 E |1 E . Unfortunately, these approaches lead to rapidly growing overhead of computationally expensive entangling gates and ancilla hardware, which forces more stringent requirement on error rates and pushes large-scale fault-tolerant quantum computation further out-of-reach. Some error correcting codes, such as the surface code, are designed to be tolerant to certain amount of ancilla errors. However, the error correcting threshold significantly degrades in the presence of noisy ancillas [16]. Alternatively, efforts are being directed towards optimizing the ancilla hardware for achieving fault-tolerance [17,18]. For example, recently a technique for syndrome extraction in bosoniccat-codes based on three-level ancilla (or a qutrit) was demonstrated [19]. However, this technique only provides protection against first-order errors in the ancilla and is still susceptible to the second-and higher-order errors. Extending this scheme for higher-order protection would require additional drives, which may ultimately open up new sources of errors and back-propagation. An alternate technique for direct, fault-tolerant syndrome extraction in bosonic-cat-codes based on engineering a high-weight stabilizer Hamiltonian has been proposed [20]. However, practical realization of this scheme is challenging and would require new experimental developments.
The above discussion suggests that a more efficient way to extract the error syndrome fault-tolerantly is with an ancilla which exhibits a highly asymmetric error channel. In this case it would be possible to design a physical ancilla-storage unitary which would commute with the ancilla's error channel and will therefore be transparent to ancilla errors [21,22]. Specifically if the ancilla only hadσ x errors, the example above shows that there would be a readout error on the syndrome but no backaction on the encoded system. With this in mind, we propose a two-component cat state in a pumped Kerrnonlinear cavity as an ancilla for fault-tolerant syndrome extraction. The cat states |C ± β = N ± β (|β ± |−β ) with N ± β = 1/ 2(1 ± e −2|β| 2 ), are degenerate eigenstates of a Kerr-nonlinear cavity under two-photon driving [23,24]. Note that these two states are orthogonal but have different normalization constants. We work in the basis so that the states along the +Z and −Z axis of the Bloch sphere, shown in Fig. 1(a), correspond to the cat states |C + β and |C − β respectively. In this basis, the states along +X and −X axis correspond to the states (|C + β ±|C − β )/ √ 2 which to an excellent approximation are the coherent states |±β for large β. The remarkable property of such a pumped cat is that natural couplings can only cause rotations around the X axis. Intuitively, this is because the pump creates a large energy barrier which prevents phase rotations (that is, rotation from the coherent states |β to |−β and vice versa). The error channel is dominated by bit-flip errors (which increase linearly with the size of the cat |β| 2 or equivalently the pump strength). But more importantly, the phase-flips and amplitude damping are exponentially suppressed (exponential in the size of the cat |β| 2 or the pump strength). As a result, this pumped cat-ancilla can be used for fault-tolerant syndrome measurements. Here, we will outline a general procedure to extract an error syndrome based on conditional The first step is to map the error syndrome on the state of the PCC |C + β or |C − β via a controlled X-rotation. The next step is to readout the state of the cat, which proceeds in two stages. The first stage is to rotate the cats |C ± β to the coherent states ≈ |±β (using the procedure described in the main text). In the second stage, a single-photon exchange coupling between the PCC and a low-Q readout cavity is turned on, a process known as Q-Switch. This coupling leads to displacement of the readout-cavity conditioned on the PCC state. Lastly, homodyne measurement of the signal from the low-Q cavity reveals the state of the PCC, thereby yielding the error syndrome.
rotation of the cat state around the X axis using only low-weight local interactions. We will discuss the faulttolerance of this technique in detail and examine specific examples based on three distinct error correcting codes, namely, qubit based toric codes [4], bosonic cat [9,10] and Gottesman-Kitaev-Preskill (GKP) code [25]. Although these examples belong to the subclass of quantum codes known as stabilizer codes, the ideas for error syndrome extraction presented here could be extended to other types of codes as well. Finally we will show how the state of the cat ancilla can be read-out in an efficient manner. We find that the desired interactions between the encoded system and cat ancilla can be easily realized using the inherent nonlinearity of the ancilla itself. That is, no additional coupling elements are required. Our results are applicable in different quantum computing architectures and demonstrate the advantages of exploiting hardware-specific resources for achieving fault-tolerance in QEC.

II. PUMPED-CAT SYNDROME DETECTOR
Consider a Kerr-nonlinear cavity driven by a twophoton drive with frequency twice the frequency of the cavity. Its Hamiltonian in the rotating wave approximation is,Ĥ In the above expression,â,â † are the photon annihilation and creation operators, K is the strength of the Kerr nonlinearity and P is the strength of the two-photon drive. The cat states |C ± β or equivalently the coherent states |±β are the degenerate eigenstates of this Hamiltonian where β = P/K [23]. The two coherent states are quasi-orthogonal, β| − β = exp(−2β 2 ), while the cat states are exactly orthogonal. Henceforth we will refer to this cavity as the pumped-cat cavity (PCC) and denote the cat subspace with C. Note that, for β = 0, |C + 0 = |n = 0 and |C − 0 = |n = 1 , where |n = 0 and |n = 1 are the Fock states. The cat subspace is separated from the rest of the Hilbert-space C ⊥ by an energy gap ω gap ∝ 4Kβ 2 (see Appendix A). ω gap is the gap in the frame which is rotating at the frequency of the cavity ω pcc , while in the laboratory frame the energy gap is ω pcc − ω gap . The negative sign appears because the Kerr nonlinearity is attractive. Moreover the expression for this gap is only approximate and as β approaches zero, the energy gap becomes 2K (which is also the gap between Fock states |n = 0 or |n = 1 and |n = 2 in the rotating frame, see Appendix A). The PCC interacts with the encoded system M in such a way that the interaction Hamiltonian in the rotating frame is, In order to understand the effect of this coupling on the PCC, first note that the cat states undergo bit-flips under the action of the photon annihilation operator, ) and for large enough β, p → 1. While the action of the annihilation operator transforms a state within C to another state which also lies in C, the photon creation operatorâ † can take the PCC out of C. However, for small couplings χ(t) M i , these spurious out-of-subspace excitations are suppressed due to the energy gap between C and C ⊥ . In this restricted subspace C,â † |C ± β = βp ∓1 |C ∓ β (see Appendix B) and Eq. (6) can very well be approximated as,Ĥ Here is the effective Pauli operator in C. This entangling interaction is identical to Eq. (1) and leads to unitary evolution equivalent to Eq. (3). Again, the couplings χ i and time are chosen so that the unitary evolution corresponding to Eq. (7) at time t = T is given byÛ (T ) = (1 +Ŝ)/2 + (1 −Ŝ)σ x /2 (ignoring possible local rotations). As a result, the ancilla cat state in the PCC undergoes a bit-flip conditioned on the stabilizer beingŜ = 1 orŜ = −1. The error syndrome can be easily extracted by reading out the state of the cat at time T . Figure 1(b) provides an outline of the proposed syndrome extraction scheme and we will delve into details with specific examples shortly. Note that, in some cases it might be physically more convenient to implement a coupling like It is possible to synthesize fault-tolerant stabilizer measurements with such interactions as well. In fact, we use such a coupling for syndrome extraction in GKP code in section IV.C.

III. SINGLE-PHOTON LOSS
We now examine the noise channel of the PCC. The major source of noise in a cavity is single-photon loss, which arises from the single-photon exchange coupling with a bath. From the previous discussion it is clear that if the coupling to the bath is smaller than the energy gap between the C and C ⊥ subspaces, then the dynamics of the PCC is confined to the C subspace. In this restricted subspace the effective two-level master equation becomes (see Appendix C), Here we assume that there are no thermal excitations in the bath, that is, the PCC can only lose photons but not gain them (see Appendix D). Note that, as long as the evolution is confined to the C subspace, Eq. (8) (or Eq. (9)) reduces to the common master equation of a cavity coupled to a bath, . Appendix C presents numerical simulations which confirm the theoretically derived master equation above. It is evident from Eq. (8) that the single-photon exchange coupling with the bath leads primarily to a bit-flip error which is accompanied by an exponentially small phase-flip error ∝ (p −1 − p) ∼ exp(−2β 2 ). In other words Eq. (8) implies that the bath lifts the two-fold degeneracy of the C subspace by an amount exponentially small in the size β 2 . Intuitively, this can be understood from the fact that the number of photons in the state |C − β and |C + β differ by an exponentially small amount, C + β |â †â |C + β = β 2 p 2 , C − β |â †â |C − β = β 2 /p 2 . It is more likely for a photon to be lost to the environment from |C − β than |C + β and this asymmetry lifts the degeneracy between the states |C ± β .
The preservation of the degenerate cat subspace makes the PCC an excellent meter for syndrome detection because coupling with the bath commutes with the interaction Hamiltonian Eq. (7) and does not cause backaction on M. Single photon loss to the bath does induce random flips between |C ± β , which reduces the accuracy of the measurement. Nevertheless, since there is no backaction, the accuracy can be easily recovered by repeating the measurement a few times and taking a majority vote. In Appendices D, E, F, we examine in detail other sources of errors such as photon gain, pure-dephasing, two-photon loss and the results are summarized in table I. We find that, irrespective of the underlying source of noise, the PCC's error channel is reduced to bit-flip errors while the phase-flips are exponentially suppressed. It is also important to point out that it is quite possible that spurious excitations or sudden non-perturbative affects overcome the energy barrier and cause excitations to the C ⊥ subspace. These excitations, although rare, can impede the fault-tolerance of syndrome measurements. However as we show in Appendix E, any dissipation such as singleor two-photon loss will autonomously correct for such leakage errors. Having shown that the cat manifold is stabilized against phase-flips, we now delve into the details of each stage of the syndrome extraction protocol. We begin by describing how the error syndrome of an encoded system is mapped on to the PCC (blue region in Fig. 1(b)) using specific examples.

IV. SPECIFIC EXAMPLES FOR STABILIZER MEASUREMENTS
A. Four-qubit stabilizerσz,1σz,2σz,3σz,4 in toric codes The n-qubitσ z stabilizer arises frequently in the toric code which is a topological quantum error correcting code [4]. Because of its significance in two-dimensional toric codes, here we will focus on the direct, eigen-space preserving measurement of theŜ z =σ z,1σz,2σz,3σz,4 stabilizer. The Hilbert space ofŜ z is classified into even E and odd eigenspaces O. The eight-fold degenerate even (odd) subspace comprises of states which are +1 (-1) eigenstates ofŜ z . We define E (even-subspace) and O (odd-subspace) to be the code and error subspace respectively, so that a measurement ofŜ z will yield −1 or 1, indicating if there was or was not an error. Direct measurement ofŜ z would require a five-body interaction between the code qubits and an ancilla which is challenging to realize experimentally. Instead, we perform syndrome measurement with two-body interactions by replacingM i withσ z,i in Eq. (6). The resulting interaction HamiltonianĤ I = χ(t)Ŝ z (â +â † ), wherê S z =σ z,1 +σ z,2 +σ z,3 +σ z,4 , has the form of a longitudinal Noise type Jump operatorÔ in the restricted C Jump operators subspace of the PCC as β → 0 Single-photon loss In general, interaction with the environment can lead to single-photon loss, single-photon gain, pure dephasing and two photon loss. When the coupling to the environment is smaller than the energy gap ωgap then excitations out of the cat subspace C are negligible and the dynamics of the PCC can be restricted in C. In this effective two-level system, the effect of the noise source can be described with the Lindbladian D[Ô]ρ =ÔρÔ † − (Ô †Ôρ +ρÔ †Ô )/2 whereÔ is the jump operator which depends on the type of noise. The Lindbladian is derived using the Born approximation, along with the assumption that the spectral density of the noise is flat around the PCC frequency ωpcc. The noise spectral density at the gap frequency is assumed to be small. For more discussion on these approximations see Appendix D, E and F. The jump operators corresponding to single-photon loss, single-photon gain, pure dephasing and two photon loss in a PCC are listed here. Here p = 1 − e −2β 2 / 1 + e −2β 2 and for large β, . Therefore we find that as the size of the cat state increases, the only effect of the environment is to cause bit-flips in the cat subspace. As β approaches 0, the cat states |C ± β approach the Fock states |n = 0, 1 respectively. In this limit, the effect of noise reduces to the jump operators in a conventional two-level system as listed in the third column here.
qubit-cavity coupling and has been realized experimentally [26,27]. For simplicity we have assumed that all the interaction strengths are equal. Although it is possible to make the interaction strengths equal [19,26,27], our scheme does not require them to be equal. As long as the interaction strengths are known, the duration of interaction with each qubit can be adjusted to perform the syndrome measurement. An alternate approach is to keep the duration of interaction fixed, but use a pair of bit-flip pulses for each qubit appropriately separated in time [12].
Following the analysis in section II, the unitary corresponding to this interaction becomesÛ (t) = i sin{2βŜ z t 0 χ(τ )dτ }σ x + cos{2βŜ z t 0 χ(τ )dτ }. To extract the syndrome, the PCC is initialized to the state |C + β and the system evolved for a time T z so that Tz 0 χ(τ )dτ = π/8β (if the interaction strengths are unequal then the duration of interaction T i,z must be such that Ti,z 0 χ i (τ )dτ = π/8β). At this time the unitary reduces to, The first term in the above unitary (exp (iπŜ z /4)) is just a local phase rotation of the qubits and can be kept track of in software while performing subsequent operations on qubits. Alternatively, localσ z -gate can be applied to the qubit during or after syndrome measurement to compensate for these rotations. It is clear that the state of the PCC after time T z is |C + β or |C − β if the qubits started in the code (Ŝ z = 1) or error subspace (Ŝ z = −1).
We justify our theoretical analysis with exact numerical simulation of the master equation (ME) of the PCC and qubits in the presence of single-photon loss (for simplicity we assume the qubits to be lossless and use the and |ψe when their initial states are |C + β and |ψe respectively. The states |ψo and |ψe are given in Eq. (13) and Eq. (14). The parameters are χ = K/20, P = 4K (β = 2) and Tz = π/8χ0β. Clearly when κ = 0, the state of the PCC at time Tz reflects the syndrome Ŝ z . The probability for the PCC to correctly indicate the error syndrome is reduced to ∼ 93% when κ = K/200 (red dotted lines). More importantly, as seen from the dotted blue lines, the state of the qubits after Tz is unaffected when κ = K/200. common bosonic ME for the PCC), Here κ is the rate of single-photon loss of the PCC. All the numerical simulations in this work are carried out using a open source software [28]. The last term in the above Hamiltonian (−2βχ(t)Ŝ z ) is added to cancel the deterministic single-qubit rotations (i.e., the term exp (iπŜ z /4) in Eq. (10)). We take a time-dependent qubit-cavity interaction to simulate a realistic experimental setup where the coupling is switched on and then turned off. The qubits are initialized in a maximally en- and the stabilized cat cavity is initialized to |C + β , with P = 4K (β = 2), χ = (π/2)χ 0 sin(πt/T z ), χ 0 = K/20 and T z = π/(8χ 0 β). To begin with, the ME is solved with κ = 0 to obtain the reduced density matrix of the PCC (ρ pcc ) and qubits (ρ q ). Figure 2(a) shows the probability for the PCC and qubits to be in the state |C − β (red) and |ψ o (blue) respectively. As expected, after time T z we find ψ o |ρ q |ψ o = 0.9999 ∼ 1 and C − β |ρ pcc |C − β = 0.9999 ∼ 1. Next the effect of single-photon loss is studied by using κ = K/200(K/10). We find that at time T z , while the probability for the PCC to be in the |C − β state is reduced C − β |ρ pcc |C − β = 0.93(0.52) because of lossinduced bit-flips between |C + β and |C − β , the qubits remain in the state |ψ o , ψ o |ρ q |ψ o = 0.9999 ∼ 1. We observe that although the fidelity of mapping the syndrome on to the ancilla cat is reduced to 52% for κ = K/10 (in which case the majority vote almost fails), there is still no backaction on the qubits.
The analysis is repeated with the qubits and PCC initialized to |ψ e and |C + β respectively. Here, As shown in Fig. 2(b) for κ = 0 ψ e |ρ q |ψ e ∼ 1 and C + β |ρ pcc |C + β ∼ 1 at t = T z . Because of single-photon loss κ = K/200(K/10) the probability to be in the state |C + β decreases to 0.93 (0.52) but the state of the qubits is |ψ e with probability 0.9999 ∼ 1. Consequently, these numerical results confirm that the qubits are transparent to the errors in the PCC. The single-photon loss in the PCC reduces the fidelity of the syndrome extraction, but this can be recovered by repeating the protocol many times and taking a majority vote. For example, with κ = K/200 the fidelity of the controlledX rotation reduces to 0.93% but by repeating the procedure 5 times the probability of correctly mapping the syndrome to the PCC increases to 99.7%. In the example considered above, χ is small compared with the energy gap ω gap . We note that, a large χ/ω gap can cause phase-diffusion of the qubits and we study this effect in more detail in Appendix H. It is possible to extend the results in this section to measure the four-qubit stabilizerŜ x =σ x,1σx,2σx,3σx,4 with a single ancilla-cat based on Jaynes-Cummings type interaction between the PCC and the qubits (see Appendix G).
The parameters are χ = K/15, P = 4K (β = 2), κ = 0 and Tp = π/4βχ0. Clearly the state of the PCC at time Tp reflects the photon-number-parity of the storage cat. The probability for the PCC to correctly indicate the error syndrome is reduced to ∼ 90% when κ = K/200 (red dotted lines). However, as seen from the dotted blue lines, the state of the storage cat after Tp is unaffected by single-photon loss from the PCC.
B. Cat code stabilizer e iπâ † sâs Cat codes are bosonic error correcting codes where the information is encoded in superpositions of coherent states [9,10]. The stabilizer for the cat code is the photon-number parity operatorP = e iπâ † sâs and indicates if there are even or odd number of photons. Hereâ s and a † s are the photon annihilation and creation operators for the storage or data cat. The two-fold degenerate codesubspace is defined by the cat states with even photon numbers: |C + α and |C + iα , which are eigenstates ofP with eigenvalue +1. The error-space is comprised of the states with odd number of photons: |C − α and |C − iα , which are eigenstates ofP with eigenvalue −1. To avoid confusion we will refer to the cat states encoding quantum information as the storage cat. In the current scheme for cat syndrome measurement [11,13], a storage cavity which encodes the cat codeword is coupled dispersively to an ancilla qubit. The dispersive coupling between the two is used to map the parity of the cat onto the ancilla. However, a random relaxation of the ancilla during the measurement induces a random phase rotation of the cat codeword, making this scheme non-fault tolerant [11,19]. In our approach, it is possible to achieve fault-tolerant syndrome detection by replacing the operatorM with the photon number operatorn =â † sâs in Eq. (6). The interaction Hamiltonian of the storage cavity and PCC is given byĤ I = χ(t)â † sâs (â +â † ). This interaction, equivalent to a longitudinal interaction between the storage cavity and the PCC, can be realized in a tunable manner [26,27]. The unitary evolution generated by this interaction iŝ The syndrome extraction proceeds by initializing the PCC to |C + β and turning on the interaction between the storage-cavity and PCC for a time T p so that Tp 0 χ(τ )dτ = π/4β. At this time, the unitary reduces to,Û The first term in the above equation e (−iπâ † sâs /2) is just a deterministic rotation of the frame of reference of the storage cat which can be taken into account in software prior to further operations. If the storage is in the code subspace x|C + α + y|C + iα , then the state of the PCC and storage at time T p is |C + β and x|C + α + y|C + iα respectively (up to a deterministic frame rotation of the storage cat).
On the other hand, if the storage cat is in the error subspace x|C − α + y|C − iα , then the PCC evolves to the state |C − β at T p while the storage cat remains in the state x|C − α + y|C − iα (up to a deterministic frame rotation). Therefore the state of the cat in the PCC indicates the error syndromeP . The PCC only measures the parity of the storage without revealing information about the actual photon statistics as long as χ is small and the dynamics of the PCC can be restricted to the stabilized cat manifold. For finite χ/Kβ 2 there is a small probability of excitations out of the C subspace which could cause phase diffusion in the storage cat. Partial correction is possible by applying a counter-drive to the PCC to cancel the excitations out of the C subspace on averagê H c = −χ â † sâs (â +â † ) (see Appendix I). The theoretical results are confirmed with numerical simulations of the master equation of the PCC and storage cavity in the presence of single-photon loss (for simplicity we assume the storage cavity to be lossless and use the common bosonic master equation for the PCC), The last term in the above Hamiltonian is added to compensate for the deterministic frame rotation of the storage cat (e −iπâ † sâs /2 ). The storage cavity is initialized in an odd-parity state |ψ o = |C − α + i|C − iα and the stabilized cat cavity is initialized to |C + β , with α = 2, P = 4K (β = 2), χ = (π/2)χ 0 sin(πt/T p ), χ 0 = K/15 and T p = π/(4χ 0 β). To begin with, κ = 0 and the density matrix of the system is numerically estimated, from which the reduced density matrix of the PCC (ρ pcc ) and storage cavity (ρ s ) are obtained. Figure 3(a) shows the probability for the PCC and storage cavity to be in the state |C − β (red) and |ψ o (blue) respectively. As expected, after time T p we find ψ o |ρ q |ψ o = 0.9999 and C − β |ρ pcc |C − β = 0.9999. Next we study the effect of single-photon loss by using κ = K/200. We find that although at T p , the probability for the PCC to be in the |C − β state is reduced C − β |ρ pcc |C − β = 0.90 because of loss-induced bit-flips between |C + β and |C − β , the storage cavity remains in the state |ψ o , ψ o |ρ q |ψ o = 0.9999.
We repeat this analysis but with the qubits and PCC initialized to the even parity state |ψ e = |C + α + |C + iα and |C + β respectively. As shown in Fig. 3(b) for κ = 0, ψ e |ρ s |ψ e = 0.9999 and C + β |ρ pcc |C + β = 0.9999 at T p . Because of single-photon loss κ = K/200 the probability to be in the state |C − β decreases to 0.90 but the state of the qubits is |ψ e with probability 0.9999. Note that in the example presented above, χ/ω gap is small. In Appendix I, we study the effect of increasing χ/ω gap , in more detail. We also observe that the approach described here can be extended to measure the stabilizer of binomial [29] and pair cat code [30]. Moreover, the syndrome extraction technique can be adapted to perform a bias-preserving CNOT between two PCCs. Such a biaspreserving CNOT is unique to the system of stabilized cat qubits and promises to improve threshold requirements in quantum error correcting codes [31].

C. Gottesman-Kitaev-Preskill (GKP) code stabilizers
The GKP code is a bosonic error correcting code which is designed to correct random displacement errors in the phase space [25,32]. The codewords are the simultaneous +1 eigenstates of the phase-space displacementŝ Here,q andp are the position and momentum operators, defined asq = (â † s +â s )/ The two ideal GKP codewords are uniform superpositions of eigenstates ofq at even and odd integer multiples of √ π respectively. These states are a sum of an infinite number of infinitely squeezed states and are unphysical (non-normalizable) because of their unbounded number of photons. More realistic codewords can be realized by replacing the infinitely squeezed state |q = 0 with a squeezed Gaussian state and replacing the uniform superposition over these states by an overall envelope function, such as a Gaussian, a binomial etc [25,33]. Recently, the GKP codewords have been realized in trapped-ion oscillators [34]. The GKP code provides protection against low-rate errors which can be expanded into small phasespace-displacements of the oscillator given by exp(−iuq) and exp(−ivp) [32,35]. The displaced GKP states are also the eigenstates of the stabilizersŜ q ,Ŝ p with eigenvalue e i2 √ πu and e 2i √ πv respectively. A measurement of the stabilizers would yield the eigenvalues and hence uniquely determine the displacement errors u, v. This is possible only when |u|, |v| < √ π/2, that is, when the displacement error is smaller than half the translational distance ( √ π) between the two codewords. A simple approach to measure the eigenvalues e 2i √ πu , e 2i √ πv ofŜ q ,Ŝ p is based on an adaptive phase-estimation protocol (APE) [33,36,37]. This approach is based on repetitive application of displacements to the storage cavity which are conditioned on the state of the ancilla [33]. In this section, we present a fault-tolerant protocol for the APE of the stabilizers for GKP code using a stabilized cat in a PCC. We will not go into the rigorous details of APE for GKP codes, which can be found in [33]. Instead we will focus on implementing it with the stabilized cat ancilla. To achieve the controlled displacement required for APE, the storage cavity is coupled to the PCC via a tunable single-photon exchange (or a beam-splitter) interaction,Ĥ =Ĥ pcc + (g(t)â †â s + g * (t)ââ † s ) [38]. Such a tunable single-photon exchange coupling can be easily realized with the three-or four-wave mixing capability of the PCC and external drives of appropriate frequencies [39,40]. For small |g| this Hamiltonian can be effectively written in the cat subspace aŝ For large amplitude β, the second term becomes negligibly small and evolution under the above Hamiltonian implements a controlled displacement along the position or momentum quadrature depending on the phase chosen for the coupling g. In this limit, when the phase and amplitude of the coupling g(t) is chosen so that g * (t) = g(t) = |g(t)| and β T1 0 |g(t)|dt = π/2, the unitary corresponding to the above Hamiltonian reduces to,Û which is the conditional displacement of the cavity required for APE ofŜ q (see Fig. 5 in [33]). Similarly, when This implements the required conditional displacements for APE ofŜ p . The overall protocol for APE is shown in Fig. 4(a,b). For estimatingŜ q , the protocol proceeds by sequential application of the gatesÛ 1 (T 1 ), followed by rotation of It proceeds by sequential application of the gatesÛ2(T2) (or U1(T1)) and measurement of the PCC. In APE, the state of the PCC is rotated by an angle φ or ϕ around the X-axis of the Bloch sphere before each measurement. The angles φ and ϕ are chosen based on its previous measurement record.
the PCC around the X-axis by an angle ϕ and finally measurement of the PCC. Similarly, for estimatingŜ p , it proceeds by sequential application of the gatesÛ 2 (T 2 ), followed by rotation of the PCC around the X-axis by an angle φ and finally measurement of the PCC. The feedback phases φ and ϕ are determined based on the measurement outcome in the previous round (Appendix J). As the number of rounds of phase estimation increases, the accuracy of the estimates for u, v also increases and therefore, the uncertainty in the estimate of the eigenvalues exp(2i √ πu) and exp(2i √ πv) will decrease. The accuracy of the phase estimation protocol is evaluated using the Holevo phase variance V q , V p which is defined as V q,p = s −2 q,p − 1 with s q = | Ŝ q | and s p = | Ŝ p | [33]. For an ideal GKP state V q,p = 0, while on the other hand, for large uncertainties in u, v V q,p → ∞.
We numerically simulate one round of phase estimation forŜ p (that is, g(t) = i|g(t)|), with the storage in an approximate GKP state |0 GKP , In the above expression N 0 is the normalization coefficient,Ŝ r = exp{r(â 2 s −â †2 s )/2} is the squeezing operator with r = 1.4 and the overlap function has been chosen to be the binomial coefficients 2 n+1 . The Holevo variance of this state is V 0 q,p = 1.25, 0.48 (because we are starting with the approximate GKP state, |0 GKP , the phase variance is not zero). The master equation used in the simulation is,ρ The density matrices of the system is obtained at time t = T = √ π/(gβ √ 2). After this, the PCC is rotated around the X-axis by φ, which will be taken to be π/2 . As expected, for large β the solid and dotted lines converge and the APE protocol with the PCC becomes ideal.
(Appendix J). After the projective measurement of the PCC states, the reduced density matrix for the storage cavity is obtainedρ s,± , from which the Holevo variance is evaluated along theq andp quadratures A successful round of phase estimation forŜ p (orŜ q ) decreases the variance V p (or V q ). Figure 5 shows the percent change in the variances, 100×(V q,p −V 0 q,p )/V 0 q,p , for different sizes of the PCC cat state β for g = 0.02K and κ = 0. For comparison, we also simulate one round of ideal APE using a lossless two-level ancilla and estimate the resulting variances V ideal q,p (see Appendix L). The figure also shows the percent change in the variance 100 × (V ideal q,p − V 0 q,p )/V 0 q,p (dashed line). Since g is small, the dynamics of the PCC is confined within C. For large β, as expected, phase estimation with PCC becomes increasingly accurate and the decrease in the Holevo variance is the same as with the ideal case. However, for small β non-idealities due to the last term in Eq. (19) are introduced and the magnitude of the decrease in variance becomes smaller.
Let us now consider the effect of the photon-loss channel of the PCC. If the PCC undergoes a bit-flip during a round of phase estimation, the measurement outcome and hence the estimate for u, v would be incorrect. This is equivalent to introduction of small displacement errors in the GKP state which can be corrected by repeated application of APE. More importantly, such errors do not increase the uncertainty in the phase variance. This can be confirmed by numerically solving the master equation in Eq. (24) and evaluating the phase variance of the reduced density matrix of the storage cavity at time T , V m q,p (see Appendix K). The variance calculated in this way corresponds to the situation when the measurement results after the APE are discarded. If, the observer (and environment) did not gain information about the system the variance V m q,p should not change. Indeed, we find that as long as β is moderately large (for example, β = 2), then even for a large κ (for example, κT = 1), V m q,p − V 0 q,p is negligible (for example < 10 −5 ). This shows that the interaction between the storage and PCC does not make the phase variance worse, which is the hallmark of faulttolerance. Contrast this with the case when the phase estimation is carried out with a two-level system with relaxation noise rate γ in time T ideal (Appendix L). We find that for The increase in the variance of theq-quadrature signifies that relaxation actually made the phase variance (and hence the GKP state) worse. Clearly, unlike the PCC's error-channel, the storage is not transparent to the relaxation error of the two-level system.

V. READING OUT THE ANCILLA CAT
Once the error syndrome is mapped to the PCC, its state |C ± β must be determined. Although the readout of the PCC must be fast (so as to be able to repeat the protocol many times), it does not have to be QND, that is the readout can introduce phase-flips (or other errors) in the cat-ancilla. This is because the PCC-codeword interaction can be turned off while the PCC is being probed so that the ancilla errors don't propagate to the encoded system. Direct single-shot readout of cat states |C ± β is possible with another qubit. Such a high-fidelity (> 99%) readout has been demonstrated in superconducting circuits using transmons [11,13]. Here we discuss an alternate readout strategy which is based on measurement of the PCC along the X-axis of the Bloch sphere and does not require additional nonlinearities in the system.
The states along the X-axis are (approximately) coherent states and can be measured easily using standard homodyne detection of the field at the output of the PCC. However the PCC is a (moderately) high-Q mode and so a direct homodyne measure will be slow. To overcome this we propose to Q-switch the PCC via frequency conversion into a low-Q readout cavity [38][39][40]. Because of the Q-switch, the low-Q readout cavity is displaced conditioned on the state of the PCC along the X-axis. Therefore a fast homodyne readout of the low-Q cavity reveals the state of the PCC and thereby the error syndrome. In the following we describe the process of rotation of cats from |C ± β to |±β and the conditional displacement of the readout cavity.

A. Rotating the PCC cat states to coherent states
To rotate the pumped cat |C ± β , first a single-photon drive is applied so that its Hamiltonian isĤ = E(â † +â)− Kâ †2â2 + P (â †2 +â 2 ). The single-photon drive rotates the pumped cat around the X-axis in time T = π/8Eβ from |C ± β to (|C + β ±i|C − β )/ √ 2 (which is a parityless cat) respectively [10,23,41]. The state after time T = π/8Eβ is aligned along the ±Y -axis of the Bloch sphere. A rotation around the Z-axis would then align the states along the ±X-axis, which is however directly in contradiction with the fact that any natural interaction of the PCC only allows rotations around the X-axis. Therefore to achieve such an operation the two-photon pump is turned off and the states are allowed to evolve freely under the Kerr-nonlinear Hamiltonian −Kâ †2â2 − Kâ †â for a time T = π/2K (the last term is added just for a phase reference). During this evolution the state [10,42,43]. Next the twophoton pump is reapplied so that the cat subspace C is again stabilized against phase-flips. As a result, the PCC remains in the coherent states |±β for a long time. Note that if there is a single-photon loss during the rotation around the X-axis then |C ± β can erroneously rotate to (|C + β ∓i|C − β )/ √ 2 respectively. On the other hand, while the two-photon drive is turned off, the single-photon loss can induce phase-errors (Appendix M). However, these errors only lead to a readout error and can be overcome by majority vote.

B. Q-Switching
After the rotation described above, the state of the PCC lies along the +X or −X-axis of the Bloch sphere (i.e., in the C manifold). The PCC is coupled to an offresonant low-Q readout resonator (RR). In the absence of any external drives, the coupling between the two is negligible because of their large detuning. A single-photon exchange coupling (or a beam-splitter coupling) can be turned on by application of external drive(s) to compensate for the frequency difference between the PCC and the RR. A three-(or four) wave mixing between the drive(s), the PCC and RR results in a resonant singlephoton exchange between the latter two. Such a controllable coupling has been implemented experimentally and is referred to as the Q-switch [38][39][40]. Once the Qswitch is turned on, the single-photon exchange coupling between the PCC and the readout cavity in the rotating frame is given by the HamiltonianĤ Q = g(â †â r +ââ † r ).
For small g this interaction can be re-written aŝ Ignoring the term ∝σ y , which becomes negligibly small even for moderately large β, the result of the Q-Switch is to displace the readout cavity conditioned on the state In the above expression â r is the amplitude of the RR's field and κ r is its linewidth. As a result, a homodyne detection of the readout cavity will measure the PCC in the X basis and hence extract the error syndrome. At steady state â r = â r max = 2igβ/κ r and the measurement rate of the homodyne signal from the readout cavity is R ideal = 2κ r | â r max | 2 = 8g 2 β 2 /κ r . At the same time, for the PCC dynamics to be confined in C we require g â r max 4Kβ 2 which implies (g 2 /κ r ) 2Kβ. Therefore the measurement rate is limited by the energy gap between C and C ⊥ . Furthermore as Im[ â r ] increases, the second term in Eq. (27) can cause rotations around the Y axis of the Bloch sphere thereby reducingσ x and the homodyne signal. However the rate of these rotations = gβ(p−p −1 )Im[ â r ]/2 is exponentially suppressed compared to the measurement rate even for moderately large β (see Appendix N for numerical simulations of the Q-Switch operation).

VI. DISCUSSION
We have introduced a protocol to fault-tolerantly measure error syndromes, which is applicable for a variety of quantum error correcting codes such as qubit-based toric codes and various bosonic codes. The underlying principle of achieving fault-tolerance is to use a single ancilla with strongly asymmetric error channel. Preserving noise bias while being coupled to the relevant degrees of freedom of the encoded system is a demanding task. Even elementary operations, such as readout along the relevant axis can become challenging. However we show that the parametrically driven nonlinear cavity (PCC) is an excellent device to resolve the apparent incompatibility between noise bias and efficient control.
Another possible realization of a cat-qubit with strongly biased noise channel is based on engineering two-photon dissipation in a parametrically pumped cavity. The cat states are the steady states of this system and just like the PCC, small couplings with the environment only lead to bit-flips. The two-photon dissipation is realized by coupling the cat-cavity to another dissipative nonlinear element and applying drives at appropriate frequencies [10,41,44]. Such a system has been implemented in superconducting circuits, however, a strong or |C − β . These are first rotated around the X-axis to the states (|C + β ± i|C − β )/ √ 2 respectively. The two-photon pump is then turned off and free evolution under the Kerr nonlinearity rotates (|C + β ± i|C − β )/ √ 2 to ∼ |±β respectively. Following this rotation the two-photon drive is turned on such that the cat subspace C is again stabilized against rotations around the Y -axis or Z-axis. The next step is to switch-on the single-photon exchange coupling between the PCC and a low-Q readout cavity. This Q-switch operation displaces the readout cavity conditioned on if the PCC was in a coherent state |β or |−β . Finally a homodyne detection of the field at the output of the readout reveals the state of the PCC, thereby extracting the error syndrome. noise bias has not yet been observed [41]. To achieve a strong noise bias any nonlinearity in the cavity and environmental couplings must be much smaller than the Liouvillian gap which depends on the strength of the engineered dissipation. However, in the realization described above, the cross-Kerr interaction between the dissipativecat and the nonlinear element is larger than the Liouvillian gap. Heating in the nonlinear coupling element causes a large backaction on the dissipative-cats which leads to phase-flips, thereby making the noise channel unbiased. However, this is not a fundamental limitation and might be overcome with alternate realizations. In contrast, the PCC is in itself nonlinear and does not require an external nonlinear element for its implementation. Therefore, its cross-Kerr interaction with spurious modes in the system can be suppressed below the energy gap ω gap and the possibility of achieving a strong noise bias in this system is realistic.
Although the PCC can be realized in many quantum computing platforms, its implementation in superconducting circuits is especially promising. For example, the Josephson Parametric Amplifier (JPA), which is a widely used tool in superconducting circuits, realizes the Hamiltonian in Eq. (29) [23,45]. The PCC can also be implemented with a single junction or transmon embedded in a 3D cavity (in fact, the PCC is essentially a slightly anharmonic transmon). The nonlinearity of the junction/transmon gives rise to the fourth-order Kerr-nonlinearity. The two-photon drive can be realized by four-wave mixing with two microwave drives, one of which is red-detuned ω pcc − δ, while the other is blue detuned from the ω pcc + δ. All other couplings required for syndrome extraction can also be realized in a controllable manner via the four-wave mixing capability of the Kerrnonlinearity. The remarkable property of the stabilization realized with the PCC is that it is fully controllable via the two-photon drive. Once the drive is turned off, the cavity can evolve freely under the Kerr-nonlinearity and rotate from cats to coherent states. This allows for subsequent readout of the PCC (and therefore extraction of the error syndrome) via Q-switching. To summarize, our results offer a realistic, hardware-efficient way for fault-tolerant error syndrome extraction in QEC.

A. Energy gap
Consider the Hamiltonian of the two-photon driven Kerr nonlinear cavity, The cat states |C ± β or equivalently the coherent states |±β are the degenerate eigenstates of this Hamiltonian where β = P/K [23]. We now make a displacement transformation D(±β) = exp(±βâ † ∓ βâ) so that the above Hamiltonian readŝ In writing the above expression we have used β = P/K (so that the terms ∝â † ,â,â †2 , andâ 2 vanish) and also dropped the constant term E = P 2 /K which represents the energy of the coherent states |±β . The vacuum |0 is an eigenstate in this displaced frame (so that D(±β)|0 = |±β are the eigenstates in the original frame). In this frame, if we ignore the terms ∝ β 0 , β 1 (in the limit of large β) and consider only the term which is ∝ β 2 , then the next eigenstate is the Fock state |n = 1 . In the original frame, this would imply that the next eigenstates are D(±β)|1 . The energy gap between |n = 1 and |n = 0 is 4Kβ 2 and therefore this is It also shows the approximate gap 4Kβ 2 (dashed blue line). Clearly, the approximate expression converges to the exact gap for large β. For small β it becomes impossible to ignore the terms ∝ β 0 , β 1 and therefore the expression is incorrect. In fact if β = 0, that is P = 0, then Eq. (29) reduces to the Hamiltonian for an undriven nonlinear cavity and the energy gap becomes equal to that between Fock states |n = 0 or |n = 1 and |n = 2 , which is qual to 2K. At this point it will be useful to intuitively examine the eigenspectrum of Eq. (29). The classical-potential or meta-potential of the PCC is an inverted double well with the states |+ ∼ |β and |− ∼ |−β as two degenerate states, as shown in Fig. 8 [46]. The meta-potential is found by replacing the operatorsâ,â † with complex numbers representing position and momentum [47]. Note that the meta-potential does not show a physical energy landscape but gives a phase-space representation of a Hamiltonian. As we have already seen, |C + β , |C − β and equivalently their superposition states |+ and |− are the exact degenerate eigenstates of the system, where As the strength of the pump P is increased, the two wells become deeper are pulled further apart. If the potential is deep enough, that is when ω gap ∼ 4Kβ 2 = 4P is large, then the next two eigenstates are approximately degenerate as well and can be approximated by the displaced Fock states |2 = D(−β)|n = 1 and |3 = D(−β)|n = 1 . This intuitive eigenspectrum will be useful in understanding the origin of phase-diffusion during stabilizer measurements in Appendix H and I.
. As the pumping strength P is increased, the meta-potential becomes deeper. In this case, the next two eigenstates are well approximated by the displaced Fock states |2 = D(−β)|n = 1 and |3 = D(−β)|n = 1 and are also approximately degenerate.
Hereâ C is the projection ofâ in C. Coherent states are not eigenstates of the photon creation operator. In is the Fock state with one photon. In writing these expressions we are assuming β is real for convenience. This implies that action ofâ † on coherent states |±β or cat states |C ± β can cause leakage out of the code space. However if the energy gap is large, this leakage is suppressed. Therefore, the dynamics can be restricted to C, Hereâ † C is the projection ofâ † in C. In other words, if the PCC is subject to a perturbation Hamiltonian which is expressed in terms of photon annihilation and creation operators, then as long as the Hamiltonian strength is smaller than the gap, the annihilation/creation operators can be replaced with their associated projections in the cat subspace (â C , a † C ).

C. Master equation with single-photon loss
The major source of noise in a cavity is single-photon loss, which arises from the single-photon exchange coupling with a bathĤ pcc,b = k g k (âb † k e i(ω k −ωpcc)t + a †b k e −i(ω k −ωpcc)t ). In this equation,b k are the bath modes with frequency ω k and ω pcc is the frequency of the PCC. From the previous discussion it is clear that if the coupling to the bath is smaller than the energy gap ω gap between the C, C ⊥ subspaces and if there are no thermal excitations in the bath to compensate for this energy gap, then the dynamics of the PCC is confined to the C subspace. In this restricted subspace, the coupling between the PCC and bath becomes, The effective two-level master equation corresponding to the system-bath coupling described above can be derived as [48], In deriving this master equation we assumed a flat-spectral density (Markov approximation) around ω pcc .
We now provide numerical evidence to justify the analysis above by comparing the dynamics using (i) the effective two-level master equation derived in Eq. (32), (ii) the standard bosonic master equation withρ = −i[Ĥ pcc ,ρ] + κ C D[â]ρ, and (iii) the master equation of a PCC coupled with a finite-linewidth cavity which emulates a general non-Markovian bath [49,50]. In case (iii) we assume that the PCC and the bath-cavity have the same frequency, so that the Hamiltonian of the system in the rotating-wave approximation (r.w.a) is, H pcc,bc =Ĥ pcc + g(â †â bc +ââ † bc ). The linewidth of the bath-cavity is κ bc and the system evolves according to the master equation,ρ = −i[Ĥ pcc,bc ,ρ] + κ bc D[â bc ]ρ. To emulate the bath, we limit ourselves to the weak coupling regime g κ bc , 4K|β| 2 . In this limit, the master equation for the PCC, obtained by adiabatically eliminating the bath cavity, is of the form given in Eq. (32) with κ C = 4g 2 /κ bc . Figure 9 shows numerical estimates for the probability of a bit-flip C − β |ρ pcc |C − β and phaseflip −|ρ pcc |− error when the PCC is initialized in the cat state |C + β or the superposition state |+ respectively (here |± = (|C + β ±|C − β )/ √ 2 andρ pcc is the reduced density matrix of the PCC). The magnitude of κ C is same in (i) and (ii), while the parameters g = 0.05K, κ bc = 2K in (iii) are chosen so that κ C = κ C .
The three different cases (i), (ii) and (iii) are depicted as solid lines, dots and triangles respectively. The value of β is increased from β = 1 in Fig. 9(a) to β = √ 2 in Fig. 9(b) and β = 2 in Fig. 9(c). As expected, since 4Kβ 2 is large all the three cases give the same probability of bit-and phase-flip errors. The probability of bit-flip error increases with β whereas that of phase-flip error decreases with β. For example, the probability of phase-flip error at t = 2/κ C decreases from 0.018 in Fig. 9(a) to 0.0067 and 5×10 −7 in Fig. 9(b) and Fig. 9(c) respectively. Therefore the numerical simulations confirm that the probability of phase-flip error decreases exponentially with β.

D. Master equation with single-photon gain
From the discussion in the previous section it is clear that while thermal photons at ω pcc can only cause transitions within C, those at frequencies ∼ ω pcc − ω gap can cause excitations out of C. In other words, the two-level approximation is strictly valid when the thermal noisespectral density is colored or non-Markovian such that thermal photons at ω pcc − ω gap are negligible. In this case, the effective two-level master equation becomes, The above equation was derived under the assumption that the spectral density of the environment is smooth or flat around ω pcc , but falls off at ω pcc − ω gap . This analysis can be numerically confirmed by emulating such a bath with a finite-linewidth cavity which is coupled to the PCC. To ensure that the thermal photons in the bath do not excite the C ⊥ subspace of the PCC, the linewidth of the bath cavity κ bc is chosen to be smaller than ω gap . The dynamics of such a system is described by the master equation, withĤ pcc,bc =Ĥ pcc + g(â †â bc +ââ † bc ). When g κ bc <∼ ω gap , the cavity emulates a non-Markovian bath. In other words, adiabatic elimination of the bath cavity would give Eq. (34) with κ C (ω pcc ) = 4g 2 /κ bc . Figure 10 compares the dynamics given by Eq. (35) and Eq. (34) with n th (ω pcc ) = n bc and κ C (ω pcc ) = κ C (ω pcc ) = 4g 2 /κ bc . The numerical estimates for the probability of a bit-flip C − β |ρ pcc |C − β and phase-flip −|ρ pcc |− error when the PCC is initialized in the cat state |C + β or the superposition state |+ respectively are shown. The bath cavity is initialized to a thermal state with n bc = 0.1. The coupling g = 0.05K, P = K (β = 1), while κ bc = 2 × (4Kβ 2 ) in Fig. 10(a) and κ bc = 0.5 × (4Kβ 2 ) in Fig. 10(b). As expected, the dynamics described by Eq. (35) and Eq. (34) agree well (the solid lines and triangles overlap) for small κ bc (Fig. 10(b)) because the probability of excitations in the C subspace is small. However, as κ bc increases ( Fig. 10(a)), the excitations in C ⊥ become significant and the effective two-level ME in Eq. (34) is no longer accurate. Note that the timescale for stabilizer measurement using the PCC is typically in the range of T = 1/K − 10/K. Therefore the relevant timescale for the plots in Fig. 10(a,b) are It is quite possible that spurious thermal excitations exist at the gap frequency or sudden non-perturbative The probability of bit-flip error is estimated by initializing the PCC to the state |C + β and estimating C − β |ρpcc|C − β . The probability of phase-flip error is estimated by initializing the PCC to the state |+ and estimating −|ρpcc|− . effects cause excitations into the C ⊥ subspace. These excitations, although rare, can impede the fault-tolerance of syndrome measurements. However as we will show in the next section, two-photon loss events will bring the system back to C, thereby autonomously maintaining faulttolerance.

E. Autonomous correction of out-of-subspace excitation with two-photon dissipation
This type of noise is present when photons are lost to the environment in pairs and will be invariably introduced when two-photon driving is applied to the PCC [10,51,52]. The rate of two-photon loss is typically negligible, but it can engineered to be larger [10,41,44]. It arises when the system-bath coupling is of the formĤ butâ †2 can excite the PCC to the C ⊥ subspace. Following the discussion in the previous sections, it is evident that if the two-photon coupling with the environment is small, then excitations out of C will be negligible. Remarkably this implies that two-photon dissipation does not introduce any errors in the PCC. Moreover two-photon dissipation can bring spurious excitations in C ⊥ back into C. This can be understood through quantum-Zeno dynamics [10,20,[53][54][55] induced by the environment which constantly monitors the PCC with the two-photon process and projects it on to the C subspace.
To elaborate with an example, suppose an excitation out of C is caused by a photon-gain event. The cat states transform asâ † |C ± 2 is a state in the C ⊥ subspace. Here D(β) is the displacement operator D(β) = exp{β(â † −â)} and for convenience, we have approximated exp(−2β 2 ) ∼ 0. Therefore, the fraction of excitations in C ⊥ ∝ 1/β decreases as the size of the cat increases. Suppose a two-photon loss event occurred after a photon gain event, in which case the cat states transform asâ 2â † |C ± In this case the fraction of excitations in C ⊥ is 1/(β + 2/β 2 ) < 1/β and we find that the two-photon loss event has decreased the out of subspace excitations. The two-photon loss channel therefore is actually desirable because it autonomously corrects for out-of-subspace excitations in the PCC (of course, only as long as the rate of two-photon excitations is smaller than the gap between C and C ⊥ ). To confirm this we simulate the dynamics in Eq. (35) with an additional twophoton dissipation κ 2ph D[â 2 ]ρ, with g = 0.05K, P = K (β = 1), κ bc = 8K and n th = 0.1. Figure 11 shows the probability of excitations in C ⊥ for κ 2ph = 0 (solid) and κ 2ph = 0.05K (dotted), when the PCC is initialized in the cat state |C + β (blue) or the superposition state |+ obtained by simulating Eq. (35) with g = 0.05K, P = K (β = 1), κ bc = 8K, n th = 0.1 and an additional two-photon dissipation (rate κ 2ph ). The blue lines and blue dots correspond to when the PCC is initialized in the cat state |C + β with κ 2ph = 0 and κ 2ph = 0.05K respectively. The red lines and red dots correspond to when the PCC is initialized in the superposition state |+ with κ 2ph = 0 and κ 2ph = 0.05K respectively. In practice, the stabilizer measurements typically would take time T = 1/K − 10/K and so timescales such that κCT = 0.005 − 0.05 are relevant.
(red). As expected the out of subspace excitations decrease with increase in κ 2ph . Because of finite κ 2ph /ω gap , the two-photon coupling with the environment can itself cause excitations out of C. Therefore, the autonomous correction of out-of-subspace excitation with two-photon dissipation is not perfect (red and blue dots saturate to ∼ 3 × 10 −4 in Fig. 11). Note that a single-photon loss after a single-photon gain event will also decrease the excitations in C ⊥ , but it will also introduce bit-flips which, although can be overcome by majority vote, is less desirable.

F. Master equation with pure dephasing
In addition to the single-photon loss, gain and twophoton loss, it is possible that the frequency of the PCC fluctuates because of couplings with the environment which could be of the form,Ĥ pcc,b = g φ,kâ †âb † kb k . In this expressionb k are the bath modes. Following the discussions above we find that if g φ,k β is smaller than ω gap , then the master equation for this pure dephasing channel can be derived aṡ Note thatâ †â |±β = β 2 |±β ± βD(±β)|1 , so that the probability to go out of the C subspace is (g φ,k β/ω gap ) 2 . Therefore for this probability to be small, g φ,k β ω gap . Moreover, for β → 0 the probability to go out of the cat subspace C vanishes. This is expected because β = 0 corresponds to the case when the cat states reduce to the Fock states |n = 0 and |n = 1 . In this case dephasing does not take the system out of C, because Fock states are eigenstates ofâ †â .
We justify the above master equation by comparing the dynamics using (i) the effective two-level master equation derived in Eq. (36) and (ii) the master equation of a PCC coupled with a cavity which emulates a general non-Markovian bath, with the Hamiltonian H pcc,bc =Ĥ pcc + gâ †â (â † bcâ bc − â † bcâ bc ). Because of such an interaction, photon-number fluctuations in the bath cavity will cause fluctuations in the frequency of the PCC or in other words pure-dephasing. To emulate this effect we evolve the system according to the master equation, The fluctuations in the number of photons in the bath cavity becomes n th + n 2 th . We limit the dynamics to the weak coupling limit g κ bc (so that the bath cavity indeed acts as a reservoir) and g 4K|β| 2 so that the two-level approximation is valid. In this limit, we expect the master equation for the PCC, obtained by adiabatically eliminating the bath cavity, to be of the form given in Eq. (36) with Figure 12 shows numerical estimates for the probability of a phase-flip −|ρ pcc |− error when the PCC is initialized in the superposition state |+ (here |± = (|C + β ± |C − β )/ √ 2 andρ pcc is the reduced density matrix of the PCC). In (ii) the parameters chosen are g = 0.0025K, n th = 1, κ bc = 0.05K so that κ C = κ C = 0.0005K. The two different cases (i) and (ii) are depicted as solid lines and triangles respectively. The value of β is increased from β = 0 to β = 1 and β = √ 2. As expected, increase in β exponentially suppresses the phase-flip rate.

G.
Four-qubit stabilizerσx,1σx,2σx,3σx,4 in toric codes Extension of section IV.A makes it clear that it is also possible to measure the four-qubit stabilizerŜ x = σ x,1σx,2σx,3σx,4 . The required interaction Hamiltonian between the qubits and PCC isĤ I = χ(σ x,1 +σ x,2 + σ x,3 +σ x,4 )(â † +â). Such a coupling can be effectively implemented by the typical Jaynes-Cummings (JC) interaction given byĤ I = χ i (â †σ −,i +âσ +,i ). For χ smaller than the energy gap ω gap , the PCC remains within C and the JC Hamiltonian reduces toĤ I = χβ i (σ x,i (p + p −1 )σ x /2 +σ y,i (p − p −1 )σ y /2). For even moderately large amplitude of the cat state in PCC (such as β = 2), the last term in the above equation (∝ p−p −1 ) becomes exponentially small and the desired interaction Hamiltonian for the measurement ofŜ x stabilizer is obtained. H. Phase diffusion during the measurement of thê Sz stabilizer As discussed in the main text the qubit-cavity coupling ∝ χ(t)(â † +â) can cause a small virtual excitation of the states in C ⊥ . As χ(t) is turned off, these virtual excitations quickly reduce and the cavity returns to the cat manifold carrying with itself an extra phase. This extra phase, which depends on χ(t), is different for different qubit states and therefore leads to some cavity-qubit entanglement and hence phase diffusion.
To elaborate, consider the eigenspectrum of the PCC when the state of the qubits is |1, 1, 1, 1 shown in Fig. 13. The results in this section are best understood by working in the |± eigenbasis of the PCC where The coupling between the qubits and PCC is χ(t)(σ z,1 +σ z,2 +σ z,3 +σ z,4 )(â † +â − 2β). As a result, when the qubits state is |1, 1, 1, 1 , the PCC experiences a single-photon drive of strength 4χ(t)(â † +â). This drive tilts the meta-potential of the PCC as shown in Fig. 13(a). We will refer to this as the 0 th -order effect. When χ(t) is small w.r.t to the energy gap ω gap , the single-photon drive lifts the degeneracy between the |+ and |− states by 16χ(t)β. This lifting of degeneracy arises because the single-photon drive couples the cat states |C + β and |C − β , which is what is exploited to perform the stabilizer measurements. To 0 th order, the enegies of the states |± are ω |± = ω g ± 8χ(t)β, where ω g is their energy when χ = 0. Importantly, when ω gap is large, the energy difference between |+ , |3 and that between |− , |2 remains the same. That is, ∼ ω gap or in other words, the tilting of the the meta-potential is uniform. Note that, this approximation is only valid when mixing with other states is negligible and breaks down with increase in χ.
and the PCC is initialized in the cat state |C + β . The evolution under the Hamiltonian H = −Kâ †2â2 + P (â †2 + a 2 ) + χ(t)Ŝ z (â +â † − 2β) is numerically simulated with P = 2K, χ(t) = (χ 0 / √ π) exp(−t 2 /T 2 z ), and T z = π/8χ 0 β. The cut-offs for the Gaussian pulse are taken at ±3T z . Figure 14(a) shows the probability of phasediffusion given by E e = 1 − ψ e |ρ q |ψ e (solid red line) as a function of χ/Kβ 2 (here χ is the peak interaction . The blue dotted line shows the theoretically estimated E e , using the formulas for phases derived in Eq. (39) and Eq. (40). The phase diffusion is proportional to the square of the coupling, that is, E e ∝ χ 2 for small χ.
The analysis is repeated with the qubits initialized in the odd parity state, Figure. 14(a) shows the probability of phase-diffusion given by E o = 1 − ψ o |ρ q |ψ o (solid black line). The 1 storder perturbation theory predicts an absence of phasediffusion in this state. The green dotted line shows the theoretically estimated E e = 0 as a reference. We find that the simple 1 st -order theory agrees well with the numerical results for small χ. However as χ increases, the disagreement between numerical estimates and theory increases, which is expected because the small χ approximation breaks down. The Gaussian pulse shape chosen for the above example behaves well and ensures the adiabacity condition that we have assumed in the theory. However, we can test our theory against another pulse shapes, such as a sine pulse χ(t) = 0.5χ 0 π sin(πt/T z ) with cut-offs at t = 0 and t = T z . In this case we expect non-adiabatic effects to emerge. We repeat the above analysis for this pulse with the results shown in Figure. 14(b). The solid lines are from numerical simulations, while the dotted ones are from the 1 st -order theory assuming adiabaticity. In this case, again we see agreement between theory and numerical results for small χ. But the theoretical and numerical results deviate for larger χ. The numerically obtained solid lines show some oscillations because of non-adiabatic effects. Moreover, deviations between the the solid and dashed lines become more prominent for the sine-pulse compared to that with a Gaussian pulse.
To summarize, we expect phase diffusion in the qubits states because of interaction with other states in the Hilbert space of the PCC. This phase diffusion is proportional to (χ/ω gap ) 2 (for small χ) and can be suppressed by increasing the energy gap ω gap . FIG. 14. Dependence of phase diffusion in the state of the qubits as a function of the coupling strength. In (a) the time dependence of the interaction between the qubits and PCC is taken as Gaussian χ(t) = (χ0/ √ π) exp(−t 2 /T 2 z ) with cut-offs at ±3Tz. In (b) the time dependence of the interaction between the qubits and PCC is χ(t) = 0.5χ0π sin(πt/Tz) with cut-offs at 0 and Tz. χ is the peak interaction strength so that in (a) χ = χ0 √ π and in (b) χ = πχ0/2. The parameters are P = 4K (β = 2) and Tz = π/8χ0β. The phase diffusion is suppressed when the excitations out of the C subspace are negligible, that is, when χ/ Kβ 2 is small. Both theoretical (dotted lines) and numerical (solid lines) are shown. The agreement between the two is good for small χ . As χ increases the 1 st -order perturbation theory is not sufficient and effect of other states in the PCC must be included. Also in (b), effect of non-adiabatic terms and higher-order effects become apparent at smaller χ compared to (a). For small χ the average phase diffusion decreases quadratically with χ /Kβ 2 . For example, the phase diffusion is < 10 −4 when χ /Kβ 2 < 0.045.
I. Phase diffusion during the measurement of e iπâ † sâs stabilizer Following the discussion in the previous section it is easy to see that the coupling between the storagecavity and the PCC causes a small virtual excitation out of the cat subspace and leads to dressing of the |± states. The Fock states comprising the storage cat |n = 0 , |n = 1 , |n = 2 ... couple to the PCC with different strengths (∝ nχ). If the coupling between the storage-cat and PCC is tuned adiabatically, then after a time T p an initial state |2n ⊗ |C + β evolves to exp(iφ 2n )|2n ⊗|C + β and the state |2n + 1 ⊗|C + β evolves to exp(iφ 2n+1 )|2n + 1 ⊗|C − β . Here the phase dependent on storage-photon-number m is, Recall that T p is the time required to map the stabilizer on to the PCC. This storage-photon-number-dependent phase leads to phase diffusion when the storage is in a superposition of Fock states such as a cat state. Full correction of phase diffusion would require complete knowledge of the photon statistics of the storage which would defeat the purpose of error correction. However, correction of the mean phase is possible by applying a counter-drive to the PCC as shown in Eq. (18). In (a) the time dependence of the interaction between the storage and PCC is χ(t) = (χ0/ √ π) exp(−t 2 /T 2 p ) with cut-offs at ±3Tp. In (b) the time dependence of the interaction is χ(t) = 0.5χ0π sin(πt/Tp) with cut-offs at 0 and Tp. χ is the peak interaction strength so that in (a) χ = χ0 √ π and in (b) χ = πχ0/2. The parameters are P = 4K (β = 2) and Tp = π/4χ0β. The phase diffusion is suppressed when the excitations out of the C subspace are negligible, that is, when χ/ Kβ 2 is small. Both theoretical (dotted lines) and numerical (solid lines) are shown. The agreement between the two is good for small χ and when the adiabatic approximation is valid. Again we find that for small χ the average phase diffusion decreases quadratically with χ /Kβ 2 . For example in (a), the phase diffusion is < 10 −4 when χ /Kβ 2 < 0.02.
Here |ψ o = |C − α + i|C − iα and |ψ e = |C + α + |C + iα . Both theoretical (dotted lines) and numerical (solid) lines are shown. The theoretical results are based on phases estimated in Eq. (43). Again we find good agreement between theory and numerical simulations for small χ for both the Gaussian pulse χ(t) = (χ 0 / √ π) exp(−t 2 /T 2 p ) (with cut-offs at ±3T p , Fig. 15(a)) and the sine pulse χ(t) = 0.5χ 0 π sin(πt/T p ) (with cut-offs at 0 and T p , Fig. 15(b)). Here T p = π/4χ 0 β. Again we find that the average phase diffusion is suppressed for small χ/Kβ 2 and the PCC indeed measures the stabilizer P without revealing any information about the underlying photon number statistics.

J. Estimating the feedback phases for phase estimation
To understand how the feedback phases φ and ϕ are determined for the phase estimation protocol described in section IV.C, suppose that the storage was in the eigenstate of the stabilizerŜ q with eigenvalue exp(2i √ πu). In this case, the state of the PCC after the application of the gateÛ 1 (T 1 ) is i|C − β sin( √ πu) + |C + β cos( √ πu). If the PCC is further rotated around the X axis of the Bloch sphere by an angle φ/2 (by application of singlephoton drive), its state becomes i|C − β sin( √ πu + φ) + |C + β cos( √ πu + φ). The probability for the PCC to remain in the |C + β state after a round of phase estimation is P φ (+|u) = cos 2 ( √ πu + φ/2). Therefore, in order to accurately predict u, the sensitivity of the probability distribution ∂P φ (+|u)/∂φ must be maximized. This is achieved in APE by choosing the feedback phase φ dependent on whether the PCC evolved to |C + β or |C − β in the previous round of phase estimation. A similar analysis applies for the APE of the eigenvalue ofŜ p . In the simulations presented in the main text, the initial GKP state is approximately the eigenstate of the stabilizers with eigenvalues u, v = 0. Furthermore, only one round of phase estimation is carried out. Therefore to maximize ∂P φ (+|u)/∂φ we choose φ = π/2.

K. Holevo phase variance in the presence of single-photon loss in the PCC
In this case the reduced density matrix of the storageρ m s is obtained at time T = √ π/(gβ √ 2) by numerically solving the master equation in Eq. (24) (i.e., without performing any rotations and measurements of the PCC). The variance is evaluated as V m p,q = s −2 p,q − 1, with s p,q = Tr[Ŝ p,qρ m s ]. Note that the variance evaluated this way is equivalent to throwing away the measurement result. Since the measurement results are discarded, no information about the storage cavity is obtained and the Holevo phase variance remains the same as that of the initial state V 0 q,p .

L. One round of APE with a qubit
One round of phase estimation forŜ p with an ideal two-level system is simulated using the master equation, Firstly, simulations are performed with γ = 0. The density matrix for the system is obtained at time T ideal = √ π/(g q β). After this, the qubit is rotated around the X-axis by φ = π/2, which is followed by projective measurement of the qubit along the Z-axis. The reduced density matrix for the storage cavity,ρ s,± is obtained, from which the Holevo variances V ideal q,p are evaluated. Next simulations are performed with γ = 0. In this case, the reduced density matrix of the storage is obtained at time T ideal (i.e., without performing any measurements on the ideal qubit). In this case, the variance is evaluated as V m,ideal p,q = s −2 p,q − 1, with s p,q = Tr[Ŝ p,qρs ].
Unless θ = nπ, the resulting states lie out side the C subspace. If the single photon loss takes place in the beginning of the protocol, (i.e., θ = 0) then the readout merely gives an incorrect measurement result. This can be recovered while repeating the entire protocol a few times and taking a majority vote over the outcomes. If θ = π, i.e., the photon loss takes place at the end of the protocol, then we recover the correct state. This is trivial because at the end of the protocol the two states are aligned along the X axis and are invariant under the single-photon loss channel. On the other hand, if the photon loss happens at t j = 0, π/2K then we end up in a state outside the C [10]. The next step of Qswitching and homodyne measurement will reveal if this error happened, in the event of which, the PCC can be reinitialized. Moreover, the re-initialization step can also be supplemented with the quantum-Zeno effect of the two-photon loss channel described in section VII.E. In the presence of the two-photon pump, the two-photon (or single-photon) loss channel will "refocus" any excitations in C ⊥ to the cat manifold.