Robust encoding of a qubit in a molecule

We construct quantum error-correcting codes that embed a finite-dimensional code space in the infinite-dimensional Hilbert state space of rotational states of a rigid body. These codes, which protect against both drift in the body's orientation and small changes in its angular momentum, may be well suited for robust storage and coherent processing of quantum information using rotational states of a polyatomic molecule. Extensions of such codes to rigid bodies with a symmetry axis are compatible with rotational states of diatomic molecules, as well as nuclear states of molecules and atoms. We also describe codes associated with general nonabelian compact Lie groups and develop orthogonality relations for coset spaces, laying the groundwork for quantum information processing with exotic configuration spaces.


I. INTRODUCTION
Quantum systems described by continuous variables arise in many laboratory settings. For example, a microwave resonator in a superconducting circuit or the motional degree of freedom of a trapped ion can be viewed as a harmonic oscillator with an infinite-dimensional Hilbert space. Such continuous-variable systems have potential applications to quantum information processing. However, quantum information encoded in an oscillator can be easily damaged by ubiquitous noise sources such as dissipation and diffusive motion in phase space.
Robustness against noise can be achieved more easily by encoding a protected finite-dimensional system within the infinite-dimensional Hilbert space of an oscillator. One method for doing so was proposed some years ago by Gottesman, Kitaev, and Preskill (GKP) [1]. A GKP code is a quantum error-correcting code designed to protect against noise that slightly shifts the position or momentum of an oscillator. The ideal basis states for the code space are "grid states" supported on periodically spaced points in position or momentum space. By measuring the code's check operators, one can diagnose a shift error that may have occurred, without disturbing the encoded quantum information, and then correct the error (if the shift introduced by noise is not too large) by performing a compensating shift. These codes are expected to perform well against realistic noise, including dissipation, which typically acts locally in phase space [2][3][4]. Construction of GKP grid states has recently been demonstrated experimentally [5,6].
In this paper, we develop GKP-like codes that protect against, not noise that shifts the position and momentum of an oscillator, but rather noise that shifts the (continuous) orientation and (discrete) angular momentum of an asymmetric rigid body. GKP codes for objects that rotate about a fixed axis [ Fig. 1(a)] were already discussed in [1]. In that case, the orientation of the object corresponds to an element of the two-dimensional rotation group U 1 = SO 2 = C ∞ . New issues arise for an object that rotates freely in three dimensions [ Fig. 1(b-c)], with orientation described as an element of the 3-dimensional Figure 1. Rigid bodies. A molecular code protects against errors in the orientation and angular momentum of a rigid body, which may be (a) a planar rotor whose orientation is an element of the two-dimensional rotation group U1, (b) a rigid rotor whose orientation is an element of the 3-dimensional rotation group SO3, or (c) a linear rotor whose orientation is a point on the two-sphere S 2 . A basis state for the code, or codeword, is a superposition of a finite number of orientations. rotation group SO 3 (for an object with no symmetries) or a point on the two-sphere S 2 = SO 3 /U 1 (for an object with a symmetry axis).
Our work is motivated by recent progress in trapping and coherently manipulating individual diatomic and polyatomic molecules [7][8][9][10][11]. Since we only consider a molecule's rotational degrees of freedom, for our purposes a molecule is equivalent to a rigid body. For that reason, we refer to quantum codes embedding a protected finitedimensional subspace in the infinite-dimensional Hilbert space of a rigid body as molecular codes.
Rigid rotor energy eigenstates, if spaced sufficiently far apart in angular momentum, provide protection against small jumps in angular momentum, but are unprotected against dephasing in the angular-momentum eigenstate basis resulting from fluctuations in the rotor's orientation. Our molecular codes, inspired by GKP codes, are designed to protect against both momentum kicks and orientational diffusion of a single molecule. Here we develop the theory of molecular codes and generalizations thereof. Laboratory realizations of these coding schemes that actually improve the coherence times of molecular qubits may still be far off, but we propose laying the foundations for molecular quantum error-correction as a challenging goal for the physicists and chemists of the NISQ era [31].
Though our work is partially motivated by advances in molecular physics, the coding methods we use are best explained in an abstract group-theoretic framework, which we will summarize in the next section. In Sec. III, we enumerate a variety of physical settings, in molecular physics and beyond, where our code constructions may be applicable. The connection with rotational states of the three molecular rotors from Fig. 1(a-c) is developed in greater detail in Secs. IV-VI, respectively. Section VII discusses extensions to more abstract state spaces. Section VIII contains conclusions and ideas for future work.

II. SUMMARY OF OUR FRAMEWORK
We describe a family of codes that generalize the GKP codes [1], which were initially formulated to encode a finite-dimensional system in the infinite-dimensional Hilbert space of a bosonic mode, or of many bosonic modes. Each code in our generalized GKP code family is associated with a nested sequence of groups Here G is a continuous group of shifts in the position of a physical object. If no nontrivial subgroup of G leaves the object invariant, and any position can be reached by applying an element of G to a standard initial position, then we may regard the "position eigenstates" {|g , g ∈ G} as a basis for the Hilbert space of the object. The generalized GKP code is a subspace of this Hilbert space defined by two properties: (1) The discrete subgroup H of the continuous group G leaves any state in the code space invariant, (2) The subgroup K acts transitively on a basis for the code space. For the standard GKP code, G is the abelian noncompact group R, the group of translations in position space of a particle in one spatial dimension. The subgroup K is the infinite discrete group containing all translations of the particle by an integer multiple of α, where α is a fixed real number. The subgroup H contains all translations by an integer multiple of dα, where d is the dimension of the code space. In this case, we may choose the basis for the code space to be (up to normalization) k ∝ h∈Z |q = (k + hd)α , (2) where |q is a position state of the oscillator and k ∈ {0, 1, · · · , d−1}. We refer to each such basis element of the code as a codeword. Thus a translation of q by dα leaves the codewords invariant, and a translation of q by α permutes the codewords according to k → k+1 modulo d. A shift in q due to an error can be detected by measuring q modulo α.
In addition to errors that shift the value of q, the GKP code also protects against errors that introduce qdependent phases. Phase errors which are diagonal in the q basis are described by functions on R. Such functions can be Fourier-expanded using irreducible representations (irreps) of R, labeled by the momentum p. The irreps that preserve the code space are those with p an integer multiple of 2π dα , and those that act trivially on the code space have p an integer multiple of 2π α . For a generalized GKP code, the detectable position shifts are labeled by elements of the coset space G/K, and the "logical" position shift errors that preserve the code space are labeled by elements of K/H. Undetectable logical phase errors correspond to representations of G which represent the subgroup H trivially, but represent K nontrivially.
In Sec. IV, we illustrate the concepts underlying generalized GKP codes by discussing the example of a planar rotor. In this case G is U 1 , the infinite compact group of rotations in a two-dimensional plane, K is the finite subgroup of U 1 containing rotations by an angle which is an integer multiple of 2π dN , and H is the subgroup of K containing rotations by an angle which is an integer multiple of 2π N . Here N, d are positive integers, and d is the dimension of the code space. This code can correct a rotation of the planar rotor by any angle less than π dN , and can correct a shift in angular momentum by any integer less than N/2. The structure of this code, for the case N = 3 and d = 2, is depicted in Fig. 2

(a).
While these planar rotor codes were already introduced in [1], generalized GKP codes where G is nonabelian have not been previously discussed to our knowledge. In Sec. V, we introduce molecular codes, which can protect an asymmetric rigid body from rotational shift errors and angular momentum kicks. In this case G is SO 3 , the infinite compact group of proper rotations in 3D space. The finite subgroups H ⊂ K ⊂ SO 3 can be chosen in various ways. By choosing H = Z N ⊂ K = Z dN to be discrete cyclic groups of rotations about one axis (for chemists, Z N = C N ), we obtain codes that can correct small rotations of the body about any axis, and can also correct momentum kicks that change the total angular momentum of the body by δ < N/2. For a pictorial representation of this code in the case N = 3, d = 2, see Fig. 2

(b).
We also discuss examples where H and K are finite nonabelian subgroups of the rotation group. Guided by the stabilizer formalism, we show that for each molecular code there is a Hamiltonian which has the code as its ground space. Each ideal codeword is not normalizable, a superposition of an finite number of position eigenstates, but there are normalizable approximate codewords which maintain good error-correcting properties.
We generalize the code construction further in Sec. VII, where we allow G to be any finite group, compact Lie group, or sufficiently well-behaved non-compact group. This formulation provides a unified treatment that encompasses molecular codes (G = SO 3 ), CSS codes (G = Z ×n D ) and GKP codes for qudits (Z D ), planar rotors (U 1 or Z), and oscillators (R).
In Sec. VI, we discuss the linear rotor, a rigid body with a symmetry axis, such as a heteronuclear diatomic molecule. For this case, the quantum codes we construct are not generalized GKP codes as defined above, because the position basis states of the linear rotor are indexed not by elements of a group, but rather by points in the coset space SO 3 /U 1 = S 2 . Codewords of a linear rotor code are uniform superpositions of antipodal points on S 2 , which lie in the same orbit of H acting on S 2 , where H is a finite subgroup of SO 3 . See Fig. 2(c) for the case H = Z 3 and codespace dimension two.
The linear rotor codes can also correct small rotations about any axis, and analyzing correction of momentum kicks follows closely the corresponding discussion for molecular codes. However, for correction of combinations of rotations and momentum kicks, there are complications which arise because each SO 3 rotation acting on S 2 has fixed points.
Coset spaces arise in both generalized GKP codes and linear rotor codes, but for different reasons. In GKP codes, position basis states are in one-to-one correspondence with elements of the group G, and the position shifts detected by the code are labeled by elements of G/K. In linear rotor codes, the position basis states themselves are in one-to-one correspondence with elements of the coset space SO 3 /U 1 . Since coset spaces play a central role in both settings, we formulate position and momentum bases, shift operators, and orthogonality relations for general G/H in Appx. D. These are applicable to Hsymmetric molecules when G = SO 3 (see Sec. III C), and may be of independent interest for general G.

