Quantum computing with rotation-symmetric bosonic codes

,


INTRODUCTION
Encoding quantum information into bosonic systems [1][2][3] is an alternative to conventional error-correcting codes based on discrete two-(or few-) state systems.The infinite Hilbert space of a single bosonic mode provides a playground for redundant digital encodings that can be tailored to a specific task [4][5][6][7][8][9][10].A natural application is to use a bosonic code at the ground level in a concatenated error-correction scheme to suppress errors below the fault-tolerance threshold of a conventional qubit-based code [3,11], potentially reducing the total overhead.Decoders that exploit the continuousvariable nature of bosonic codes can improve the faulttolerance threshold [12][13][14] and reduce the number of physical qubits required [15].From a hardware perspective, well controlled, low loss bosonic modes occur in many quantum technology platforms, such as electromagnetic modes in optical cavities [16,17] and free space [18], superconducting circuits and microwave cavities [19][20][21][22][23], and motional modes in ion traps [24][25][26].
Gottesman, Kitaev, and Preskill (GKP) introduced a seminal scheme for quantum computing with bosonic codes, based on states with discrete translation symmetry in phase space [3].While GKP codewords were recently prepared and manipulated in the laboratory [26], experimental progress with other bosonic codes-especially the cat [2,5,27,28] and binomial code families [6]-is more advanced.In a breakthrough experiment, Ofek et al. [29] demonstrated enhancement in the lifetime of a cat-code qubit compared to an unencoded qubit using the same hardware-the so-called break-even point for error correction.This was the first error-correction scheme to * arne.grimsmo@sydney.edu.auachieve this milestone in an experiment.A similar experiment using binomial codes also came very close to break even [30].Initial steps towards fault-tolerant error correction with these codes have been made recently [31].
In this work we show how cat and binomial codes belong to a larger family of bosonic codes characterized by discrete rotation symmetry in phase space, in analogy to the discrete translation symmetry of GKP codes.Specifically, we consider codes where a single qubit is encoded into a subspace in which the discrete rotation operator ẐN = exp i π N n acts as logical Z, where n is the Fock-space number operator.We refer to these codes as bosonic rotation codes.The parameter N here quantifies the degree of discrete rotation symmetry for the code: It immediately follows that the operator RN = Ẑ2 N acts as the identity on the codespace, i.e., any state in the codespace is N -fold rotation symmetric in the sense that it is invariant under a rotation by 2π/N .
A consequence of N -fold rotation symmetry is that an encoded state |ψ N has support only on every N th Fock state, |ψ N = ∞ k=0 c kN |kN .The degree of rotation symmetry N thus quantifies the magnitude of a detectable shift in number and sets a code distance in Fock space.A complementary notion of distance for phasespace rotations, π/N , quantifies detectable rotation errors and reveals a trade-off between detectable numbershift and rotation errors.
A special subset of the bosonic rotation codes we introduce are number-phase codes, which are rotated superpositions of states with small phase uncertainty [32].We show that vanishing phase uncertainty is related to (approximate) number-translation symmetry.In the limit of vanishing phase uncertainty, the number-phase codes are analogous to ideal GKP codes, with number and phase playing dual roles in place of position and momentum.Interestingly, we show that cat codes, binomial codes, and the shift-resistant qudit codes introduced in Ref. [3] arXiv:1901.08071v3 [quant-ph] 6 Sep 2019 each approach this ideal limit of vanishing phase uncertainty as their average excitation number increases.
We present a scheme for universal quantum computation for number-phase codes, where the workhorse is an entangling controlled-rotation (crot) gate based on a cross-Kerr interaction (∼ n ⊗ n).A properly tuned crot serves as a logical controlled-Z, ĈZ = diag(1, 1, 1, −1), between two number-phase codes.Notably, codes with different degree of rotation symmetry and of different type (e.g.cat and binomial) can be fully entangled by the crot gate.Similarly, a self-Kerr interaction (∼ n2 ) can be used to enact the single-qubit phase gate Ŝ = diag (1, i).Augmented with preparation of dualbasis codewords |+ N and destructive measurements in the dual basis, all Clifford gates can be executed.Universality is achieved using injected magic states.The gates we introduce have favorable properties in terms of fault tolerance: Errors are amplified and spread in a very limited way, such that the "size" of an error after a gate is proportional to the "size" prior to the gate.
We also introduce a new error-correction scheme for the number-phase codes discussed above.The error correction is based on teleporting the encoded information into a new, fresh ancilla [33].A remarkable feature of this approach is that recovery operations can be tracked entirely in software.In essence, the need for potentially difficult and highly nonlinear operations to restore the codespace has been replaced by preparation of ancillae in logical basis states.
We perform a numerical study of error-correction performance in the presence of simultaneous loss and dephasing noise on encoded qubits, while assuming noiseless ancillae.A critical question for a bosonic errorcorrecting code is whether it performs better than the "trivial encoding"-a qubit encoded in Fock states |0 and |1 -under the same noise model.The point where the error-corrected qubit performs as well as the trivial encoding is referred to as the break-even point for error correction.For the studied noise model, we find that both cat and binomial codes go beyond break even by several orders of magnitude for degrees of rotation symmetry in the range N = 2-4, and dimensionless noise strength for simultaneous loss and dephasing in the range κt = 10 −3 -10 −2 .Remarkably, we also find that the teleportation-based error correction scheme we introduce performs nearly as well as the optimal recovery map found numerically, for noise-free ancillae and idealized measurements.
Finally, we outline a fault-tolerant and universal scheme based on concatenating number-phase codes with Bacon-Shor subsystem codes [34][35][36][37].The concatenation serves three purposes: To deal with errors in state preparation which are hard to check for, to suppress errors in noisy measurements by exploiting correlations across multiple measurement outcomes, and to further suppress the logical error rate by dealing with errors that are too large for the bosonic code to handle.Our specific example using a Bacon-Shor code illustrates the broader point that a fault-tolerant scheme should be tailored to strengths and weaknesses of the bosonic code at the ground level.
This paper is laid out as follows.In Sec.II we detail the structure of bosonic rotation codes and describe how to distinguish the codewords in the computational and dual bases using number and phase measurements, respectively.We introduce a measure of modular phase uncertainty that quantifies embedded phase-measurement error in a given bosonic rotation code.In Sec.III we define number-phase codes, a family of bosonic rotation codes with small modular phase uncertainty, and we give examples of number-phase codes, including cat and binomial codes.In Sec.IV we present a universal scheme for quantum computing with number-phase codes.In Sec.V we give a method to perform a modular excitation number measurement, n mod N , which can be used to detect number errors and to prepare bosonic rotation codewords.In Sec.VI we study in detail error propagation and show that the gates in our set map small errors to small errors and are in that sense fault tolerant.In Sec.VII we lay out a scheme for teleportation-based error correction that can be used for any number-phase code, and we numerically test the performance of our errorcorrection procedure for cat and binomial codes under simultaneous loss and dephasing.In Sec.VIII we outline a fault-tolerant scheme for quantum computing based on concatenation of number-phase codes and Bacon-Shor subsystem codes.Finally, in Sec.IX, we summarize our results and highlight open problems.

II. BOSONIC ROTATION CODES
Single-mode bosonic codes utilize the large Hilbert space of a bosonic mode to protect logical quantum information.There are countless ways to embed a qubit, with each encoding comprising a two-dimensional subspace spanned by states serving as the logical codewords, and the remaining Hilbert space providing the freedom to detect and correct errors.In many physical implementations, the dominant sources of noise are loss, gain, and dephasing.Various bosonic qubit encodings have been designed specifically to counteract these noise processes, notably cat [2,5,27,28] and binomial codes [6], which share the key property that the codewords exhibit discrete rotational symmetry.
We use discrete rotation symmetry to define a class of single-mode codes called bosonic rotation codes.First, we say that a code has discrete N -fold rotation symmetry if any state |ψ in the code subspace (codespace) is a +1 eigenstate of the discrete rotation operator 1RN = e i 2π N n, where n = â † â is the Fock-space number operator ([â, â † ] = 1).It follows that the square root of RN preserves the rotation symmetry and acts as a Hermitian operator that squares to the identity on the codespace.
We define an order-N bosonic rotation code, or rotation code for short, to be a code where the operator acts as logical Z.The choice of Z over X is just a convention, but we emphasize that a code where ẐN acts as a non-Pauli operator is not a rotation code according to our definition.An example of the latter is a squarelattice GKP code where Z2 acts as a logical Hadamard.This distinction is important when discussing "easy" and "hard" gates for different codes.We briefly comment on the rotation symmetry of GKP codes in Appendix C. The logical codewords for any order-N rotation code can be constructed from discrete rotated superpositions of a normalized primitive state |Θ .In fact, we have that two states |0 N,Θ and |1 N,Θ satisfy ẐN |j N,Θ = (−1) j |j N,Θ if and only if the two states can be written in the following form: where N i are normalization constants.There is a technical constraint on |Θ for the codewords to be nonzero, which we specify precisely in Sec.II A. When the rotated primitives appearing in Eq. ( 3 3) is reminiscent of GKP codes whose codewords are superpositions of translated squeezed states [3].However, due the natural 2π periodicity of rotations, only a finite number of superpositions are required, and the resulting codeword always remains physical.This is because the rotation operator in Eq. ( 2) conserves excitation number, unlike the displacement operator used to define the GKP codewords.In Sec.III, We make a tighter analogy between GKP codes and a subclass of rotation codes called number-phase codes.
A. Fock-space structure Discrete rotational symmetry enforces a spacing of the codewords in Fock space, which underpins the codes' robustness to loss and gain errors.This can be seen by acting the operator ẐN on an arbitrary state |ψ = n a n |n : ẐN |ψ = n e iπn/N a n |n .Clearly |ψ is a +1 eigenstate of ẐN if and only if a n = 0 for all n = 2kN for integer k.Similarly, |ψ is a −1 eigenstate if and only if a n = 0 for all n = (2k + 1)N .This leads to the following general form for any ±1 eigenstates of ẐN : The coefficients f kN in Eq. ( 4) are related to the Fock-state coefficients of the primitive |Θ = n c n |n in Eq. ( 3) as follows: The normalization factors introduced here are related to the normalization constants in Eq. ( 3) as There are no further restrictions on the coefficients f kN apart from normalization.
To explicitly connect the two representations of rotation-symmetric codewords, Eq. (3) and Eq. ( 4), we use the relation for a Kroenecker comb, δ n,kM for n = 0, 1, 2, . . ., (5) to construct a projector onto the set of Fock states |2kN + for k = 0, 1, 2 . . .: The factors e iπ /N with ∈ {0, 1, . . ., 2N − 1} are the complex 2N th roots of unity.Acting the projector on a primitive |Θ = n c n |n with at least one non-zero produces an (unnormalized) eigenstate of the operator ẐN with eigenvalue e iπ /N . 4t is now straightforward to see that Eq. (3) and Eq. ( 4) are equivalent, since we can write with With the help of Eq. ( 6) we recognize these as Eqs.(3a) and (3b).For the codewords to be well-defined it is now clear that the primitive must have support on at least one of the |2kN Fock states and one of the |(2k + 1)N Fock states.This is the only constraint on |Θ , and the orthogonality of the codewords is then easily seen from the fact that they have support on strictly different Fock states.
The dual-basis codewords, |± N , are constructed as usual via superpositions of the computational basis codewords, |± N = (|0 N ± |1 N )/ √ 2 leading to Fock space representations Both |± N have support on the full set of |kN Fock states.From Eqs. (4a) and (9a) it is clear that any logical |0 N state is also a logical |+ 2N for a code with twice the rotation symmetry, which is not necessarily the same code.In other words, for a given codeword |0 N,Θ defined by a primitive |Θ , we have that for some primitive |Θ .Whenever the codeword normalization constant in Eq. (3) satisfy N 0 = N 1 , the above holds with |Θ = |Θ .See Appendix A for further details.
While it is evident that ẐN |j N = (−1) j |j N for j = 0, 1, it is not generally possible to find a similarly simple operator that acts as a logical X within the codespace.In Sec.III we present a set of rotation codes whose logical X is approximately given by a number-translation operator.The absence of a simple logical X does fundamentally pose a problem for quantum computing, since universality can be achieved without this operator as shown in Sec.IV.
A useful quantity for comparing codes is the average excitation number of the code, ncode := 1 2 tr Πcode n , where Πcode : projector onto the codespace [40]. 5By construction the average excitation number is the same for each of the dual-basis codewords, and ncode = ± N |n|± N .Since the rotation operator commutes with the number operator, [ RN , n] = 0, rotations doe not increase the excitation number.The computational-basis codewords have different average excitation number due to different phases in the superpositions in Eq. ( 3), but it remains bounded.This is in contrast to translation-based GKP codes that suffer from the following: either the code states are unphysical as they have infinite excitations, or the discrete translational symmetry is spoiled by energy constraints.The 0N codes introduced previously are the order-N rotation codes with the lowest possible mean excitation number, n0N = N 2 .It is worth noting that the trivial encoding where a qubit is encoded in the two lowest Fock states, is a rotation code with N = 1.The trivial encoding serves as a useful benchmark against which other codes can be compared [29,30,40].

