New class of quantum error-correcting codes for a bosonic mode

We construct a new class of quantum error-correcting codes for a bosonic mode which are advantageous for applications in quantum memories, communication, and scalable computation. These 'binomial quantum codes' are formed from a finite superposition of Fock states weighted with binomial coefficients. The binomial codes can exactly correct errors that are polynomial up to a specific degree in bosonic creation and annihilation operators, including amplitude damping and displacement noise as well as boson addition and dephasing errors. For realistic continuous-time dissipative evolution, the codes can perform approximate quantum error correction to any given order in the timestep between error detection measurements. We present an explicit approximate quantum error recovery operation based on projective measurements and unitary operations. The binomial codes are tailored for detecting boson loss and gain errors by means of measurements of the generalized number parity. We discuss optimization of the binomial codes and demonstrate that by relaxing the parity structure, codes with even lower unrecoverable error rates can be achieved. The binomial codes are related to existing two-mode bosonic codes but offer the advantage of requiring only a single bosonic mode to correct amplitude damping as well as the ability to correct other errors. Our codes are similar in spirit to 'cat codes' based on superpositions of the coherent states, but offer several advantages such as smaller mean number, exact rather than approximate orthonormality of the code words, and an explicit unitary operation for repumping energy into the bosonic mode. The binomial quantum codes are realizable with current superconducting circuit technology and they should prove useful in other quantum technologies, including bosonic quantum memories, photonic quantum communication, and optical-to-microwave up- and down-conversion.