III. EXPERIMENTAL REALIZATIONS
Before proceeding to discuss code constructions in more detail, in this section we briefly mention some of the physical settings where these constructions might apply. The rotational states of a molecule provide one such setting, where the orientations of a molecule correspond to elements of SO 3 (in the case of an asymmetric polyatomic molecule) or S 2 (in the case of a heteronuclear diatomic molecule). In addition, other physical systems, including atomic or molecular hyperfine, vibrational, and electronic states, as well as atomic ensembles and levitated nanoparticles, realize similar configuration spaces. Codeword constructions. (a) Left panel: Sketch of the planar rotor state space U1. Black/white points represent the positions present in the two codewords (10) of the Z3 ⊂ Z6 GKP rotor code. Correctable shifts (− π 6 , π 6 ] are highlighted in blue. Right panel: U1 angular momentum ladder ∈ Z. Black/white squares represent momentum states present in the logical-X codewords (11). (b) Sketch of the same features of the Z3 ⊂ Z6 molecular code (45). Left panel: Position space is drawn as a ball of radius π with antipodal points identified, and each SO3 rotation by angle ω around axis v ∈ S 2 corresponds to the vector ωv on the ball. The set of correctable rotations is in blue, but part of it is cut out to show that it contains the origin (meaning that small rotations around any axis are correctable). Right panel: Momentum space is a 3D square pyramid with height labeled by and base by |m|, |n| ≤ . We plot only the m = n part, where the codewords (49) have support. (c) Sketch of similar features of the Z3 ⊂ Z6 linear rotor code (102). Left panel: the blue spherical lune contains all points that are closer to the enclosed black point than to any other black or white point. Right panel: Momentum space is a 2D pyramid with base |m| ≤ , showing states participating in the logical-X codewords (105).
Laser cooling and trapping techniques have recently enabled several seminal advances for diatomic polar molecules, namely: the creation of low-entropy arrays in an optical lattice [39,40], trapping and imaging in tweezer arrays [7,9] and magnetic traps [41,42], and even the first quantum degenerate gas of polar molecules [43]. Coherence times of ∼ 100 ms to ∼ 1 second in angular momentum states of diatomic polar molecules have already been observed in several experiments [44][45][46].
Laser cooling and quantum control of polyatomic molecules continues to be a rapidly-progressing field [8,32,47,48]. Further, the possibility of angular momentum state-resolved detection has recently been considered [10,32]. In addition, quantum gates of opticallytrapped symmetric top molecules have recently been analyzed [21]. Symmetric top molecules also hold promise for simulating quantum magnetism [49,50]. Moreover, specific classes of polyatomic linear polar molecules that feature more than one optically active metal atom have recently been proposed for laser cooling and trapping [51]. Prospects for cooling other complex polyatomic molecules have also been analyzed [52].
Here we highlight a few techniques that could help realize aspects of our codes in real systems.
Rotational states The codewords for our codes can be expressed as coherent superpositions of several different molecular orientations. Alternatively, each codeword can be expressed as a coherent superposition of eigenstates of angular momentum (a.k.a. "rotational states"). When discussing experimental realization of the codes, the basis of rotational states is far more convenient than the position-eigenstate basis, because rotational states can be directly addressed using experimental tools.
For the case of a planar rotor, with configuration space U 1 , the rotational basis states {| } transform as onedimensional irreducible representations of U 1 ; for the case of a polyatomic molecule, with configuration space SO 3 , the basis states {| mn } correspond to matrix elements of irreducible representations of SO 3 ; and for the case of a diatomic molecule, with configuration space S 2 , the basis states {| m } correspond to spherical harmonics. In molecular physics [53][54][55][56], corresponds to the total angular momentum of the rotor, m is the z-component of the angular momentum in the lab frame, and n is the z-component in the rotor frame. How codewords are expressed as linear combinations of rotational states is illustrated in the right panels of Fig. 2(a-c), respectively, for three simple rotor codes.
Microwave dressing One can try to stabilize the codewords using polychromatic microwave dressing. Note that we consider single molecules and neglect any effects due to their interaction. The inherent rigid-rotor Hamiltonian for SO 3 and S 2 is diagonal in the angular momentum basis, with eigenvalues ( + 1). 1 Therefore, transitions between states with different momenta are individually addressable (unlike, e.g., the transitions of a harmonic oscillator Hamiltonian). Selection rules for the internal indices n, m are dictated by the polarization of the microwave field. Thus, the energy and polarization of a microwave field can be tuned to couple two angular momentum states that are neighbors in the angular momentum pyramid. That is, the value of , m, or n can change by 1 unit in a single-photon transition.
However, the angular momentum states making up each codeword are widely spaced in the internal indices. For example, in the case of the SO 3 code depicted in Fig. 2(b), the codewords have support only on {| mn } states such that m = n is an integer multiple of 3. For Because a single microwave tone couples states that differ by just 1 unit of m or , a sequence of virtual transitions induced by multiple pulses would be needed to couple states with more widely separated values of m or . For example, coupling states with |δm| = 3 requires a 3-photon transition that is sufficiently detuned from the two intermediate states, and coupling states with δ = 2 requires a two-photon transition sufficiently detuned from the one intermediate state. We outline a scheme to generate these states in Appendix A. This scheme requires many pulses, but it is on par with previously proposed molecular dressing schemes [57][58][59].
We have neglected rotational-state-dependent trapping effects, which are prominent in optical dipole traps [44,[60][61][62]. These effects will be negligible when considering a single molecule in the motional ground state of the trap, whose intensity can be robustly stabilized. In this case, the unique Stark shift for each rotational state due to the trap simply requires an updated microwave frequency catalog for all transitions. However, this spread in polarizability poses a practical problem when considering many molecules, since one must ensure that they all experience the same optical intensity. Accordingly, alternative trapping schemes may be more appropriate for the applications proposed in this work. Magnetic micro-traps [41] are compatible with electronic spin doublet or triplet molecules such as CaF, SrF, YbF, or YO. Radio-frequency electric traps are compatible with molecular ions [20,32]. Such trapping potentials are sub-stantially less dependent on the rotational state of the molecule since they couple to magnetic dipoles and electric monopoles, respectively.
More generally, one can consider engineering the desired pulses to generate states or correct errors via established optimal-control schemes [38,63]. It has been shown that one can control the planar [64,65], linear [66][67][68], and even rigid [69] rotors, and it would be useful to extend these and other efforts [70,71] to stabilizing the required code subspace.
Crystal fields In a class of quantum error-correcting codes called stabilizer codes, the code space is the simultaneous eigenspace with eigenvalue 1 of a set of commuting Pauli operators, which are called check operators. A special subclass of stabilizer codes are the CSS codes, for which each check operator can be chosen to be either Z-type or X-type; the Z-type operators {Ŝ Our molecular codes are not stabilizer codes, but as we explain in Sec. V, the code space is the degenerate ground space of a Hamiltonian which is a sum of Z-type and Xtype terms. Here the X-type check operator rotates the molecule, while the Z-type check operator is diagonal in the position basis but alters the total angular momentum. Just like its oscillator counterpart [1, Sec. XIII], this molecular Hamiltonian is gapless, but ground states of an approximate gapped version would be close to the approximate codewords we introduce in Sec. V C.
TheŜ Z check operators are momentum kicks which couple well-separated angular momentum states {| mn } for SO 3 or {| m } for S 2 . For example,Ŝ Z for a linear rotor code based on the octahedral group is a superposition of octopole ( = 4) spherical harmonics; see Eq. (116). Such harmonics are in principle present in a general interaction with a bath [72]. However, simple laser, DC, or microwave fields produce only ≤ 2 harmonics [54,Chs. 4 and 7].
One way to generate the required higher value of is to put the molecule into a crystal lattice. For rotor codes based on a discrete subgroup K ⊂ SO 3 ,Ŝ Z is the lowestfunction that is symmetric under K. Thus, putting the rotor into a K-symmetric lattice yields a background field whose dominant term is exactlyŜ Z . For example, putting a linear rotor into an octahedrally symmetric lattice yields a background potential [73,74] that is exactly theŜ Z (116) required for the octahedral code. This potential is minimized at those orientations of the rotor that are superposed to construct the codewords; in fact, these degenerate minima were noticed earlier in an experimental context [75]. Similarly, embedding into a two-dimensional square lattice yields the appropriateŜ Z (114a) for a linear-rotor version of the planar rotor code introduced in Sec. IV. To access subgroups of SO 3 forbidden in crystals, one could consider embedding a molecule in a quasicrystal.
Crystal symmetries can enforce only theŜ Z check operator condition; theŜ X check operator condition must be imposed by some other means. TheŜ X operators are trigonometric functions of the angular momentum operators ← − L for SO 3 orL for S 2 . These are not naturally available, as the rigid rotor Hamiltonian (75) and its generalizations 1 contain terms that are at most bilinear in the angular momentum components. However, there are other terms in the full rotor-in-lattice Hamiltonian [76,Eq. (7.2)], and, akin to superconducting circuit schemes [77], one might engineer the molecule's environment (for example, by embedding the molecule in a liquid Helium nanodroplet [78]) to arrange for adiabatic elimination to provide the requiredŜ X terms.
Nuclear spin coupling If an error causes the molecule to rotate slightly, we recover from the error by applying a compensating small rotation. The desired rotation can be executed by turning on a Hamiltonian which is linear in the angular momentum. But since the natural rigid rotor Hamiltonian is quadratic, this linear term is not so easily realized in the laboratory.
One way to provide a Hamiltonian term which is linear in the molecule's angular momentum is to couple the rotational states of the molecule to nuclear spin states via nuclear spin-rotation interactions [53,Eq. (1.32)] [45,79] where I is the nuclear spin. The nuclear spin can serve as a convenient ancilla system, and the orientation of the molecule can be controlled by manipulating the nuclear spin. Similar approaches have been applied to solidstate systems in which electronic spins are coupled to nuclear spins [80]. This is roughly analogous to using a superconducting Josephson-junction device coupled to a bosonic mode for manipulating the states of a bosonic error-correcting code.
We also need to correct momentum kicks by applying unitary operations that change the value of . Operations which shift the occupation number of a cavity can be applied by coupling the cavity to a 3-level atom [81] or by using linear optics [82]. Similar schemes could shift the value of for a U 1 rotor. Extensions of such schemes may be helpful for controlling the rotational states of higher-dimensional rotors.

B. Spin systems
Certain combinations of spins offer another platform for simulating the linear rotor space S 2 and quotient spaces SO 3 /H from Table I. We list three manifestations: L spin-1/2 systems in a totally symmetric spin state, L spin-N/2 systems in a totally symmetric state, and a pair of spin-L/2 systems. In the limit of large L, each of these systems provides a useful approximation to one of the spaces of interest. While the first two cases are usually studied in the context of atomic ensembles, the third case can easily arise in the nuclear spin manifold of an atom or a molecule. Many small spins L spin-1/2 particles in a totally symmetric spin state have a total angular momentum of L/2. The L → ∞ limit of this large collective spin is sometimes said to be a semiclassical limit, meaning that the spin-L/2 object behaves like a continuous classical spin when L is large. An intuitive way to understand this limit is to consider the spin-coherent states |v SC = e −iϕ/2 cos ϑ for v = (ϑ, ϕ) ∈ S 2 [89,90]. These states are not orthogonal; instead they form an overcomplete frame for the collective spin's (L + 1)-dimensional Hilbert space, with overlap | v|v SC | 2 = ( 1+v·v 2 ) L . As L → ∞, the states become orthogonal and correspond to the position states |v of S 2 (Table V.B). For finite L, superpositions of these spin-coherent states can be approximate codewords for a linear rotor code.
Many medium spins Any pure state of a spin-1/2 system is invariant under a continuous U 1 subgroup of the rotation group SO 3 ; each pure state corresponds to a point on the Bloch sphere, and a rotation about the axis aligned with that Bloch vector leaves the state invariant. In contrast, there are pure states in higher-spin representations for which the subgroup which preserves the state is a nontrivial discrete subgroup H of SO 3 . For example, the spin-2 state |T ∝ | 2 −2 + √ 2| 2 1 is invariant under the tetrahedral subgroup T. Therefore, applying SO 3 rota-tions to |T generates a manifold of states { |a T }, where the label a is a point in the coset space a ∈ SO 3 /T. The spin-coherent states { |a ⊗L T }, obtained by taking a tensor product of many identical elements of this manifold, approximate the position-basis states of SO 3 /T in the limit of large L. This idea can be generalized: spin-coherent states { |a ⊗L H } approximate the position-basis states for the coset space SO 3 /H, if |a H is a higher-spin state with invariance group H.
The above T-symmetric and similar H-symmetric states [96, Table 2] -examples of Perelomov coherent states [90] -have been used as a mean-field ansatz for the ground space of spin-N Bose-Einstein condensates [97,98]. We will use such coherent states to extract error syndrome information for molecular codes (see Sec. V B).
Two large spins Instead of using only the symmetric subspace, one can consider the entire space of a pair of spin-L/2 systems. Per the addition rules [99,Ch. 8], the (L + 1) 2 orthonormal basis states for this system can be chosen to be the angular-momentum eigenstates {| m }, with ≤ L and |m| ≤ . These are precisely the rotational states of a linear rotor, except for the truncation ≤ L. Formally, then, the state space of a pair of spin-L/2 systems matches the state space on S 2 in the limit L → ∞. Since the normalizable approximate codewords of the linear rotor code are necessarily truncated for large L anyway, these approximate codewords can be accurately realized using a pair of spin-L/2 systems for sufficiently large L (see Sec. V C).
If one instead considers two different spins L/2 and L /2, one obtains a different band of S 2 momentum states. While developing codes for such band-limited subspaces is outside the scope of this work, it is possible that our coding strategies may also be useful there.
As a concrete experimental platform for large-spin systems, we can consider nuclear spin spaces of molecules or single atoms. Diatomic molecules such as NaCs [19] offer exactly the band-limited subspaces mentioned above. Concerning single atoms, Lanthanide species such as dysprosium (Dy), holmium (Ho), and erbium (Er) have large total spin manifolds in the their ground states due to their large nuclear spins and many unpaired electrons in their f-shells. Accordingly, such atoms have already attracted attention for the possibility of scaling up quantum computing by collectively encoding in multilevel atoms [100][101][102]. Ho in particular has the largest hyperfine ground space of any atom, with 128 ground states [102]. Laser cooling and trapping techniques are well established for Dy [103], Ho [104], and Er [105], as well as other lanthanides. Moreover, quantum degenerate gases of Dy [106,107] and Er [108,109] are widely used for novel quantum simulations based on their large magnetic dipole moments.
Planar rotors Several systems have the configuration space of the planar rotor. The system depicted in Fig. 1(a) is a diatomic molecule confined to rotate in a two-dimensional plane, but one can also consider a twoion crystal [110]. Other possibilities include the phase difference between two superconductors on either side of a Josephson junction [111] and orbital angular momentum of light [112].
One can also embed the first few angular momentum states of the planar rotor in the linear and rigid rotors. For fixed angular momentum L, the linear rotor subspace {| L m } with |m| ≤ L is equivalent to the band-limited subspace {| , | | ≤ L} of the planar rotor.
Symmetric molecules A molecule with symmetry group H has an orientation state space parameterized by SO 3 /H (see Table I). For example, the methane molecule CH 3 has the tetrahedral symmetry group T, and the alkaline earth monomethoxide (MOCH 3 ) family -potentially useful for quantum computing [21] -has symmetry group Z 3 . This is also the relevant symmetry group of Posner molecules, postulated to have potentially useful quantum effects [113,114]. The symmetry group of the fullerene molecule is the icosahedral group I, and the 3-manifold SO 3 /I has an exotic shape that was once proposed as a model for the geometry of the universe [88,115]. It is interesting that such exotic spaces are readily accessible in relatively simple molecules. Completely asymmetric and U 1 -symmetric molecules correspond, respectively, to rigid and linear rotors from Sec. III A.
More generally, if a group G acts transitively on the states of a quantum system, and the subgroup H of G leaves the states invariant, then the configuration space of the system is G/H. In Appendix D, we develop mathematical tools for parameterizing the position eigenstates and the dual momentum states of such a system, including orthogonality/completeness relations, and a Poisson summation formula [116].
Electronic states One can consider embedding certain spaces from Table I in the electronic eigenstates of single atoms. The eigenstates of hydrogen offer a platform for a band-limited subspace of the linear rotor S 2 , and even the space SU 2 (closely related to the rigid rotor SO 3 ; see Appx. B). Let us label the atom's eigenstates by ν, m , where 0 ≤ |m| ≤ < ν and the energy E ν, ,m ∝ 1/ν 2 . For fixed energy ν = L, the manifold of states is the same subspace of S 2 as that obtained by combining two large spins in Eq. (6). If we instead consider all values of ν, , m, we obtain SU 2 by an appropriate unitary transformation, related to writing the hydrogen atom in parabolic coordinates [117].
Vibrational states One can also consider using vibrational states of atoms or molecules to encode quantum information [29]. As control over vibrational states improves, it may be possible to implement bosonic errorcorrecting codes [3]. Position-state subspaces of har-monic oscillators also yield the two rotational spaces of interest. For example, considering position states |x, y, z of three oscillators with x 2 + y 2 + z 2 constant yields S 2 . With four oscillators, one obtains SU 2 . To simulate S 2 using momentum states, one can take all Fock states of two oscillators with even total occupation number.
Levitated nanoparticles The codewords of our SO 3 and S 2 codes are coherent superpositions of different possible orientations for a rigid body. Though we have emphasized the potential applications to atoms and molecules, the same ideas can be applied to any quantized 3-dimensional rigid body that can be coherently manipulated. While there is a size limitation due to decoherence, we are on the cusp of entering the quantum regime for levitated nanoscale particles of helium [118], vaterite [119], diamond (alone [120] or doped [121]), and silicon [122][123][124], to name a few. Nanoparticles may seem to be unlikely candidates for quantum computing, but it would be interesting nonetheless to try to stabilize quantum superpositions of their orientational states (cf. [125]).

IV. ERROR CORRECTION BASICS FOR THE PLANAR ROTOR
The goal of error correction is to encode quantum information into a cleverly-chosen subspace (the code) such that it is possible to recover said information from errors caused by physical noise. Before proceeding to discuss codes which protect against noise acting on a 3dimensional rigid body, we will review a simpler case which was previously considered in [1]: encoding a finitedimensional system in the infinite-dimensional Hilbert space of a planar rotor. By discussing this case we can introduce the key concepts underlying our code constructions in a familiar mathematical setting. The interested reader can consult [126] [127,Ch. 7] for other introductory material on quantum error correction.
The position-basis eigenstates for a planar rotor are in one-to-one correspondence with the elements of the two-dimensional rotation group U 1 = SO 2 = C ∞ . Equivalently, these are the position eigenstates for a particle moving on a circle; the basis elements may be denoted {|φ , φ ∈ [0, 2π) = U 1 }, with continuum normalization φ|φ = δ(φ − φ ). A dual basis is provided by the angular-momentum eigenstates (a.k.a. "rotational states") {| , ∈ Z}, where φ| = 1 √ 2π e i φ and hence | = δ . Noise might rotate the system, applying an operator alternatively, noise might kick the angular momentum, applying some power of the kick operator In fact, we can expand an arbitrary noise channel E acting on the density operator ρ of the planar rotor in terms of a complete basis of operators, where each element of the basis is a product of anX φ operator and an th power of theẐ operator: Above, the expansion coefficients E φφ are such that E is a channel. Our goal is to encode a finite-dimensional logical system in the infinite-dimensional Hilbert space of the rotor, where this logical system is protected against any errorX φẐ where both φ and are sufficiently small. In other words, if ρ consists of states in the logical (a.k.a. code) subspace, and if E is expanded using only such cor-rectableX φẐ , then we will be able recover the original ρ from E(ρ). Otherwise, recovery may not be possible, and logical information stored in ρ may become corrupted.

A. A protected qubit
For example, the two orthonormal basis states of a protected qubit can be chosen to be [see Fig. 2 Both basis states are eigenstates with eigenvalue 0 ofφ modulo π 3 . Suppose that |ψ is an arbitrary state in the code space spanned by |0 and |1 . If an error occurs which causes φ to shift by δφ ∈ (− π 6 , π 6 ), we can unambiguously diagnose the error by measuringφ modulo π 3 . Once δφ is known, we can correct the error by applying a unitary transformation that shifts φ by −δφ, restoring the state of the rotor to the initial undamaged state |ψ .
Alternatively, we may expand the basis states of the code in the angular-momentum eigenstate basis, finding Both basis states are eigenstates with eigenvalue 0 ofL modulo 3. Suppose an error occurs which causes the angular momentum to shift by δ ∈ {−1, 0, 1}. We can unambiguously diagnose the error by measuringL modulo 3. Once δ is known, we can correct the error by applying a unitary transformation that shifts by −δ . Furthermore (see below),φ modulo π 3 andL modulo 3 are compatible observables that can be measured simultaneously. Therefore, we can correct any combination of shifts in φ and , as long as the shift in φ is no larger than π 6 and the shift in is no larger than 1.
The code basis states in Eqs. (10)(11) are not normalizable and therefore unphysical. However, we may replace the position eigenstates in Eq. (10) by narrow wave packets; then the sum over s in Eq. (11) is modulated by a broad envelope function. In that case, the code states are physical, and the nice error-correction properties we noted still hold, up to negligibly small corrections.
Our main task in this paper will be to generalize this code construction, in various directions. For that purpose, it will be convenient to have other ways to describe the code. Our first alternative description uses the stabilizer language [126,128].
Stabilizer formalism A stabilizer code may be characterized as the simultaneous eigenspace with eigenvalue 1 of a set of commuting unitary operators, called the stabilizer generators. For the code specified by Eqs. (10)(11), we may choose these operators to bê To check that these operators commute, recall the relation e iφL e −iφ =L − 1, and the identityXe αLX † = e αXLX † for any unitaryX and scalar α.Ŝ Z andŜ X are the code's check operators, which we can measure to diagnose errors. Note that measuringŜ Z is equivalent to measuringφ modulo π 3 and that measuringŜ X is equivalent to measuringL modulo 3, as we asserted earlier, and that we can perform these measurements simultaneously becauseŜ Z andŜ X commute.
Furthermore, we note that the operators also commute with the stabilizer generators, which means that these are logical operators which preserve the code space. We see also that Z and X anticommute, and that they square to the identity on the code space, whereŜ Z = S X = 1. Thus Z and X may be regarded as the logical Pauli operators acting on the encoded qubit, where Z is diagonal in the basis {|0 , |1 } and X is diagonal in the conjugate basis { 1 √ 2 |0 ± |1 }. CSS construction We may also describe our protected qubit using the language of Calderbank-Shor-Steane (CSS) codes [126,128]. In the CSS construction, a quantum error-correcting code is built from a classical error-correcting code K and a subcode H ⊂ K.
In the case of the protected qubit with basis states (10), the code K is a 6-state system embedded in the infinitedimensional Hilbert space of the rotor, with the 6 states corresponding to 6 equally spaced angular positions of the rotor, rotated by φ = 2π 6 k, k ∈ {0, 1, · · · , 5}, relative to a standard reference orientation. This classical system is protected against errors that shift the rotor slightly, rotating it through an angle δφ ∈ (− π 6 , π 6 ). The subcode H has three states, with orientations φ = 2π 3 k, k ∈ {0, 1, 2}, and protects against rotations which are twice as large: δφ ∈ (− π 3 , π 3 ). In the associated quantum code, each of the basis states (10) is a uniform superposition of all the elements of a coset of H in K, the trivial coset (the elements of H) for the basis state |0 , and the nontrivial coset for the basis state |1 . The protection of this qubit against shifts of the rotor is inherited from the corresponding property of the classical code K.
There is a dual description of this quantum code, making use of the angular momentum basis of the rotor rather than its position basis. The classical code H ⊥ , dual to H, contains all angular momentum eigenstates where is an integer multiple of 3. These two classical codes are dual in the sense that the representations of the group U 1 contained in H ⊥ represent the elements of H trivially. Similarly, the classical code K ⊥ dual to K contains all angular momentum eigenstates where is an integer multiple of 6, those representations which represent K trivially. Evidently, K ⊥ is a subcode of H ⊥ . For the quantum code, each basis state in Eq. (11) is a uniform superposition of all the elements of a coset of K ⊥ in H ⊥ , the trivial coset for the basis state 1 √ 2 |0 + |1 , and the nontrivial coset for the basis state 1 √ 2 |0 − |1 . The classical code H ⊥ protects against shifts of the angular momentum by δ ∈ {−1, 0, 1}, and the quantum code inherits this property.
Viewed as an abstract group, the code K is the subgroup Z 6 of U 1 , and H is the subgroup Z 3 ⊂ Z 6 . The construction can be easily generalized to K = Z dN and H = Z N , where d and N are positive integers, in which case the quantum code is d-dimensional. In the stabilizer language, this more general code has stabilizer generatorŝ Its logical operators, are generalized Pauli operators, obeying the Heisenberg-Weyl commutation relation ZX = e i 2π d XZ. This quantum code protects against position shifts by δφ with |δφ| < π dN and momentum kicks by δ with |δ | ≤ (N − 1)/2 (for odd N ). Note the tradeoff: increasing N improves the protection against angular momentum kicks, but weakens the protection against rotations.
Partial Fourier transform There is yet another way to describe the code construction, using the notion of a partial Fourier transform, which will be helpful as we seek further generalizations. Recall that the position and angular-momentum bases for the planar rotor are related by Fourier transforming: It is useful to imagine that the above integral over φ is carried out in two steps. We write φ = a + 2π N h, where a ∈ (− π N , π N ] and h ∈ {0, 1, · · · , N −1}; then integrating φ from −π to π is equivalent to integrating a from − π N to π N , and summing h from 0 to N −1. Likewise, we can do the sum over in two steps; we write = N s + λ, where s ∈ Z and λ ∈ {0, 1, · · · , N −1}, and we separate the infinite sum over s from the finite sum over λ. When we speak of a "partial Fourier transform", we mean performing one of these two steps without the other.
By performing the sum over h but not the integral over a, we obtain a new orthonormal basis with normalization a; λ|a ; λ = δ(a − a )δ λλ . From now on, the presence of a semicolon inside a ket declares that ket to be an element of this basis. This {|a; λ } basis is convenient for our purposes because shifts in position or angular momentum affect only one of the two indices. A shift in angular momentum by δ acts on the basis according to To recover our previous code construction, we choose d basis states {|k } with λ = 0 and a = 2π dN k, finding If an error occurs in which |δ | ≤ (N − 1)/2 (for odd N ) and |δφ| < π dN , we diagnose the error by performing a measurement which determines the value of λ and also the value of a (mod 2π dN ). Then the value of a unambiguously identifies the shift in φ and the value of λ unambiguously identifies the shift in . Once known, these shifts can be corrected to recover the initial undamaged code states.
The orientation label φ of the planar rotor can be viewed as the element of the group U 1 describing the rotation which reaches φ starting from a standard initial orientation. The basis {|a; λ } for the rotor's Hilbert space reflects a decomposition of U 1 which may be written symbolically as That is, a labels an element of U 1 /Z N (a coset of Z N in U 1 ), and λ labels an element of Z N (an irreducible representation of Z N ). Our error-correction procedure makes use of a finer decomposition: The correctable rotation error is an element of U 1 /Z dN , the correctable angular momentum kick is an element of Z N , and code basis states correspond to elements of Z dN /Z N . We will use similar decompositions in our constructions of quantum codes for more general groups.

B. Gates, recovery & initialization
To use the above codes for quantum computation on multiple encoded rotors, we need to initialize in the code subspace, execute quantum gates, and perform the measurement-based error-correction described above. For these tasks, we need operators other than the Paulitype operatorsX φ (7) andẐ (8). As is typical of quantum codes, there is an "easy" subset of all possible operators that aid us in the above tasks in a reasonably fault-tolerant manner. For U 1 -rotors, such normalizer or symplectic operations are generated by certain quadratic functions of the rotors' positions and momenta [129,130].
Symplectic operations Single-rotor symplectic operations include unitary operators generated by Hamiltonians that are polynomials in angular momentum of at most degree two. The quadratic-phase operator while commuting with position shiftsX φ (also generated byL). The analogous two-rotor "conditional-phase" operator, cphs ϕ = e −iϕL⊗L {cf. [131], Eq. (23)}, commutes withX φ ⊗ 1 and 1 ⊗X φ , but mapŝ Another operation is the conditional rotation, shifting the position of the second rotor by φ, conditioned on the first rotor being at position φ. This mapŝ while acting trivially onẐ ⊗ 1 and 1 ⊗X φ . The quad and cphs operations can be realized by turning on Hamiltonians quadratic in angular momenta for a specified amount of time [cf. Eq. (4)]. The crot operation however cannot be obtained from the "Hamiltonian" H =φ ⊗L, because such an H would not be invariant under 2π-rotations of the first rotor, and therefore would not be single-valued. (A similar problem plagues the "Hamiltonian"φ, present in the exponent ofẐ, whilê φ 2 is not single-valued even when exponentiated.) To produce such an operator in the lab, one can consider adapting implementations of the related oscillator phase operator to rotors [81,82] (see Sec. III A).
Logical gates The above symplectic operations, for certain ϕ, perform logical Clifford operations on the encoded qudits. The gate quad 2π dN 2 performs a logical qudit rotation mapping Z → XZ (up to a phase), while cphs 2π dN 2 and crot act as entangling gates. In the case of a logical qubit (d = 2) with logical operators Z =Ẑ N and X =X π N (15), the symplectic operations producing the above logical transformations act on the rotor positions φ 1,2 and momenta 1,2 as follows: . We have assumed in Eq. (27) that φ and simultaneously have definite values, which makes sense for an encoded state assuming that φ and are sufficiently small. These transformations do not amplify correctable position and momentum shifts into uncorrectable ones, and a small overrotation or underrotation in the implementation of one of the logical gates introduces only correctable errors, not logical errors. In this sense, the logical gates are faulttolerant.
The above symplectic operations do not provide a universal set of logical operations. One way to upgrade to such a set is to include unitaries generated by the logical operators {X, Z} themselves. The gates e iϕ(X+h.c.) and e iϕ (Z+h.c.) allow for arbitrary single-qudit rotations, while e iϕ (X⊗X+h.c.) allows for arbitrary logical XXrotations. Such gates are however not fault-tolerant, as fluctuations in the ϕ's will produce undetectable errors. One can also consider using Hamiltonians that are cubic (or higher) in angular momenta.
Diagnosis & Recovery A shift in the position by δφ and momentum by δ maps logical states |k → | 2π dN k + δφ; δ (up to a phase). To diagnose the errors we need to measureφ mod 2π dN andL mod N . Once this error syndrome is known, we can undo the damage by applyingX † δφ (7) andẐ δ † (8) to the corrupted logical states.
To measureφ mod 2π dN , we need an ancilla that can resolve all possible values of this syndrome, while revealing no information about the protected encoded state. One way to extract the syndrome is to encode the ancilla using the same code that protects the data [132]. Specifically, we may prepare an ancillary rotor in the logical-X eigenstate |0 X , a uniform superposition of the position eigenstates {|φ = 2π dN k , k = 0, 1, . . . dN −1}, which is therefore invariant under the rotation φ → φ + 2π dN . Applying the crot gate (25) to a noisy logical state and a noiseless ancilla yields The ancilla can then be measured in the {|φ } basis, and the measured value modulo 2π dN determines the shift δφ. If the ancilla is noisy or the measurement is imperfect, then the extracted value of δφ is likewise noisy; nevertheless, if a fresh supply of ancilla rotors is continuously available, this recovery procedure will with high likelihood prevent small displacements of the data rotor from accumulating to produce an uncorrectable logical error.
To measureL mod N , we need an ancilla that can resolve the N values of the syndrome. In this case, we could initialize an ancilla rotor in the state |φ = 0 , and apply cphs 2π N to the data and ancilla rotors. This gate rotates the ancilla by 2π N δ , and the value of δ can therefore be extracted by measuring the ancilla in the position basis. Since the syndrome takes discrete values, some noise resilience is built into the procedureδ is determined by rounding off the measured value of φ to the nearest multiple of 2π N . Since we only need to resolve a discrete number of momentum syndrome values, a discretized version of the above scheme using a quN it ancilla works just as well. Let {|h z , h ∈ Z N } be the position states of the qunit, and initialize the qunit in the state |0 z . Then apply the entangling gate where X satisfies X |h z = |h + 1 z (modulo N ) and X N is the identity. This yields and measuring the quN it in the position basis then reveals the syndrome.
Initialization The above error-correction procedures can equivalently be used to initialize in certain logical states. For example, consider one rotor initialized in |φ = 0 , coupled to an ancillary quN it initially in |0 z . Applying cphs yields Measuring the ancilla in the |h z basis to obtain a particular λ = λ collapses the rotor state to |0; λ . Applying a momentum kickẐ λ † then produces the logical state |0 = |0; 0 , thereby completing the initialization. Analogous initialization schemes use the position syndrome measurement.

V. MOLECULAR CODES
By a "molecular code" we mean a finite-dimensional subspace of the infinite-dimensional Hilbert space of a rigid body in three dimensions (a.k.a. a "rigid rotor"). To define a basis for this infinite-dimensional Hilbert space, we imagine fixing a coordinate system in the laboratory, pinning the body's center of mass, and specifying the orientation of the body relative to a standard initial configuration in this fixed coordinate system. For a molecule with no symmetries, the possible orientations are in oneto-one correspondence with the elements of the 3D special orthogonal group SO 3 ; thus we may choose the "position" basis {|R , R ∈ SO 3 }. This correspondence between group elements and orientations of the body follows the same logic as in our discussion of the planar rotor in Sec. IV, where we identified position-basis eigenstates with elements of U 1 .
If the body has symmetries, using a group element to specify the orientation becomes redundant, and the position basis should be refined accordingly. For example, if there is an axis of symmetry (as for a diatomic molecule composed of two distinct nuclei), the body is invariant under the U 1 subgroup of rotations about the symmetry axis, and the possible orientations are in one-to-one correspondence with the coset space SO 3 /U 1 , which is equivalent to the two-sphere S 2 . If in addition the axis of symmetry has no preferred direction, so the body is invariant under reflections that invert the axis (as for a diatomic molecule composed of two identical nuclei), then the position eigenstates are labeled by the elements of the real projective space SO 3 /O 2 = RP 2 . In this section, we assume the body has no symmetries; the case of a body with a symmetry axis (a.k.a. a "linear rotor") is discussed in Sec. VI.
An active rotation of the body described by SO 3 element S alters the orientation of the body according to R → SR; that is, the group element describing the orientation of the body is left multiplied by S. This rotation is represented by the unitary operator − → X S , which acts on the Hilbert space according to We will also consider passive rotations, rotations of the coordinate system in the laboratory, which act on the position basis according to As in our discussion of the U 1 case, there is a Fourierconjugate basis of angular momentum states (a.k.a. "rotational states"), defined for SO 3 by The {D mn } denote matrix elements of the angular momentum irreducible representation of SO 3 , obeying and The integral is with respect to the invariant Haar measure dR on SO 3 , here normalized so that the volume of the group SO3 dR = 8π 2 . The elements of the conjugate basis transform under active and passive rotations according to These and other useful properties of the D mn matrices are summarized in Table IV. The functions D mn (R) are a complete basis for functions which map the group to complex numbers. Hence an arbitrary function f (R) on the group can be Fourier expanded in this basis: We'll use the notationf for the operator associated with the function f (R) that is diagonal in the {|R } basis: Fourier expanding this operator, we obtain An arbitrary operator E acting on the Hilbert space of the rotor can be expanded in terms of an operator basis, in which each element of the basis is a diagonal operator followed by an active rotation. After Fourier expanding the diagonal operator, E has the expansion where we have absorbed an -dependent numerical factor into the coefficient E mn (S). This is the analog of the expansion of an operator acting on a qudit in terms of the Pauli operator basis. Therefore, a completely positive noise channel E acting on a state ρ of the rigid rotor has an expansion of the form Our goal is to construct a code that allows us to recover successfully from any error of the form where the position shifts S, S and momentum kicks , are sufficiently small. Using this code, we can recover from the noise channel E with high fidelity if has most of its support on small values of S, S , , .
To determine how well these codes protect against physical rigid-rotor noise models [133][134][135][136][137][138][139], one would expand the noise operators in terms of position and momentum shifts and estimate the probability of an uncorrectable error. A similar analysis for code states of harmonic oscillators rather than rotors [3, Sec. VII] shows that physically relevant noise is typically correctable with high probability. If the noise acts locally in phase space, our rotor codes should perform well.

A. ZN ⊂ Z2N codes
We want to construct a finite-dimensional code subspace for the rigid rotor which is protected against small shifts in position and in angular momentum. For this purpose, we will specify a discrete subgroup H ⊂ G = SO 3 and consider the basis defined by the corresponding partial Fourier transform. In this section, we assume H is Z N , an abelian group of rotations about the z-axis; the case where H is nonabelian is discussed in Secs. V D-V E.
As for the case of G = U 1 from Sec. IV A, our code construction makes use of a basis defined by a partial Fourier transform associated with the subgroup Z N . The elements of this basis are here, |ω, z denotes the position eigenstate |R , where R ≡ R ω,z is a rotation by angle ω ∈ [0, 2π) about the zaxis. Note that the index λ ∈ {0, 1, · · · , N − 1} indicates the irreducible representation of Z N according to which the state |SZ N ; λ transforms. From now on, the presence of a semicolon inside a ket declares that ket to be an element of this basis. The rotation S is a representative of a coset in the lens space SO 3 /Z N . Coset representatives are not unique, because of the freedom to multiply S on the right by an element of Z N without modifying the coset. We label each coset using the representative S that is as close as possible to the identity rotation. We call the set of such representatives the fundamental Voronoi cell, denoting it by F SO3/Z N (see Appx. B). It is shown in blue in Fig. 2 More generally, the N images of F SO3/Z N under the action of passive rotations R ∈ Z N are called Voronoi cells of R. These cells are disjoint, and together they cover SO 3 in what is known as a Voronoi tiling. The six cells for N = 6 are shown in groups of three in Fig. 3(c), right and left panels. Voronoi tilings exist for all discrete subgroups H ⊂ SO 3 ; fundamental cells F SO3/H for various H are bounded in orange and blue in Fig. 4.
Codewords As in Sec. IV A, code basis states are associated with the elements of the coset space Z dN /Z N , where Z dN is a larger group of rotations about the z-axis that contains Z N . Here, for simplicity, we will assume that d = 2, but the generalization to other values of d is straightforward. Then the codewords are The state |0 is the uniform superposition of elements of Z N , while |1 is the uniform superposition of the elements of the nontrivial coset of Z N in Z 2N , elements displaced from Z N by R π N ,z , the π N rotation about the z-axis. In terms of the partially Fourier-transformed basis Eq. (44), we may express the codewords as Using Eq. (34), we can also express these codewords in the angular-momentum eigenstate basis. Since D mn (R) is a diagonal matrix for any rotation R about the z-axis, 2 we easily compute (for r ∈ {0, 1}) We see that, when expanded in the | mn basis, the only states that occur with nonzero coefficients are those for which m = n is an integer multiple of N . This property will ensure that the codewords are well protected against sufficiently small angular momentum kicks. It is also useful to express the codewords in the logical-X basis, defining |r X = 1 √ 2 |0 + (−1) r |1 and finding The codeword |0 X , expanded in the | mn basis, includes only basis states in which m = n is an even multiple of N , and the codeword |1 X includes only basis states with m an odd multiple of N . The | mn 's which occur with nonzero coefficients are indicated schematically in Fig. 2(b) for N = 3, with black squares indicating basis states in the expansion of |0 X and white squares indicating basis states in the expansion of |1 X . Position shifts We will correct an error of the form Eq. (43) in two steps. In the first step, we diagnose and reverse the shift in the position basis − → X S : |R → |SR . After the position shift is corrected, we can proceed to correct the momentum kickD mn .
For any coset space G/H, we can label the cosets using coset representatives chosen from the fundamental Voronoi cell F G/H . Then the action of G on the cosets is described by the induced representation [140][141][142] where T is a compensating element of H chosen to ensure The effect of a representative rotation on the group elements making up the codewords is shown in Fig. 3(a). For correcting position shifts acting on the codewords, the relevant coset space is SO 3 /Z 2N . We quotient out Z 2N rather than Z N , because both |0 and |1 are superpositions of elements of Z 2N ; hence an element of SO 3 /Z 2N characterizes the shift away from the code space induced by − → X R in Eq. (50), without revealing any information that distinguishes |0 from |1 . We divide the basis elements {|SZ N ; λ } (44) into two disjoint subsets, where each subset is parametrized by an element of F SO3/Z 2N rather than an element of F SO3/Z N , as follows: where λ ∈ {0, 1, · · · , N − 1} as before, but nowS ∈ F SO3/Z 2N . Since each element of S ∈ F SO3/Z N can be uniquely expressed as either S =S or S =SR π N ,z , for S ∈ F SO3/Z 2N , this is the same basis as described earlier, just with a different labeling than before. The first set is the set of all states obtained by acting with a ro-tationS ∈ F SO3/F 2N on the logical zero codeword; the second set is obtained similarly from logical one. (If we wished to construct a d-dimensional codespace, we would divide the basis into d disjoint subsets, with each subset parametrized by an element of F SO3/Z dN .) To diagnose the error, we measure the value ofS, and then apply − → X † S to attempt to correct the effect of the position shift. If the actual shift error is − → X R , where R is contained in the F SO3/Z 2N , this recovery procedure suc- (54), these codewords are mapped to error states |0 X and |1 X , whose components are marked in red. (c) Voronoi cells of group elements corresponding to codeword |0 (left) and |1 (right) are indicated as a red, blue, or green region.
cessfully corrects the position-shift error, mapping Subsequent momentum-kick correction, described below, would then complete the recovery, correctly mapping the corrupted states back to their respective codewords (46). However, if R is not contained in F SO3/Z 2N , then there may be an uncorrected logical error which interchanges |Z N ; λ and |R π N ,z Z N ; λ on the right-hand side of Eq. (52).
Thus the code protects against any position-shift error − → X R for R ∈ F SO3/Z 2N . This set of correctable rotations is indicated by the blue region in Fig. 2(b). How large an angular rotation can be tolerated depends on the axis of rotation, and can be determined by analyzing the geometry of the fundamental cell F SO3/Z 2N (see Appx. B). We find that a rotation by angle ω about an axis with polar angle Θ is contained within F SO3/Z 2N for The maximum correctable rotation angle ω max (Θ) is smallest for rotations about the z-axis, where ω max (0) = π 2N , as for the planar rotor code discussed in Sec. IV A. The largest correctable rotation angles occur when the rotation axis is in the equatorial plane, where ω max ( π 2 ) = π. Thus, any rotation about such an axis is correctable, unless the rotation angle is precisely π. The relative volume occupied by correctable rotations in SO 3 is 1 2N . Momentum kicks We have now described how to correct the position shift − → X R in Eq. (43). Next, we need to understand how to contend with a momentum kick acting on the code space. We can compute the action ofD mn on the codewords using Eq. (47), findinĝ After the noise acts on the encoded state, and the position-shift error has been corrected, we measure the value of λ, the syndrome for the momentum-shift error. The key thing to notice is that, while λ determines the value of m (mod N ), the codeword-dependent phase e i π N m in Eq. (55) depends on the value of m (mod 2N ). In fact, for any value of ≥ N , the operatorD N N is a nontrivial logical operator that preserves the code space and flips the relative phase of |0 and |1 .
Once the value of λ is known, we attempt recovery by applying the unitary operator U m with the action where m is chosen to be the integer with minimal absolute value such that m = λ (mod N ). For example, we can choose U m to have the same action asD N † mm on the position eigenstates |R ω,z , namely How U m acts on |R when R is not a rotation about the z-axis can be chosen arbitrarily. We note though, that this extended operator can be diagonal in the {|R } basis. That is, the recovery operation after a momentum kick can be a phase shift that depends on the orientation of the rotor, and has the action Eq. (57) when the rotor's orientation differs from the standard reference orientation by a rotation about the z-axis.
Notice that m (mod 2N ) is unambiguously determined by λ = m (mod N ) for any m satisfying |m| < N/2. Therefore, the damage to the codewords caused by the action ofD mn will be corrected successfully when |m| < N/2. Since |m| ≤ , we conclude that the code protects against any momentum kickD mn such that For ≥ m > N/2, however, a logical error may occur. It is also instructive to consider how the momentum kickD mn acts on the basis of angular momentum eigenstates. We observe that The group integral (59) can be expressed in terms of Clebsch-Gordan coefficients [see Table IV.G]. For our purposes, what's noteworthy is that selection rules for addition of angular momenta require the integral to vanish unless As indicated in Eq. (48), if the codewords are expanded in the {| m n } basis, then m = n is an integer multiple of N for all states that occur with nonzero coefficients. For < N/2, the momentum kickD mn changes the value of m and n by less than half the spacing between successive multiples of N . Therefore, these shifts in m and n can be unambiguously identified and corrected. However, it is simpler to understand how the recovery procedure works in detail using the expansion of the codewords in the the position basis {|R } [as in Eq. (56)] rather than the angular momentum basis (detailed in Appx. C). The effect of an angular momentum kickD 1 1,1 is visualized in Fig. 3(b) for the case N = 3. Recalling Eq. (55), this kick shifts the code space to a subspace with λ = 1, andD 1 −1,−1 shifts the code space to a subspace with λ = 2. In either case, measuring λ points to a unique error with ≤ 1 which can then be corrected. However,D 2 2,2 also maps the code space to the same subspace with λ = 2 asD 1 −1,−1 , imparting a different codeworddependent phase; according to Eq. (55), the codeword |1 acquires the relative phase exp(−i π 3 ) whenD 1 −1,−1 acts on the codespace, and the relative phase exp(i 2π 3 ) when D 2 2,2 acts on the codespace. Therefore, if theD 2 2,2 error occurs, and is misdiagnosed as aD 1 −1,−1 error, a nontrivial logical error results when recovery is attempted.
Logical operators The unitary active rotation − → X π N ,z , acting on the code basis states in Eq. (45), has the effect of interchanging |0 and |1 . It can be regarded as the logical Pauli operator X acting on the code space. This operation can similarly be performed by the passive rotation ← − X π N ,z [since the codewords (45) consist of position states forming an abelian group]. In other words, we can rotate the molecular frame or the lab frame to perform this operation. Active and passive rotations always commute, We will use this fact to infer the momentum kick syndrome λ using passive rotations, without interfering with position shifts − → X R .
We have already noted thatD N N (for any ≥ N ), acting on the code basis states, preserves |0 and flips the phase of |1 . Thus its action on the code space is equivalent to the logical Pauli operator Z. However,D N N is not unitary as an operator acting on the full Hilbert space of the rotor. Why isn'tD N N unitary? Recall thatD mn is diagonal in the {|R } basis, with eigenvalues {D mn (R)}. The trouble is that for rotations that are not about the z-axis, {D mm (R)} does not have modulus 1, and therefore cannot be an eigenvalue of a unitary operator. Specifically, if we parametrize R αβγ using Euler angles in the ZY Z convention, where α ∈ [0, 2π), β ∈ [0, π], γ ∈ [0, 2π), which has modulus less than 1 for nonzero β.
To formulate an implementation of Z that is achievable in the laboratory, we should find a unitary extension of its logical action to the full Hilbert space. As for the recovery operation described earlier, we can choose this logical Z to be a phase shift that depends appropriately on the orientation of the rotor.
One way to produce logical gates involves turning on the HamiltonianD N N N + h.c. to perform a logical Z-axis rotation with angle proportional to the time the Hamiltonian is turned on. This provides unitary logical Z-gates, and analogous two-qubit ZZ-gates can be performed via the HamiltonianD N N N ⊗D N N N +h.c.. However, such gates are subject to over-or under-rotation errors.
Check operators Once we have operators whose action on the code space matches that of the logical Pauli operators X and Z, we can square these operators to define the check operators for the code. Then the code space can be said to be the simultaneous eigenspace with eigenvalue 1 of these operators.
Recall that X is a position shift defined as either left or right multiplication by R π N ,z , corresponding to either an active or a passive rotation, respectively. We choose our "X-type" stabilizer to be a passive rotation, yielding the unitary operator The conditionŜ X = 1 requires the codewords to be invariant under a position shift by R 2π N ,z . The additional benefit of using a passive rotation is that all of the partial Fourier-transformed states (44) This way, the syndrome λ can be extracted via a projective measurement onto eigenspaces ofŜ X . As we've noted,D N N N is not unitary, but nevertheless we may square it to obtain a (nonunitary) Z-type check operator = sin βdαdβdγ |R αβγ e i2N (α+γ) cos 4N (β/2) R αβγ | .
The eigenspace ofŜ Z with eigenvalue 1 contains rotations about the z-axis (β = 0), by angle ω = α+γ = π N h, where h ∈ {0, 1, · · · , 2N − 1}. The only states that satisfy these conditions and that are also invariant underŜ X are the states in the code space.
To check thatŜ X andŜ Z are really commuting operators, we observe that where we have used the invariance of the Haar measure to obtain the second equality. Furthermore, if S is a rotation about the z-axis, then, recalling the ZY Z Euler-angle convention used here, right multiplication by S merely changes the third angle: Using this and Eq. (61), we see thatD N N N and ← − X π N ,z anticommute, not only acting on the code space, but also acting on the whole Hilbert space of the rotor. Correspondingly,Ŝ Z = (D N N N ) 2 andŜ X = ( ← − X π N ,z ) 2 commute, and thus can be simultaneously diagonalized.

B. Measurement & Initialization
Generalizing our discussion for the U 1 rotor from Sec. IV B, we outline procedures for extracting the momentum (λ ∈ Z N ) and position (S ∈ F SO3/Z 2N ) shift values using ancilla systems. These procedures also allow us to perform logical state initialization.
Momentum syndromes There are N different possible values of λ, so a one-shot measurement requires an ancilla with at least N orthogonal states. We use a quN it ancilla with Z-eigenstates |h z , X-eigenstates |h x (h ∈ Z N ), and Pauli operator X satisfying X |h z = |h + 1 z (modulo N ).
To measure λ, we initialize the quN it in |0 z and entangle it with the rigid rotor by applying the gate where the second line is obtained using Eqs. (37b) and (47). This gate shifts the "position" of the quN it by n, conditioned on the rotor having angular momentum z-component n in the rotor frame. Applying this to a partially Fourier-transformed basis state (44) and using Eq. (63) yields The value of λ has thus been mapped onto the ancilla, and a subsequent Z-basis measurement of the ancilla allows us to extract λ. Position syndromes To diagnose position shifts without disturbing the logical information, we have to use an ancilla to measure the syndromeS ∈ F SO3/Z 2N -"an SO 3 rotation modulo Z 2N ". In order to perfectly resolve all possibleS in one shot, the ancilla needs to admit an orthonormal set of position states parameterized by F SO3/Z 2N . Such a set is exactly the set of orientations of a Z 2N -symmetric rigid body (see Sec. III C). However, coupling an asymmetric molecule to a symmetric one is difficult. Below, we show how to approximate the required position states using generalized spin-coherent states of a finite-dimensional spin (see Sec. III B).
We use a spin-L ancilla {| L s , |s| ≤ L}, which admits an irrep of SO 3 with corresponding rotation matrices D L (R). In order to "mod out" the Z 2N rotation, we initialize the ancilla in any state |Z 2N whose maximal invariant subgroup is Z 2N , i.e., Such states exist for any L ≥ N [143, Table 10.1] (see also [98]); for example, the L = N family of states cos η N N + sin η N −N satisfies the above for any η ∈ (0, π/4). Any rotation R ∈ SO 3 can be written as R =ST , withS ∈ F SO3/Z 2N and T ∈ Z 2N . Therefore, applying rotations to |Z 2N and using Eq. (35) yields the following set of generalized spin-coherent states |S Z 2N , To map the syndrome onto the ancilla, we use the conditional rotation (cf. [144,Eq. (4) This gate applies a rotation D(R) on the ancilla, conditioned on the rotor being in the state |R . When applied to the specified ancillary state, this gate maps S ∈ F SO3/Z 2N onto the ancilla while ignoring the logical state index. Applying it to the two sets of basis states from Eq. (51), we have Unfortunately, a projective measurement in the overcomplete |S Z 2N set of the states will not yieldS exactly, since the spin-coherent states are not orthogonal for any finite L [90, Sec. 2.3]. However, they approach orthogonality in the limit L → ∞, meaning that a sufficiently large spin should be able to resolve points in F SO3/Z 2N to desired accuracy.
Initialization The crot gate can also be used to initialize in the logical-X state |0 X ∝ T ∈Z 2N |T (49). Say the rotor instead starts in the lowest-momentum state | 0 00 -a state outside of the codespace. Then, application of the gate yields (up to normalization) (74) A projective measurement obtaining someS followed by a rotation − → X † S yields the desired logical state.

C. Normalizable codewords
Our logical codewords are not normalizable and therefore unphysical.
To obtain normalizable states we may regulate the sum over the angular momentum in Eq. (48) by introducing a broad envelope function which decays sufficiently rapidly for large . In position space, this corresponds to replacing the position eigenstate |ω, z by a sharply peaked normalizable wavepacket which approximates |ω, z . The protection against position shifts is mildly impaired due to this spreading of the codewords in position space. On the other hand, these approximate codewords still have support on angular momentum states such that is an integer multiple of N , and therefore the code continues to detect momentum kick operatorsD mm with < N and |m| > 0. However, the kicksD 00 no longer leave the codewords invariant [as in Eq. (55)], inducing a slight -dependent distortion that can cause a logical error.
Average momentum The expectation value of the total angular momentum is infinite for ideal codewords, but finite for approximate codewords. The square-root of the expectation value ofL 2 , determines the average momentum of the approximate codewords |r . In Appx. C, we detail the calculation that obtains the above r-independent result, valid in the ∆ → 0 limit. While the average photon number is proportional to the total oscillator energy, energy for the rigid rotor is proportional to¯ 2 . For our normalizable codewords, the energy scales identically with ∆ as that for the normalizable GKP states [1]. The variance of¯ , is also similar to GKP states (for the latter, photon number moments satisfy a geometric distribution [3]).
Approximate correctability The spreading of the basis states in position space gives rise to an intrinsic error in the approximate code; the basis states |0 and |1 are imperfectly distinguishable even in the absence of noise. To quantify the probability of intrinsic memory error, we estimate P leak -the probability that the approximate logical zero state leaks into the union of Voronoi cells associated with the other logical codeword [for N = 3, these are the three cells in the right panel of Fig. 3(c)]. In Appx. C, we find in the ∆ → 0 limit, The right-hand side is exponentially suppressed with 1/∆ 2 : similar to GKP codes [1], a gentle smearing in position space does not significantly affect the codes' performance. More concretely, P leak ≈ 10 −3 requires an average momentum of¯ ≈ 5.4, with 99% of the approximate codewords supported on the ≤ 10 momentum subspace. A more stringent P leak ≈ 10 −6 corresponds to¯ ≈ 8.1, and requires ≤ 15 to support 99% of the codewords. While these are reasonable numbers for the angular momentum, we also have to keep in mind that, in contrast to the oscillator, the rotor energy is proportional to¯ 2 .
As we have noted, the approximate codewords are supported on values of which are integer multiples of N ; therefore, angular momentum kicks with < N and |m| > 0 are detectable. However, the kicksD 00 slightly distort the codewords, leading to the potential for a logical-X error. To quantify this, we calculate the matrix element 0 |D 00 |1 for < N in Appx. C. Numerically, as ∆ → 0, this element is suppressed exponentially with 1/∆ 2 for all cases tested. In said appendix, we estimate its asymptotic behavior, showing that its dependence on ∆ is similar to P leak (78), The "≈" indicates that this asymptotic estimate is supported, to some extent, by numerical evidence.

D. Dihedral molecular codes
For molecular codes, G is the rotation group SO 3 , and up until know we have considered the case where H, K are abelian, namely H = Z N and K = Z dN (for a code space of dimension d). We may also construct codes for which K, and perhaps also H, are nonabelian subgroups of SO 3 . Position correction proceeds similarly as for the abelian molecular codes: one measures values in the coset space SO 3 /K and applies a rotation to map back into the codespace. Picking nonabelian subgroups allows for more uniform correctable rotation sets F SO3/K than the saucer-like F SO3/Z 2N from Fig. 2(b). Detectable and correctable momentum kicks can be read off by successive use of branching formulas, i.e., restricting SO 3 -irreps D to K and decomposing the resulting matrix into irreps of K, and then further restricting and decomposing into H-irreps. Here we describe D N ⊂ D 2N molecular codes, where D N is the dihedral group.
Codewords The group Z N , containing rotations about the z-axis by angle ω = 2π N h with h ∈ {0, 1, · · · , N − 1}, can be extended to the dihedral group D N by adding the ω = π rotation around the x-axis. This dihedral group has 2N elements, the original N rotations contained in Z N and also N "reflections" -rotations by π about N equally spaced axes on the equator. In terms of Euler angles, the rotations in D N are the elements { 2π N h, 0, 0} of SO 3 , and the reflections are the elements { 2π N h, π, 0}, for h ∈ {0, 1, · · · , N − 1}.
Here we consider an extension of the Z N ⊂ Z dN codes to D N ⊂ D dN . For the d = 2 case, the coset space D 2N /D N contains two cosets: the trivial coset (the D N subgroup of D 2N ) and the nontrivial coset, which is obtained by multiplying all elements of D N by the rotation with Euler angles { π N , 0, 0}. The logical codewords are This code family has much in common with the Z N ⊂ Z 2N code; in particular, it can correct momentum kicks with < N/2. The space of correctable position shifts -the prism space SO 3 /D 2N [Table I and Fig. 4(a)]gets flatter with increasing N . Thus, as for the Z N ⊂ Z 2N codes, there is a tradeoff: as N increases, the code protects against larger momentum kicks, but at the cost of weakened performance against rotation errors.   Table I) and codewords of (b) the T ⊂ O and (c) the T ⊂ I codes from Sec. V E.
Now S is an element of the fundamental Voronoi cell S ∈ F SO3/D 2N , λ labels an irreducible representation (irrep) of D N , and -Z λ µν (T ) denotes the matrix elements of that representation, evaluated for the D N element T . (The nonabelian group D N has both one-dimensional and twodimensional irreps.) The codewords Eq. (80) correspond to |0 = |D N ; 1 00 and |1 = |R π N 00 D N ; 1 00 , where λ = 1 is the trivial irrep. The basis states |SD N ; λ µν span all states that can be reached when a correctable error acts on the codeword |0 ; S is the rotation error and λ µν indexes the momentum kick. Similarly, the basis states |SR π N 00 D N ; λ µν span all states that can be reached when a correctable error acts on the codeword |1 .
Position shifts Our recovery consists of first correcting position shifts by measuring S and applying − → X † S to map all error states into the subspace {|D N ; λ µν , |R π N 00 D N ; λ µν } for all λ µν . To extract S, we can readily adapt the procedure described in Sec. V B. This entails initializing an ancillary system in a D 2N -invariant state, performing the crot gate (72), and measuring the ancilla in a basis of generalized spin-coherent states parameterized by F SO3/D 2N . A similar scheme can be used for state initialization.
Momentum kicks To see how the momentum kick operatorsD mn affect the codewords, we need to understand how the irreducible representation (irrep) of SO 3 with angular momentum decomposes into irreps of D 2N and D N . When N is odd, the group D N has two one-dimensional irreps, the trivial representation (which we denote by 1), and a nontrivial representation (denoted by 1 ) which represents rotations by +1 and reflections by −1. In addition, there are (N − 1)/2 twodimensional irreps, which we denote by 2 k with k ∈ {1, 2, · · · , (N − 1)/2}. We can characterize a representation according to how the generators of D N , the rotation R 2π N 00 and the reflection R 2π N π0 , are represented. All 2 k irreps represent the reflection by the 2 × 2 matrix while the rotation is represented by the diagonal matrix Thus, the two-dimensional irrep of D N decomposes as two one-dimensional irreps of Z N which are interchanged by the reflection. When N is even, there are N/2−1 twodimensional irreps described by Eqs. (82)(83), and also two additional one-dimensional irreps (denoted by 1 ± ), representing the rotation R 2π N 00 by −1 and the reflection R 2π N π0 by ±1, respectively. The irrep D of SO 3 decomposes into 2 + 1 onedimensional irreps of U 1 ; these represent the rotation by angle φ about the z-axis by {e imφ , m = − , − +1, · · · , }. For < N/2 and m = 0, the ±m irreps of U 1 pair up to form a two-dimensional irrep of D N , while the m = 0 irrep of U 1 provides a one-dimensional representation of D N , either 1 if is odd, or 1 if is even. From Eq. (83) we can infer the "branching rules" specifying how the irreps of D 2N transform under the D N subgroup, namely 1 → 1, 1 → 1 , and 2 k → 2 k , for k < N/2 .
This means that, of the irreps of D N that arise in the decomposition of D for < N/2, each is descended from a unique irrep of D 2N . Suppose, now, that the momentum kick operatorD mn acts on the codewords Eq. (80) of the code associated with D N ⊂ D 2N , where < N/2, and we are able to diagnose the irrep of D N according to which the damaged states transform. Because this irrep of D N points to a unique irrep of D 2N , the action of the rotation R π N 00 on the states is unambiguously determined. This means it is possible to recover, mappingD mn |0 back to |0 , and D mn |1 back to |1 , without any logical error.
However, for ≥ N/2 the situation is different; the D 2N irrep from which the D N irrep arises is no longer unique. Correspondingly, projecting onto an irrep of D N afterD mn acts does not fix the relative phase of |0 and |1 ; therefore perfect recovery is not possible.
To be concrete, consider the case D 3 ⊂ D 6 ⊂ SO 3 . Here, D 3 has just one two-dimensional irrep, which we will simply call 2. The = 1 irrep of SO 3 decomposes as under D 6 and D 3 , respectively. The four matrix elements D 1 mn , for m, n ∈ {±1}, constitute the two-dimensional irrep 2 of D 3 and 2 1 of D 6 ; therefore, using the pairs of basis states (81), we havê for m, n ∈ {±1}. The damage inflicted on the codewords byD 1 mn can be reversed by applyingD 1 † mn . (The error operatorD 1 00 , realizing the representation 1 of D 3 and D 6 , is also easily reversed.) ThoughD 1 † mn are not unitary operators acting on the full SO 3 Hilbert space, a completely positive recovery map can be constructed which consists of projections onto D 3 irreps followed by appropriate momentum kicks. This map will successfully recover from any noise channel that can be expanded in {D mn } for ≤ 1.
The SO 3 -irrep = 2, on the other hand, branches as under D 6 and D 3 respectively. Now D 2 mn constitutes the 2 2 irrep of D 6 for m, n ∈ {±2} and the 2 1 irrep of D 6 for m, n ∈ {±1}; however these two distinct irreps of D 6 cannot be distinguished as irreps of D 3 . Therefore diagnosing the irrep of D 3 according to which the damaged codewords transform does not suffice to determine the relative phase of the two code basis states; noŵ for m, n ∈ {±2}, in contrast to Eq. (86). If, say, aD 2 22 error were to occur, it could be mistaken for aD 1 −1,−1 error. An attempt to recover by applyingD 1 † −1,−1 would result in a logical phase error, with |0 → |0 and |1 → −|1 . Thus, while the D 3 ⊂ D 6 code can protect against angular momentum kicks with ≤ 1, it does not protect against arbitrary kicks with ≤ 2. In general, the observation (84) implies that the D N ⊂ D 2N code protects against all kicks with < N/2.
An undetectable error corresponds to a nontrivial representation of D 6 that branches to the trivial representation of D 3 . The lowest angular momentum at which this occurs is = 3, with branching rules Here, the nontrivial irrep 1 + of D 6 reduces to the trivial irrep 1 of D 3 . Diagnosing this trivial irrep yields no information about its parent irrep of D 6 , meaning that = 3 momentum kicks produce undetectable errors. For N = 3, the only nontrivial correction one needs while mapping the states back into the codespace is the correction of the µ-dependent phase (86b) for λ = 2. Therefore, only knowledge of λ, µ is required, and the error syndrome can be obtained by performing a projective measurement onto a basis that resolves these indices without extracting the logical information. One such basis is the joint eigenbasis of the two commuting rotations from Table II. Such a measurement will project the corrupted codewords onto eigenstates of these operators. A successful recovery operation, then, maps the resulting states back into the codespace, applying (in the case of λ = 2) a µ-dependent phase that undoes the action of the = 1 momentum kick from Eq. (86b).

E. Other nonabelian molecular codes
Other interesting codes can be constructed using the tetrahedral, octahedral, and icosahedral subgroups of the rotation group. All are finite nonabelian groups, denoted T, O and I, respectively, with order |T| = 12, |O| = 24, |I| = 60. T is isomorphic to the alternating group A 4 , O is isomorphic to the permutation group S 4 , and I is isomorphic to the alternating group A 5 . Since T is a subgroup of both O and I, codes can be constructed based on the embedding T ⊂ O, with code dimension 2, or based on T ⊂ I, with code dimension 5.
The logical codewords for T ⊂ O are uniform superpositions of SO 3 elements, indicated as black/white balls in Fig. 4(b). That code can correct rotation errors in the fundamental Voronoi cell F SO3/O , the cube-like region bounded in blue in the figure. The T ⊂ I code can correct rotation errors in F SO3/I , the dodecahedron bounded in blue in Fig. 4(c). In that figure, the balls of five different colors correspond to the SO 3 elements making up this code's five logical codewords.
To investigate how well these codes protect against momentum kicks, we examine the branching rules for SO 3 → K → H, as in Sec. V D, but where now H = T and K is either O or I. The group T has four irreps labeled as {1, 1 , 1 , 3} (with number denoting dimension), O has five irreps {1, 1 , 2, 3, 3 }, and I has five irreps {1, 3, 3 , 4, 5}. We note that D =1 , the defining 3-dimensional irrep of SO 3 , also provides defining irreps of the subgroups T, O, and I; therefore the branching rule applies to both the T ⊂ O and T ⊂ I codes. This means that projecting onto the basis of irreps of T unambiguously identifies the errorD mn , which can therefore be corrected, assuming that ≤ 1. Hence both codes protect against kicks with ≤ 1.
Focusing on T ⊂ O (the T ⊂ I code behaves similarly), the = 2 irrep of SO 3 has branching rules [145] Here, the T-irrep 3 is the same 3D irrep that appears in Eq. (90), but the irrep 3 of O is different than the irrep 3 in Eq. (90). Therefore, the projection onto the basis of irreps of T does not unambigously identify the irrep of O, and we conclude that the T ⊂ O codes do not protect against arbitrary momentum kicks with ≤ 2.
Undetectable errors are associated with nontrivial irreps of O which branch to trivial irreps of T. This occurs at = 3, due to the branching rules Interestingly, the T ⊂ O code can also detect all momentum kicks with = 4, 5, because for these irreps of SO 3 , the trivial irrep of T appears only as a descendant of the trivial irrep of O. Momentum kick correction for the more general codes proceeds by measuring a combination of left and right rotations that distinguishes the error spaces sufficiently well for one to correct succesfully. As with the dihedral codes, momentum kicks produce µ-dependent relative phases between corrupted codewords, which need to be corrected upon recovery. Using T ⊂ O as an example, successful reovery requires determining the irrep label λ ∈ {1, 1 , 1 , 3} and the µ label for λ = 3. After correcting position shifts, the corrupted states lie in the subspace {|R , R ∈ O}. The three check operators ← − X π 2 π 2 π , − → X 0π0 , and − → X π00 commute on this space, and measuring in their joint eigenbasis resolves λ and µ.
Just like SO 3 rotations permute cosets in the lens space SO 3 /Z N in an induced representation (50), elements { − → X S } S∈K permute cosets in K/H, providing logical X-type operators. For T ⊂ O, there are only two cosets, so { − → X S } S∈O either act trivially or exchange the two codewords. For T ⊂ I, the sixty rotations { − → X S } S∈I form a five-dimensional permutation representation of I when acting on the five codewords. Since I = A 5 (the alternating group), any permutations of the codewords in A 5 are realized by the unitary − → X R 's. Moreover, these gates are fault tolerant. If there is a slight over-or underrotation S = S and the rotated state − → X S |r is close to (but not quite equal to) the codeword − → X S |r , then the error-correction procedure will fix this by mapping − → X S |r to the closest codeword.

VI. LINEAR ROTOR CODES
By a linear rotor we mean a rigid body with a symmetry axis, such that rotations about that axis leave the orientation of the body invariant. The paradigmatic example is a diatomic molecule containing two distinct atoms; we discuss other manifestations in Sec III C. In contrast to an asymmetric body, for which orientations of the body are in one-to-one correspondence with elements of the rotation group SO 3 , the configuration space of the linear rotor is the coset space SO 3 /U 1 = S 2 , because the U 1 rotations about the symmetry axis do not alter the orientation. This is equivalent to the configuration space of a particle moving on a two-sphere.
The position eigenstates {|v } provide an orthogonal basis for the Hilbert space of the linear rotor, with continuum normalization, where v denotes a point on S 2 (equivalently a unit 3-vector). It is convenient to parametrize points on the sphere using spherical coordinates v = (θ, φ), where θ denotes the polar angle and φ is the aximuthal angle; thus θ ∈ [0, π] and φ ∈ [0, 2π).
A rotation R ∈ SO 3 rotates the linear rotor with orientation v to a new orientation Rv. It is represented by the unitary operatorX R , with action A rotation acting on S 2 , in contrast to a rotation acting on states of an asymmetric rigid rotor, has fixed points; the position eigenstate |v is left invariant by a rotation R = (ω, ±v) about the axis v or the axis −v: X ω,±v |v = |v .
Any point v on S 2 can be obtained by applying a suitably chosen rotation R to a fiducial initial point (for example the north pole v 0 ), but there are many more rotations than points, because two rotations in the same U 1 coset map v 0 to the same point. Another relevant operation is inversion or parity, mapping v to its antipode −v. The parity operation P commutes with any rotation R; rotations together with inversions generate the group O 3 of proper and improper rotations in three dimensions, isomorphic to SO 3 × Z 2 . In Hilbert space, P is represented byX P , with action which commutes withX R for any R.
Dual to the continuous position basis is the discrete Fourier-conjugate basis, defined on S 2 by where Y m (v) is a spherical harmonic. The momentum states satisfy the normalization where dv is the surface area element on the two-sphere. In the momentum basis, Other relevant features of S 2 are listed in the third column of Table V. The spherical harmonics form a basis for functions on the sphere, meaning that any operator on S 2 that is diagonal in the position basis can be expanded in Z-type operatorsŶ However, since there are more rotations than molecular orientations, products of rotations and the above diagonal Z-type operators do not form an orthonormal basis for operators on S 2 . They instead form an overcomplete frame, satisfying the completeness relation in Eqs. (123), (100) A similar relation holds for more general quotient spaces, as described in Appx. D. Overcompleteness complicates the analysis of recovery from errors of the form in which a momentum kick by , m is combined with a rotation R.

A. Simplest linear rotor codes
Here we embed the Z N ⊂ Z 2N code (20) for general N into the linear rotor. While their SO 3 counterparts allowed protection against small momentum and position shifts, these codes can correct either against rotations around any axis by sufficiently small angles or against O(N/2) angular momentum kicks.
Codewords Constructing the simplest linear rotor codes is similar to that for SO 3 in Sec. V A. Codewords are equal superpositions of equatorial states | π 2 , φ , whose azimuthal angle φ is every even or odd multiple of π N , For the case N = 3, these codewords are shown in Fig. 2(c). These codewords are not normalizable, but normalizable approximate codewords can be obtained by introducing a damping factor, just as we discussed for SO 3 codes [see Sec. V C and Appx. A]. Expressing the codewords in terms of angular momentum states | m (96b) yields, for r ∈ {0, 1}, To derive Eq. (103), it suffices to observe that Therefore, the only terms that survive when we do the sum over h ∈ Z N in Eq. (103) are those in which m is an integer multiple of N . The logical-X codewords are that is, |0 X is a superposition of angular momentum eigenstates with m an even multiple of N , and |1 X is a superposition of states with m an odd multiple of N . In addition, because Y m ( π 2 , φ) = 0 whenever − m is odd [99], only every other value of appears in the superposition for each fixed value of m [see Fig. 2(c)].
Position shifts We will use the error-correction conditions [146,147] (see also [148], Thm. 10.1) to determine which errors can be handled by our code. To be able to correct against some subset of rotations, one should satisfy for all such correctable rotations R, R , This product of rotations is just another SO 3 rotation, X † RX R , rotating the equatorial "necklace" of constituent orientations of our codewords to another great circle.
To satisfy (106a), notice that if N is odd, the codeword |1 consists of superpositions of all points antipodal to those of the codeword |0 , Therefore, assuming odd N from now on and remembering that inversion commutes with all rotations, With the antipodal assumption (107), the first condition (106a) is satisfied for all R ∈ SO 3 .
The second condition (106b) puts restrictions on where the rotations can map the codewords. To be concrete, consider the case N = 3, depicted in Fig. 2(c). The codeword |0 is a uniform superposition of three "constitutent" points on the equator of S 2 , which are marked by black balls in the figure. The codeword |1 is likewise a uniform superposition of three constituent points, marked by white balls. For each constituent point there is a corresponding Voronoi cell, containing all points on S 2 which are closer to that point than to any other constituent point (see Appx. B). Each such Voronoi cell is a spherical lune, a sliver of the sphere bounded by two lines of longitude separated by angle π 3 ; one of these cells is colored blue in Fig. 2(c). The condition Eq. (106b) will surely be satisfied as long as the rotation R −1 R maps each constituent point to a point in its Voronoi cell.
Momentum kicks Just like rigid-rotor codes, linear-rotor codes protect against sufficiently small momentum kicks. Selection rules for addition of angular momenta dictate that a momentum kick operatorŶ m maps a momentum state | m to states | L M that satisfy Because the codewords have support on states such that m is an integer multiple of N , the code can detect momentum kicks with ≤ N − 1 and correct shifts with < N/2. The procedure for diagnosing and correcting momentum kicks follows closely the corresponding discussion for rigid-rotor codes.
Combined shifts We have now seen that the code with basis states Eq. (102) can protect against both small rotations and small angular momentum kicks. But problems arise when we consider errors that combine a rotation and a kick. Suppose for example that v is a constituent point of the codeword |0 , hence −v is a constituent point of |1 , and consider a rotation R ω,v about the axis v by a small nonzero angle ω. Then, because one and only one constituent point of each codeword is preserved by the rotation, we have To be specific, Y 1 1 (θ, φ) ∝ e iφ sin θ is nonzero for θ = π 2 , and we therefore conclude that 0|Ŷ 1 1XR |0 = 1|Ŷ 1 1XR |1 . This means that the error-correction condition is not satisfied by this code for this error.
More generally, suppose that v 1 is a constituent point of |0 , and that R, R are two rotations both of which map v 1 to another point v 2 . (There is a one-parameter family of such rotations.) Suppose in addition that Ru = Ru , where u, u are any other constituent points of |0 . Then Again, because for odd and nonzero Y m (v 2 ) we find that 0|X † RŶ mXR |0 = 1|X † RŶ mXR |1 , the error-correction conditions are not satisfied.
Given the above limitations, this code can protect against either (I) All rotations R ∈ SO 3 that keep each constituent orientation in its corresponding Voronoi cell, or (II) All momentum kicksŶ m with 0 ≤ m ≤ < N/2. In addition, if we exclude from set (I) all rotations around axes corresponding to constituent points of our logical states, then the code can correct both the rotations remaining in (I) and momentum kicks (II). However, the code still cannot correct products of such rotations and kicks due to Eq. (111). This is in contrast to rigid rotor codes, which protect against any product of a sufficiently small rotation and momentum kick.
The above diminished performance begs the question of whether such codes are of any use against realistic noise [133][134][135][136][137][138][139]. Since the rotations themselves are overcomplete, and since these codes protect against (virtually) all small rotations, such codes may be applicable to certain environments, especially ones where the noise is biased [149]. These codes can also be concatenated with other codes, whose purpose would be to provide a layer of protection against momentum kicks. It is likely that the formalism of approximate error-correction [3,150,151] may be required to study their applicability.
In a sense, the continuous U 1 -symmetry of the linear rotor is too much symmetry for such GKP-type codes to perform well. However, the framework presented here can serve as a springboard to designing codes for the many molecules with discrete symmetries -less symmetric than the linear rotor, but not completely asymmetric like the rigid rotor (see Sec. III C). Configuration spaces of less symmetric molecules should make it possible for codes of this type to perform better (see Sec. VIII).
Partial Fourier transform To construct a recovery for the above error sets, we can once again develop a partially Fourier-transformed basis. As before, we use subgroups H ⊂ K to split up our underlying space X = S 2 into various pieces as But because S 2 is not a group, the first quotient space does not consist of cosets, but instead consists of orbits in S 2 under K. The orbit Kw of a point w ≡ (θ, φ) under K is the set of points to which one can get to by applying rotations in K to (θ, φ). Identifying points in S 2 belonging to the same orbit, one comes up with the orbi t-manifold (i.e., orbifold) S 2 /K (see Table I). We construct the partially Fourier-transformed basis on S 2 and its corresponding recovery for the codes discussed above in Appx. E.
Gates & check operators Check operators for the Z N code on S 2 are similar to its counterpart on SO 3 : the Z-type check operatorŜ Z selects the 2N orientations {| π 2 , π N h + µπ } h∈Z N ,µ∈Z2 , while the X-type check opera-torŜ X has maximal eigenvalue only at the two particular superpositions of these orientations [corresponding to the two codewords (102)].
The momentum shiftŶ 2N 2N (99) acts as the identity on the codespace, while the shiftŶ N N acts as a logical-Z operator. As with the rigid rotor, neither of these are unitary on the full Hilbert space. We can obtain simpler versions by using operators of the form [152] ( where w ∈ S 2 and p is a nonnegative integer. Expressing the "position operator"v in spherical coordinates yields theŜ Z below,Ŝ Z = cos(2Nφ) sin 2Nθ (114a) X-type check operators include powers of the z-axis rota-tionX 2π A combination of such powers yields Eq. (114b) above. InversionX P is a logical-X operator.

B. Nonabelian subgroup codes
Mimicking Sec. V E, we briefly discuss more general codes based on nonabelian H ⊂ K. A simple example is H = T and K = T × Z P 2 , where Z P 2 is the group generated by inversion P . Its codeword constituents lie on two antipodal tetrahedra that are invariant under T (black and white points in Fig. 5, respectively). Taken together, these tetrahedra make up a cube. Letting w cube be one of the vertices of the cube, we can express the codewords in terms of the orbit of w cube under T: The normalization factor 1/6 arises here because the 12 elements of T map w cube to only 4 distinct constituents for each codeword. As before, these codewords are part of a partially Fourier-transformed basis associated with T, formulated in Appx. E. These T codes correct against momentum shifts {D mn } with ≤ 1, and detect momentum shifts with ≤ 2, like their counterparts on SO 3 (see Sec. V E). Check operators The Z-type check operatorsŜ Z have the same eigenvalue at each of the constituent points of the code, which in the T case means the corners of the cube in Fig. 5. This condition is clearly satisfied by harmonics that are symmetric under K, since that group leaves the cube invariant. In Appx. E, we describe how to obtain such harmonics by "averaging" or "twirling" the spherical harmonics over K. Using this procedure, we obtain the Z-type check operator Figure 5. Linear rotor codes. Sketch of two polyhedral harmonics for the T code on S 2 , whose two codewords are equal superpositions of the white and black points, respectively. The left harmonic is the code's stabilizerŜZ (116) and the right is the logical-Z operator (117). Positive (negative) values are in yellow (blue), and the outlined spheres have radius 1.
corresponding to the K-symmetric harmonic Y 4 0 . Shown in the left panel of Fig. 5, the above is normalized such that the constituent states {|±Rw cube } R∈K of the codewords are eigenstates with eigenvalue +1.
Naturally, T-symmetric harmonics can act as logical Z-type operators within the codespace. The smallestlogical-Z operator is shown in the right panel of Fig. 5, corresponding to the harmonic Y 3 2 averaged over T, The X-type check operatorsŜ X consist of rotations {X ω,w , (ω, w) ∈ T}, commuting with allŜ Z but not necessarily with each other outside of the codespace. The group T is generated by the rotations ( 2π 3 , (x+y+z)/ √ 3) and (π, z), sô S (1) together with theŜ Z check operator, are sufficient to identify the code space. Relation to spherical designs There is a one-way connection between designs and momentum kick detection. An L-design is a set of points P ⊂ S 2 satisfying for all polynomials f of degree ≤ L. An L-design satisfies f (P) = f (RP) for any rotation R ∈ SO 3 [153, Thm. 5.6.1] and any polynomial f with degree ≤ L. Because of this property, and because spherical harmonics {Y m } are degree-polynomials restricted to the sphere, the states |P ∝ p∈P |p andX R |P form a code detecting ≤ L momentum kicks, where R is any nontrivial rotation.
Designs often arise as orbits of a group H acting on a particular point w, P = Hw. For example, the constituent orientations of each of the codewords of our T ⊂ T×Z P 2 code form a two-design, and the +1 logical-X state consists of all points on a cube and forms a 3-design. (Not all of our codes are designs: the equatorial sets of points making up our Z N codewords detect momentum kicks, but do not form N − 1-designs.) The connection to designs suggests a way to obtain other design-based codes, whose codewords are not based on a single orbit, or whose codewords make up more complicated polyhedra [154]. There is also a potentially interesting extension of oscillator-based error-correcting codes based on designs [155] to molecular state spaces.

VII. A QUBIT ON A GROUP
In Sec. V we described a family of quantum codes based on the nested subgroups H ⊂ K ⊂ SO 3 . In this section, we generalize this construction. The basic framework was already discussed in Sec. V D. We formulate quantum codes based on H ⊂ K ⊂ G using a symbolic decomposition of G defined by a partial Fourier transform: We interpret elements of G/K as correctable rotation errors and elements of H as correctable momentum kick errors, while elements of K/H correspond to basis states which span the code space. Data for these codes are summarized in Table III. We consider error-correcting codes for quantum systems whose canonical position basis {|g } corresponds to elements of a group, g ∈ G. Such spaces admit generalized versions of many of the features of standard quantum mechanical spaces such as qubits or oscillators: position and momentum bases, their corresponding shifts, orthogonality relations, a Weyl-type relation, etc. We have collected these in Table IV, intending it to be an extension of  an analogous table [156, Table 1] for the standard spaces.
The position/momentum bases for general G can be discrete/discrete (e.g., for qudit spaces G = Z ×n D ), continuous/discrete (for rotors G ∈ {U 1 , SO 3 }), or continuous/continuous (for oscillators G = R). These differences obscure the intuition we are trying to convey, so we keep G finite for clarity here. The caption of Table IV adapts these discussions to other G, and Ref. [116] rigorously formulates many of the required tools for type I unimodular second-countable groups.
Most of the structure for general G is already present for G = SO 3 , which we outlined in Sec. V. Position shifts − → X for general G are represented by left multiplication, − → X h |g = |hg , and analogous shifts ← − X exist for right multiplication. "Momentum" kick operators are diagonal in position space, acting as [157,Eq. (5)] Part. Fourier basis (124) {|aH; λ µν , a ∈ F G/H , λ µν ∈ H} Logicals (126) {|rH; 1 00 , r ∈ F K/H } Corr. position shifts F G/K Corr. momentum kicks Use branching formulas Check operatorsŜZ (135) Table III. List of elements of a H ⊂ K code on G from Sec. V A.
The set H consists of (equivalence classes) of all irreps of H, F G/K is the Voronoi cell of the identity (see Appx. B), and K ⊂ K consists of all elements of K that map to identity when projected onto the logical subspace.
where Z mn (g) is the m, nth matrix element of the group element g in the irrep . These matrix elements are part of the momentum basis for G: We collect all mn into G, the "dual space" of G.
Products of position shifts and momentum kicks,

form an orthonormal and complete basis for operators on G,
where Tr(·) = g∈G g|(·)|g and h, h , k, k ∈ G. Thus, any physical noise channel E acting on this space can be expanded in terms of this operator basis, as before (9,42). The purpose of our codes is to protect against "small" position shifts as well as certain momentum shifts. Partial Fourier transform Our code constructions make use of the partial Fourier transform on G, whose states are parameterized by cosets in G/H and H-irreps, Above, a belongs to the coset space G/H, which we parameterize using F G/H , the Voronoi cell of the identity (see Appx. B). The coefficient -Z λ µν (h) is the µ, νth matrix element of the d λ -dimensional irrep λ of H, evaluated for the element h ∈ H. We use the Greek letters λ, µ, ν to label matrix elements of irreps of H, and save the letters , m, n for labeling matrix elements of irreps of G.
The above basis interpolates between the group's position states (H = {1}) and momentum states (H = G).
One can show that it is orthonormal and complete: 3 This basis arises in several other contexts in science and engineering, which we discuss in Appx. F. Codewords Our codewords correspond to cosets of H in K. For r ∈ F K/H and λ = 1 the trivial irrep, Expressing the G position states (126) in terms of momentum states yields Here we have introduced the notation f (H) for the Haverage (also called H-twirl ) of a function f on G over the subgroup H, defined by Observing that Z mn (rH) = Z (r)Z (H) mn , we see that the momentum state | mn "participates" in the expansion of |r (occurs with a nonzero coefficient) only if Z (H) = 0. Irreps with this property make up the reciprocal space of H in G, For each , we also have to determine the participating m, n indices; these depend on the basis used for Z (see Appx. D).
Denoting the set of participating momentum-state indices mn by G/H, Eq. (127) becomes We have thus mapped the position degree of freedom r from the ket |rh of the position-basis expansion (126) into the coefficient Z mn (rH) of the momentum-basis expansion (130). This can be done for any coset state |aH; 1 00 with a ∈ G/H -a manifestation of the Fourier transform on G/H (see Appx. D). Analogously, one can develop a Fourier transform on the codespace K/H. 3 To show the above, we use g = ah with a ∈ F G/H and h ∈ H for each g ∈ G, ah|a h = δ G/H aa δ H hh , and Table IV.E. We define generalized delta functions δ X xy for a space X, satisfying Position shifts Position shifts acting from the left realize an induced representation for each λ, meaning that { − → X g } g∈G do not connect different λ's. The difference from the abelian case (50) is the behavior of the internal indices µν, Above, the compensating element k g ∈ H is picked such that gak −1 g ∈ F G/H . Let us determine the set of correctable position shifts − → X g . First consider g ∈ F G/K , in which case there is no compensating element. Then, the error state obtained from applying a momentum kick and position shift to the codeword |r will consist of a superposition of the basis elements (124) with a = gr. By measuring a rotation in F G/K and applying the corresponding position shift, the recovery will map each gr to the element r ∈ K/H whose Voronoi cell contains gr. (The partitioning into cosets ensures that the Voronoi cell of each r ∈ K/H will contain only one gr.) Since g ∈ F G/K , gr will be in the Voronoi cell of r, so r = r. After recovery, each r will return to its original location. Now consider g / ∈ F G/K . Now, the corrupted position label corresponding to codeword r can stray into the the Voronoi cell of some other element r = r. The above recovery will snap such error words to the wrong codewords, leading to logical errors. In the case of nonabelian codes, there may be errors due to the effect of the compensating element on µν (131).
Momentum kicks Assuming we have exactly corrected a position shift, the resulting state lies in the span of {|rH; λ µν } for all r ∈ K/H and λ µν ∈ H. Below, we show how to use the branching formulas for G restricted to K, and then K restricted to H, to determine detectable and correctable momentum kicksẐ mn . We leave the precise formulation of a momentum-kick recovery for general G to future work.
Let ∈ G, κ ∈ K and λ ∈ H, so that → κ → λ means that contains at least one copy of the K-irrep κ when restricted to K, which in turns contains at least one copy of λ when restricted to H. We denote the trivial irrep by 1. For convenience, we assume that Z are written in a K-admissible basis (see Appx. D), meaning that Z (k) for k ∈ K are block-diagonal with respect to the K-irreps. Similarly, we assume that those Z (k) are in turn in an H-admissible basis.
First consider detectable errors. Let be such that one of its branches is → κ → 1 with κ = 1. Then, there exists a momentum kickẐ mn for some m, n that is undetectable. To prove this, consider matrix-valued versions of the error-correction criteria, projecting the matrix of G-mometum shiftsẐ into the codespace (126), We will show that the above depends on r.
Since Z (h) is in an H-admissible basis, we can express each Z (h) in Z (H) ∝ h∈H Z (h) as a direct sum of irreps of H. By the group orthogonality relations on H, Z mn (H) = δ mn only for those n which correspond to matrix elements of h in the trivial H-irrep. We have assumed that branches to at least one trivial irrep of H, so there exists such an n, which we call n . [This implies that ∈ H ⊥ (129), a necessary but not sufficient condition for undetectability.] Now, consider the column Z mn (rH), with m ∈ {1, 2, · · · , d κ } and d κ being the dimension of the κ irrep that contains the trivial irrep λ = 1. When r = 1 (the identity), Z mn (rH) = δ mn . But since κ = 1, there exists another r = 1 that is represented differently. Thus, Z mn (r H) = δ mn , and Eq. (132) depends on r.
Now consider correctable errors. Let = be such that they branch to the same nontrivial H-irrep via different nontrivial K-irreps κ = κ , i.e., → κ → λ and → κ → λ, respectively. Then, momentum kicksẐ andẐ will not be simultaneously correctable. To prove this, let m, n be the matrix elements of the copy of λ contained in κ, and m , n be those for the copy of λ contained in κ . Then where we have used the basis (124) in the second line. Using orthogonality of this basis, When r = 1, the sum over p reduces to δ mm . But since κ = κ , there exists an r = 1 such that the above yields a different result. Therefore, one cannot correct both and momentum kicks.
Gates & check operators Logical X-type gates include all { − → X k } k∈K , which realize an induced representation on the logical subspace K/H. A subset of those, which we call K ⊂ K, acts as the identity in this induced representation; such operators can be used as check operators for momentum-kick syndrome measurement. Examples of such representations are discussed in Sec. V E.
The position shifts { ← − X h } h∈H also act trivially on the codewords. These do not commute with each other for nonabelian H, but do commute with − → X k (since left-and right-multiplication commute). These can also be used as check operators, and the resulting combined set of Xtype check operators is listed in Table III.
If H is a normal subgroup of K, then the shifts { ← − X k } k∈K also realize logical gates; otherwise, such shifts may not preserve the code subspace (since left and right coset spaces, K/H and H\K, are not equal). For G = SO 3 , such cases include Z N ⊂ Z 2N and T ⊂ O, but not T ⊂ I.
Twirling momentum kick operators over K, offers a convenient method for generating Z-type check operatorsŜ Z . The above operators are functions on G/K: for w ∈ G/K and r ∈ K/H. Thus, measuring them does not spoil the logical information. A projective measurement onto the basis of the joint eigenstates of these mutually commuting operators can be used to determine the syndrome w. (The scheme outlined below implicitly performs such a measurement.) SuchŜ Z commute with each other and all { ← − X k } k∈K , but only commute with { − → X k } k∈K on the subspace {|rH; λ µν } with r ∈ K/H and λ µν ∈ H. Since they can be nonunitary, they do not in general form a group. Twirling momentum kicks over H produces logical Ztype operators. A similar procedure yields Z-type check and logical operators for codes on S 2 (see Appx. E).
Measurements Recall that, given a subgroup K, each group element g ∈ G can be written as g = ak for a ∈ F G/K and k ∈ K. In order to diagnose which position shift occurred without destroying the logical information, one needs to read off the coset label a without obtaining information about k. Since there are only |G/K| different values one needs to distinguish, we can pick the ancillary space to be G/K (instead of the larger G) and still measure in one shot.
LettingX g be the induced representation of G on G/K, we apply the generalized crot gate (cf. [157]) onto the G-space housing our logical information and an ancilla initialized in some state |K (assumed invariant under {X k } k∈K ). SinceX g =X aXk and since the initial state is K-invariant, the ancilla will obtain only the coset label a, without destroying coherences between elements of the coset. This procedure can also be used for logical state initialization. The space G/K can be "simulated" by a finitedimensional space spanned by generalized spin-coherent states [90], similar to our construction from Sec. V B.

VIII. CONCLUSION & FUTURE WORK
We have developed error-correcting codes that protect against small shifts in the position and momentum of a rigid body and, more generally, of a state space {|g , g ∈ G} where G is a group. Our treatment unifies CSS codes (G = Z ×n D ) with GKP codes for qudits (G = Z N = C N ), oscillators (G = R), and planar rotors (G = U 1 = SO 2 = C ∞ or G = Z). We propose using our rigid-body codes, for which G is the 3-dimensional proper rotation group SO 3 , to robustly encode quantum information in the rotational states of asymmetric molecules.
We also constructed related codes that protect a linear rotor, whose configuration space S 2 is a coset space rather than a group, and we formulated position and momentum bases, their associated shifts, and orthogonality relations for general coset spaces.
A basis may be chosen for a rigid-body code space such that each basis state is a uniform superposition of a finite number of possible orientations for the body. Because position eigenstates in a continuous-variable system are not normalizable, the ideal codewords are likewise not normalizable and have infinite energy. But we may instead choose normalizable, finite-energy approximate codewords which retain good error-correction properties.
Our coding scheme has potential applications to polar molecules, certain spin systems, atomic ensembles, single atoms, and levitated nanoparticles. We now mention several possible topics for future investigation.
Physical noise Our codes are designed to protect against noise that acts "locally in phase space." For CSS codes the correctable errors are low-weight Pauli operators acting on a few qubits. For GKP oscillator codes, the correctable errors are small shifts in the position or momentum of the oscillator. For rigid-rotor codes, the correctable errors are small shifts in the rotor's orientation or small kicks in its angular momentum.
Physical noise may act nonlocally in phase space. But it has recently been shown that the dominant noise in microwave cavities is sufficiently local for GKP codes to work effectively [3,4]. It remains to be seen whether the noise in realistic rigid rotors [133][134][135][136][137][138][139] has similarly benign properties.
Symmetric molecules For a molecule with a symmetry group H ⊂ SO 3 , the configuration space of molecular orientations is the coset space SO 3 /H. A larger symmetry group means a smaller configuration space, and thus less room for diagnosing rotation errors. In the extreme case of a perfect sphere, invariant under any SO 3 rotation, there is no room in the one-dimensional space SO 3 /SO 3 for any logical information at all. It would be interesting to investigate further how the performance of our codes depends on the symmetry group. Of particular interest are Z 3 -symmetric molecules (such as monomethoxides [21] or Posner molecules [113,114]), which are invariant under rotations by ±120 degrees.
Nuclear motion Instead of considering rigid molecules that are assumed to be in a fixed vibrational state, one can also consider "floppy" molecules for which there is no clear separation between rotational and vibrational motion. Such motion ranges from small nuclear vibrations around equilibrium positions [53] to largerscale bending motion [158] and even nuclear permutations [159]. To devise codes that protect quantum information carried by (for example) floppy molecules, we will need to consider different configuration spaces than for the rigid-body codes described here. Nevertheless, some of the mathematical tools we have developed may be applicable in this broader context.

Finite group L 2 (G)
Rigid rotor L 2 (SO3)  Table IV. Summary of relations for L 2 (G) -the space of L 2 -normalizable functions on a group G -extending analogous summaries for ordinary qudit and oscillator state spaces [156, Table 1]. The C LM m m are Clebsch-Gordan coefficients [99,140]. When G = Z ×n D , the state space is that of n quDits, and the position states and their corresponding momentum states are both bona-fide (i.e., discrete) orthonormal bases. The rotor state spaces U1 and SO3 and, more generally, any continuous compact G admit bases of position states in the continuous/Dirac sense [160,Sec. 6.6]. In those cases, 1 |G| g∈G is replaced by 1 |G| G dg, where |G| is the volume of G as a manifold and dg is the Haar measure [141]. However, since such spaces are compact, their corresponding momentum bases are still discrete. The oscillator G = R is continuous and noncompact, meaning that both its position and momentum bases are continuous. For this group and others like it, 1 |G| is omitted and the sum over turns into an integral (with respect to the Plancherel measure) [161] (see also [141,Sec. 8.3.3]). Table V. Summary of relations for coset spaces L 2 (G/H), treated as subspaces of group spaces L 2 (G); see Appx. D. The C LM m m are Clebsch-Gordan coefficients [99,140]. The operatorX h is − → X h projected onto the quotient space.
Appendix A: Building codes via microwave dressing As discussed in Sec. III, the most versatile approach to generating the approximate codewords is to build a linear combination of angular momentum eigenstates with the proper weights using an array of microwave couplings. For this preliminary scheme, we neglect hyperfine structure and mixing of momentum states with nuclear quadrupole moments [79]. As a concrete physical platform, we focus on molecules composed of bosonic isotopes of alkaline-earth(-like) atoms [162] as well as 12 C and 16 O, which have zero nuclear spin. A small electric field lifts the degeneracy of all | |m|,|n| ↔ | |m |,|n | transitions, but does not significantly mix eigenstates. Similarly, a magnetic field can split the ±m and ±n degeneracies. Recall that the eigenenergies for a given are proportional to B ( + 1). 1 Hence any transition − = ±1 has a unique energy.
Since B ∼ 1 GHz for most molecules, | |m|,|n| ↔ | |m |,|n | transitions can conveniently be driven with microwave fields. Note also that the dipole matrix elements (DMEs) of such transitions are relatively large for polar molecules, often µ ≈ 1 atomic unit (a.u.). Therefore, multiphoton processes which are off-resonant from intermediate states can still achieve sufficient couplings. Figure 6 shows the codewords for U 1 (a), SO 3 (b), and S 2 (c) in the angular momentum basis, where the opacity qualitatively indicates the fractional population of the normalized state. Recall that, for SO 3 , we require only the n = m states, so no explicit discussion of n is necessary in any of these cases. Consider, for example, 1 Σ-type molecules, such as biakalis. Their orientations correspond to the state space S 2 , and we consider realizing the codewords (103) with N = 3. We apply the damping function e − 1 2 ∆ 2L2 from Sec. V C to normalize the codewords. The parameter ∆ > 0 depends on how many momentum states max we want to consider, whileL 2 is the total angular momentum operator. The resulting logical zero approximate codeword, up to normalization, is We assume the molecule is initially in the rigid-rotor ground state | m = | 0 0 , and assemble the state (A1) using microwave tones. All couplings "cascade" down from | 0 0 as shown in Fig. 6(c). Control over the frequency, power, polarization, and phase of a microwave tone can readily be achieved in the laboratory, and is essential to build the state (A1). The microwave couplings are all adiabatic with respect to the timescales of molecular rotation, and we expect that continous-wave (CW) microwave pulses will be possible to build the codewords as the steady state solution of the Hamiltonian with the microwave driving terms of the form Figure 6. Microwave dressing. Sketch of the microwave tones required to build the approximate codewords out of angular momentum eigenstates up to | max| = 3 for U1 (a) and max = 6 for SO3 (b) and S 2 (c). We assume the molecule is initialized in | = 0 for U1, | 0 00 for SO3, and | 0 0 for S 2 . An array of microwave tones is applied to construct the codewords. Any transition allowed by dipole selection rules can be driven with a Rabi frequency Ω m m , phase φ m m , and detuning δ m m . (For SO3 we utilize only the n = m states, so no explicit mention of n is necessary for those cases. For U1, there are only states with integer .) Curved lines without arrows illustrate vastly off-resonant coupling to a state for which the population is effectively zero, and the state can be adiabatically eliminated. Curved lines with arrows illustrate couplings with finite population of the state. To prepare approximate codewords in the subspaces shown, at most 12, 24, and 22 unique microwave tones are required for U1, SO3, and S 2 , respectively.
with Rabi frequency Ω m m , detuning δ m m , and phase φ m m in the rotating frame of the original rigid-rotor Hamiltonian BL 2 .
In the perturbative limit Ω/δ 1, where we have suppressed the decorations on Ω, δ for clarity, the population P m can be expressed as P m = (Ω/δ) 2 P m , where P m is the population in | m . We ignore the Stark shift of | m , given by δ S = Ω 2 /δ, since δ S δ. Applying the same analysis to multiphoton processes, now consider the 3photon pulses | 0 m0 → | 1 m1 → | 2 m2 → | 3 m3 . Assuming vastly off-resonant drives for the intermediate states, we can adiabatically eliminate said states. The population in | 3 m3 is given by Thus, | l3 m3 can effectively be attained from | l0 m0 using the above combination of tones.
The above scheme can be used to transfer population in each momentum state present in the approximate state (A1) to neighboring states. That way, the population in | 0 0 cascades down the angular momentum pyramid. The required tones are shown in Fig. 6. Curved lines with arrows illustrate couplings with finite population of the state. For the S 2 state (A1) with max = 6, we require 22 unique microwave tones. Similar schemes for U 1 and SO 3 , shown in Fig. 6(a-b), require 12 and 24 tones, respectively.
The above is just a sketch. A detailed analysis based on, e.g., exact diagonization of the coupling Hamiltonian or a master equation would be required to choose the frequency, power, polarization, and phase of each microwave tone (A2). One must be aware of the formation of dark states as well as potentially dynamic evolution of the populations. Advanced modeling is particularly important outside the perturbative limit when Ω m m /δ m m ∼ 1, for which population dynamics must be addressed. Timedependent pulses can also be employed for which power and phase can be adjusted on timescales comparable to the Rabi frequencies (but still slow compared to rotational timescales). Such analysis is outside the scope of this work.
An electric field may be helpful for building the codewords, and could potentially reduce the number of required microwave tones. In our notation, an electric field is represented by operator cosφ for U 1 ,D 1 00 for SO 3 , and Y 1 0 for S 2 . For the latter two spaces, a large electric field mixes -states with the same m [see Eq. (60)]. This point is particularly salient in the case of SO 3 , where couplings down the columns for |m| = 0, 3, 6 are required. A large electric field will naturally create these couplings down each column of Fig. 6(b).

Appendix B: Voronoi cells
We determine the Voronoi-Dirichlet cells of the quotient spaces SO 3 /H from Table I. This is strictly an adaptation of the work of Postnikov [83] (see also [86]).
Let X be a metric space with distance function d and distinguished origin point x 0 . Let H be a discrete group whose elements R ∈ H map points x ∈ X as x → Rx. This group maps the origin to the orbit {Rx 0 } R∈H . Each such point Rx 0 has its own Voronoi cell -a region consisting of points that are closer (or as close) to Rx 0 than to R x 0 for any R = R. When R is the identity, we call the corresponding cell the fundamental Voronoi cell, When the space is a group (X = G), x 0 is the identity, and the above is thus the Voronoi cell of the identity.
To properly account for distances in SO 3 , we recall that it is equivalent to the 3-sphere S 3 = SU 2 with opposite points identified, SO 3 = S 3 /Z 2 [140]. The 3-sphere can be parameterized by either a 4-dimensional unit vector or by a quaternion. Just like a semicircle parameterizes a circle with opposite points identified, hemispherical quanternions, are an equivalent way to parameterize R = (ω, v) ∈ SO 3 . The distance function d we use is the dot product of the above 4-vectors.
The Voronoi cell of a point p is bounded by the intersection of the interiors of the mediatrices of p and all q that are in the orbit of p under H. A mediatrix of points p and q is the set of all points that lie the same distance from p and q. For a 2D square lattice, the boundary of F R ×2 /Z ×2 consists of segments that bisect lines that connect the center of the cell with centers of neighboring cells. The boundaries of F SO3/H are hyperplanes that go through the midpoint (Ω/2, w) of the geodesic connecting the center with each group element (Ω, w) ∈ H. Points η on such hyperplanes satisfẏ whereη ≡ ∂η/∂ω. Solving for ω yields We use this to plot the various manifolds in Figs. 2-4.
Letting H be a z-axis rotation subgroup yields Eq. (53).
Leakage error To evaluate P leak , we first start with its complement P ok = 1−P leak , the projection of |0 onto its own Voronoi cells [for N = 3, those in the left panel of Fig. 3(c)]: Recall that |0 is a superposition of smeared group elements |R 2π N k,z for k ∈ Z N . Inserting this expansion for |0 , we estimate P ok in the ∆ → 0 limit by ignoring contributions from elements leaking outside of their own Voronoi cells, (C6) Inserting the asymptotic expression for 0|e −∆ 2L2 |0 and using invariance under rotations (C2) brings us to (C7) Now we get rid of the v-dependence of the absolute value. Recall that rotations conjugate each other as For each v, we pick (Ω, w) such that R Ω,w v = z. We then "create" that rotation inside the ket and commute it through to the bra, We further estimate this matrix element via the same procedure as that for the average angular momentum, Plugging all of the above into P leak = 1 − P ok yields The integration measure [99,Sec. 4.5.4] is dS ω,v = 4 sin Θ sin 2 (ω/2)dΘdΦdω , and for F SO3/Z 2N , the integration of (Θ, Φ) = v is over S 2 and ω ∈ [0, ω max (Θ)] [see Eq. (53)]. To absorb the "1−" part, we integrate over the complementary region, for which ω ∈ [ω max (Θ), π]. Trivially integrating over the azimuthal angle and simplifying yields dω ω 2 e −ω 2 /∆ 2 .
To simplify the integral, we first use invariance under Θ → π − Θ to write where, due to the new integration domain, we can remove the absolute value in ω max and define ω ≡ 2 cot −1 cos Θ cot π 4N . Now we apply Laplace's method [163]: in the ∆ → 0 limit, the leading-order contribution to the ω-integral is around ω = ω , since the exponential ω 2 /∆ 2 is minimized there. Thus, we can increase the upper ω-bound to infinity without losing accuracy and perform the resulting Gaussian-type integral. Plugging the result into the remaining integral yields Now the dominant contribution is around Θ = 0. Expressing ω in terms of Θ, we expand both ω sin Θ and the exponential around zero, Plugging this in, extending the upper bound to infinity, evaluating the resulting Gaussian-type integral, and simplifying yields the result (78). Momentum kick distortion A way of understanding why detection of < N momentum kicks implies correction of < N/2 kicks stems from the fact that products of D mn (R)D m n (R) can be expanded in terms of a sum of single D-matrices [99,Sec. 4.6.1]. Upgrading this to operators and using selection rules (60)  For the normalizable codewords, the problem comes from violations of the Knill-Laflamme conditions stemming fromD 00 , namely, 0 |D 00 |1 = 0. Using Eq. (C16), this translates to not being able to perfectly resolve kickŝ D mm with fixed m but different , as the distortion caused by such kicks depends on . Working in the ∆ → 0 limit, plugging in the approximate codeword normalization, using Table IV.G, and using selection rules (60), Numerically, thus sum is exponentially suppressed with 1/∆ 2 for all < N that we have tested. Below, we estimate its asymptotic behavior, showing that its dependence on ∆ is surprisingly similar to P leak (78). As ∆ → 0, ever increasing values of L, contribute to the sums (C18). For L, , the Clebsch-Gordan coefficients C L,P N ,0, ,P N approach their semiclassical limit -a particular D-matrix element [99, Sec. 8.9.1]. Since D-matrices are unitary, this element is bounded by one. Setting all C's to one and evaluating the innermost sum over P yields For all > , there are 2 + 1 different values of L. For each value, we approximate the resulting sum over by the sum associated with L = . This yields (2 + 1) e −∆ 2 ( +1) (−1) N . (C20) The sign of the summand oscillates with , with periodicity N . Numerically, we observe that this expression scales as the quoted estimate (79).
Appendix D: Coset spaces L 2 (G/H) In close analogy to group spaces G, here we construct Table V -an analogue to Table IV for coset spaces G/H with H ⊆ G. The key idea is to treat these spaces as subspaces of the group space G. This allows us to develop position/momentum shift operators and orthogonality relations. This treatment is intended for molecular state spaces SO 3 /H, but it also provides a framework for qudit-type spaces G/H for finite G as well as symmetric spaces for G a Lie group. However, as with Sec. VII, we consider finite G to better flesh out the key intuition.
Mathematically, our result is a "coordinates statement" of the Peter-Weyl theorem for homogeneous spaces [164,Corr. 9.14] [165] [166,Eq. (116)] [167,Sec. 2.3.9]. The ability to make such a statement stems from a particular choice of the "coordinates", namely, bases for the irreps of G that are block-diagonal when restricted to H.
Recalling that a space G consists of states {|g , g ∈ G}, the defining position states of the space G/H are equal superpositions of elements of cosets of H in G, where a is any element of the coset aH. In effect, projecting into the subspace spanned by the above states is equivalent to performing the quotient map on the level of the group. Some applications require unique choices of coset reprensetatives, so we pick a ∈ F G/H -the Voronoi cell of the identity (see Appx. B). We abuse notation and use G/H and F G/H interchangeably throughout the paper. Expressing these in terms of the momentum states of G from Table IV (48), all ∈ SO 3 participate, but the internal indices m, n are restricted.
While the surviving are established by H ⊥ , surviving m, n depend on the choice of basis used for the irreps Z . We pick an H-admissible basis [165], for which each Z decomposes into blocks of some irreps λ( ) ∈ H when restricted to h ∈ H, Picking a particular matrix element p, n selects one of three cases: 1. a matrix element that is outside of the above block decomposition and hence zero, 2. a matrix element of a nontrivial irrep λ( ) = 1, 3. a matrix element of the trivial irrep λ( ) = 1.
In case (2), the group orthogonality relations (Table IV.E) for H tell us that such a matrix element averaged over H will be zero (since we assumed the irrep is nontrivial and -Z 1 00 (h) = 1). Thus, only case (3) survives, and we see that H ⊥ consists of only those irreps that contain a trivial irrep of H. Since the trivial irrep is one-dimensional, since we are using an H-admissible basis, and since our average has a 1 |H| factor, one must have Z pn (H) = δ pn for all n corresponding to trivial λ( ) = 1 in decomposition (D4). Plugging this in yields where where we collect the surviving ∈ H ⊥ , the surviving n designated by our H-admissible basis, and all m ∈ {1, · · · , d } into G/H. This set determines the Gmomentum states | mn that form the momentum basis for G/H. Since the position states |aH each consist of different group elements, they are orthogonal. Inserting a resolution of identity in terms of G-momentum states into aH|a H yields completeness relations The remaining identities in the 2nd column of Table V  are determined from the above and Table IV. Denoting − → X g projeted onto G/H asX g , the productŝ for g ∈ G and mn ∈ G/H form an overcomplete frame for operators acting on G/H, Example: rigid rotor Recall from Appx. B that the rigid rotor is itself a quotient space, SO 3 = SU 2 /Z 2 , where Z 2 = {I, −I}. We can interpret it as a subspace of SU 2 , with position states where R ∈ SO 3 and |±R SU2 are position states in SU 2 .
To determine the SU 2 momentum states | mn (with ∈ Z/2 now being integer or half-integer) participating in the momentum basis of SO 3 , we can expand |±R SU2 in terms of momentum states and simplify the sum (i.e., Z 2 -twirl). The irreps of SU 2 are also expressible in terms of Wigner D-matrices, and such Z 2 -twirls are simple: since D (−R) = −D (R) for the half-integer irreps. This shows that only the integer SU 2 irreps participate in SO 3 . The momentum states of SO 3 are thus | mn with 0 ≤ |m|, |n| ≤ .
The − → X R , ← − X R , andD mn of the rigid rotor (see Sec. V) are inherited directly from their analogues on SU 2 . The − → X R and ← − X R operators together from the group SO 3 × SO 3 , the joint group of lab-frame and molecule-frame transformations for an asymmetric molecule.
Example: linear rotor A canonical example of a coset space is the two-sphere, where G = SO 3 , H = U 1 .
Here we show that this space is equivalent to an appropriately chosen subspace of the rigid rotor SO 3 . Picking U 1 to be z-axis SO 3 -rotations R 00γ (in the Euler angle φθγ parameterization), v = (θ, φ) ∈ S 2 , and the Wigner D-matrices 2 are already in a U 1 -admissible basis. The position states are then To determine the momentum states | mn participating in the momentum basis of S 2 , we can expand |R φθγ in terms of momentum states and perform the U 1 -integral (i.e., twirl) of the corresponding coefficients D mn . Using dγD mn (φ, θ, γ) Thus, the S 2 momentum states are | m ≡ | m0 . Further applying this machinery works out the rest of the third column of Table V.
In this framework, the X-(98) and Z-type (99) operators of S 2 can be viewed as projections of the X-and Z-type operators of SO 3 onto S 2 . From Table IV.F, we see that all − → X R for R ∈ SO 3 are also operators on S 2 , acting on the m indices of the S 2 momentum states and yielding the position shiftsX R . Projecting the ← − X R operators, on the other hand, retains only certain matrix elements, m | ← − X αβγ | m = δ δ mm D 00 (0β0) . (D17) Only two values β ∈ {0, π} yield unitary operators on S 2 , with β = 0 being the identity and β = π being the S 2 inversion operationX P . These form the group Z P 2 , which together with the projected − → X R 's forms the group SO 3 × Z P 2 = O 3 of proper and improper rotations on S 2 . Example: Z N -symmetric rotor Another space of interest is SO 3 /Z N , the orientation space of a Z Nsymmetric molecule. Using z-axis rotations for Z N , this is a subspace of SO 3 with position states where a = (φ, θ, ξ) ∈ F SO3/Z N , (θ, φ) ∈ S 2 , and ξ ∈ [0, 2π N ). To determine the participating momentum states, we perform the Z N -twirl As with the linear rotor, this space inherits all − → X R rotations. However, projecting the ← − X R rotations yields m,N p | ← − X αβγ | m ,N p = δ δ mm D N p,N p (αβγ) . (D21) As opposed to the case of the linear rotor, ← − X R is not diagonal in the momentum basis, and so there are more unitary operators inherited from such rotations. For example, all triples (α0γ) and (απγ) yield unitary operators, forming the group O 2 . Together with all − → X R 's, these form the group SO 3 × O 2 .
As N → ∞, ξ → 0 and this space approaches S 2 . In pictures, the saucer-like space [see Fig. 2(b)] compresses to a flat pancake with all of its boundary points identified, which is equivalent to the two-sphere.
Poisson summation A final interesting note is the presence of a Poisson summation formula on these spaces. Recall the standard formula for functions f ∈ L 2 (R), Oftentimes, the first term in the sum over is sufficient asymptotically with some parameter (see Sec. V C), so this formula is useful to approximate sums with integrals. A closer inspection reveals that this is a special case (H = Z and G = R) of the more general formula for evaluating the sum of a function f ∈ L 2 (G) over H [116]: This can be generalized to sums over cosets aH.

Appendix E: Partial Fourier transform on S 2
Our focus here is on protection against small rotations, which necessitates the use of coherences between antipodal orientations to store the logical information [i.e., satisfaction of Eq. (107)]. Given this condition, it is convenient to let the subgroup K ⊃ H be H × Z P 2 , where Z P 2 is the group generated by inversion P . Since there are only two cosets {H, P H} of H in K, our choice of K restricts us to only qubit codes. (Other choices for K are of course possible, but we do not expound on them here.) Abelian subgroup codes Let us pick H = Z N (for odd N ) and K = Z N × Z P 2 , where Z N corresponds to the group of z-axis rotations. The orbit of a point (ϑ, ϕ) (with ϑ / ∈ {0, π}) under K consists of the 2N points (ϑ, ϕ + π N h) and (π − ϑ, ϕ + π N h + π) with h ∈ {0, 1, · · · , N −1}. To form our basis, these points are then split up into two sets of N points, each set corresponding to one of the two cosets labeled by r ∈ {0, 1}. The two cosets are then Fourier-transformed to construct the respective basis states {r, λ} (with λ ∈ {0, 1, · · · , N − 1}) for each orbit (ϑ, ϕ), yielding the basis These states are defined for all (ϑ, ϕ) belonging to the Voronoi cell of | π 2 , 0 , except at the points ϑ / ∈ {0, π}. This cell is depicted by the blue spherical lune in Fig. 2(c). The codewords (102) correspond to |0Z N ( π 2 , 0); 0 and |1Z N ( π 2 , 0); 0 , respectively. The cone points ϑ ∈ {0, π} are special in that they are invariant under any Z N rotations around the zaxis. For such points, λ = 0, and their orbits under Z N are simply the points themselves, |0Z N (0, 0); λ = |0, 0 and |1Z N (π, 0); λ = |π, 0 .
The above basis is orthonormal and complete due to Eq. (112), and with this basis at hand, we can devise a recovery map for our code. A simple map consists of isometries mapping the subspace {|rZ N (ϑ, ϕ); λ } r∈{0,1} for each (ϑ, ϕ) and λ (with ϑ / ∈ {0, π}) into the codespace {|r } r∈{0,1} . The remaining cone points ϑ = 0, π can be mapped to any state in the codespace, and we choose to map them to 1 √ 2 (|0 + |1 ). Because it preserves coherences between antipodal points, this recovery protects from all rotations R that keep each orientation in its Voronoi cell. To see this, consider N = 3 and write a general code state (with |c 0 | 2 + |c 1 | 2 = 1) as where for h ∈ {0, 1, 2}, the states are superpositions of a pair of antipodal points. These states are mapped toX R |ψ h ψ h |X † R upon a rotation X R , with each constituent orientation | π 2 , 2π N h being mapped to some point |v h , and its antipode to |−v h . Each |v h is supported on |0Z N (ϑ h , ϕ h ); λ for all λ and some ϑ h , ϕ h , and similarly |−v h overlaps with |1Z N (ϑ h , ϕ h ); λ for all λ. Our recovery maps eacĥ X R |ψ h ψ h |X † R back into the codespace, preserving the logical information. Coherences |ψ h ψ h =h | are not preserved, but this is not detrimental since the logical information is already inside each |ψ h .
Nonabelian subgroups Here we construct the partial Fourier-transformed basis for H ⊂ K, where for simplicity we assume H to be the maximal subgroup of K. By identifying points connected by actions of rotations in K, S 2 can be partitioned into orbits Kw = {|kw } k∈K with w ∈ S 2 /K. Since S 2 is not a group, the number of points in an orbit Kw depends on the starting point w ∈ S 2 . Generically, each rotation R ∈ K maps w to a distinct point Rw, but there exist special points (e.g., the aforementioned cone points), invariant under some (or even all) R, for which the size of the orbit is < |K|. We have to consider such complications when designing the partial Fouriertransformed basis on S 2 .
We now further partition each Kw into one or more parts, corresponding to cosets of H in K. To do so, we apply the orbit-stabilizer theorem for each orbit. Consider the subset Hw for each orbit Kw, whose maximal invariant group is either H or K (as there are no subgroups inbetween). If this group is H, then by the theorem there is a one-to-one-correspondence between elements of the orbit of Hw under K and cosets a ∈ K/H. If the group is K, then Hw = Kw.
Applying the H Fourier transform on each subset aHw = {|aRw } R∈H yields (cf. [116]) indexed by orbits w ∈ S 2 /K, cosets a ∈ K/H, and irrep elements λ(w) µν ∈ H. The irrep elements depend on w, since the size |Hw| of each orbit, and therefore the number of states in the subspace {|Rw } R∈H , depends on w. Likewise, the coset index a is used only when |Kw| = |Hw|; otherwise, Hw is invariant under K, and no a index is needed.
A simple example is H = T and K = T × Z P 2 . A generic orbit aTw is a tetrahedrally symmetric set of 12 points, and Kw is an octahedrally symmetric set of 24 points. At a special point w cube , Tw cube form the vertices of a tetrahedron, and Kw cube is a cube [Fig. 5]. We pick the corresponding two states {|aTw cube ; 1 00 } a∈Z P 2 to be the codewords (where 1 is the trivial irrep of T).
Symmetric harmonics A simple way to obtain Ksymmetric harmonics from the spherical harmonics is to average or twirl them over K,  1)] to express the twirl in terms of Wigner D-matrices. 2 The above is nonzero only for those admitting K-symmetric harmonics. factor is parameterized by angles replacing the discrete band index n in the standard Bloch functions, while the second factor is simply k-space. This basis has seen applications in signal processing [171], where it is useful for resolving signals from noise. This basis has also been studied in quantum foundations [172], and its constituent states can be grouped to form a codespace and error spaces for GKP codes [1] (a motivation for this work).
Another interesting example is {SO 3 , U 1 }. Its corre-sponding decomposition has been useful for expressing vector fields on the sphere [173,Sec. 12.3]. Symmetry-adapted bases Such bases are used to block-diagonalize H-symmetric Hamiltonians acting on a space X into blocks corresponding to irreps λ ∈ H. For the {U 1 , Z 3 } example, a Z 3 -symmetric Hamiltonian written in the basis (20) will not have any matrix elements connecting different values of λ. This diagonalization procedure is ubiquitous in physics and chemistry [168, (see also [116]).
Coherent states The states {|aZ 3 ; λ } a∈U1/Z3 for fixed λ can then be obtained by applying position shifts on the fiducial state |0Z 3 ; λ , making them similar to Perelomov coherent states [90, Sec. 2.1] (with the caveat that the representation of the group of shifts is reducible).
A key difference between such states for {R, Z} and the conventional oscillator coherent states is the choice of fiducial state: a GKP state for the former and the vacuum Fock state for the latter.
Fiber bundles If we instead take a look at {|aZ 3 ; λ } λ∈Z3 , we have a 3D space for each a ∈ U 1 /Z 3 . For this and any {G, H} case where G is a Lie group, the states form a fiber bundle with base space G/H, fiber H, and cross-section {a} [90].