The phase and Fock grids
With a given primitive |Θ , the order of rotation symmetry N parameterizes a code both in phase space and in Fock space, via Eqs.( 3) and (4).From these two forms of the codewords, it is natural to define a number distance and rotational distance of a code as6 respectively.Number and phase-space rotation play dual roles: codes of increasing N are further separated in Fock space but more closely separated in terms of rotations.
For an order-N rotation code, we refer to the set of angles {md θ } for m = 0, 1, . . .2N − 1 as the phase grid and the set of Fock states {|kN } for k = 0, 1, . . .as the Fock grid.These are in analogy to the position-and momentumspace grids (or more general quadrature-grids) on which GKP codes are defined.They broadly characterize the types of error to which the code is naturally resilient.
A number-shift error smaller than d n (e.g.∼ âk or ∼ (â † ) k with k < N ) is detectable.For rotation errors the boundary between detectable and undetectable errors is not as sharp in general, but a good code should be able to detect a rotation which is small compared to d θ (e.g. e iθn with θ < d θ ).This basic idea is illustrated in Fig. 2.
We return to a more detailed discussion of "small" vs. "large" errors in Sec.VI.

B. Distinguishing the codewords
The structure of rotation codes in Fock space, Eq. ( 4), and in terms of rotations, Eq. ( 3), suggests a natural way to distinguish codewords in the computational and dual bases using number and phase measurements, respectively.Phase measurements play a crucial role in the quantum computing scheme introduced in Sec.IV.

Number measurement
The computational-basis codewords |0 N and |1 N can be distinguished (destructively) by measuring excitation number as seen clearly in Eq. (4).For an order N code, a number measurement returns an outcome kN for integer k, where even k corresponds to |0 N and odd k to |1 N .In the presence of errors such a measurement can still correctly identify the damaged codewords.For example, if we assume that upwards and downwards shifts in number (e.g.loss and gain) are equally likely, a simple decoder to identify the codeword from a number measurement outcome n is to round to the nearest kN and declare the outcome "0" if k is even and "1" if k is odd.In practice the noise model motivates the decoding scheme.Under pure loss, for example, the decoder should always round up to the nearest kN .

Phase measurement
An approach to distinguishing |± N,Θ with a natural robustness to rotation errors relies on phase estimation.In the absence of errors, the task can be formulated as follows: Given the codeword |+ N,Θ for a rotation code, we wish to determine θ in e iθn |+ N,Θ .If θ (mod 2π/N ) = 0 the state is |+ N,Θ while if θ (mod 2π/N ) = π/N , the state is |− N,Θ .In the presence of rotation errors, the phase estimation problem is generalized to estimating a continuous variable θ ∈ [0, 2π).A decoding procedure rounds θ to the nearest mπ/N .Then, if m is even declare the outcome "+," and if m is odd declare the outcome "−."This is exactly analogous to the excitation number decoding scheme described above.Again, the decoding scheme should in general be adapted to the system's noise model.
Holevo [32] and Helstrom [41] introduced an optimal measurement to distinguish states in the one-parameter family e iθn |ψ 0 for the situation where no prior information about θ is assumed (and for a specific class of "deviation functions" quantifying the deviation of the estimated value from the true value).The POVM elements of this measurement depend on a fiducial state |ψ 0 = n c n |n that defines the phase estimation problem.They can be written in the Fock basis (Theorem 4.4.1 in Ref. [32]), with completeness relation k f kN |kN .We refer to the set of POVMs in Eq. ( 14) as the canonical phase measurement.
For an order-N rotation code, the relation RN |+ N,Θ = |+ N,Θ implies that phase measurements only acquire information about the phase θ modulo 2π/N .To quantify the uncertainty in a phase estimation measurement where we only care about the modular phase, we slightly modify a phase-uncertainty measure introduced by Holevo [32].We adopt a measure of modular phase uncertainty by considering the 2π/N periodic random variable e iN θ under the probability distribution µ(θ) = tr M can (θ)|+ N,Θ + N,Θ | for θ.We can then define an uncertainty measure where e iN θ := 2π 0 e iN θ µ(θ)dθ is the mean modular phase, and ∆e iN θ := 2π 0 |e iN θ − e iN θ | 2 µ(θ)dθ.Even in the absence of loss of phase information due to external noise, the underlying primitive endows a code with some level of modular phase uncertainty.This can be found from Eq. (15) using the following form for the mean modular phase, where f kN are the Fock-grid coefficents of the code, Eq. ( 4), as before.Henceforth, we use ∆ N (θ) to quantify the embedded phase uncertainty in the codewords.This embedded uncertainty is in analogy to the embedded position/momentum errors in finitely squeezed GKP codewords [3,42].Note that, in general, the embedded phase uncertainty depends on the order of rotation symmetry.
In Sec.III we show that certain families of rotation codes have meaningful limits where ∆ N (θ) → 0, which is akin to the limit of infinite squeezing for ideal GKP codes.Note that because the canonical measurement Eq. ( 14) assumes no prior knowledge about θ, it might be suboptimal if such knowledge exists.If rotation errors are small, we expect that θ is close to one of the values mπ/N , and it might be possible to exploit this knowledge in a phase-estimation measurement.Moreover, since the measurement is defined with respect to the ideal, undamaged codeword |+ N,Θ , it might perform less than ideal in the presence of general noise that includes errors beyond pure rotation errors.For the numerical simulations of error correction circuits in Sec.VII B, we compare the canonical phase measurement to Pretty Good Measurements, as introduced in Ref. [43][44][45] (see also Appendix D), which explicitly takes information about the noise model into account.
When all γ n are real in Eq. ( 14), the measurement can be approximated using adaptive homodyne measurements [46] and has been the subject of much theoretical and experimental study [47][48][49][50][51][52][53].One can similarly define phase-uncertainty measures analogous to Eq. ( 15) for other phase-estimation schemes.As an example, heterodyne measurement also measures the phase, but at the cost of larger uncertainty.An ideal heterodyne measurement is described by measurement operators |α α|, |α a coherent state, with completeness relation d 2 α π |α α| = Î.The estimated phase for an outcome α is simply θ = arg(α).We can define a phase uncertainty ∆ het N (θ) for heterodyne measurement analogously to the canonical phase uncertainty defined above.A heterodyne measurement gives larger uncertainty in the estimated phase than the canonical phase measurement; however, heterodyne measurement is nevertheless a likely practical candidate for distinguishing the logical codewords of the numberphase codes introduced in the next section.
In general, the phase uncertainty in a measurement is a function of both the codewords and the choice of measurement scheme.As long as the phase fluctuations in the measurement results are small compared to the rotational distance d θ = π/N , the two codewords |± N,Θ can be distinguished faithfully.This idea is illustrated in Fig. 3.

FIG. 3.
Distinguishing the |±N codewords.By design |−N = e i π N n|+N , such that distinguishing the codewords can be viewed as a phase estimation problem.The phase precision, ∆N (θ), depends on the measurement scheme, with a canonical scheme given by the POVM in Eq. ( 14).(a) Measuring θ to distinguish the codewords for an N = 2 code (d θ = π/2).If the measurement result falls in a white wedge, we declare "+" and in a gray wedge, we declare "−".(b) The same procedure for a codeword that has undergone a rotation error, e iθ n|+N .For large rotations, θ ∼ d θ /2, the logical state will be misidentified.If the noise model is biased in such a way that clockwise rotations are more likely than counter clockwise (or vice versa), the decoder should be biased accordingly by rotating the white and gray wedges.

III. NUMBER-PHASE CODES
The embedded phase uncertainty in Eq. ( 15), ∆ N (θ), is minimized when the distribution of Fock-grid coefficients is completely flat, i.e., |f kN | = |f (k+1)N | for all k, such that | e iN φ | = 1 and ∆ N (θ) = 0, c.f. Eqs.(15) and (16).However, such a state is not normalizable, rendering this limit unphysical.Formally, we can consider families of physical codes that in some appropriate limit satisfy ∆ N (θ) → 0. As we will show, this is satisfied for a class of rotation codes very much analogous to GKP codes, with number and phase playing roles akin to position and momentum.Perhaps somewhat surprisingly, the previously studied cat and binomial codes both belong to this class. 7  7 We note that GKP codes defined for a quantum rotor, i.e., a particle moving on a circle described by angular position φ and angular momentum N , have been studied previously [3,54].However, the strictly non-negative spectrum of the number operator, n, implies that no unitary operator e i φ exists such that [n, e i φ] = e i φ [55].In this sense number and phase do not constitute a proper conjugate variable pair.See, e.g., Ref. [56] for a discussion on angle and phase operators in quantum mechanics, and Refs.[55,57] for a proposal to define unitary and hermitian phase operators as a limit of a sequence of regularized operators.

A. Ideal number-phase codes
In analogy with ideal GKP codes defined in terms of superpositions of position (or momentum) eigenstates, we define a family of order-N rotation codes as: where ∞ n=0 e inφ |n are known as phase states and are not normalizable [58,59].In the Fock basis, the codewords are simply |0 N ∝ k |2kN and |1 N ∝ k |(2k + 1)N .Note that we can write the POVM for the canonical phase measurement in Eq. ( 14) (for real coefficients γ n = 1) as M can (φ) = |φ φ|.Eq. ( 17) follows from Eq. ( 3) by replacing |Θ ∝ |φ = 0 .
Any state in the codespace spanned by Eq. ( 17) is, of course, a +1 eigenstate of RN .The codewords are also +1 eigenstates of a number-translation operator We have that RN ΣN = ΣN RN , and the operator satisfies XN ẐN = − ẐN XN , while both ẐN and XN commute with RN and ΣN .Finally, for the code Eq. ( 17), we have that XN |± N = ±|± N , and this operator thus acts as logical X.