We construct a new class of quantum error-correcting codes for a bosonic mode which are advantageous for applications in quantum memories, communication, and scalable computation. These 'binomial quantum codes' are formed from a finite superposition of Fock states weighted with binomial coefficients. The binomial codes can exactly correct errors that are polynomial up to a specific degree in bosonic creation and annihilation operators, including amplitude damping and displacement noise as well as boson addition and dephasing errors. For realistic continuous-time dissipative evolution, the codes can perform approximate quantum error correction to any given order in the timestep between error detection measurements. We present an explicit approximate quantum error recovery operation based on projective measurements and unitary operations. The binomial codes are tailored for detecting boson loss and gain errors by means of measurements of the generalized number parity. We discuss optimization of the binomial codes and demonstrate that by relaxing the parity structure, codes with even lower unrecoverable error rates can be achieved. The binomial codes are related to existing two-mode bosonic codes but offer the advantage of requiring only a single bosonic mode to correct amplitude damping as well as the ability to correct other errors. Our codes are similar in spirit to 'cat codes' based on superpositions of the coherent states, but offer several advantages such as smaller mean boson number, exact rather than approximate orthonormality of the code words, and an explicit unitary operation for repumping energy into the bosonic mode. The binomial quantum codes are realizable with current superconducting circuit technology and they should prove useful in other quantum technologies, including bosonic quantum memories, photonic quantum communication, and optical-to-microwave up-and down-conversion. Continuous variable quantum information processing using bosonic modes [1][2][3][4][5][6][7][8] offers an attractive alternative to two-level qubits. In practice, hybrid systems containing fixed qubits, photons trapped in resonators, as well as flying photon qubits will likely be essential to realistic architectures for quantum computation and communication [9][10][11]. There is lively current interest in novel schemes for robustly encoding quantum information in bosonic modes [12][13][14][15][16][17][18][19][20][21][22]. In particular, early work by Chuang et al. [12] developed two-mode bosonic codes which can protect quantum information against amplitude damping of the bosonic field. This paper presents a new class of codes that are similar but have two distinct advantages: they require only a single bosonic mode (not two with identical decay rates), and they can correct other errors, e.g., dephasing in addition to amplitude damping. Our codes are also similar in spirit to the 'cat codes' [16][17][18][19] and indeed asymptotically approach them in certain parameter limits. However our codes require a smaller mean boson number to achieve a given fidelity, and are defined in a finite Hilbert space, making explicit construction of the required unitary operations more straightforward.
Besides extending the lifetimes of bosonic qubits or quantum memories, we describe how such codes could be useful in increasing the fidelity of quantum communication and remote entanglement between hardware modules through photon 'pitch and catch' protocols [23][24][25] as well as in improving the fidelity of communication based on reversible microwave to optical state conversion [26]. In general, a bosonic mode can refer to an electromagnetic, magnetic or mechanical mode. However, the most likely implementations in the short term are photonic, so throughout this paper we will use term photon than the more general boson, for simplicity. These codes are of general interest for quantum information processing but we will place particular emphasis on the possibility of realizing them and the Chuang et al. code [12] using superconducting qubits dispersively coupled to microwave resonators. Given the remarkable experimental progress in circuit QED in the last decade [9,10], such codes are ideally suited for this architecture and should be feasible with current technology.
Superconducting qubit phase coherence times have risen some five orders of magnitude and can now reach ∼ 100 µs in 3D cavity geometries [27,28] and up to ∼ 40 µs in planar geometries [29][30][31]. Superconducting microwave resonators are simpler than Josephson junction based qubits and can readily be constructed to have lifetimes even longer than the best qubits [10,[32][33][34][35]. It is therefore interesting to consider the possibility of using microwave resonators as qubits or as quantum memories. Experimental capabilities to arbitrarily control the quantum state of a hybrid cavity-qubit system are now so advanced [36][37][38][39][40][41][42][43][44] that it is time to take the next step and develop optimal quantum error correction codes that further extend the arXiv:1602.00008v3 [quant-ph] 18 Jul 2016 lifetimes of photonic quantum bits and memories.
Because a resonator mode is a simple harmonic oscillator with equidistant level spacing, the only quantum states that can be accessed via classical linear drives are simple coherent states. To create more useful quantum superpositions of photon Fock states which can store quantum information, it is necessary to couple the bosonic mode to a non-linear element, e.g., a superconducting qubit [41,42], a trapped ion [45][46][47][48] or a Rydberg atom [32,33]. Experiments have demonstrated coherent mapping of a superconducting qubit state onto the corresponding coherent superposition of 0 and 1 photons in a resonator [36] and the creation of more complex superpositions [37]. Later experiments with superconducting qubits and cavities demonstrated the ability to transfer the qubit state into the cavity for a period ∼ 750 µs much longer than the qubit lifetime and then return it to the qubit prior to verification via process tomography [35]. Remarkably, it is also now possible to make quantum non-demolition measurements of photon number parity [39] which can be used to greatly simplify the measurement of Wigner functions [32,38,39]. Such parity measurements are utilized as the error syndrome measurement in cat codes [17,18,39] and will be used in some of the codes presented here. More generally, by employing optimal control pulses [49,50] for engineering the driving terms of both a harmonic oscillator and a coupled non-linear element, one can realize arbitrary unitary operations for the full system with high experimental fidelity [41][42][43][44]. The practicality of the codes presented here relies on recent experimental progress in realizing this arbitrary unitary control.
Rudimentary quantum error correction (QEC) protocols have been successfully carried out in ion traps [45,47,48], with nuclear magnetic resonance [51][52][53], with nitrogen-vacancy centers in diamond [54,55], Rydberg atoms [33] and superconducting qubits [56][57][58][59]. However, it is difficult to reach the 'break-even point', where the coherence time of the logical qubit exceeds the lifetime of the constituent physical qubits. This has recently been achieved in cavity photonic logical qubits [44] against photon loss errors and in nitrogen-vacancy centers in diamond [60] against dephasing errors. For qubit-based technologies, reaching break-even is challenging because it takes N = 5 physical qubits for the smallest possible code [61][62][63][64], N = 7 qubits for the Steane code [65], and N = 9 qubits for the Shor code [66]. If the errors are uncorrelated single-qubit errors, the bare error rate is N times faster than for a single qubit. Thus the quantum error correction protocol must overcome this factor of N in order to reach break-even. If the errors are highly correlated, e.g. in the case of uniform magnetic field fluctuations in an ion trap, there may exist a decoherence-free-subspace encoding which will be advantageous [47,64,[67][68][69]. To date there is no evidence that correlated errors are a significant problem for well-shielded superconducting qubits.
Another potential advantage of resonators is that the error model appears to be very simple. The dominant source of decoherence is the energy loss of the cavity as it slowly emits photons into its output and input ports. The cavity energy ring-down rate κ is the analog of 1/T 1 for a qubit. To date, there is no evidence of dephasing errors associated with frequency fluctuations of 3D metallic superconducting cavities though dephasing has been seen in coplanar waveguide resonators by the Zmuidzinas group [70] and attributed to two-level systems in the dielectric substrate. However dispersive coupling of a qubit to a resonator will introduce random fluctuations of the cavity frequency associated with T 1 state change events in the qubit [35]. Additionally, there can be, for example, energy leakage from the driven ancillary qubit to the resonator that can be result in photon gain errors. We will focus on correcting cavity photon loss errors but the constructed codes can be protected also against dephasing and photon gain errors as well.
The paper is organized as follows. In Sec I, we introduce quantum error correction against discrete photon loss, photon gain and dephasing errors through simple bosonic single-mode codes. These are generalized to binomial quantum codes in Sec. II. Next we consider realistic continuous-time dissipative evolution under these errors. Since the continuous-time evolution introduces an infinite set of errors even during a finite timestep, exact quantum error correction is impossible. In Sec. III, we prove our main result-the binomial quantum codes can perform approximate quantum error correction to any given order in timestep for realistic continuous-time dissipative evolution. We introduce an explicit and experimentally relevant recovery process. In the remainder of the paper, we analyze the performance of the codes, present comparisons to related pre-existing codes, and discuss applications in quantum communication and as logical qubits, respectively in Secs. IV-VII. Further improvements and overall discussion of the binomial codes are presented in Sec. VIII before the summary and conclusion of Sec. IX.

I. QUANTUM ERROR CORRECTION AGAINST PHOTON LOSS, GAIN AND DEPHASING ERRORS
The generic task of quantum error correction is to find two logical code words-a qubit-embedded in a large Hilbert space. The code words are required to be robust such that if any one of the single, independent errorŝ E k ∈Ē occurs, no quantum information is lost and any quantum superposition of the logical code words can be faithfully recovered. This is equivalent to finding two logical code words |W σ , where σ = ↑, ↓, that satisfy the quantum error correction criteria [64,71], known also as the Knill-Laflamme conditions [62,72], for allÊ ,k ∈Ē such that α k are entries of a Hermitian matrix and independent of the logical words. The independence of entries α k from the logical code words and the structure of the non-diagonal entries guarantee that the different errors are distinguishable and correctable. We consider a damped harmonic oscillator suffering from photon losses. Our intention is to design logical code words, which are embedded in the Hilbert space of the harmonic oscillator and protected up to L photon loss events occurring in the time interval δt between two consecutive quantum correction stages. The set of discrete errors isĒ L = Î ,â,â 2 , . . .â L [73]. We will see that satisfying the conditions (1) for these errors is sufficient to produce a code that is systematically correctable up to a given order in κδt under the full amplitude damping operators. Here our primary focus will be on photon loss errors. Later we will discuss correcting photon gainâ † and dephasing errorsn.
Suppose we restrict our attention to the lowest 2 M Fock states of a single mode of a resonator. This Hilbert space is the same size as that for M qubits and if one had complete control over it, one could imagine having a kind of hardware shortcut in which a single resonator mode replaces a complex of M physical qubits to form one or more logical qubits [10]. Notice that increasing the size of the Hilbert space does not increase the number of error channels or the minimal number of error syndromes. Consider the following simple encoding of M qubits into the state of the resonator. The 2 M Fock states cover photon numbers 0, 1, . . . , (2 M − 1). Let photon Fock state |n be represented by is the binary representation of the number n. The jth binary digit represents the eigenvalue (1 +σ z j )/2 for the corresponding 'physical qubit.' This appears to be a very simple and satisfactory encoding but consider what happens when the n = 8 state (say) loses a single photonâ |1000 = √ 8 |0111 . What seems to be a simple error model in terms of photon loss actually becomes a model with correlated multi-qubit errors. Hence typical quantum error correction schemes based on models of independent single qubit errors cannot be easily transferred to this problem [63,64]. Because the mean photon loss rate κ â †â scales exponentially with M , we will focus here on representing a single logical qubit using a small number of states in the cavity to permit error correction.
An example of a code protecting againstĒ 1 = Î ,â is A photon loss error brings the logical code words to a subspace with odd photon numbers that is clearly disjoint from the even-parity subspace of the logical code words. Therefore, the off-diagonal parts of the quantum error correction matrix (1) α are identically zero. The remaining diagonal part of α requires that the mean photon number is identical for both of the states, herē n = W σ |n|W σ = 2. This means that the probability of a photon jump to occur (or not to occur) is the same for both of the states, implying that the quantum state is not deformed under an error. Explicitly, if a quantum state and |Ē 1 ↓ = |1 denote the error words. The quantum information (the complex coefficients u and v) is not deformed.
In the optical regime, the photon loss error can be detected by an external photodetector. This is not yet practical in the microwave regime, but fortunately we have the capability of very high fidelity quantum non-demolition measurements of the photon number parity [39]. The original state is recovered by a unitary operationÛ 1 that performs the state transfer |Ē 1 σ ↔ |W σ ; see Appendix A for details. Correcting a non-unitary error with a unitary operation works only because it is conditioned on the detection outcome of the particular error. Notice that the code (2) is similar to a code developed in Ref. [12] by Chuang et al. for a multi-mode system. Our code has the important advantages of requiring only a single bosonic mode and having rate for uncorrectable errors that is smaller by a factor of three (see Sec. V).
Generalizations of the code (2) are possible, for example In addition to the logical words having the same mean photon number, the error words |Ē 1 √ 2 also have the same mean photon number. Thus the code can tolerate another photon loss error and the protected error set isĒ 2 = Î ,â,â 2 . The photon loss errors are detected by measuring photon number mod 3; see Appendix A. The error recovery procedure is similar to that above: an error detection is followed by a unitary operation performing a state transfer |W σ ↔ |Ē k σ . The error correction matrix α for the code (3) is diagonal because of the sufficiently large spacing of the occupied Fock states in the logical words such that photon loss errorsâ , ≤ 2, cannot lead to overlap of the error words.
Frequency fluctuations of the cavity (i.e. noise ξ(t) coupling to the photon number, ξ(t)n, for example by transitions of a dispersively coupled ancilla qubit [35]) cause dephasing of the quantum memory. In the limit of fast Markovian noise, the effect of fluctuations is well approximated by a Lindblad dissipator with a jump operator √ γn, where γ is the dephasing rate. Even in the case of non-Markovian noise, the errors take the form U (δt) = exp(−i δt 0 ξ(τ )dτn). For small enough timesteps δt this error can be expanded as superposition ofn k operators. Thus in both cases protection can be achieved by considering the operatorn and its higher powers. In what follows we will refer to these operators as dephasing errors.
Due to the spacing of the Fock states and the properties of bosonic operators, the code (3) protects also against a dephasing errorn, thus the full error set is E 2 = Î ,â,â 2 ,n . Since the dephasing error does not change the photon number, it leads to an error state |ψ n =n |ψ / ψ|n 2 |ψ , which is a superposition of the original words and the error words related to the dephasing |Ē n ↑ = ( The only way to detect the dephasing error is to make projective measurements into the logical word basisP W = σ |W σ W σ | and if the answer is negative and no photon loss errors were detected, the original state is recovered by making a unitary operation performing a state transfer |Ē n σ ↔ |W σ . Remarkably such complex operations applied to a cavity-ancilla qubit systems are now technically feasible [41][42][43][44]. The code (3) can instead be chosen to be protected against errorsĒ 2 = Î ,â,â † ,n since a photon gain error and two-photon loss errors have the same change in the photon number mod 3 and the logical code words already obey the quantum error correction condition for the photon gain error: W σ |ââ † |W σ = (n + 1)δ σσ . As a special case, one can choose to protect only againstĒ 1 = Î ,â,n achieved by the same Fock state coefficients as with the code (3) but with spacing of the code (2): The relationship between the codes (3) and (5) arises from a general structure, which we exploit in the next section.

II. BINOMIAL QUANTUM CODES
We now generalize the above codes to protect against the error set, E = Î ,â,â 2 , . . . ,â L ,â † , . . . , (â † ) G ,n,n 2 , . . . ,n D , (6) which includes up to L photon losses, up to G photon gain errors, and up to D dephasing events. We have found a simple class of codes which can correct such an error set, where the spacing is S = L + G, maximum order N = max {L, G, 2D} and the range of the index p is from 0 to N + 1. The two-parameter (N, S) code space is shown in Fig. 1. Because the Fock state coefficients involve binomial coefficients we refer to this class as the binomial codes.
The spacing between the occupied Fock states is S + 1 such that the correctable L photon loss and G gain errors can be uniquely distinguished by measuring photon number modulo S + 1, which we call 'generalized parity' here. The quantum error correction conditions (1) require that W σ |(â † ) â |W σ , for all ≤ max{L, G}, is equal for the two logical code words. Satisfaction of Eq. (1) guarantees that the quantum state is not deformed under an error and implies as well an existence of a recovery process-the detectable errors can be recovered using unitary operations. By using commutation relations it is equivalent to require that W σ |n |W σ , for all ≤ max{L, G}, be equal for the two logical code words, just as the mean photon number of the logical code words (2) was required to be equal. A straightforward way of seeing that expectation values for moments of the photon number are equal is to recall the binomial formula and consider the difference The derivative on the last line preserves at least one (1+x) in each of the terms of the above polynomial such that ∆ = 0 for all ≤ N = max{L, G}; see Appendix B. It should be noted that the coefficients of the Fock states in the code words (7) are independent of the spacing S + 1. The spacing between occupied Fock states enables the detection of photon loss errors. The values of the Fock state coefficients are determined by balancing the moments of the photon number distribution so that the rate of errors is the same for all logical states. The basis of the two logical code words can be generalized to d logical code words, a so-called 'qudit', by utilizing extended binomial coefficients N +1 p d [74,75] (defined in Appendix C; these are also called polynomial coefficients [76]), where i = 0, 1, . . . , d−1 and p m = (d−1)(N +1). By using a similar argument as with the binomial qubit codes in Eq. (8), one can show that the photon number moments are equal for all of the d code words; see details in Appendix C. In what follows we, for simplicity, concentrate on the binomial qubit codes but all the results can be extended to the binomial qudit codes as well. For measuring photon number mod S + 1 the mode needs to be coupled to an ancillary system, either a superconducting qubit [41,42], a trapped ion [45][46][47][48] or a Rydberg atom [32,33]. With superconducting circuits, the parity could be measured by utilizing the strong dispersive coupling between the cavity and the ancillary qubit and by using number selective coherent drives similar to the demonstrated quantum non-demolition parity measurement [38,39,41,42]; see Appendix A. Encoding the different outcomes of a multi-valued measurement, such as S ≥ 2, in the higher excited states of the ancillary  (7). The largest blue circle denotes the code (2) protected against a photon loss error L = 1, the blue square is the code (3) protected againstĒ2 = {Î,â,â 2 ,n} orĒ 2 = {Î,â,â † ,n}, and the green diamond denotes the code (5) protected againstĒ 1 = {Î,â,n}. The parameter S = L + G sets the total number of detectable photon loss L and gain G errors. The parameter N sets the maximum order the code is protected against photon loss, gain and dephasing errors N = max {L, G, 2D}. The codes denoted with blue have protection against photon loss and gain errors set by S = L + G and in addition they are protected against dephasing up tô n max{L,G}/2 . The codes denote with red allow in addition heralding of S − 2N uncorrectable photon loss or gain errors. The codes denoted with green are protected against a total of S photon loss and gain errors, as well as against up ton N/2 dephasing errors. In the limit N → ∞ the binomial codes asymptotically approach the 2(L + 1)-legged cat codes [17][18][19] protected against L photon loss errors.
qubit would allow single-shot measurements. An alternative is to do S sequential measurements with a two-level qubit.
Dephasing errors result in mutually non-orthogonal error states: for them the quantum error correction matrix is non-diagonal but Hermitian. For that reason, to detect and recover those errors one needs to make projective measurements in an orthonormalized basis, as with the code (3). After a detection of an error, the original state is recovered by a unitary operation performing a state transfer between the subspaces of the error and logical code words.

A. Errors correctable by binomial codes
The binomial code coefficients were derived using the requirement to be able to correct the photon loss or gain errors. Considering only photon loss errors, the parameter L + 1 can be interpreted as the distance of the binomial quantum codes since it is the minimum number ofâ operators needed for mixing the two code words. Inclusion of dephasing errors makes the quantum error correction matrix (1) non-diagonal, but it automatically follows from the binomial coefficients that dephasing errors up to order max{L, G}/2 are also corrected by these codes. The highest degree of dephasing protectionn D does not need to be limited to the value set by the photon loss/gain protection. By increasing the length N of the binomial code words, D can be increased without a limit. This gives the maximum order as N = max{L, G, 2D}. Note also that since the binomial codes are protected against any one of the errors from the error set (6), they are also protected against any errors that are superpositions of these. Such errors include, for instance, displacement 'unitary' errorsD for small unknown β. More precisely, a binomial code with given values of N , L and G satisfies: where |n + − n − | ≤ G + L with n + , n − ≥ 0 and the α n+ are constants. In particular, if the condition is satisfied for some values of n + and n − , it is satisfied for all smaller values. This property means, for example, that the code can correct all errors of the form if all nonzero ξ (i) When choosing a code, the minimum value of N is determined by the term with the largest total number ofâ andâ † operators. The parameter L (G) is given by the error term that causes the largest overall decrease (increase) in excitation number. For example, to correctÂ =â † +n 2 requires G ≥ 1 from the first term, N ≥ 2 from the second term and L ≥ 0 as there are no number-decreasing terms.

III. APPROXIMATE QUANTUM ERROR CORRECTION UNDER CONTINUOUS-TIME DISSIPATIVE EVOLUTION
Up to now we have assumed that the cavity is subject to a finite set of discrete errors. In fact, the cavity evolves continuously in time. For example, the standard Lindblad time evolution of a density matrixρ of a cavity coupled to a zero-temperature bath with a cavity energy decay rate κ (represented in the frame rotating at the cavity frequency) is In a finite time interval δt, continuous-time evolution results in an infinite set of possible errors. Exact quantum error correction of the full set of errors is not possible.
However, the probabilities of the errors scale with powers of κδt and we can choose to correct only the most important errors in κδt. Formally, we will exploit the notion and theory of approximate quantum error correction [21,[77][78][79][80][81][82][83][84]. We expand each error operator in powers of κδt and choose to correct up to a given highest order. It is then enough to satisfy the quantum error correction criteria (1) only approximately such that the original state can be recovered with an accuracy given by the same highest order in κδt.
Initially, we consider only photon loss errors due to cavity damping and extend the discussion for photon gain and dephasing processes later. One can 'unravel' the Lindblad equation (13) for photon loss errors by considering the conditional quantum evolution of the system based on the measurement record of a photomultiplier that clicks whenever a photon leaks out of the cavity. In this quantum trajectory picture [85], one views the first term in Eq. (13) representing the photon loss jump of the system when the detector clicksρ →âρâ † . This is not normalized because it includes the fact that the click probability is proportional to Tr(âρâ † ) =n. The last two terms inside the brackets represent time evolution of the system under the non-Hermitian HamiltonianV / = −i κ 2â †â when no photons are detected. We have previously omitted this no-jump evolution for simplicity, but will now examine this crucial part of the physical error process.
Much like a Feynman path integral, we can express the evolution of the density matrix from time 0 to δt in terms of a sum over all possible trajectories with photon loss jumps occurring at all possible times during the finite time interval δt. We express this time evolution as a completely positive and trace preserving (CPTP) process whereÊ are Kraus operators encapsulating the time evolution generated by exactly photon losses and the no-jump evolution. Remarkably, by integrating over all the possible jump times of exactly photon jumps during the time interval δt, we can derive an exact analytic expression forÊ [12,86,87], See Appendix D for more details of the derivation. An important feature of the damped simple harmonic oscillator is that the precise timing of the the photon jumps plays no role. This can also be seen in the interchangeability of the order of the operators in Eq. The measurement backaction of observing no photon jumps is non-trivial. It reduces the relative probability of the higher occupied Fock states with respect to the lower ones, formally expressed with the factor exp − 1 2n κδt in the error operators (15). Others have addressed this by constructing multimode codes [12,21,89,90]. These codes avoid no-jump evolution by combining two or more physical elements with identical decay rates and constructing the logical code words such that they are superpositions of states with the same combined total excitation number. They are essentially entangled versions of the codes (2)-(5); see Sec. V.
One of our key results is that certain single-mode codes, such as the binomial codes (7), can correct the no-jump evolution to the same accuracy as photon loss errors. We illustrate this first to accuracy O(κδt) before giving a general description to an arbitrary accuracy in powers of κδt.

A. Approximate quantum error correction to first order in κδt
Let us consider the code (2). When no photon loss is detected, the quantum state |ψ = u |W ↑ + v |W ↓ transforms under the no-jump evolution given byÊ 0 = exp − 1 2 κδtn . Code (2) is protected against a photon loss error occurring with a probability to first order in κδt: Thus, it is reasonable to consider the no-jump evolution to the same accuracy. Taking into accountÊ 0 and the normalization in the denominator of |ψ 0 =Ê 0 |ψ / ψ|Ê † 0Ê 0 |ψ 1/2 to first order in κδt, we obtain Here |E 0 ↑ = (|0 − |4 )/ √ 2 is the error word associated with the no-jump evolution. Notice that the logical code word |W ↓ = |2 is unaffected by the no-jump evolution as its excitation number is equal to the mean photon number.
The no-jump error causes deterministic evolution inside the subspace {|W ↑ , |E 0 ↑ } which can be inverted to the desired accuracy by applying a unitary operator, Here,Û res is an arbitrary unitary operator on the subspace complementary to the logical and error subspaces in order to completeÛ 0 to a unitary operator in the entire Hilbert space. It can be taken to be the identity of the complementary subspace. By combining detection-correction of both the errors, the total recovery process is R = {R 0 ,R 1 }. The Kraus operators arê R k =Û kΠk mod 2 , whereΠ k mod 2 is a projection into the photon number subspace k mod 2 and the correction unitaryÛ 1 is introduced in the text after Eq.
(2). The recovery processes results in the original state to first order in κδt as desired: Here we have first ignored all the partsÊ ≥2 of the error process whose effect is O[(κδt) 2 ]. On the next line we use the knowledge that the initial state has even parity and the photon loss error processÊ shifts photon number by , Alternatively the recovery can be done by a measurement projecting to the subspace of logical code words [91] If the measurement projects out of the code space, then it is interpreted as the occurrence of a photon loss error and it is corrected with the unitaryÛ 1 performing the state transfer from the error subspace of a photon loss to the logical code words. If the measurement projects into the code space, the state underwent no-jump evolution of Eq. (16) and has been projected back to its original form by the measurement backactionP W . With a probability scaling with (κδt) 2 the state |E 0 ↑ , belonging to the compliment of the logical subspace, is interpreted as a photon loss error. However, this causes no interference with the approximate recovery process as it occurs with a probability beyond the accuracy limit of the code. Recovery by measurement is reminiscent of the quantum Zeno effect: if the time evolution of a quantum state is linear (or faster) in δt, it can be slowed to order δt 2 by frequent measurements projecting to the non-evolved basis [85]. The no-jump evolution scales linearly in κδt and therefore can be corrected by frequent projective measurements. Although the recovery process R m is conceptually simpler, sophisticated measurements such asP W are presumably harder to realize at high fidelity than parity measurements [39] (at least with the current technological capabilities).

B. Approximate quantum error correction to Lth order in κδt
Here, we construct an explicit recovery process in terms of projective measurements and unitary operations, which generalizes the above discussion to multiple photon losses and shows that the binomial codes can protect against the continuous-time dissipative evolution of Eqs. (14)(15) to an accuracy of (κδt) L . Let us take the binomial code words |W σ protected against L photon loss errors, and choose G = 0 and S = L in Eq. (7). Here we show that they are protected against the no-jump evolution to the desired accuracy as well. Our derivation is similar to Ref. [21]. However we arrive at a result that is not obvious from Ref. [21] since we exploit the explicit structure of the error operatorsÊ (15).
The Kraus operatorsÊ >L can be ignored as they have an effect of O[(κδt) L+1 ]. We also ignore the parts of the remaining Kraus operators that are irrelevant to the desired accuracy and split the rest into two parts for convenience,Ê for 0 < ≤ L. We denoteB as the important leadingorder part andĈ the relevant sub-leading part, where for clarity we have separated the common photon loss term. The pure no-jump evolution is handled differently [81] and we writeÊ 0 The termÊ µ, denotes the µth entry of the expansion of (1 − e −κδt ) / ! exp(−κδtn/2) in powers of (κδt) 1 2 . They are polynomials ofn with highest degree ≤ µ/2.
With these preliminaries, the resulting error process is Here we see that the partB ρB † needs to be corrected exactly since it always has an effect larger than O[(κδt) L+1 ]. It is not necessary to correct exactly the entire interference partB ρC † since its contribution is partly beyond the accuracy limit. Hence, one can ignore the negligible O[(κδt) L+1 ] part of the interference terms and verify only that the effect of the remaining important part is independent of the logical code words. Together, if the error operatorsB andĈ for all 0 ≤ ≤ L satisfy the two following conditions, the original state can be recovered to an accuracy of (κδt) L . The first condition guarantees that the errorsB k can be recovered exactly, see Eq.
(1). The second condition shows that the effect of the interference is tolerable. BothB † B andB † Ĉ up to accuracy of (κδt) L can be written as a polynomial ofn with the highest degree of L. The binomial code words protected against L photon losses have equal expectation value ofn , for all ≤ L and for both of the code words, which implies that the conditions (22) are satisfied for them. Now we show that the recovery process R = {R 0 ,R 1 , . . . ,R L } with the Kraus operatorsR k = U kΠk mod L+1 results in the original state to the desired accuracy. The photon number modulo L + 1 is measured and the measurement result k has a backaction in the form of the projectionΠ k mod L+1 . For k = 0, the error words are |B k . Conditioned on the measurement outcome, one applies a correction unitaryÛ k performing a state transfer between the logical code words and the error words |B k σ , AgainÛ k is completed to a unitary operator in the entire Hilbert space byÛ res which is an arbitrary unitary operator on the subspace complementary to the logical and error subspaces (and different for each k). For k = 0, the error word needs to be orthogonalized with respect to (24) These unitary operationsÛ k correct both the photon lossâ k and the no-jump evolution by the rest ofB k in Eq. (20a). As in the L = 1 case, the errorÊ shifts the photon number by and the initial state has a known generalized parity meaning thatR Finally, we arrive at the approximate quantum error correction recovery process with accuracy O[(κδt) L ]: We have used the form (21) of the error process, the conditions (22) and the form of the correction unitaries (23)- (24). The last summation is the resolution of the identity, ∞ =0Ê † Ê =Î, by using Eq. (19) and ignoring terms that are O[(κδt) L+1 ]. The residual error terms in Eq. (25) depend on the binomial code parameters S and N . We analyze the effects of this dependence on the codes' performance in Sec. IV.
In summary, we have shown that the single-mode codes protected against L photon loss errors are approximate quantum error correction codes protected against the continuous-time dissipative photon loss channel to an accuracy of (κδt) L . Physically, if observation of photon loss errors up to a maximum of L times yields no information on population and relative phases between the logical code words, then also the observation of no-jump errors ≤ L times yields no information and the measurement backaction does not deform the encoded quantum information of the state. This is one of our main results as it gives an explicit construction recipe for approximate error correction codes to arbitrary order in κδt for a damped bosonic mode.
As discussed in Sec. II, the binomial codes may also be used to protect against more complicated error operators, such asn. An analysis of the code parameters required to achieve such protection in the case of dissipative Lindblad time evolution under these errors is given in Appendix E. As in the case of dephasing errors in Sec. I, the recovery process for more general errors will be more complicated than that for photon losses alone.

IV. BINOMIAL CODE PERFORMANCE
Ignoring possible experimental infidelities of the recovery process, the performance of a binomial code is defined by the rate of uncorrectable errors. When including several error channels, that is photon loss, photon gain and dephasing errors with rates κ, κ + and γ, the exact expression for the dominant uncorrectable error depends on the relative ratio of these rates. For simplicity, here we consider just a single error channel, the photon loss channel.
Let us consider the binomial code words with S = N = L and study first the mean photon numbern = 1 2 (L + 1) 2 . It scales quadratically with the number of protected photon loss errors L. This implies faster decay of the code words of higher-order protection and that to achieve the advantage of higher-order protection, the timestep δt must be made appropriately smaller. More precisely, the rate of uncorrectable errors is dominated by the leading uncorrectable photon loss error rate, that is, the rate of losing L + 1 photons during the timestep δt:  (7) with S = N = L = 1 (black), 2 (gray), 3 (brown), 4 (red) and 5 (orange). Here we have assumed a perfectly faithful recovery process. The dashed line shows the performance of the naive encoding L = 0, |W i ↑/↓ = |0/1 , whose rate of entanglement infidelity at small δt approaches κ/2 corresponding to the rate of a photon loss withn = 1/2. Entanglement infidelity [92] is calcu- Wσ| is the fully mixed state of the logical code words. The entanglement infidelity for a fully mixed state is equal to the process infidelity 1 − χII of a quantum memory. For an ideal quantum memory χII = 1 and the full quantum process is just an identity operation [64]. At small timestep δt, the slopes of Fe/δt agree well with the slopes for the rate of the leading uncorrectable error PL+1/δt. The binomial code with L = 1 outperforms the naive encoding for timesteps δt 0.4κ −1 and the codes with L > 1 become favorable when δt 0.2κ −1 .
This scaling result implies that for a fixed timestep δt there exists an optimal binomial code with finite L that minimizes the uncorrectable error rate among different binomial codes. In Fig. 2 we have demonstrated the performance of the binomial codes for S = N = L = 0, . . . , 5 via the rate of the entanglement infidelity which, in the absence of infidelities in the recovery process and at small timesteps δt, is well approximated by the leading uncorrectable error rate. As is clearly visible in Fig. 2, for a given δt there exists an optimal code and larger codes are preferable for smaller timesteps.
An experimental infidelity η related to a single recovery stage increases the error rates by η/δt favoring low-order binomial codes with longer optimal timesteps; see Appendix F. The optimality of a code depends also on the detailed structure of the experimental recovery process since some of the infidelities can be correctable errors suppressed by the next round of the recovery process. In addition, parity measurements often have higher fidelity [39] than the unitary operations. The overall fidelity of the error recovery could be improved by making several measurements and using Bayesian estimation to increase the confidence of the error detection step [93].
If a self-Kerr non-linearity term ∝n 2 is present in the cavity Hamiltonian, then it no longer commutes with the dissipative evolution. Such terms are difficult to avoid, either as a result of intrinsic higher-order behavior of the resonator, or due to hybridization with other non-linear degrees of freedom, such as superconducting qubits. During timesteps with only no-jump evolution, a non-linearity just introduces an additional unitary evolution that can be taken into account by defining a frame of rotating code words. In this frame the Fock state coefficients in Eq. (7) acquire time-dependent complex phase factors but still obey the quantum error correction conditions (1). Another possibility is to apply a gate that inverts the unitary evolution as recently demonstrated experimentally with superconducting qubit-cavity technology [42].
During timesteps with photon jumps, the noncommutation of the Hamiltonian andâ means precise timing of the photon jumps matters. Different Fock states acquire different, jump-time-dependent phase factors. After averaging over possible jump times, this generates additional dephasing errors, of size ∝ δt. However, the probability of a timestep with a photon jump is only ∼ κδt. As a result, the net effect is ∼ δt 2 , which is higher order than the corresponding photon loss error. Thus, as long as the non-linearity is not much larger than κ, it does not break the approximate quantum error correction arguments of Sec. III. Furthermore, the binomial codes can protect against additional dephasing errors by increasing the parameter N in Eq. (7). The cost of the higher degree of protection is an increase in the error probabilities, which can be compensated by decreasing the error correction timestep correspondingly, cf. Fig. 2. The Kerr effect becomes a limiting factor for codes with large number variance (n −n) 2 .n only describes the 'mean field' Stark shift, which does not contribute to the dephasing of Fock states relative to each other.

A. Two-mode codes
As we have discussed above, even in the event of no photons being lost, the Kraus operatorÊ 0 = exp(− 1 2n κδt) has a non-trivial effect on the single-mode code words, and so must be corrected. This can be avoided if the words are superpositions of states with the same excitation number by combining multiple physical elements [12,89,90]. In particular, some of the multimode bosonic codes in Ref. [12] have the same structure as the binomial singlemode codes presented here, but are entangled across multiple photon modes, p even/odd c p |p(S + 1), N tot − p(S + 1) , (27) where N tot = (N + 1)(S + 1) is the excitation number, /2 N and |n, m is a state with n photons in one mode and m in the other. This code consists of two copies of the one-mode binomial code of Eq. (7) with the words entangled between the two modes.
Let us consider the simplest example, two-mode version of the single-mode code of Eq. (2), Assuming identical photon decay rates κ for both modes, the Kraus evolution operator in the absence of photon losses from either mode isÊ 00 = exp(− 1 2 (n 1 +n 2 )κδt), so thatÊ 00 |W σ = exp(−2κδt) |W σ and the code words are unchanged. The correctable errors are still single photon losses, which can occur from either of the two modes, giving rise to different error words: where |E i1 σ is the error word after a photon loss from mode i. A parity measurement on each mode can distinguish from which mode the photon was lost, and so be used to determine whether to correct the error words |E 11 σ or |E 21 σ . The unitary operations required for error correction are swaps |E i1 σ ↔ |W σ , that is unitary operationŝ whereÛ res denotes an arbitrary unitary operation that completesÛ i1 to a unitary operation in the entire Hilbert space. These are similar to the one-mode corrections, except that they involve creating states that are entangled between the two modes. This is realizable using an experimental setup where one can generate entanglement between the modes and has sufficient separate unitary control on the individual modes. However, they are likely to have lower fidelity than the equivalent onemode operations. See Appendix G for a specific hardware proposal where two cavities (or cavity modes) are dispersively coupled to a common transmon qubit witĥ jâ jσz , whereâ j is the annihilation operator for the jth mode. If the dispersive couplings are fine-tuned to be equal χ 1 = χ 2 , then the codes of Eq. (27) form a decoherence-free-subspace [67,68] with respect to qubit excitation induced dephasing errors exp(−χ(n 1 +n 2 )τ ) where τ is unknown. In practice high-precision fine-tuning of χ j is hard to achieve and one needs to correct dephasing errors with higher-order codes similar to the single-mode binomial codes.
As in the single-mode code, the fidelity of the error correction is determined by the rate of uncorrectable errors [77] and for small κδt this is dominated by twophoton losses. There are three paths for two-photon loss from the states of the two-mode code, Eq. (28), compared to one path for the one-mode code, Eq. (2). Assuming equal κ, the rate of two-photon losses via each path is the same, so the rate of uncorrectable errors for the twomode code is three times larger than the one-mode code. Which code is preferable will depend on the fidelity of the no-jump correction for the one-mode code, as the need for this operation is eliminated in the two-mode case. More generally, for unequal κ, there will be a no-jump evolution of the form exp(− 1 2 (κ 1n1 +κ 2n2 )δt) which one would have to deal with using a similar no-jump correction procedure as described for the binomial codes.

B. Cat codes
The binomial codes are similar to existing cat codes [16][17][18][19]. Cat codes are also approximate quantum error correction codes for a damped bosonic mode and consist of superpositions of well-separated coherent states, "legs", evenly distributed in a circle in phase space. Cat codes with 2(L+1) legs protect against L photon losses, and are related to the binomial codes with spacing S = L. In both cases, the diagnosis of errors is performed by measuring the photon number modulo S + 1. The four-legged cat code [18] protects against single photon losses, and so is similar to the class of binomial codes with L = 1, of which the simplest case is Eq. (2). The two logical cat code words are superpositions of coherent states |±β and |±iβ , The normalization factors Z ↑/↓ become equal as |β| → ∞. In this limit, the cat codes satisfy C β ↓ |n p |C β ↓ = C β ↑ |n p |C β ↑ for all p, so that in the notation of Eq. (7) cat codes have N → ∞, giving potential protection against dephasing errors to unlimited order, see Fig. 1. The difference in normalization constants for different cat states means that the approximate quantum error correction conditions Eq. (22) are not exactly satisfied for generic values of |β| 2 : where the second approximation neglects terms O(e −2|β| 2 ). Similar expressions, with different trigonometric functions, can be found for the higher order Kraus operators. When the right hand side of Eq. (32) is nonzero, the cat code is subject to uncorrectable errors O(κδt), which are suppressed by increasing the separation parameter β, at the cost of increasing the average photon number and hence the error rate. Notice in comparison that the binomial codes with S = 1 exactly suppress all photon loss errors to first order in κδt.
The Fock state distributions of the binomial and cat codes are binomial and Poissonian, respectively. As the average number of photons is increased (larger N ), both of these distributions approach a normal distribution, and so the binomial and cat codes asymptotically approach each other. Similarly, the qudit binomial codes approach qudit cat encoding [19] since the extended binomial coefficients also approach the normal distribution [75].
By construction, a photon jump event transforms one cat state into another cat state. To the order that the approximate quantum error conditions (22) are satisfied, the quantum information is preserved and, as long as photon jumps are detected and recorded, there is no further correction needed. Since no-jump evolution damps coherent states, e −κδtn |β = |e −κδt β e −κδtn |β = |e −κδt β , the only necessary correction is a "re-pumping" of the cat states. This can be achieved using a discrete unitary correction operation (analogous to the binomial codes) or continuous non-linear amplification coming from an engineered reservoir [17,18] (analogous to similar passive/autonomous error correction schemes [94,95]). The basic principle of passive schemces is stabilization of a manifold of codewords as an attractive (stable) fixed-point of drives and dissipation so that the only remaining task is to track generalized parity for photon jumps [18]. The cat codes based on equal amplitude coherent state superpositions, cf. Eq. (31), are 'natural' candidates for these purposes since they require only gradual continuous inversion of the damping of the coherent state amplitude without active discrete correction stages. The two-leg cat has already been stabilized by reservoir engineering to achieve dominant two-photon drive and two-photon dissipation [96].
The single-mode binomial codes require an explicit correction gate at every timestep whether or not a photon jump has occurred. However, binomial codes satisfy the approximate quantum error correction conditions to order δt with a smaller average photon number:n = 2 for the code of Eq. (2), rather thann ≈ 2.3 for the cat code that minimizes Eq. (32). Furthermore, the binomial codes operate in a restricted Hilbert space, which could be beneficial for the practical construction of the unitary operators required for error diagnosis and recovery. This particularly applies to errors involvingâ † operators, whose operation on cat codes is less straightforward thanâ operators alone.

C. Permutation-invariant codes
The definition of our codes, Eq. (7) has the same structure as the permutation-invariant codes, defined for M qubits [83,84]: where the Dicke state |D M n is symmetric superposition of all permutations of n up spins and M − n down spins, e.g. |D 3 1 ∝ |100 + |010 + |001 in the notation of Sec. I. Note that the similarity in structure is the same only for qubit code words; the qudit extension of the permutationinvariant codes [84] is different from ours.
Although the definition of these codes in terms of excitation number take the same form, the physical and mathematical distinctions between the single mode bosonic oscillator and the many-qubit system distinguishes the goals and behavior of the two codes. The connection with the bosonic system can be identified by taking the M → ∞ limit of permutation invariant codes. Then, by the Holstein-Primakoff transformation [97], the collective "giant-spin" subspace of Dicke states with total spin M/2 → ∞ becomes equivalent to a bosonic system. Using this mapping, we can identify several important differences between the bosonic and qubit code constructions. First, while in the spin system it is important to consider errors acting on the individual qubits [83], the errors in the bosonic system map to only the giant-spin operators, symmetric superpositions across all the qubit operators, e.g.
whereσ − i is the spin lowering operator for the ith spin. In addition to the restriction to symmetric errors, the physical asymmetry between bosonic errors, e.g.â and a † makes it reasonable to consider a smaller set of errors, e.g.Ē = Î ,â , than the qubit case, where being able to correct any qubit error, i.e. E = Î q ,σ − ,σ + ,σ z , is more natural. Finally, taking the M → ∞ limit significantly simplifies the action of the error operators: The suppression of the n 2 term in the large M limit significantly simplifies the satisfaction of the QEC conditions. As a result, the bosonic system has considerable additional flexibility in the construction of QEC codes, with concomitant performance gains. For example, for finite M there is no equivalent of our smallest code, Eq.
(2) in the permutation invariant codes. In general, the average excitation number in a code that corrects L excitation losses scales as L 2 /2 for bosonic binomial codes compared with 3L 2 /2 in the permutation-invariant codes [83].

D. GKP codes
While all codes discussed so far are defined using a discrete (i.e., countable) basis, the Gottesman, Kitaev, and Preskill (GKP) codes [13] are defined using the continuous basis of non-normalizable eigenstates of the position operatorx. A unique resulting feature of GKP codes is that the correctable errors themselves form a continuous set. The simplest ideal qubit GKP words are whereD is the displacement operator from Eq. (10) and |x = 0 is the starting position eigenstate. In position space, such states are infinite combs of position eigenstates spaced 2 √ π apart, so the effective spacing between the two logical states is S = √ π. The same result holds in momentum (p) space via Fourier transform of Eq. (36). Naturally, all position and momentum shifts e −iup e ivx with |u|, |v| ≤ √ π/2 are correctable. However, the GKP codes can also correct any error operators expandable in the basis of correctable shifts. Careful expansion of photon lossâ and other errors [20] has confirmed that GKP codes can in principle (i.e., for small enough κδt) correct photon loss, gain, and dephasing errors.
The ideal GKP code words (36) contain both an infinite number of photons and states which are perfectly squeezed in thex quadrature. To make the codes experimentally realizable, the superposition in Eq. (10) has to be filtered (to keep the photon number finite) and a distribution of states has to be substituted for the sharp |x = 0 state (to account for imperfect squeezing). In the traditional form of the approximate codes, a p-dependent Gaussian filter is put into the sum in Eq. (36) and a Gaussian wavepacket is substituted for |x = 0 . However, the choice of filter and starting state can be arbitrary. There are a handful of theoretical proposals [98][99][100] (see also Ref. [101] for an error analysis of GKP states), including one based on a clever use of phase estimation [20], to realize such approximate GKP states. GKP states are also useful in designing highly precise gates for other quantum computing architectures [102].
The approximate code words are not perfectly orthogonal, so one must take into account the error coming from the non-orthogonality. Since the ideal GKP states have infinite photon number, the approximate GKP states must contain a sufficiently high number of photons in order to manage such imperfections. An optimistic [20] estimate for this photon number isn = 4, which uses the traditional form of the approximate code words and bounds the error probability coming from the non-orthogonality at about 1% (Eq. (38) of Ref. [13]). Using the same approximate code words, a photon number of 2 implies a 9% error bound. As a result, the traditional form of the approximate code words is expected to contain more photons than, e.g., the smallest (n = 2) binomial code (2). However, the GKP code words can protect against a larger set of errors than the minimal binomial code. Due to the various choices of starting state and filter as well as due to the difficulty of comparing continuous correctable error sets to discrete ones, a detailed comparison of the relative capabilities of the GKP and binomial/cat classes of codes remains to be done.

VI. APPLICATIONS IN QUANTUM COMMUNICATION
Aside from improving lifetimes of quantum memories and quantum bits, bosonic mode quantum error correction is also useful for quantum teleportation [103,104] and quantum communication, which consists of quantum state transfer and generation of high-fidelity entangled pairs of quantum bits between two distant nodes in a quantum network. We consider here a primitive task, namely the 'pitch-and-catch' scenario [24,25,105] for quantum state transfer which can be used for quantum repeaters [106,107]. The scenario consists of (see Fig. 3) initialization of qubit A into a superposition of the ground and excited state, encoding this superposition into the logical code words of the send cavity via a unitary swap operation, letting the cavity state leak in a time-reversal symmetric manner ('pitch') into a transmission line or to other kind of a flying oscillator mode such that the inverse process into the receiving cavity ('catch') is most efficient [105,108]. The transfer is finalized by decoding the received cavity state via a unitary swap operation to the qubit B. The full process corresponds to a quantum state transfer between the qubits through the modes. The remote physical qubits can be entangled by using the same protocol with the first swap operation being replaced with a CNOT-gate between the physical qubit A and the logical qubit of the cavity.
The overall process is vulnerable to various errors and infidelities at the different stages of the transfer process [109]. The most obvious imperfection is the attenuation of the state of the flying oscillator mode caused by the photon loss processes, similar to Eqs. (13)(14)(15), during the transmission. A crucial part of the 'pitch-and-catch' process is the engineering of the temporal and spatial mode of the flying oscillator [24,25,[110][111][112] so that the catch by the receiving cavity is as reflection less as possible, but this is unlikely to be perfect. The pitching process can also include a conversion from microwave to optical domain or between different microwave frequencies [26,113]. The fidelity of the conversion itself can be improved by using quantum error correction. In addition, there can be errors in the encoding and decoding processes between the qubits and cavities, as well the cavities and the flying oscillator mode can suffer the same loss processes we have already discussed for applications to quantum memories in Secs. I-III. If one uses the naive encoding |W i ↑/↓ , all these error sources lead to unfaithful quantum state transfer. When using the binomial code First, the state of the qubit A is encoded in the send cavity S using code words |W S ↑,↓ . The state in S is allowed to leak into the flying oscillator mode F ('pitch'). By controlling the cavity decay rate, one can precisely tune a time-reversal symmetric temporal mode such that the quantum information is fully absorbed in the receiving cavity R ('catch'). Before decoding the received cavity state to the qubit B, the fidelity of the transfer process can be improved by a round of QEC in the received cavity state.
words or other quantum codes [114] as the logical code words in the cavities and in the transmission, the fidelity can be increased by performing a recovery process on the received cavity state before decoding it to the receiving qubit B. This way one can improve the fidelity of the process by removing the effect of the correctable errors (6) from the full process. The performance of the different binomial codes can be estimated similarly as in Sec. IV and Fig. 2 but considering e.g. transmission infidelity instead of the photon loss probability κδt during a timestep.

VII. CONTROLLING A LOGICAL QUBIT IN A CAVITY
In addition to their use for quantum memories and communication, it would be beneficial if the encoded qubit state could be unitarily controlled to perform quantum computation. A naive way to realize single-qubit rotations would be to decode the cavity state back into an ancilla qubit, rotate the qubit and then re-encode the state into the cavity. This is not optimal since the decoherence rate of the ancilla is higher than that of the cavity [35,44].
Using optimal control pulses [43,44,49,50] it should be possible to directly realize an arbitrary unitary on the cavity while minimizing the effects of the short ancilla lifetime. For example, for the binomial code with S = N = 1 [see Eq.
(2)], the unitary corresponding to a Z gate On the last line we have explicitly written a particular choice of the action ofÛ res on the non-code-word state |E 0 ↑ .Û res completes the remainder of the unitary operation. The phase gate inherits the diagonal nature of the Z gate of Eq. (37): The structure of the X gate iŝ where the functional part is an addition of 2 mod 4 photons in the even photon number manifold of max 4 photons. The difficulty of achieving such unitaries is on the same scale as the gates needed to perform the encoding of the initial state. Consequently, the universal control of a binomial logical qubit is achieved with the same resources as the quantum error correction itself. Joint conditional and entangling operations on two logical qubits would additionally require an entangling gate between the logical qubits. In Appendix G, we analyze a hardware proposal where this would be possible. Progress is already underway in this direction with the recent experimental demonstration of 'a cat in two boxes' [43] which used complex entangling operations between two cavities.

VIII. DISCUSSION
So far we have considered code words constructed from Fock state superpositions with a definite generalized photon number parity, resulting in the code word spacing S. This spacing readily implies a diagonal quantum error correction matrix for photon loss and gain errors. By relaxing the parity structure we can find codes with even lower rates for uncorrectable and correctable errors. However, the recovery process for these optimized codes involves more complicated measurements whose experimental fidelity is expected to be lower than that of the relatively straightforward parity measurements. We have searched for optimized codes by minimizing the largest uncorrectable error rate, the rate P L+1 /δt of losing L + 1 photons. Using this method we have found analytic and numerical codes with reduced rates for correctable and uncorrectable errors, some of which we were then able to transcribe analytically. As with the binomial codes, these optimized codes are exactly protected against L photon losses, implying that they are approximate quantum error correction codes for the photon loss channel on accuracy of (κδt) L ; see Appendix H for details.
The recovery that is presented in Sec. III for the binomial codes is not the optimal recovery; it is merely an example of a recovery process to the desired accuracy. Adjustments of the recovery process cannot beat the overall accuracy limit set by the code itself, but the prefactors of the higher-order terms in the infidelity can be made considerably smaller. A simple way of making an improvement in the sub-leading terms of the infidelity is to add to the recovery operations a unitary 'echo' operationÛ x that performs state transfer |W ↑ ↔ |W ↓ :R =Û xR . The effect of this is a partial recovery of classical information from uncorrectable, higher order errors. In general, the optimal code can be found simultaneously improving both the code and the recovery processes-a procedure that may require numerical optimization [79,92].
The binomial and the optimized codes have several appealing features compared to the two-mode codes [12] and the cat codes [16][17][18][19] including smaller rates for correctable and uncorrectable errors, protection against photon gain and dephasing errors. It is noteworthy that our codes operate in a restricted Hilbert space and this may be a practical advantage in designing unitary controls (in contrast to, for instance, the cat codes made out of coherent states). To achieve the full performance advantage provided by the features of the binomial codes one needs to perform sophisticated high-fidelity unitary control at a high rate. Low-fidelity unitary control favors codes with less frequent measurements and unitary operations which favors cat codes and two-mode codes. The binomial and the optimized codes outperform the cat codes and two-mode codes when the performance benefit is larger than the difference in the total infidelity of the unitary control between the codes. Current superconducting technology [42][43][44] is on the verge of this transition.

IX. CONCLUSIONS
We have presented a new class of 'binomial' quantum error correction codes for a bosonic mode. By constructing an explicit recovery process, we demonstrated that the binomial codes are protected to given order in the timestep against continuous dissipative evolution under loss, gain and dephasing errors. Therefore, any errors which can be expanded in terms of the creation/destruction operators of the bosonic mode can be corrected to arbitrary order. The performance of the codes is characterized by the largest rate of uncorrectable errors (e.g., the rate of losing L + 1 photons for a code protecting against L photon losses). Ignoring the infidelity of the recovery process, our analysis showed that with timestep δt 0.4/κ, where κ is the photon loss rate, the naive encoding in Fock states |0 and |1 is outperformed by the smallest binomial code. For even smaller timesteps, higher-order binomial codes become preferable. Infidelities in the recovery process favor lower-order binomial codes.
The binomial code words consist of superpositions of equally spaced number eigenstates and are therefore eigenstates of a generalized parity. As a result, detection of loss and gain errors can be performed by measuring this generalized parity. More generally, the binomial codes, cat codes [16][17][18][19] and Gottesman-Kitaev-Preskill (GKP) codes [13], share this type of structure. Namely, the logical state pairs of all three codes can be thought of as interleaved combs of eigenstates of some operator (the photon number operator for binomial/cat codes and the oscillator position operator for GKP codes) whose coefficients are related to a distribution (the binomial, Poisson, and Gaussian in the case of the binomial, cat, and GKP codes, respectively). Comparison with GKP codes suggests that it would be useful to identify commuting operators (stabilizers) for detecting errors for the binomial codes [115]. We leave this for a future work.
The generalized parity structure is a rather strong restriction on the code words and we show in Appendix H that, for codes built out of number operator eigenstates, better ideal performance is achieved by relaxing this structure. In future work it would be very interesting to find more examples of such codes and understand the structure of these optimized bosonic codes. Taken together, we foresee that the binomial codes and their relatives will improve the fidelity of quantum memories, communication and scalable computation based on bosonic modes.
We summarize here the required conditional unitary control for the recovery of the binomial codes under the photon loss channel. As described in Sec. I-III, the binomial codes are tailored so that the photon loss errors are detected by measuring changes in the generalized photon number parity that serves as a proxy for the number of lost photons in a short timestep δt. With superconducting circuit QED technology the ability to straightforwardly measure photon number parity stems from the strong dispersive coupling of an ancillary qubit to the cavity H disp / = χσ zâ †â . In the strong-dispersive limit, where the strength of the dispersive coupling χ is greater than the decay rates of the qubit and the cavity, one can drive the qubit conditioned on given photon number states of the cavity [116,117]. This can be then used for photonnumber conditioned qubit operations, such as flipping the qubit state conditioned on the generalized photon paritŷ whereσ x is a Pauli matrix andÎ q the identity operator for the qubit. After this operationÛ k mod L+1 , the measurement of the qubit state realizes measurement of the generalized photon parity and projection of the cavity state byΠ k mod L+1 . Error detection is followed by a correction unitaryÛ k , Eqs. (23)(24), that performs a state transfer between the error words |B k σ and the logical code words |W σ . The exact form of the correction unitaryÛ k depends on the parameters of the binomial code, Eq. (20). In the strong dispersive limit, individual qubit and cavity drives are enough for implementing any unitary on the cavity [41][42][43][44], see also Appendix G. The unitary correction applied to the cavity state can be combined with the initial conditioned unitary (A1) (A2) which, followed by a qubit measurement, implements the Kraus operatorR k =Û kΠk mod L+1 of the recovery in Eq. (25). Repetition for all of the values of k realizes the full recovery process R = {Û kΠk mod L+1 }.

Appendix B: Moments ofn for the binomial codes
Here we show from Eq. (7) that the expectation value of certain moments of the photon number operatorn are identical for both code words |W ↑/↓ . In other words, we show that and for some real σ-independent α . The = 0 case conveniently takes care of orthonormality between the code words while the = 0 conditions guarantee that the the words can be corrected from various errors (up to the relevant order). In Appendix C, we extend the definition (7) to qudits and perform a similar proof for moments of the qudit code words.
To prove Eq. (B1), we show that the difference of the moments of |W ↑ and |W ↓ , is zero. Using definition (7), the difference between the even and odd populated words is For = 0, the sum is equivalent to a binomial expansion of (1 + x) N +1 with x = −1 (which is clearly zero). The nonzero case is equivalent to taking derivatives of the binomial expansion and multiplying by x (before substituting x = −1). This is because each action of the derivative brings down a power of p while multiplication by x brings x p−1 back to x p . In total, Each action of the derivative acting on (1 + x) N +1 subtracts one from the power N + 1. Since ≤ max{L, G}, the largest subtracted power is max{L, G}. However, since N = max{L, G, 2D} (where D accounts for dephasing errors and is not relevant here), there will always be a nonzero power of 1 + x after the action of the derivative. Therefore, the expression (B4) is a polynomial in x and 1+x containing only nonzero powers of 1+x. Substituting x = −1 into that polynomial yields ∆ = 0. An alternative basis for the binomial codes of Eq. (7) can be achieved by taking a normalized sum and difference of the code words |W σ , In this basis it is obvious that the moments ofn are equal since the number distributions are identical. What is not obvious is the fact that W ↑ |n | W ↓ = 0. The proof is similar to the equal moments in the above case.

Appendix C: Extended binomial qudit codes
We extend the above qubit states to the qudit case using extended binomial coefficients (see [74,75] and refs. therein; these are also called polynomial coefficients [76]). Letting d ≥ 1 be the dimension of the logical qudit space, we define extended binomial coefficients recursively, starting from the ordinary binomial coefficients. Defining These are the coefficients of powers of x in the expansion [76] 1 + x + ...
Notice that the largest power of x in such an expansion is (d − 1)n, which reduces to n for the well-known binomial case. The last ingredient necessary to generalize to qudits is the generalization of (1 + x) n | x=−1 = 0 used in the proof above. For this, we introduce the dth root of unity w ≡ exp(i 2π d ) and recall that adding all powers of w from zero to d − 1 gives zero. This reveals a set of identities useful in defining and proving the error correction properties of the qudit states: This sum is also zero for any nonzero power of w, i.e., w → w l for nonzero integer l. For the zeroth power, the sum gives d n .
We now generalize the binomial code words of Eq. (B5) to where the indices µ, ν ∈ {0, 1, . . . , d − 1} are from now on evaluated modulo d and d ≥ 2. Similar to the qubit case, S = L + G and N = max {L, G, 2D}. We call these codes 'extended binomial codes' as they are not to be confused with quantum polynomial codes [118].

Moments ofn for the extended binomial codes
Similar to the qubit case, it should be clear that the spacing S + 1 between the nonzero Fock state populations of | W µ guarantees that W µ | (â † ) â | W ν = 0 for all | − | < S + 1. Therefore, to satisfy the error correction criteria, we are once again left with determining the powers ofn which can be used to construct any diagonal (in Fock space) products of error operators. Here we show that where α are real and µ-independent. Using definition (C4), we notice that and the µ-dependence is immediately canceled. We now relate this sum to Eq. (C2). For = 0, the sum is equivalent to the expansion of (1 + x + ... + x d−1 ) N +1 with x = w ν . Equation (C3) reveals that this sum is zero unless ν = 0, proving that {| W µ } d µ=0 are orthogonal. For the ν = 0 case, w ν = 1 and Eq. (C2) yields d N +1 , proving that {| W µ } d µ=0 are properly normalized.
The nonzero case is equivalent to taking derivatives of the expansion (C2) and multiplying by x (before substituting x = w ν ). In total, (C7) Similar to the ordinary binomial case, each action of the derivative acting on (1 + x + . . . + x d−1 ) N +1 subtracts one from the power N + 1, but N is large enough so that there will always be a nonzero power of 1 + x + . . . + x d−1 remaining after the action of all derivatives. Therefore, each term in Eq. (C7) contains at least one nonzero power of 1 + x + . . . + x d−1 . Substituting x = w ν into each term yields zero unless ν = 0 and so Eq. (C5) holds.
The coefficients α of Eq. (C5) for the first few can be easily determined from this method [76]: The coefficient α 1 is the mean photon number of the code words, which we see scales linearly with the spacing S, the qudit dimension d, and the maximum number of correctable errors of one type, N .

Appendix D: Derivation of the Kraus operatorsÊ
Here, we derive the Kraus operator representation of the time evolution generated by the standard Lindblad master equation The zero-jump contribution consists of only the no-jump evolution under the non-Hermitian The single jump contributionρ 1 (t) consists of the no-jump evolution interrupted by a jump and averaged over all possible jump times, where κdτ is the probability for a jump during dτ . We have used the identity exp (κδtn)â exp (−κδtn) =â exp (−κδt) .
Similarly the double jump contribution iŝ and the general term for jumps iŝ where we gather the analytic expression for the Kraus operatorŝ Here γ = (1 − e −κt ) / ! is related to the probability of the processρ →Ê ρÊ . When considering a small time interval δt and expandingÊ to the lowest order in κδt, we see that roughly speaking a photon loss error occurs with a probability amplitude proportional to √ κδt. If this is a proper Kraus representation, it must obey the identity relation To see if this is the identity, we apply it to an arbitrary Fock state |m and recognize that the resulting binomial expansion yieldŝ Since this is true for every m, the identity relationΞ =Î is indeed satisfied. The Kraus operator expansion is not unique. This particular form organizes the errors according to how many photons are lost. Because of the no-jump evolution in between the jumps, the error operator for photon losses isÊ and not simplyâ .

Appendix E: Lindblad evolution correctable by binomial codes
Here we show how to find binomial codes that may be used to correct non-unitary Lindbladian evolution generated by operatorsÂ i of form occurring with respective error rates κ i . Some of this discussion is similar to that given for a different bosonic encoding in Ref. [20]. For a sufficiently small time interval δt, the errors introduced by the dissipative evolution, where D(ĉ)ρ =ĉρĉ † − 1 2 {ĉ †ĉ ,ρ}, can be expanded in the parameters i = κ i δt. For each operatorÂ i , we can specify that we wish to suppress all errors induced up to O( xi i ) where x i can be interpreted as the maximum number ofÂ i error events in the time interval δt.
The values of xi i may differ between A i and, in general, the time evolution involves mixtures of these operators. To represent the different combinations of i that occur as part of the correctable errors, we introduce the shorthand where y i are any integers satisfying: To achieve this accuracy, the code words must satisfy the QEC conditions under application of the time evolution Kraus operators E = {Ê k } to the appropriate order: [21] where i may be any of the expansion parameters. In general, it is not possible to obtain a closed form for the Kraus operators as in Appendix D. However, the evolution during a time interval δt can be unraveled into different quantum trajectories [85]. Then, for a given trajectory, the system dynamics consists of continuous no-jump evolution described by the operator: and a sequence of jumps taken from the set of operators √ κ iÂi .

Jumps alone
Without the no-jump evolution, the sum over trajectories would produce sums over all possible products of the jump operators √ κ iÂi , integrated over all possible jump times in the interval δt, to give Kraus operatorŝ Here, we only need to consider Kraus operators that are possible up to O( √ γ), as any terms that are higher order will produce errors that are beyond the desired accuracy. Putting these operators into the approximate QEC condition results in conditions of the form where the operator combinations in each square bracket can be any possible up to O( √ γ). By normal ordering, these conditions can be expressed as sums of terms like the left hand side of Eq. (11). The normal ordering procedure may produce operators that cannot be expressed as powers ofÂ i . However, following the discussion beneath Eq. (11), we only need to find a binomial code that satisfies Eq. (E7) for the terms with the worst-case (i.e. largest) values of either n + = n − or |n + − n − |. All other terms, including those that may be generated by normal ordering, then also satisfy Eq. (E7) as a result of Eq. (11). A binomial code that satisfies the worst-case instances of Eq. (E7) can be found by choosing one that can correct the highest order error operators: The combinationsÂ † iÂ j contain all the worst-case operators that appear in the conditions of Eq. (E7). We then find a binomial code that can correct this error following the rationale below Eq. (12).

Including no-jump evolution
Including the no-jump evolution introduces instances of the no-jump operator, Eq. (E5), between the individual jump operators to give the behavior between jump times. Since all these intervals are ∼ δt, the no-jump operator can be expanded in terms that are ∼ i , so that the Kraus operators becomê Since each instance ofÂ i orÂ † i still appears with a factor of √ i , the largest combined total ofâ andâ † operators appearing in theÊ k to O(γ) is unchanged by inclusion of the no-jump evolution, and so the appropriate N can be determined as in the previous section. However, since the no-jump evolution introduces instances of the operator conjugatesÂ † i into the Kraus operators, it can lead to new terms that change the number of excitations differently to evolution under jump events alone. This will alter the required values of L and G.
For example, consider the choice: where the error rate κ = /δt so that the desired order of correction is O( 2 ). In the presence of no-jump evolution, the set of Kraus operators includes: where we have omitted some terms that are O( ) or O( 2 ) because such terms will automatically satisfy the QEC conditions once we perform the analysis below. From the analysis of the previous subsection, we would consider onlyÂ 2 , and conclude that we should use a code with L + G = 4. However, putting the Kraus operators into Eq. (E4), we find: A binomial code satisfying Eq. (11) for such a term requires L + G = 5. The no-jump evolution introduces new terms in the expansion of the QEC conditions that must be included. As in the above example, the worst-case instances are introduced from terms of the form ( iÂ † iÂ i ) xi/2 . We can then include them with the worst-case error set of Eq. (E8): One can now find a binomial code that corrects these errors, and as a result the non-unitary evolution to the desired order, by expressing these operators in the form of Eq. (12) and satisfying the binomial code conditions for N , L and G.
We note that in many physical circumstances, either A † iÂ i = f (n), in which case the no-jump evolution does not change the number of excitations; or the error is Hermitian, in which case including no-jump evolution gives expressions that are the same as Eq. (E7). In these situations, only the error set of Eq. (E8) need be considered. For example, taking the operators from Eqs. (E9), we obtain for Eq. (E15): Using this error set results in the same conditions as found without the no-jump evolution, Eqs. (E9) and (E10) Appendix F: Performance of the binomial codes under an unfaithful recovery process In Sec. IV, we showed that the performance of a binomial code protected against L photon loss errors (7) is well captured by the largest rate of the unrecoverable errors, i.e., the rate of losing of L + 1 photons during a timestep δt, where for simplicity we have assumed that S = L. Practically, the recovery process is always associated with an infidelity related to unfaithful gates and imprecise measurements. The total error rate P T can be approximated by the sum of the largest unrecoverable error and the infidelity η of the recovery process: where N is the prefactor of the P L+1 scaling. The optimal timestep is δt opt = κ −1 η/N L L+2 1 L+1 which balances between minimizing the rate of unrecoverable errors and the infidelity of the recovery process itself. With this optimal timestep, the best performance of an unfaithfully recovered binomial code scales as function of η as The performance benefit of higher order codes is achieved only with small η.

Appendix G: Hardware proposal for the two-mode codes
The two-mode codes [12] or the universal control of two binomial logical qubits encoded in different individual modes could be realized using two separate modes in the same cavity or using a recently constructed system [43] of two cavities dispersively coupled to a common transmon qubit that is used to perform unitary operations on the combined cavity system (see also a related hardware proposal in Ref. [18]). Implementation requires the ability to perform the necessary measurement and error correction operations on the two cavity modes,â j , j = 1, 2. Here . Sketch of a two-cavity configuration with a dispersively coupled common transmon qubit [43], which is sufficient for realizing the two-mode codes. Each of the elements has a separate drive, denoted by εj and n, respectively. Alternatively, one could use two distinct modes of the same cavity.
we show that the single-qubit, two-cavity experimental configuration, Fig. 4, is in principle sufficient to realize universal control of the two modes.
The dispersive coupling Hamiltonian is of the form To establish universal control of the multimode system, it is sufficient to show that each mode can be universally controlled, and that it is possible to generate a beamsplitter interactionx jpk −x kpj (equivalent toâ jâ † k +â † jâ k ) between different modes j = k [119]. Using the identity Eq. (G1b), the cavity drives along with the dispersive interaction generate effective, qubit-dependent drives on an individual cavity: Choosing ε j to be real or imaginary results in effective operators ∝p jσz orx jσz . Combining these with pre-and post-rotations of the qubit yields, e.g.x jσy . Applying Eq. (G1b) again enables the construction of products of the mode operators [120], for example: Using Eq. (G1a) to sum Eqs. (G3a) and (G3b) with j = k gives a single-mode dispersive interaction, which in combination with external cavity drives is enough to produce single-mode universal control [41]. Superposing Eq. (G3c) with the same term with the opposite sign and j ↔ k produces the beamsplitter interactions that are sufficient to give universal control of the multimode system [119]. For practical applications, having additional, separately controlled, qubits inside each cavity may simplify the control pulses, but as this proof demonstrates, in principle they are not necessary.

Appendix H: Optimized bosonic codes
The performance of a binomial code protected against loss of L photons is dominated by the rate of losing L + 1 photons, that is, the largest rate of uncorrectable errors. As noted in Sec. IV, this rate scales quite unfavorably. This is the cost of the sparse and tidy structure of the binomial codes; the occupied Fock states of the code words have definite generalized photon number parity {|k | k = 0 mod L + 1}. It is expected that by relaxing this Fock state structure we can improve the intrinsic performance of the code and pay a price in fidelity of the recovery process as the error detection and recovery will need more sophisticated unitary control.
Here we follow the construction that we used for the binomial codes: we first find exact satisfaction of the quantum error correction criteria for the discrete photon loss errors ≤ L times and then demonstrate that we can find a recovery process for the continuous-time photon loss channel to accuracy (κδt) L . In practice, we find code words |W σ that simultaneously minimize the dominating term of the rate for losing L + 1 photons, whereρ c is the fully mixed state of the code words |W σ , and satisfy the constraints of the quantum error correction criteria (1) for the discrete error setĒ L = {Î,â,â 2 , . . . ,â L }, for allÊ ,k ∈Ē L such that α k are entries of a Hermitian matrix. Most of the solutions we have found to this optimization problem are numerical and the detailed exploration and classification of them is left as future work. For the simplest error setĒ 1 = {Î,â}, we have found an analytic code with remarkably low rate for the correctable error P 1 /κδt =n = ( √ 17 − 1)/2 ≈ 1.56 and rate for the uncorrectable errors P 2 /κδt = κδt(3 √ 17 − 7)/4 ≈ 1.34 κδt.
The comparison with values P bin 1 /κδt =n bin = 2 and P bin 2 /κδt = 2 κδt of the corresponding binomial code (2) shows a performance advantage both in the rate of correctable and uncorrectable errors. Due to the lack of definite parity structure with the codewords (H2), one has to use general projective measurements to detect loss of a photon instead of the straightforward parity measurements for the binomial codes (App. A). These general projections may be realizable using current superconducting circuit technology [41][42][43][44] but most likely with lower fidelity than parity measurements [39]. By extending this code to be protected against a photon gain error, E 1 = {Î,â,â † }, we get Here we observe an even more dramatic relative and absolute improvement in P 1 /κδt = ( √ 21 − 1)/2 ≈ 1.79 and P 2 /κδt = κδt(4 √ 21 − 9)/4 ≈ 2.33 κδt in comparison with the values P bin 1 /κδt = 3 and P bin 2 /κδt = 5.25 κδt of the corresponding binomial code |W ↑ = (|0 + |6 )/ √ 2 and |W ↓ = 3 .

Approximate quantum error correction under continuous-time dissipative evolution
Here, we construct a recovery operation for the optimized code (H2) that achieves an accuracy of O(κδt) in protecting against the photon loss channel that includes both the photon loss jump and no-jump errors, as we did for the binomial code in Sec. III A. The optimized code (H2) has a diagonal QEC matrix for the discrete errorsĒ 1 = {Î,â}. But for the errors (15) that include the no-jump evolution, E 1 = {Ê 0 ,Ê 1 }, there are non diagonal elements that do not identically vanish and violate the structure of the QEC matrix due to the mixing caused by the no-jump evolution: = −δ ↑↓ 2(κδt) Notice that the diagonal approximate quantum error correction criteria (22) was a result of the strict generalized parity structure of the binomial codes. Here we have deliberately broken this structure and may wonder whether the highest uncorrectable error for E 1 is of the order of (κδt) 2 or (κδt) 3 2 as there is a non-vanishing term (κδt) 3 2 W ↑ |nâ|W ↓ in the QEC matrix. The effect of them is most easily seen by explicitly going through the error and recovery processes. Remembering that a quantum state |ψ = u |W ↑ + v |W ↓ transforms to |ψ ≡Ê |ψ / ψ|Ê † Ê |ψ 1 2 under the action of a Kraus operatorÊ , the respective error states under no-jump evolution and a photon loss error are and respectively for the photon loss errors, where one notices that the error words overlap between the two errors |E 1 ↓ = |E 0 ↑ , captured by the non-vanishing non-diagonal term (κδt) 3 2 W ↑ |nâ|W ↓ . We adopt now the recovery process of Eq. (18). Because we cannot use parity to detect a photon loss error we replace it with a measurement that asks whether the system is in the subspace of words after a photon loss error {|E 1 σ }. This measurement performs the projectionP 1 = σ |E 1 σ E 1 σ |. The recovery process is R = {Û 0 (Î −P 1 ),Û 1P1 }, where the unitary oper-ationÛ 1 performs state transfer |W σ ↔ |E 1 σ and the unitary operationÛ 0 performs the state transfer |W ↓ ↔ |W ↓ + κδtγ 0 |E 0 ↓ similarly as with the code (2). Thus, we get the recovery processes where we have written the time evolution with the help of the probabilities of the Kraus operator Tr(Ê † 0Ê 0ρ ) = 1 −nκδt + O[(κδt) 2 ] and Tr(Ê † 1Ê 1ρ ) =nκδt + O[(κδt) 2 ] and the resulting states |ψ i ψ i | from Eq. (H5). From this expression we see that many terms that are first order in |ψ i , together with the corresponding probability, actually produce a higher order term. The second term in the second line comes from the overlap between the two errors, indicating a misidentification of the errors with a probability ∼ (κδt) 2 . The recovery process fails to order (κδt) 2 because part of the no-jump evolution is corrected as a photon loss error. However, this can be ignored as we are protecting to order κδt. Notice that the same result within the accuracy κδt can be also achieved by the recovery R m = {P W ,Û 1 (1 −P W )}. Here, the recovery error ∼ (κδt) 2 comes from incorrectly identifying part of the photon loss error.
For L = 1, the approximate QEC conditions of the continuous-time dissipative evolution under photon loss are equivalent to the QEC conditions of Eq. (1). Hence, the code of Eq. (H2) can correct the continuous-time error process to order κδt as was shown above. However in general, for L > 1, the optimized code words protecting against the continuous-time error process to order (κδt) L will be timestep dependent. The error operators can be written asÊ ∼â Ê 0 . Then by writing the optimized code words |W σ as |W σ =Ê −1 0 |W σ / √ Z σ we have effectively reduced the problem to finding code words |W σ that satisfy QEC conditions of Eq. (1) for the bare photon loss errorsĒ L = {Î,â,â 2 , . . . ,â L }. With the normalization factors Z = Z σ = W σ |E −2 0 |W σ , the operationÊ −1 0 / √ Z is unitary for the states |W σ to order (κδt) L as a consequence of QEC conditions. [2] S. Lloyd and J.-J. E. Slotine, Analog Quantum Error