B. Approximate number-phase codes
Ideal number-phase codes as defined in Eq. ( 17) are unphysical as they require infinite excitation number and are not normalizable.Nevertheless, certain families of rotation code approach ideal number-phase codes, in a sense to be defined below, in limits of large excitation number.
We first recognize that for any rotation code with positive, real Fock-grid coefficients {f kN } [ Eq. ( 4)], we have if and only if ∆ N (θ) → 0, where ∆ N (θ) and e iN θ are defined in Eqs. ( 15) and ( 16), respectively.It follows that the condition of vanishing phase uncertainty defines a family of codes that, in this limit, are stabilized by ΣN [Eq.( 18)] and for which XN [Eq.( 19)] acts as logical X.
Three codes-cat, binomial and Pegg-Barnett-whose phase uncertainty vanishes in an appropriate limit (see Appendix B for definitions and details of each code).The second and third columns give a primitive and the Fock-grid coefficients [Eq.( 4)] (for cat codes N * i is the normalization factor N * 0 for even k and N * 1 for odd k).The fourth column shows the limit where each code becomes the 0N encoding (which is the trivial encoding, Eq. ( 12), for N = 1), and the fifth gives the limit where ∆N (θ) → 0. The sixth column gives an asymptotic form of the Fock-grid coefficients, and the last column gives an asymptotic form for the mean modular phase.For each code the mean modular phase uncertainty approaches zero, ∆N (θ) → 0. The function ϑ3(r, τ ) is the Jacobi elliptic theta function of the third kind.
An interesting property of number-phase codes arises from the fact that in the limit of Eq. ( 20), the two codewords normalization constants are equal, N 0 = N 1 , in Eq. ( 3).It follows that the dual-basis codewords also become equal-weight superpositions of the primitive  15), for each family of N = 3 codes as ncode increases.For each code a proper asymptotic limit, given in Table I, yields no embedded phase uncertainty, ∆N (θ) → 0. In the opposite regime, ncode → 3 2 , all three codes limit to the 03 encoding.Note that N = 3 codes with ncode < 3  2 do not exist and that binomial and Pegg-Barnett codes are defined only at discrete excitation numbers; connecting lines are guides for the eye.
[see Eq. (A4)], A stronger number-phase duality is apparent for numberphase codes than for generic rotation codes: the dualbasis codewords, |± N , are separated from each other by exactly d θ = π/N in terms of phase-space rotations but have support on the same Fock states, c.f. Eq. ( 9).Conversely, the computational-basis codewords, |0 N /1 N are separated from each other by d n = N in Fock space but supported on the same set of phases {mπ/N }.
There are many examples of rotation codes that limit to ideal number-phase codes in the sense of Eq. (20).A straightforward example are codes constructed from normalized Pegg-Barnett phase states, |φ, s := [55,57,60], as the primitive |Θ .As the parameter that sets their truncation in Fock space becomes large, s → ∞, Pegg-Barnett codes approach ideal number-phase codes (up to normalization).With the constraint s = p × 2N for integer p ≥ 1, the Pegg-Barnett codes are identical to the shift-resistant qudit codes introduced in Ref. [3], embedded in the infinite Hilbert space of a bosonic mode. 8Further details about Pegg-Barnett codes can be found in Appendix B 3.
Perhaps more surprisingly, cat codes (Appendix B 1) and binomial codes (Appendix B 2) also satisfy Eq. ( 20) in the limit of large α and large truncation K, respectively.Table I summarizes the three examples of numberphase codes we discuss here.For these codes, the embedded phase uncertainty approaches zero when the relevant code parameter is large enough, as shown in Fig. 4 for N = 3 codes.
Colloquially, we refer to any family of rotation codes that satisfies ∆ N (θ) → 0 in an appropriate limit as a number-phase code.In practice, the specific form of the Fock-grid coefficients {f kN }, can make a significant difference in the embedded phase uncertainty for small to moderate excitation numbers.Phase measurements play a critical role in the quantum computing scheme of Sec.IV and the error-correction procedures of Sec.VII.As a consequence, although different number-phase codes behave identically for large excitation numbers, they can have different performance at experimentally relevant excitation numbers [40].This is apparent in Sec.VII B, where we compare the error-correction performance of cat and binomial codes.

IV. SYMMETRY AS A RESOURCE: QUANTUM COMPUTING WITH NUMBER-PHASE CODES
We introduce a quantum computing scheme based on three basic ingredients: Preparation of codewords in the state |+ N , a small number of unitary gates, and (destructive) measurement in the logical X basis.Our focus is on operations that are, in a certain sense, faulttolerant.For the unitary gates this means that the gates should not amplify errors too badly, a notion that is made precise later in Sec.VI, while for the measurement it means that the codewords |± N should be distinguishable in the presence of small errors.As already discussed in Sec.II B 2, the latter can be achieved with phase measurements, given that the codes have small inherent phase uncertainty.Vanishing phase uncertainty is equivalent to (approximate) translation symmetry in Fock space, as we showed in Sec.III, such that the existence of a robust X-basis measurement can be said to be a consequence of this number-translation symmetry.On the other hand, it turns out that the unitary gates we introduce only rely on rotation symmetry.We show that, given a supply of encoded basis states |+ N , these two symmetries imply the ability to enact any gate in the logical Clifford group, using physically reasonable operations that are fault-tolerant in the above sense.The situation can be compared to GKP codes, where (approximate) discrete quadrature translation symmetry leads to any logical Clifford being (approximately) implementable by a Gaussian operation [3].
As for the state preparation step, which is in general code dependent, flexible techniques have already been developed in various physical platforms, in particular in circuit QED [29,30] and ion-traps [61], that can be applied to prepare codewords for a wide range of codes.It is beyond the scope of the present work to discuss state preparation in detail, but we briefly comment on a few approaches in Sec.IV B. All of the known approaches are limited by noise in the preparation procedure, and one can not rule out codewords with large errors.The issue of faulty state preparation is postponed until Sec.VIII, and for the time being we simply assume that |+ N states can be prepared.
Due to the existence of a robust X-basis measurement, our main focus will be on approximate number-phase codes from here on.That said, the unitary gates introduced below apply to any rotation code, such that the scheme can be extended to any such code where a practical X-basis measurement can be found.

A. Universal operations for number-phase codes
The quantum computing scheme introduced in the following is based on the universal set where S is an encoded version of the phase gate Ŝ A remarkable feature of the following scheme is that the required unitary gates are agnostic to the specific details of the rotation code in question.The encoded { S, CZ }-gates depend only on the degree of rotation symmetry and consequently apply equally to all rotation codes.In particular, this allows entangling operations between different rotation codes, e.g., cat and binomial, and teleportation from one code to another.

Unitary gates
We have already shown that logical Z for an order-N rotation code can be implemented through a simple rotation ẐN = e iπ n/N .The next gate in our set is the following two-mode gate that implements a controlled rotation between an order-N and an order-M rotation code [2,62]: where n are number operators for the two respective modes.To understand its action on the codespace, we recognize that crot N M |kN ⊗ |lM = e iπkl |kN ⊗ |lM for Fock states |kN and |lM .Since kl is even unless both k and l are odd, it follows from Eq. ( 4) that the action on an encoded state |i for i, j = 0, 1.Thus, the crot gate acts as a CZ gate on the codespace of any two rotation codes.
A logical Ŝ = diag(1, i) can similarly be enacted by a quartic (in â, â † ) single-mode Hamiltonian, The action of ŜN on the codespace can be seen by acting on the Fock states in Eq. ( 4) In principle, Hamiltonians of even higher order in n can be used to generate diagonal non-Clifford gates.In particular, a logical T gate could be enacted by as is easily checked by acting on the codewords |0 N , |1 N in Eq. ( 4).However, in addition to the experimental challenge of engineering an octic Hamiltonian, the TN gate can amplify errors in damaging ways as we show in Sec.VI.It is therefore unlikely to be of practical use and we propose a scheme based on gate teleportation instead.

Teleported gates
The crot gate and logical M X measurements, together with appropriately prepared ancillae, allow us to complete a universal set of operation with a gateteleported logical Hadamard H and T -gate.
An ancilla prepared in |+ M allows execution of the Hadamard gate, using the following teleportation circuit [36,63,64]: where represents the same encoded qubit state (but not necessarily in the same code).The measurement is in the |± N basis, and we use i = 0 for the outcome "+" and i = 1 for the outcome "−."The notation Xi H thus means that depending on the outcome, an H ("+") or X H ("−") is applied to the data.Since our scheme for quantum computation is based only on Clifford gates and magic-state injection, rather than correcting the conditional Pauli X, the simplest solution is to keep track of it in a Pauli frame [33,65].Alternatively, the process can be repeated until the desired outcome is achieved [63].
The set { CZ , H, S} generates the Clifford group.To achieve universality, we teleport the gate T = diag(1, e iπ/4 ) by consuming an ancilla prepared in In order to teleport the T gate, we need an encoded |T M state.Arbitrary encoded states can be injected assuming we have universal control over two-level ancillae in the trivial encoding |0 triv = |0 , |1 triv = |1 : The circuit in Eq. ( 27) can be used to teleport an arbitrary ancilla state into a rotation code, where the top rail represents the two-level ancilla with N = 1.The procedure is not fault-tolerant, because an error on the ancilla propagates into the rotation code.Preparation of |T states can be made fault-tolerant using magic-state distillation, assuming high-quality Clifford operations are available [67]. 10  As we discuss in Sec.VIII, this can be achieved by concatenation with a second code and performing state distillation at the level of the top code.
If needed, we can also execute an Ŝ = diag(1, i) gate in a similar fashion by consuming an ancilla prepared in Again, the outcome dependent factor Xi can be kept track of using a Pauli frame.This can be an alternative to using the gate Eq. ( 25) directly, which might be more practical experimentally than controlling a self-Kerr Hamiltonian ∼ n2 .

B. State preparation
State preparation is a crucial ingredient for quantum computing with bosonic codes and can also be the most difficult part.Here, the logical |+ N state plays a key role in both the gate teleportation and state injection needed for teleported T gates.A large literature exists on state preparation of GKP codewords [42,[68][69][70][71], while relatively less theoretical work has been done for rotation 9 Note that in this case, because T is not a Clifford gate, the correction for the "−" outcome (i = 1) is non-Pauli.The correction can be done by applying X S for this outcome (using that X S T X = −e −iπ/4 T , where the overall phase factor is unimportant).In fact, since X S is equivalent to S up to a change of Pauli frame, we can simply apply S [66].Alternatively we can repeat the protocol until the desired outcome is achieved. 10An unfortunate clash in nomenclature has led to the state |T that teleports the gate T being called an H-type (not T -type) magic state, because it is equivalent to a Hadamard eigenstate up to Clifford gates.Further, in its original setting in Ref. [67], T was used to denote a different gate: that whose eigenstates are T -type magic states.
codes, and the optimal way to prepare codewords will in general depend on the code in question.This is therefore a broad topic, and we do not address it in detail in this work.
One experimental approach to preparing logical basis states involves a strong dispersive interaction between the mode and an ancilla qubit (in circuit QED these could be a cavity mode and a transmon qubit).Combined with displacement operations, such an interaction is in principle universal [72,73], in the sense that any state of the mode can be prepared in the absence of errors.Optimal control can be used to generate a sequence of control operations that maximizes the fidelity of a target state in the presence of errors, which has been performed in the circuit QED setting [29,30].An alternate approach could be to prepare a primitive |Θ , and then measure excitation number mod N , using the measurement introduced below in Sec.V.For either of these approaches the fidelity of the state preparation is limited by noise in the preparation procedure, and one can not rule out corrupted codewords with large errors.We postpone a discussion of how to deal with faulty state preparation until Sec.VIII.

Breeding rotation symmetry
We here present a method to "breed" logical states for an order-N rotation code from code states with lower order rotation symmetry.In analogy to a scheme for producing GKP states from Ref. [68], each stage of the breeding consists of coupling the bosonic mode to an ancilla mode followed by measurement of the ancilla.When successful, a |0 2N,Θ state is produced from a |0 N,Θ state, and the whole process can be repeated as required.
We begin with a codeword |0 N,Θ and an ancilla qubit prepared in a state Critically, we note that the ancilla could be a two-level system in the state or encoded in a rotation code of any order M .The ancilla is then measured in the |± M -basis.When the "+" outcome is obtained, the state becomes superposed with a rotated version to create a codeword of higher rotation symmetry, with outcome probability Beginning from a primitive |Θ , n successful rounds of breeding produce a logical state with 2 n -fold rotation symmetry, |0 2 n ,Θ .Just as in Ref. [68], the success probability falls off exponentially in n, but this could be improved by making use of higher-dimensional ancillae such as in Ref. [42].The relation, Eq. ( 31), can likewise be used on a low-order |+ N,Θ (or a dual primitive, see Appendix A) to breed a higher order |+ 2N,Θ state.
It is also worth noting here that for number-phase codes discussed in Sec.III, which are our main focus, we have the approximate relation (see also Appendix A) Thus, preparation of |0 N,Θ states is equivalent to preparation of approximate |+ 2N,Θ states for these codes.

V. MODULAR NUMBER MEASUREMENT
The crot gate is a fundamental building block for the universal gate set, state breeding, and the errorcorrection scheme we introduce in Sec.VII.Here, we show that the crot gate can also be used to perform a non-destructive modular measurement of excitation number n.In addition to being a novel measurement for a bosonic mode, the modular number measurement can be used both to detect number-shift errors on an encoded state and to conditionally prepare N -fold rotationsymmetric codewords from a primitive |Θ .The measurement we present here is a natural generalization of previous schemes where a two-level ancilla (transmon qubit) was used to detect number mod 2 for cat and binomial codes [29,30].
A non-destructive measurement of n mod N can be performed with the following circuit: RN where the controlled-RN gate is defined as and the measurement is to be understood as a phase measurement as described in Sec.II B 2. To see how this circuit works, consider the action of the ĈR N gate on a Fock state, |n , for the data rail and |+ M for the ancilla: where := n mod N , and we used that e i 2πp M n|+ M = ( RM ) p |+ M = |+ M for any integer p.The net result is a rotation of the ancilla state |+ M by an angle θ anc = 2π /(N M ), which takes the ancilla out of its codespace.This rotation can be detected using a destructive phase measurement of the ancilla with a resolution set by the ancilla's embedded phase uncertainty ∆ M (θ) relative to 2π/(N M ).For illustration, Fig. 5 shows a n mod 4 measurement using two different ancillae: (a) a coherent state and (b) a two-lobe cat state.These can be interpreted (for large enough α) as a |+ M codeword for M = 1 and M = 2, respectively.The motivation for using ancillae with higher M is the fact that errors may occur during the ĈR N gate, as discussed below.After the measurement, the value of is known, and the data rail is (in the ideal case) projected into an Nfold rotation-symmetric subspace: ρ → Π N ρ Π N , where the projector Π N is given in Eq. ( 6).Thus, a n mod N measurement can be used to prepare codewords for an Nfold rotation code in the following way: First, prepare the primitive associated with the code, |Θ , and then measure excitation number mod 2N .Conditional on ancilla phase being undisturbed ( = 0), the primitive undergoes the transformation Π0 2N |Θ = |0 N,Θ .Similarly, an ancilla outcome corresponding to = N conditionally prepares ΠN 2N |Θ = |1 N,Θ .

Error propagation in modular number measurement
Errors on the ancilla can propagate to the data rail during the n mod N measurement.Rotation errors on the ancilla do not propagate to the data rail (because they commute with the crot gate) and are not problematic beyond reducing the measurement fidelity.However, any ancilla error that does not commute with n, such as loss or gain, can induce a rotation error on the data rail (see Sec. VI for a detailed discussion of error propagation).For example, a loss error at a random time during the measurement leads to a rotation error of the data rail by an angle θ data ∈ 0, 2π N M .Thus, using an ancilla with small M brings along the danger of propagating a large rotation error back to the data qubit.In particular, for M = 1 ancilla, such as the coherent state in Fig. 5(a), a loss error at an unknown time during the C R N -gate completely randomizes the data rail's phase.The maximum magnitude of the rotation error induced by a single ancilla loss/gain event scales as 1/M , and thus can be reduced by using large-M ancillae.The drawback of using higher-M ancilla is larger measurement uncertainty in the phase measurement in Eq. ( 33).This can be seen in Fig. 5(b) for the two-lobe cat state ancilla.
We note that an improved number-parity syndrome for N = 2 rotation codes was recently demonstrated experimentally, where the ancilla was encoded in a simple rotation code using three levels of a transmon qubit [31].
The interaction exactly commutes with the dominant ancilla error |1 2|, such that there is no back-action from the ancilla onto the data at all for this error.This syndrome detection scheme can be said to be fault-tolerant to a single loss event on the ancilla [31].Further suppression of state preparation errors can be achieved using a concatenated error-correction scheme, as discussed in Sec.VIII.

VI. ERRORS AND ERROR PROPAGATION
As was emphasized in the original description of GKP codes in Ref. [3], the discussion of fault tolerance is somewhat different for bosonic codes than for conventional qubit stabilizer codes.For bosonic codes, it is entirely acceptable for every mode involved in the quantum computation to have small errors.In fact, this is unavoidable in practice.In the context of number-phase codes, "smallness" of errors is relative to a code's number and rotational distance, c.f. Eq. ( 13), as we explain in more detail below.Therefore, propagation of small errors is not a major issue.What is catastrophic, however, is when initially small and approximately correctable errors are amplified to the point where the probability of logical errors become likely.Gates that turn small errors into large errors should therefore be avoided.
As we show in the following, the gates introduced in the previous section behave nicely in terms of error amplification.They do not amplify the magnitude of a numbershift error of the form ∼ âk (∼ â †k ), although they might map a number-shift error onto a number-shift error plus a rotation error, e iθn .The upshot is that the new rotation error is proportional to the size of the number-shift error relative to the Fock-space distance, i.e., θ ∼ k/d N .In this sense, the new error is proportional in size to the initial error, and importantly, small errors remain small.Restricting to gates with such well-behaved error propagation properties is likely to be a pre-requisite for bosonic codes to have an advantage over unencoded qubits.We return to this point in Sec.VIII where we discuss a faulttolerant concatenated quantum computing scheme.

A. Error bases and large vs. small errors
There are two single-mode operator bases that are particularly useful in the context of rotation codes.The first is the set [74] n âk , (â where k, ≥ 0 run over all non-negative integers.A straightforward way to show that this is an operator basis is to first expand the displacement operator in a normal ordered form, Since we can write â † k âk = k =0 c k n by reordering operators, it follows that D(α) can be expanded in terms of the set Eq. ( 36). 11And, since the displacements form an operator basis, so does the set in Eq. ( 36), and the Kraus operators of any single-mode channel can therefore be expanded in terms of such operators.
A second useful operator basis is where k ≥ 0 is an integer and θ ∈ [0, 2π).That this is a basis follows from Eq. ( 36) since n = 2π 0 12 We will make use of this basis heavily in the following, and it is therefore convenient to introduce a short-hand notation: A negative k thus denotes a downwards shift in number and a positive k an upwards shift.An error Êk (θ) with 0 < |k| < N is detectable for any rotation code.This follows from the Fock-space separation of N between |0 N and |1 N .In general, we can not make a similarly sharp distinction between detectable and un-detectable rotations, but for the ideal numberphase codes introduced in Sec.III, a pure rotation error E 0 (θ) with 0 < θ < π/N is formally detectable.
Intuitively, an error with a small |k| compared to d n /2 = N/2 and small |θ| compared to d θ /2 = π/(2N ) is a "small" error and should be correctable to a good approximation for a number-phase code with N -fold rotation symmetry.Typically, the codes discussed in this paper are only approximate error-correcting codes for physically relevant noise channels [75].

B. Error propagation
To show that our gates do not amplify errors too badly and to introduce the error-correction schemes in the next section, we need to understand how the errors propagate through the gates introduced in Sec.IV.Here we describe errors using Êk (θ) given in Eq. (39).The { ŜN , crot N M } gates are generated by quadratic powers of the number operator, and although they are non-Gaussian, we show that they do not amplify errors too badly.In contrast, the gate TN = exp(iπn 4 /4N 4 ) is highly nonlinear, and as we show below this gate amplifies errors in a more damaging way, which is why we do not rely on using this gate in the scheme introduced in Sec.IV.
All of the unitary gates in our scheme commute with pure rotation errors, e iθn .For number-shift errors we can use that the commutation relation of an operator e cn with a power of â is given by the general formula where +1 is a polynomial of order . 13A similar commutation relation for (â † ) k follows straightforwardly by Hermitian conjugation.Applying this to ẐN ( = 1), we have f 0 (n) = −1, and the prefactor in Eq. ( 40) is a global phase.Explicitly, for a general error Êk (θ).Recall that we are labeling the errors with an index k < 0 for an error ∼ â|k| and k > 0 for an error ∼ (â † ) |k| .We see that propagating an Êk (θ)-error through the Gaussian ẐN -gate only leads to a phase factor and the error is not amplified at all.Gates with = 2, such as ŜN in Eq. ( 25), on the other hand, introduce new rotation errors: The initial rotation error θ is amplified by an amount proportional to the initial number-shift error k.Recall that the angular distance of the code is d θ = π/N and the number distance is d n = N .If |k| < d n /2 is a small, approximately correctable number-shift error, then the additional rotation error π|k|/N 2 < d θ /2 is small as well.
Thus if k and θ are sufficiently small and approximately correctable, we expect the error after the gate to be approximately correctable as well.This is akin to a gate implemented by a constant depth circuit on a qubit stabilizer code, where an initial error can spread at most within a constant-size light cone [76,77]. 14  13 Since [n , â] = f −1 (n)â, we have e cn âe −cn = e cf −1 (n) â. 14 Of course, one also has to take into account that the type of error introduced by the gate is different from the initial error, and it is not clearcut whether a rotation error of magnitude πk/N 2 is better or worse than a number-shift error of magnitude âk or (â † ) k , even though they are both in some sense small when k is small compared to N/2.In general this will depend on the code's ability to deal with phase and number-shift errors.Commuting an error through the crot gate spreads errors between the two modes involved in the gate.Label the two modes a and b, where a is encoded in an order-N rotation code and b in an order-M rotation code.Commuting crot through an error on mode a gives where the superscript a/b indicates the mode that an operator acts on.Here, the initial number-shift error on mode a spreads to a rotation error on the mode b.
Again, if |k| < N/2 is small with respect to the number distance of mode a, mode b is rotated by an angle π|k|/(N M ) < π/(2M ) which is small compared to its angular distance.In other words, even though the error has spread to a new rotation error on mode b, the error remains small relative to the rotational distance of this mode.In the context of [[n, 1]] qubit codes with a single logical qubit encoded in n physical qubits [78], the crot gate is analogous to a logical CZ gate enacted transversally between two code blocks.How errors propagate through the gate set { ẐN , ŜN , crot N M } is summarized in Fig. 6.Finally, we show that gates generated by n for > 2, such as the TN gate in Eq. (44), are unlikely to be useful for fault-tolerant quantum computing, because errors are amplified and spread in a potentially damaging way.Propagating an error through TN produces additional linear and nonlinear rotation errors, where F k N = e i kπ 4N 4 (4n 3 +6n 2 ) is a nonlinear rotation error.The precise consequences of such nonlinear errors on relevant codes requires further study; however, we expect it to be rather damaging, see, e.g., Ref. [79].As already discussed in Sec.IV we avoid using this gate in our scheme, instead relying on gate teleportation for a logical T .

VII. ERROR CORRECTION
Number-phase codes, introduced in Sec.III, are naturally robust to shifts in number with higher-N codes tolerating larger shifts.On the other hand, their robustness to phase errors is directly related to the rotational distance d θ = π/N , and rotations reasonably small compared to d θ /2 can be corrected.Here, we introduce a constructive and practical error correction scheme for number-phase codes and study its performance numerically.
In a well designed error-correction scheme one needs to (i) use gates that do not amplify errors such that they become uncorrectable, (ii) use measurements that are robust to noise, and (iii) carefully construct ancilla interactions such that errors do not spread from ancilla qubits to data qubits in a catastrophic way.In the context of [[n, k]] qubit stabilizer codes, where k logical qubits are encoded in n physical qubits, two common approaches to fault-tolerant error correction are Steane (Steane-EC) and Knill (Knill-EC) error correction [78].
In an adaptation of these schemes to single-mode codes (i.e., codes with each logical qubit encoded in a single bosonic mode), [[n, 1]] code blocks are replaced by bosonic modes, and gates and measurement are replaced by fault-tolerant bosonic counterparts.For example, in Ref. [3], Steane-EC was adapted to GKP codes by replacing transversal cnots by the fault-tolerant (linear) sum gate and logical X and Z measurements by quadrature measurements.
Rotation codes, on the other hand, do not in general have a fault-tolerant cnot (or Hadamard), due to the highly non-linear nature of the X-operator.Steane-EC can therefore not be used directly.We get around this issue by adapting a version of Knill-EC to number-phase codes.This approach turns out to have many salient features.As an alternative, we also present a hybrid Steane-Knill scheme in Appendix E.

A. Error correction by teleportation
We present a bosonic version of Knill-EC [33,80,81] for number-phase codes.Its implementation requires crot gates, phase measurements, and preparation of |+ N states, as illustrated in Fig. 7(a).The measurements attempt to distinguish between damaged logical codewords in the dual basis. 15Similar schemes have been considered previously in the context of measurement-based quantum computing [81], where it is occasionally referred to as telecorrection due to the teleportation-based errorcorrection circuit: the circuit in Fig. 7(a) can be recognized as two consecutive one-bit teleportations.
].The Pretty Good s orthogonal states, irly well between the The measurement is (C1) The first step of the circuit in Fig. 6(b), involving only the top ancilla, (a) Schematic illustration of telecorrection using number-phase codes, where MX are phase measurements with outcomes xi.The scheme is based on how errors spread through the crot gate.An arbitrary error Êk (θa) on the order N data rail (b) induces a rotation of the order M upper ancilla rail by θ b = πk N M (c).Phase measurements on the data rail and the upper ancilla rail extract information about θa and θ b ∼ k.By the end of the circuit the logical information has been teleported to the bottom order-L ancilla rail (typically L = N ).
A particular feature of the teleportation-based errorcorrection scheme makes it desirable for number-phase codes.Natural errors for bosonic modes include loss and gain errors that shift the codewords off the Fock grid |kN .Actively correcting such errors generally requires difficult, non-linear shift operations up or down the Fock ladder, see e.g.Ref. [82].In contrast, for the circuit in Fig. 7(a), the damaged state is teleported into a fresh ancilla, thus restoring the codespace, with only a logical error channel remaining (assuming, of course, error-free ancillae).Whether one can correct this remaining logical error depends on the magnitude of the initial error and the error-correcting properties of the code.
The ability to correct errors using teleportation is based on the following circuit identity (c.f., Fig. 6) where the labels N , M , and L indicate the order of rotation symmetry for each encoded rail, Ê = Êk (θ) is an arbitrary error as defined in Eq. ( 39), and R = Ê0 is a pure rotation error.Crucially, although the initial error Ê on the top rail spreads to a rotation error R on the second rail, this does not spread to an error on the third rail because R commutes with crot.By measuring the first and the second rail, we can teleport the state from the first to the third rail [c.f.Eq. ( 27)] and remove the error in the process.The teleportation is successful as long as one is able to correctly distinguish between codewords in the dual basis in the presence of the errors.We consider the action of the error-correction circuit in more detail for error-free ancillae.Consider an encoded logical state ρN = 1 i,j=0 ρ ij |i N j N | that is sent through an arbitrary single-mode noise channel N (ρ N ) followed by the error correction circuit in Fig. 7(a).One can show that the corresponding quantum channel can be written where ρL = 1 i,j=0 ρ ij |i L j L | on the right-hand side represents the same logical state as ρN on the left hand side, but now encoded in the order-L number-phase code of the bottom ancilla rail (in general this can be a different code).The operators Pi ∈ { Ī, Z, X, X Z} are logical Paulis acting on the encoded order-L output state.
The weights c ij ( x) := tr[ Mx1 ⊗ Mx2 σij ] in Eq. ( 46) are set by the measuremnt scheme and the noise channel: Here Mxi are POVM elements for the two measurements in Fig. 7(a), and the sum over outcomes, x = (x 1 , x 2 ), should be understood as an integral for continuous measurement outcomes.We have also introduced σij := U crot • N • U † crot |i j| with |i = H|a N ⊗ H|b M with ab being the binary representation of i (i.e.|i runs over The operators σij thus represents a damaged two-mode logical dual basis, where the noise channel N has been commuted through the crot gate. Crucially, Eq. ( 46) shows that after error correction the remaining error channel acts entirely in the logical subspace of the output mode, for any noise channel N acting on the input mode.In principle, a measurementdependent Pauli recovery Px could be applied, but the simplest solution is to track the most likely Pauli correction Pi * in a Pauli frame.The right Pauli correction can be guessed using, for example, a maximum likelihood decoder

B. Numerical results for loss and dephasing with error-free ancillae
In a recent work, Albert et al. [40] investigated the error-correction performance of several bosonic codes including cat and binomial under pure loss.In that work, a recovery map was found by numerical optimization, and it was shown that bosonic codes can heavily suppress loss errors, in principle.While it sets a useful bound, numerical optimization does not provide any information about how to implement the recovery map in FIG. 8. Average gate infidelity as a function of average excitation number in the code, ncode [Eq.( 11)], for an N = 3 cat code (top row) and binomial code (bottom row).We compare the theoretically optimal error-correction scheme found numerically (optimal) to our telecorrection scheme using Pretty Good Measurements (pretty good) and canonical phase measurements (phase).The encoded data rail is subject to noise through evolution under the master equation in Eq. ( 49) with equal loss and dephasing strength, κ φ t = κt.Each column shows results for a different amount of total noise κt before error correction is performed.A code performs better than break even (the uncorrected trivial encoding) whenever the gate infidelity is below dashed line (falls outside the shaded region).
practice.An important step forward is therefore to compare an explicit error-correction scheme to the numerically optimal recovery map for relevant noise channels.
To make this comparison we focus in this section on a setting with noise-free ancillae and idealized measurements.Dealing with faulty ancillae and measurement noise is a non-trivial problem which we return to in a qualitative discussion in Sec.VIII.One of our main results is that the teleportation-based error correction scheme presented above is close to optimal in the relevant region of small noise, with a gap from the optimal scheme arising primarily from inherent noise in the phase measurements.
In this section we numerically compute the average gate fidelity [83] for a channel composed of an ideal encoding of a qubit into a number-phase code, followed by a single-mode noise channel, and finally error correction using noise-free ancillae and ideal gates. 16We have confirmed that the Knill-EC scheme from the previous section and the hybrid Steane-Knill scheme presented in Appendix E perform identically for the codes and parameter ranges we investigated.
In the idealized situation where the ancillae are noise free, one can use, e.g., a simple M = 1 cat code with for the middle ancilla rail in Fig. 7(a).For large enough α, rotations of the state |+ cat can be detected arbitrarily well with phase measurements, giving essentially perfect syndrome measurements for this rail.Moreover, we set L = 1 for 16 The average gate fidelity F for a d level system is related to the entanglement fidelity Fent as F = (dFent + 1)/(d + 1) [83].
the bottom (output) rail and use the trivial encoding, |0 triv = |0 and |1 triv = |1 , for this mode.The errorcorrection circuit therefore also decodes the encoded information.
The total quantum channel we consider is where S• = Ŝ • Ŝ † , with Ŝ = |0 N 0| + |1 N 1|, is the ideal encoding map for a given code, N is a noise map, and E Knill is the error-correction circuit.This is a logical channel with qubit input and qubit output, due to the use of a trivial encoding for the final output mode of the error-correction circuit.Note that E Knill • N is given by Eq. ( 46) in the case when recoveries are tracked in software rather than applied explicitly.To compute the average gate fidelity, we explicitly apply a correction P † i * to undo the most likely Pauli error using the decoder in Eq. ( 47).
The noise channel we consider consists of simultaneous loss and dephasing.Specifically, N (ρ) is the solution to the master equation integrated up to some unitless time κt, with We wish to quantify the performance of the telecorrection scheme from Sec. VII A. To this end, we compare the average gate fidelity for the channel in Eq. ( 48) with a channel where the error-correction map is replaced by the completely positive trace-preserving map E opt that maximizes the fidelity.The latter can be found by solving a semi-definite program [40], and we refer to this recovery as optimal.The discrepancy between the teleportation-based scheme and the optimal is due in large part to the inherent uncertainty of the phase measurements, c.f. Sec.II B 2, and is especially prominent for small average excitation numbers.We obtain further insight into the origin of this gap by comparing canonical phase measurements to Pretty Good Measurements (see Appendix D) for the data rail in the circuit Fig. 7(a).The measurement on the middle ancilla rail is in both cases a canonical phase measurement as defined in Eq. ( 14). 17 We refer to these two error-correction schemes as phase and pretty good, respectively, depending on which measurement is performed on the data rail.We emphasize that the pretty good scheme is used in our numerics purely to gain insight into the origin of the gap between phase and optimal.
We focus here on cat and binomial codes as examples of number-phase codes.As expected, these codes have similar performance for large average excitation number, ncode [Eq.(11)], but can show significant differences for smaller ncode [84].Remarkably, we find that the phase error-correction scheme approaches optimal for large ncode and small noise strength, and that the pretty good scheme is near optimal for almost all ncode and small noise strengths.
In Fig. 8 we show examples of the average gate infidelity 1 − F [83,85] for an N = 3 cat code (top row) and N = 3 binomial code (bottom row) as a function ncode .We fix the dephasing rate to be equal to the loss rate κ φ = κ and compare three different noise strengths parameterized by κt.The dephasing rate κ φ models both natural dephasing and additional uncertainty in the phase measurements, which motivates choosing a fairly large κ φ .The dashed line in the figures shows the average gate infidelity using the trivial encoding |0 triv = |0 and |1 triv = |1 on the data rail with no error correction.This marks the break-even point above which, in the pink region, encoding and error correction perform worse and provide no advantage.
There are several takeaway messages from the results in Fig. 8. First, as advertised, both the pretty good and phase error-correction schemes are near optimal for large ncode .While for phase there is a significant gap at small to moderate ncode , the pretty good scheme performs very close to optimal except for very small ncode and/or large noise strengths.Second, for all schemes the codes exhibit an optimal ncode where the infidelity reaches a minimum.Under small loss rates the optimal ncode for phase is much larger than for pretty good 17 Numerically we implement phase measurements by discretizing the phase θ j = θ 0 + j2π/J, j = 1, . . ., J, and define POVMs Mj = and optimal, due to the poor ability of phase measurements to distinguish states with small ncode .Third, we see that the binomial code generally outperforms cat for small ncode and low noise strength, while the performance is identical for large ncode .We note that for smaller dephasing rates, binomial codes would have increasing advantage over cat codes since a more loss-dominated noise channel generically favors smaller ncode [40].
Fig. 8 also shows that there is a significant potential for going beyond break-even, at least within the idealized error model considered here.To investigate this further we compare cat and binomial codes with different N in Fig. 9.For each N and each code, we choose the optimal ncode .We then plot the logical infidelity 1 − F as a function of noise strength for the three different errorcorrection schemes optimal, pretty good and phase.
There are two main observations from Fig. 9. First, both cat and binomial codes break even by orders of magnitude for all error-correction schemes under the simplified noise model considered here.We can identify breakeven pseudo-thresholds, defined as the noise strength (κt) be , where the infidelity is equal to that of the trivial encoding with no error correction (i.e., where the lines in Fig. 9 cross the pink/white boundary).The break-even thresholds are fairly high, falling in the 1-10% range, for the range of N considered, but they decrease with larger N .The second observation is that the logical infidelity 1−F falls off more rapidly with higher N , over a range of κt.However, the gain in performance is diminishing with increasing N .We do not expect the infidelity to become arbitrarily small with increasing N , since the protection against phase noise decreases.The relatively large reductions in infidelity with increasing N seen in Fig. 9 suggest that the performance is not limited by dephasing for the noise parameters and codes considered here.
The results presented in this section have consequences for the prospects of using number-phase codes for faulttolerant quantum computing.On one hand, the large break-even potential motivates further study of these codes under realistic noise models including noisy ancillae, noisy encoding, more realistic measurement models, and noise during gates.A pertinent question is how sensitive the performance is to nonlinear unitary errors such as those from unwanted self-Kerr interactions.On the other hand, the expectation that arbitrarily low infidelities cannot be reached means that cat and binomial codes must ultimately be concatenated with a second code to suppress errors further.

VIII. ROADMAP TO FAULT TOLERANCE
In this section we outline a scheme that achieves a long-standing goal for number-phase codes such as cat and binomial: A fault-tolerant universal set of operations.First, let us summarize the challenges that need to be overcome for fault-tolerance with number-phase codes (and rotation codes more generally): • We touched upon some of the challenges with state preparation in Sec.IV B. A modular excitationnumber measurement (Sec.V) can be performed to check a state for loss and gain errors, but not without risk of introducing new rotation errors.Unfortunately, we have not been able to find a practical, nondestructive measurement to check for rotation errors.If only number-shift errors are checked for, state-preparation noise will be biased towards rotation errors. 18  • Realistic syndrome measurements are going to be rather noisy.A standard approach, especially in topological stabilizer codes, is to repeat the syndrome measurements multiple times and decode based on a record of measurement outcomes [66].However, due to the destructive nature of the measurements in Fig. 7, they cannot straightforwardly be repeated.
• We expect that logical error rates can only be suppressed up to a point for realistic error channels.
In particular, there is a tradeoff between resilience to number-shift and rotation errors, c.f. Eq. ( 13). 19  One way to overcome these issues is to concatenate the bosonic code with a conventional qubit code so that 18 This is a noticeable difference with GKP codes, where the two respective syndrome measurements for quadrature shifts are equally easy [3].Fundamentally the issue stems from the highly non-linear number-translation "stabilizer" ΣN , c.f. Eq. ( 18) and Fig. 12. 19 GKP codes suffer a similar tradeoff between resilience to position and momentum shifts [3].
the qubit code can deal with errors not handled by the bosonic code.This is broadly the approach taken recently for GKP codes, e.g., in Refs.[11,13,14].Tailoring fault-tolerant gadgets to the respective strengths and weaknesses of the bosonic code is, however, not a trivial task.If this is not done carefully, the advantage of using a bosonic code at the ground level is diminished, and any performance benefits over using bare qubits might be lost.Simply, we want to optimize the concatenated scheme to maximally exploit the error-correction properties and noise resilience of the ground-level bosonic code.
In the following we outline how this goal can be achieved using concatenation with a Bacon-Shor subsystem code [34,35,86].This specific choice serves to illustrate the broader point of how a fault-tolerant concatenated scheme can be tailored to exploit the strengths of the underlying bosonic code.
A single Bacon-Shor code can have a high faulttolerant pseudo-threshold at intermediate code size, even though the threshold vanishes in the limit of infinitely large system size [37,87,88].Bacon-Shor codes are attractive candidates for near-and intermediate term logical qubits due to their geometrically local layout in two dimensions and weight-two gauge operator checks [37,86,89].Specifically, we will make use of a teleportationbased scheme developed by Aliferis and Preskill for repetition codes in Ref. [36] and generalized to Bacon-Shor codes by Brooks and Preskill in Ref. [37].We refer to these two works collectively as the Aliferis-Brooks-Preskill (ABP) scheme.
The key to our fault-tolerant gadgets is to use only bosonic operations that do not amplify errors within a mode and do not spread small errors to larger errors at the bosonic level.This allows the error correction properties of the bosonic code to be exploited fully.The bosonic  (c, d) By repeating a nondestructive measurement of ẐL ⊗ ẐL r times, we get a robust MZ L Z L gadget.(e) The error-correction gadget from Ref. [36].Here, |+L = |+N ⊗n , and the XL-measurement is independent, destructive phase measurement of each mode in the repetition code block.code operations we make use of are We also assume universal control over two-level ancillae, or equivalently, bosonic modes in the trivial encoding triv = |0 , |1 triv = |1 , and crot N 1 gates between the two-level ancillae and order N rotation codes.Using the ABP scheme, this suffices for universal quantum computing.Remarkably, the bosonic error correction is seamlessly integrated into the Bacon-Shor error correction with our approach, such that minimal overhead is incurred.The bosonic error correction is in this sense highly efficient.

A. Parallel teleportation
Let us start with the issue of measurement errors in the error-correction scheme in Fig. 7, as this gives an entry point into the ABP scheme.As already stated, because the syndrome information is extracted using destructive measurements, the measurements can not simply be repeated.However, since the measurements and state preparation in Fig. 7 are all in the X-basis, a simple remedy is to concatenate with a length n repetition code (for n odd) in the dual basis, Logical XL measurements and state preparation for the repetition code are then simply independent phase measurements and independent preparation of the n bosonic modes using a number-phase encoding.Measurement errors are suppressed by performing a majority vote on the n outcomes. 20This means that, if we can generalize the teleportation circuit in Fig. 7 to teleportations of repetition code blocks, we can use the simple encoding in Eq. ( 51) to suppress measurement errors.This is essentially a classical encoding, and the repetition code plays a role analogous to repeated measurements in topological codes [66].
A useful observation is that a ĈZ -gate enacted between each qubit in a repetition code block and a single ancilla qubit acts as a logical ĈZ between the repetition code block and the one ancilla.So, for example, the red crot gates between the upper block and the ancilla in Fig. 10(a) gives a logical ĈZ between this block and the ancilla, leading to the identity with Fig. 10(b) where the thick lines represent repetition code blocks of length n.The circuit in Fig. 10(a, b) represents a nondestructive measurement of ẐL ⊗ ẐL , where ẐL is a logical Pauli-Ẑ for the repetition code block.To increase robustness to ancilla measurement errors, we can repeat this circuit r times, as illustrated in Fig. 10(c, d) to get a robust M Z L Z L gadget.Error correction is performed, following Ref.[36], by the logical one-bit teleportation circuit in Fig. 10(e).Note that with n = r = 1, the error-correction gadget in Fig. 10(e) is identical to that in Fig. 7(a).This is thus a direct generalization of the scheme we introduced above in Sec.VII, and the error correction circuit performs both bosonic code and repetition code error correction in one step.
Let us pause at this point to clarify what is achieved by concatenating with a repetition code.First of all, the repetition code is used to suppress measurement errors, but it also protects against rotation errors more generally.This is especially useful if state-preparation noise is biased towards rotations, as will be the case if numbersyndrome checks are used in this step.
To further understand the concatenated bosonicrepetition code's robustness to number-shift errors, consider for sake of concreteness an N = 2 number-phase code and a noise channel biased towards loss with negligible gain.An N = 2 number-phase code can on its own be robust against a single loss error when gain is negligible.Say, for example, a single loss error occurs on one of the ancilla rails in the M Z L Z L gadget in Fig. 10.It will spread to a clockwise rotation error of magnitude π/4 on all of the upper and lower data rails.This is acceptable, because the number-phase code with angular 20 Digitizing each bosonic mode measurement result as in Fig. 3 and performing a majority vote is unlikely to be the optimal scheme.Recent work on GKP codes has shown that decoders that explicitly take advantage of continuous variable measurements have better performance [12,13,15].
distance d θ = π/2 can deal with rotation errors of this magnitude (note that under the assumption of no gain, one should bias the decoding procedure in Fig. 3 towards clockwise rotations).Confidence in detecting this loss error is increased by the fact it is present in all n phase measurements on the upper data rails.Despite using only a repetition code, the scheme is thus robust to both rotation and loss errors, because the bosonic code at the ground level can handle both.This is what we mean when we say that the bosonic-code error correction is integrated in the qubit-code error correction.
On the other hand if, say, two of the r ancillae in the M Z L Z L have a single loss error, this will propagate to a rotation error of magnitude π/2, which is too large for an N = 2 number-phase code to handle.Consequently, this leads to a logical error at the repetition-code level with high likelihood.The number of ancillae r and the repetition-code length n thus have to be chosen dependent on the order of rotation symmetry of the numberphase code, N , as well as the physical loss rate.We note that concatenation with a repetition code has recently been proposed in the context of N = 1 cat codes [90,91].An N = 1 cat code does not provide any protection against loss or gain errors, but gives rise to a highly biased effective noise model because transitions |α → |−α are exponentially suppressed in |α| 2 .In this situation, no active error correction is performed at the bosonic-code level, and the purpose of the repetition code is to protect against loss and gain errors, which is orthogonal to what we propose here.

B. Cats of cats and repetitions of repetitions
The above concatenated error-correction scheme can be improved following Ref.[37].The techniques presented there can be adopted straightforwardly to the present context, so we only briefly comment on the main ideas here.
Despite the scheme already described above being robust to both loss and rotation errors, it may be impractical to prepare number-phase codes with very large N .This limits number of ancilla measurements, as explained above, because a single ancilla loss or gain error spreads to all of the data rails, and vice versa.This problem can be overcome by replacing each of the r |+ N middle-rail ancillae in Fig. 10 by logical |+ L for a repetition code which is dual to Eq. ( 51): The logical Pauli-X for this code is X⊗n .However, since we only require destructive measurements of the ancillae, one can perform destructive phase measurement to measure each of the n ancilla modes in the |± N basis, as in Fig. 3, and take the parity of the digitized outcomes.The purpose of using the dual repetition code Eq. ( 52) for the middle-rail ancillae is that a fully transversal Ĉ⊗n 11.An extension of the error correction scheme from Ref. [36] where each ancilla is encoded in the state |+ L , Eq. ( 52).On the left, the rails represent number-phase codes, the ĈZ gates are crot gates, and the measurement is independent destructive phase measurement of each mode in a block.The parity of the n digitized measurement outcomes is computed to perform a measurement in the |± L basis.On the right, the thick lines represent reptition code blocks and the gates are logical ĈZ between the code blocks.Error correction is otherwise performed exactly as in Fig. 10: The circuit is repeated r times and finally the upper data block is measured M ⊗n X , with the lower data block prepared in |+N ⊗n .
gate enacted between the two codes, Eqs. ( 51) and ( 52), performs a logical ĈZ gate between the two code blocks. 21he basic building block of the error correction gadget then simply becomes an encoded version of the scheme from Fig. 7(a), as illustrated in Fig. 11.The error correction scheme is otherwise identical to that in Fig. 10.The crucial difference is that since the ĈZ gates are now fully transversal, an error on any mode in the circuit spreads to at most two other modes.
The state ⊗n is sometimes referred to as a "cat state."Since any bosonic rotation code is also a generalized cat code, according to Eq. ( 3), we can refer to the state |+ L as a "cat-of-cats."Of course, preparing these cat states also incurs overhead.As explained in Ref. [37], this can be done fault-tolerantly using only the basic operations G bosonic (with about 2n crot gates and n extra ancillae for a length n cat-of-cats.).The last extension from Ref. [37] is to replace the repetition code with a Bacon-Shor subsystem code.A Bacon-Shor code can be thought of as a concatenation of a length n repetition code with a second, length m, repetition code.While the code in Eq. ( 51) only gives protection against rotation errors (beyond the protection provided by the bosonic code), a Bacon-Shor code with m > 1 will provide additional protection against loss and gain errors.In general, one can optimize the ratio m/n to the noise model and the capabilities of the bosonic code at the ground level.Error correction is still performed with a gadget as in Fig. 10(e) using a relatively straightforward generalization of the M Z L Z L measurement, and where logical |+ L for the bosonic-Bacon-Shor code is now a product of cat-of-cats states [37].Crucially, the only operations ever needed are crot gates between pairs of modes, preparation of |+ N states, and destructive phase measurements to measure each mode independently in the |± N basis.

C. Universality
In the ABP scheme, a logical cnot gate is built out of the fundamental operations in Eq. ( 50) [36,37].Universality is furthermore achieved by injecting noisy states |+i = (|0 + i|1 )/ √ 2 and |T = (|0 + e iπ/4 |1 )/ √ 2 directly into the Bacon-Shor (or repetition) code block.In the present context, state injection can be performed by preparing the two lowest levels of an ancilla, e.g. a transmon, in the desired state |ψ , and using a cross-Kerr interaction between the ancilla and a bosonic mode to perform a crot N 1 gate.The one-bit teleportation gadget in Fig. 10(e) is then used to teleport the ancilla state into a code block.In this case, the upper rail in Fig. 10(e) is the unencoded two-level ancilla in the state |ψ , and the lower rail is the Bacon-Shor code block.This circuit prepares the code block in an encoded state |ψ L up to a known measurement-dependent logical Pauli.Several noisy |+i L or |T L states can be distilled to higher fidelity using standard state distillation protocols, as analyzed in Ref. [37].
As a final remark, we emphasize that although the fullblown scheme using Bacon-Shor codes and cat-of-cats ancillae is quite complex, the simplest repetition code with single-mode ancillae should already be able to demonstrate all the key ingredients of a fault-tolerant scheme.It is therefore a promising candidate to realize small-scale logical qubits in near-to-medium term experiments [89].

IX. CONCLUSIONS AND DISCUSSION
We have presented a broad class of bosonic errorcorrecting codes characterized by discrete rotation symmetry, which we call bosonic rotation codes, or simply rotation codes for short.Several well known codes, including cat, binomial and 0N-codes, are rotation codes.Cat and binomial codes moreover belong to a subset of rotation codes, the number-phase codes, which are characterized by vanishing phase uncertainty for large excitation numbers.Another member of this subset are Pegg-Barnett codes, which can be interpreted as the shiftresistant qudit codes introduced in Ref. [3] embedded in the infinite-dimensional Hilbert space of a bosonic mode.
The theoretical framework we present here for numberphase codes allows a natural comparison with GKP codes, summarized in Fig. 12. First, number-phase codes are analogous to approximate GKP codes, with number and phase playing dual roles in place of position and mo-mentum. 22Second, the fact that the GKP stabilizers are generated by Hamiltonians linear in annihilation and creation operators leads to Gaussian Clifford gates.In contrast, number-phase codes have one symmetry generated by a quadratic Hamiltonian ( RN ) and one non-Gaussian symmetry ( ΣN ).As a consequence, a subset of the Clifford group-the diagonal Cliffords-can be generated by Hamiltonians that are quartic in annihilation and creation operators, while the full Clifford group contains highly non-linear gates.The smaller set of natural unitary gates and the higher degree of non-linearity is a disadvantage compared to GKP codes.However, the issue of non-linearity is not entirely clear cut.Selfand cross-Kerr interactions are very natural in some platforms [19,93], and some of the GKP Cliffords will require underlying physical nonlinearities as well-for example, to realize the shear gate, S, and the two-mode gate CZ .
A feature of number-phase codes is that phase measurement is a natural candidate for a robust logical measurement in the dual basis.In practice, phase measurements are realized by heterodyne and homodyne measurements as well as adaptive homodyne schemes [58,94].The existence of a robust dual-basis measurement is crucial for the quantum computing and error correction schemes presented in Secs.IV and VII.
The entangling gate (crot) in our scheme is a controlled-rotation gate based on a cross-Kerr interaction between two modes.The crot-gate plays a central role in many pieces of our quantum computing scheme including gate teleportation, modular number measurement, and error correction.An attractive feature of the crot gate is that it can be used to interface any two rotation codes.In fact, the crot gate can even be used as an entangling gate between any bosonic rotation code and a square-or hexagonal-lattice GKP code, due to the underlying rotation symmetry of the GKP code lattices, see Appendix C.This could be used in hybrid schemes employing multiple encodings and for switching between codes using teleportation.The generality of the crot gate is similar in spirit to that of the exponential-SWAP (eSWAP) gate [95,96], which is agnostic to code type but makes no guarantees about error propagation.In contrast, the Kerr-based interactions that underlie crot gates amplify errors only in a very limited way, and are thus attractive candidates for use in a fault-tolerant scheme.
There are two particularly salient features of the teleportation-based error-correction scheme we introduced in Sec.VII.The first is that for large average excitation number in the code, the performance (as measured FIG.12.Comparison between the number-phase codes introduced in this work and GKP codes [3].For simplicity we consider the square-lattice GKP code.The cartoon shows codewords for an N = 4 number-phase code, with dn = 4, d θ = π/4, and a GKP code with dq = dp = √ π.For each code type there are unitary gates that are "natural" in the sense that they are generated by physically natural Hamiltonians and that they map small errors to small errors.To achieve universality, the unitary gates are supplemented with state preparation and Pauli measurements for both code types.Note that it was recently shown that the GKP magic state |Tgkp can be distilled using only Gaussian operations [97].The number-phase-code analog to the envelopes in the approximate GKP codewords are number-amplitude envelopes such as those in Fig. 4. by average gate fidelity) is near that of the optimal recovery map allowed by the laws of quantum mechanics.For small average excitation number, the gap from optimal stems mainly from the inability of phase measurements to accurately distinguish the logical codewords in this limit.The second is that teleportation-based error correction does away with the need for explicit recovery operations to restore the codespace, and logical recoveries can be tracked entirely in software.Since explicit recovery operations would require highly nonlinear implementations, this is a major simplification.
Finally, we outlined an approach to universal faulttolerant quantum computing with number-phase codes in Sec.VIII.Given the highly non-linear nature of the number-translation symmetry ΣN , Eq. ( 18), one can wonder if fault-tolerant error correction is possible.We showed that fault-tolerance can indeed be achieved, through concatenation with a Bacon-Shor code and exploiting schemes that were originally developed to deal with highly asymmetric noise [36,37,88].This illustrates the broader point of how a concatenated scheme can be tailored to the strengths and weaknesses of the under-lying bosonic code.We showed how bosonic-code error correction can be seamlessly integrated with the qubitcode error correction and further how fault-tolerant gadgets can be constructed using bosonic operations with minimal error spread or amplification.In this way, one can hope to maximize the advantage of using bosonically encoded qubits over bare qubits at the ground level.
It is worth reiterating that no additional syndrome measurements are required to perform error correction at the bosonic level beyond those needed for the qubit subsystem code itself.In other words, error correction at both levels is performed in one step, such that no additional resources are used compared to if bare qubits were used at the ground level.This is an interesting contrast to other recent work on concatenation of GKP codes with topological qubit codes [13,14].In these latter works, dedicated ancillae and syndrome-measurement circuits are introduced to perform bosonic-code error correction, thus incurring more overhead.
It is still largely an open problem to quantify the performance of bosonic codes for fault-tolerant error correction and computing, and thus their potential to give an improvement over bare qubits.An important part of future research on bosonic codes is therefore to quantitatively study different schemes in a fault-tolerant setting.Our scheme based on concatenation with Bacon-Shor codes is the first example of a fault-tolerant scheme for bosonic rotation codes, and an interesting direction for future research is to explore this path further with other concatenated codes and to optimize fault-tolerant protocols.In particular, decoders tailored to bosonic codes at the ground level have already shown promise in theoretical work on GKP codes [12,13,15].
The angular and Fock-space structures that characterize rotation codes leave freedom to define different codes through the coefficients {f kN }, Eq. ( 4), that arise from a choice of primitive |Θ .Several rotation codes have been presented in the literature, such as cat codes [5] and binomial codes [6] and modified versions of these codes that improve their error-correcting capability by changing the relative phases of their Fock-grid coefficients [10].Their structure, properties, and error-resilience have been studied recently in Ref. [40].We summarize cat and binomial codes here and introduce two other examples.The first is a generalization of cat codes to include squeezing.The second is a new class of code based on the phase states introduced by Pegg and Barnett [60].For each we give a primitive |Θ and the Fock-grid coefficients, {f kN }, associated with an order-N code.For binomial codes the primitive itself depends on N , while the other code families use the same primitive for all N .Note that in the main text we are primarily interested in the subset of rotation codes that have approximate number-translation symmetry-the number-phase codes introduced in Sec.III.Each of the codes introduced here can serve as a number-phase code in an appropriate limit.(B2) where the squeezed vacuum coefficients are S ,0 (r, φ) = 0 for odd and for even.In the limit of no squeezing, S ,0 (r → 0, φ) = δ ,0 .The coefficients for a displaced number state are with associated Laguerre polynomials L k (x).The |0 N and |1 N codewords are constructed using a displaced squeezed state as the primitive |Θ scat = |α, r, φ = 0 with α real and positive.From Eq. (3a) the computational basis states are given by23 The Fock-grid coefficients can be found readily from the cn in Eq. (B2), see Sec.II A for details.Two code subclasses can be identified by specific parameters: Cat codes emerge in the limit that squeezing vanishes, r = 0, and squeezed vacuum codes arise when the displacement vanishes, α = 0.24 For the smallest cat code (α → 0, r = 0), the trivial encoding in Eq. ( 12) is realized.The Fock-grid coefficients for cat codes are where N * i indicates the Fock-space normalization factor N * 0 (N * 1 ) (see Sec. II A) for k even (odd).Note that the cat codes we consider in this work are distinct from the two-mode cat codes in Ref. [84] and the single-mode cat codes in Refs.[4,99], where the codewords are manifestly nonorthogonal while still exhibiting discrete rotational symmetry.

Binomial codes
Binomial codes were introduced in Ref. [6] as a class of codes that can exactly correct loss, gain, and dephasing errors up to a certain order.The codewords are most straightforwardly defined in the conjugate basis 25 : The Fock-grid coefficients {f kN } can be read off directly, c.f. Eq. ( 9).There are many binomial codes with N -fold rotation symmetry, one for each value of K = 1, 2 . . ., which sets the truncation level in Fock space.The mean excitation number is nbin = 1 2 N K [40], and the mean modular phase can be simplified to Binomial codes are defined explicitly at the codeword level, leaving freedom to describe associated primitives.However, each binomial code, specified by its rotational order N and truncation parameter K, has a different set of primitives.An example primitive can be defined as translation symmetry, all GKP codes also exhibit N = 2 discrete rotation symmetry, as we show below.However, GKP codes are not rotation codes as we define them in Sec.II, because the operator Ẑ2 does not act as a Pauli operator.Depending on the underlying lattice defining the GKP codewords, ẐN may nevertheless act as a logical Clifford operator for some values of N .Two notable GKP codes where this is the case are the square-and hexagonal-lattice GKP codes, which means that these codes exhibit some properties of rotation codes.We briefly elucidate this point.
The codespace of a single-mode ideal GKP qubit is defined to be the +1 eigenspace of the stabilizers where D(ζ) = e ζâ † −ζ * â is the displacement operator, 26and α and β are complex numbers satisfying The stabilizer group consists of all powers ( ŜX gkp ) n1 ( ŜZ gkp ) n2 for n 1 , n 2 ∈ Z.The shift operators that act as logical Paulis for the GKP qubit are where the form of Ŷgkp follows from the general identity D(α) D(β) = e Since X † gkp = Xgkp ( ŜX gkp ) −1 and Ẑ † gkp = Ẑgkp ( ŜZ gkp ) −1 , they are equivalent up to stabilizers and have the same action on the codespace.Thus, R2 acts as the identity operator on the codespace of an ideal GKP code.In other words, all GKP codes have 2-fold discrete rotation symmetry.
The computational-basis codewords can be written as a superposition of coherent states: with j = 0, 1.It is natural to define state lattices in the complex plane for the computational-basis codewords, as well as the codespace lattice, L = L 0 ∪L 1 , consisting of all points n 1 α + n 2 β.As described in Ref. [40], the codeword lattices are basis-dependent, while the codespace lattice L is not.Note that Eq. (C2) means that the unit cell, or fundamental parallelogram, of L has area π/2. 27e consider two canonical examples of ideal GKP codes defined on square (gkps) and hexagonal (gkph) lattices.The codes can be defined in terms of their respective lattice-basis translations α and β: Thus, R4 = Ẑ2 = e i π 2 n (the Fourier transform operator) acts as a logical Hadamard H for gkps.It follows that the eigenstates of H for this code can be written in the form Eq. ( 4), a fact that was recognized in Ref. [3].It was also suggested there that measurement of number mod 4 to can be used to prepare Hadamard eigenstates, which are equivalent to the magic state T gkps up to Cliffords.Since mapping logical H to Z is a non-Clifford operation, this is not a trivial change of basis for a GKP code, and we therefore do not classify the square-lattice GKP code as a rotation code.
For hexagonal-lattice GKP, N = 6 rotations perform logical π/3-rotations around the XY Z-axis: giving a cyclic permutation of the logical Pauli operators.Thus R6 = Ẑ3 acts as the logical Clifford gate H S † . 28An N = 3 rotation, given by R3 = R2 6 , acts as the logical gate ( H S † ) 2 = e −i π 4 S H, which performs a cyclic permutation of the Paulis in the opposite order.
The fact that the square-and hexagonal-lattice GKP codes have non-trivial Cliffords implementable as discrete rotations also implies that the crot gate can be used between a bosonic rotation code and these two GKP codes.In particular crot N 4 (crot N 6 ) implements a controlled-H (controlled-H S † ) between an order-N rotation code and a square (hexagonal) GKP code, with the rotation code as control and the GKP code as target.
In contrast to square-and hexagonal-, the rectangularlattice GKP code does not benefit from additional Clifford gates performed via discrete rotations.Lastly, we note that the crystallographic restriction theorem implies that no lattice can have higher than 6-fold rotation symmetry, and R6 is thus the highest degree rotation operator that can preserve the codespace of a GKP code.

Appendix D: Pretty Good Measurements
As we alluded to in Sec.II B 2, the canonical phase measurement might not be the optimal measurement to distinguish the codewords |± N .Even in the absence of noise, two orthogonal codewords cannot in general be perfectly distinguished by a canonical phase measurement due to embedded phase uncertainty ∆ N (θ).Moreover, in a realistic scenario where the codewords may be damaged, defining a phase estimation problem with respect to the ideal codewords is sub-optimal.We do not attempt to find an optimal scheme in general, as this must likely be done on a case-by-case basis for different codes and noise models.Instead, we introduce a measurement that perform well for all the codes and noise models 28 Interestingly, H S † = ( S H) † , and S H has T -type magic states as its eigenstates, where we use the original terminology from [67].
N (ρ N ) The first step of the circuit in Fig. 6 we study in this paper.This is the Pretty Good Measurement introduced in Refs.[43][44][45].The Pretty Good Measurement perfectly distinguishes orthogonal states and is designed to also distinguish fairly well states with small non-zero overlaps.The measurement is defined through the POVM elements where |i runs over the states to be distinguished, and N represents an arbitrary noise channel.The operator σ = N ( P ) with P = i |i i| represents the projector onto the subspace in question sent through the noise channel.The POVM elements satisfy i Mi = Pσ , where Pσ is a projector onto the support of σ.To have a complete measurement, one can add a POVM element Î − Pσ projecting onto the complement of Pσ .Note that in contrast to the canonical phase measurement, the Pretty Good Measurement explicitly exploits knowledge about the noise N .Here we introduce an error-correction circuit, depicted in Fig. 14, as an alternative to the circuit in Fig. 7.We call this error-correction method "hybrid" (hybrid-EC), because the first crot gate and the measurement of the top ancilla rail can be recognized as identical to one of the two steps of Steane-EC, while the second crot and the measurement on the data rail is a one-bit teleportation, identical to one of the steps in Knill-EC.Essentially, this circuit uses Steane-EC for one of the syndromes (numbershift errors) and Knill-EC for the other (dephasing errors).This error-correction scheme is based on the circuit identity where Ê = Êk (θ) is again an arbitrary initial error and the two rotation errors, R = Ê0 N L , as well as the most likely logical Clifford error Ca * can be deduced using, e.g., a maximum likelihood decoder.The rotation error is straightforward to correct, or alternatively can be tracked by updating later phase measurements.The error Ca * is not a Pauli error; however, by performing the error-correction circuit twice, the most likely error will be a Pauli from the set Pi ∈ { Ī, Z, X, X Z} which can be tracked in a Pauli frame.
We have verified in numerical simulations that the hybrid-EC scheme performs identically to the Knill-EC scheme presented in Sec.VII A, i.e., the results in Sec.VII B are identical for both schemes.In fact, there is arguably a slight advantage of the hybrid-EC scheme in the case of noiseless ancillae, because we can use an unencoded state |α for the upper ancilla rail in Fig. 14.This state give slightly better phase resolution compared to an M = 1 cat code, as used in Sec.VII B, at the same value of α.

a. Relation to recent experiments
The hybrid-EC scheme generalizes the experimental protocol used in the two experiments in Refs.[29,30], where error correction for N = 2 cat and binomial codes was implemented, respectively.The scheme employed the error-syndrome circuit Eq. (E2) with the ancilla replaced by an unencoded qubit in the state |+ = (|0 + |1 )/ √ 2 and the crot gate in their case was crot = crot N 1/2 = e i 2π N n⊗n .An error E k (θ) on the data qubit was thus imprinted as a phase on the ancilla, i.e., |+ → |0 +e i 2πk N |1 , and the syndrome measurement attempted to estimate this phase.Note that with N = 2, an initial error prior to the gate with |k| mod 2 = 1 on the data qubit flips the ancilla to |− , while an error with |k| mod 2 = 0 leaves the ancilla in the state |+ .This syndrome does not detect dephasing errors, nor does it restore the state back to the Fock grid |kN .For cat codes, loss events can be tracked in software so that recoveries for this particular error are not necessary (this does not include the no-jump part of the bosonic loss channel, however) [29].For binomial codes, optimal control was employed in Ref. [30] to find a unitary that approximately restores the codespace.In the hybrid-EC scheme we propose, both detection of dephasing errors and restoration of the codespace is performed by the second step of the error correction circuit, Eq. (E3).The difficulty of restoring the codespace has thus been replaced by the ability to prepare copies of encoded |+ N states.
considering the small κ φ t limit: × e (t−t k )S J . . .J e (t2−t1)S J e t1S ρ0 , (F5) where J ρ = κâρâ † , and S = L κ φ + L κ − J .Next, note that the no-jump part of the evolution factorizes as e tS = e t(Lκ φ +Lκ−J ) = e tLκ φ e t(Lκ−J ) , (F6) where e tLκ φ is given by Eq. (F2) and e t(Lκ−J ) ρ = e −κnt/2 ρe −κnt/2 .(F7) Using this, it is straightforward to pull the jump superoperators J through all the no-jump superoperators in Eq. (F5): J e tLκ φ = e tLκ φ J (F8) J e t(Lκ−C) = e −κt e t(Lκ−C) J .One can, of course, also find a Kraus-operator representation of e tLκ φ using exactly the same method, We, however, do not need such a Kraus-operator representation of the dephasing channel for our purposes in Sec.VII, since the dephasing channel commutes with all the crot gates.We found it more convenient to solve the master equation numerically, with N κ φ (0) = I the identity superoperator as initial condition, to find the pure dephasing channel N κ φ (t) = e tLκ φ .
) are orthogonal, Θ|( ẐN ) m |Θ = 0 for 0 < m < 2N , then N 0 = N 1 = 2N .Generally, however, they are not orthogonal, and the normalization constants are different, N 0 = N 1 .Regardless, the codewords themselves are exactly orthogonal for any valid |Θ , and any state in the codespace, |ψ N = a|0 N + b|1 N , has N -fold rotation symmetry, RN |ψ N = |ψ N .Here and henceforth we suppress the Θ-subscript when referring to a generic rotation code of order N unless it is required for clarity.From the above, we recognize that there are many different rotation codes with the same degree of rotation symmetry N .While a given primitive |Θ uniquely defines an order-N rotation code, there are many possible primitives that give rise to the same code.Several examples of rotation codes are shown in Fig.1.The best known example are cat codes, where the primitive is a coherent state |Θ cat = |α [5]. 2 Another simple example are the "0N codes" |0 0N = |0 , |1 0N = |N [38, 39], which can be constructed, e.g., from |Θ 0N = (|0 + |N )/ √ 2. The form of Eq. (

FIG. 4 .
FIG. 4. (a) Magnitude of the Fock-state amplitudes for a |+N state for N = 3 cat, binomial, and Pegg-Barnett codes with parameters that give ncode = 19.5 for each.The amplitudes are nonzero only on Fock states |3k for k = 0, 1, 2, . . . .(b) The embedded phase uncertainty, Eq. (15), for each family of N = 3 codes as ncode increases.For each code a proper asymptotic limit, given in TableI, yields no embedded phase uncertainty, ∆N (θ) → 0. In the opposite regime, ncode → 3 2 , all three codes limit to the 03 encoding.Note that N = 3 codes with ncode <3  2 do not exist and that binomial and Pegg-Barnett codes are defined only at discrete excitation numbers; connecting lines are guides for the eye.

FIG. 5 .
FIG.5.Measurement of n mod 4 using an ancilla prepared in (a) a coherent state and (b) a two-lobe cat-state.Shown are the initial ancilla states (solid), and each circle is a potential rotation of the ancilla that depends on the data-rail state being measured.They are labeled by outcomes for a measurement of n mod 4. In both (a) and (b) the specific ancilla rotation shown, θanc, corresponds to an = 1 outcome indicating that the data rail is off the order-N Fock grid.

FIG. 6 .
FIG.6.Propagation of errors through gates.An error Êk (θ) at the input of a gate (left column) is propagated to new errors at the output (right column).The circuit identities hold up to an overall phase factor (see the text for the exact relations).The new error Ê0(θk) for ŜN and crot is a pure rotation error with θ k = πk N M , with N = M for ŜN .

FIG. 10 .
FIG. 10.Building blocks of the error-correction scheme from Ref. [36].(a) The rails represent number-phase codes and the ĈZ gates are crot gates.A Ĉ⊗n Z gate enacted between a repetition code block and a single ancilla acts as a logical ĈZ .(b) The same circuit as in (a) where the thick lines represent length n repetition code blocks.(c, d) By repeating a nondestructive measurement of ẐL ⊗ ẐL r times, we get a robust MZ L Z L gadget.(e) The error-correction gadget fromRef.[36].Here, |+L = |+N ⊗n , and the XL-measurement is independent, destructive phase measurement of each mode in the repetition code block.

1 2 (
αβ * −α * β) D(α + β).The constraint Eq. (C2) ensures that the stabilizers in Eq. (C1) commute, and that Xgkp and Ẑgkp commute with the stabilizers and anti-commute with each other.From the identity e −iθn D(ζ)e iθn = D(e −iθ ζ) we see that the discrete rotation operator RN for N = 2 has the following action on the Pauli shift operators: R †

FIG. 13 .
FIG. 13.Code lattices L0 (filled circles) and L1 (open circles) in the complex plane for (a) square-lattice GKP and (b) hexagonal-lattice GKP.The area of the lattice-parallelogram is π/2.The codespace lattice L is also apparent in the Wigner function Wgkp(α) of the completely mixed state 1 2 Πgkp.Using quadrature axes, Q and I, as defined in Fig. 1, Wgkp(α) is identical to the above plots with positive δ-functions at each point in L. For the Wigner functions, arrows indicate direction of displacement for Xgkp and Ẑgkp.

)
Codespace lattices for gkps and gkph are shown in Fig.13.Depending on the lattice, specific discrete rotations can act as non-trivial logical Clifford gates.In particular, for square-lattice GKP, N = 4 rotations transform the Paulis:
Appendix E: Hybrid Steane/Knill error correction are both proportional to k.A phase measurement on the top rail thus estimates k, and a recovery operation can be applied to the bottom rail to undo the leftover error R .The first step of the circuit in Fig.7(b), involving only the top ancilla, measurement of the excitation number mod N on the data rail, as explained in Sec.V.The second step of the circuit, to a fresh new ancilla, thus restoring the codespace up to a known rotation error as per Eq.(E1).More explicitly, we consider an encoded state ρN in an order N rotation code sent through a noise noise channel N • = n Ân • Â † n , followed by the error-correction circuit in Fig.14.In this case, it is convenient to expand the noise Kraus operators as Ân = k dθc nk (θ) Êk (θ) = k Ênk where we define Ênk = dθc nk (θ) Êk (θ).The state after the error-correction circuit can be writtenE hybrid • N (ρ N ) = 1 2 a,b=± x n,k,k |a N b N | Ê † nk ,(E5)τ kk := Ê0 πk N M |0 M 0 M | Ê † 0 πk N M ,(E6)represent damaged codewords for the data and ancilla, respectively, and C+ = H, C− = X H are logical Cliffords.We again use a notation where ρL on the righthand side represents the same logical state as ρN on the left-hand side, but where the latter is encoded in the order-L number-phase code of the bottom ancilla in Fig.14.The most likely rotation error on the output, Ê0πk *