Quantum error-correcting codes with a covariant encoding

Aurélie Denys¹,², * and Anthony Leverrier¹, †

¹Inria Paris, France

²Quandela

(Dated: July 25, 2024)

Given some group $G$ of logical gates, for instance the Clifford group, what are the quantum encodings for which these logical gates can be implemented by simple physical operations, described by some physical representation of $G$? We study this question by constructing a general form of such encoding maps. For instance, we recover that the $[5, 1, 3]$ and Steane codes admit transversal implementations of the binary tetrahedral and binary octahedral groups, respectively. For bosonic encodings, we show how to obtain the GKP and cat qudit encodings by considering the appropriate groups, and essentially the simplest physical implementations. We further illustrate this approach by introducing a 2-mode bosonic code defined from a constellation of 48 coherent states, for which all single-qubit Clifford gates correspond to passive Gaussian unitaries.

A main challenge in designing fault-tolerant approaches to quantum computing is the need to address two seemingly conflicting requirements: protecting quantum information against various sources of noise, and manipulating the same quantum information in order to perform a computation. The standard approach is to first look for quantum error-correcting codes offering a good protection against relevant noise sources, and then try to understand how to implement logical gates fault-tolerantly, meaning that they shouldn't map innocuous, correctable errors to uncorrectable ones. Here, we explore the other direction: starting with some logical gate set of interest, we design all the encodings compatible with a given physical implementation of these gates, and only later pick the ones with good error protection capabilities.

Consider a logical Hilbert space $\mathcal{H}_L$ (typically, a logical qubit) and a physical Hilbert space $\mathcal{H}_P$ (for instance, an $n$-qubit space, or a multimode Fock space for bosonic encodings), as well as two unitary representations $\lambda$ and $\pi$ of some group $G$ on these two Hilbert spaces. For each $g \in G$, the operators $\lambda(g)$ and $\pi(g)$ will correspond to unitary operations on the logical and the physical spaces, respectively. What are the isometric encodings $\mathcal{E}: \mathcal{H}_L \to \mathcal{H}_P$ covariant with respect to $G$, i.e. such that

$$ \pi(g) \mathcal{E}(|\psi\rangle) = \mathcal{E}(\lambda(g) |\psi\rangle), \quad (1) $$

for all $g \in G$ and $|\psi\rangle \in \mathcal{H}_L$? This property means that the physical operation $\pi(g)$ implements the logical operation $\lambda(g)$. Ensuring the covariance property is easy: averaging any linear map $V: \mathcal{H}_L \to \mathcal{H}_P$ over the group action gives rise to a $G$-covariant map $V_G$:

$$ V_G := \frac{1}{|G|} \sum_{g \in G} \pi(g) V \lambda(g)^{\dagger}. \quad (2) $$

How to choose $V$ to get an isometry, and therefore a valid quantum encoding? Our main technical result (Lemma 1 below) provides a sufficient condition.

We illustrate our approach by first recovering several well-known quantum codes as instances of this construction, and then by introducing a multimode bosonic code with a simple implementation of the single-qubit Clifford group. For multiqudit codes, transversal physical gates are a natural choice of fault-tolerant implementation: $\pi(g) = \lambda(g)^{\otimes n}$. The 5-qubit code and the Steane code are examples of small codes with a transversal implementation of the binary tetrahedral group $2T$ and binary octahedral group $2O$ (i.e. the single-qubit Clifford group). Moving on to bosonic codes [1, 2], we explain how the GKP code [3] and cat codes [4, 5] fit into the formalism. These two constructions are respectively obtained for a physical representation $\pi$ generated by linear or quadratic Hamiltonians, that is, displacements or phase-shifts. We also design a multimode bosonic code for which the single-qubit Clifford group is implemented with passive Gaussian unitaries (phase-shifts and beam splitters). We further show how to obtain a universal gate set by adding quartic Hamiltonians. The advantage of this code compared to the GKP code is that its encoded states are superpositions of a finite number of coherent states, removing any normalization issue.

We note that this construction is not limited to multiqudit or bosonic encodings. In fact, Gross applied a similar approach to design codes with covariant gates on spin systems [6].

**A sufficient condition for isometric encodings.**— For finite groups $G$, the following lemma provides a simple condition for the map $V_G$ to be isometric.

**Lemma 1.** Let $V$ be a linear map between a logical Hilbert space $\mathcal{H}_L \cong \mathbb{C}^d$ and a physical Hilbert space $\mathcal{H}_P$. Let $G$ be a finite group with two unitary representations $\lambda, \pi$ on $\mathcal{H}_L$ and $\mathcal{H}_P$, respectively. Assume in addition that $\lambda$ is irreducible. If $v := \text{tr}(V^\dagger V_G)/d \neq 0$, then $v^{-1/2} V_G$ is a $G$-covariant isometry.

The proof is deferred to Appendix B and is a simple

<footnote>* aurelie.denys@quandela.com</footnote>

<footnote>† anthony.leverrier@inria.fr</footnote>
<figure><img src="image_1.png" /><figcaption>Figure 1. Encoding circuit of Lemma 1, when $V = |\Phi\rangle\langle\Omega|$. The unitary operator $U$ block-diagonalizes the physical representation $\pi$ and $\Pi$ projects onto the irreducible representation of $\lambda$ in $\mathcal{H}_P$. After the gate $U^\dagger$, the state lives in $\mathcal{H}_L \otimes \mathcal{H}_{L'} \otimes \mathcal{M}$, with $\mathcal{M}$ the multiplicity space of $\lambda$. Registers $\mathcal{H}_L$ and $\mathcal{H}_{L'}$ are swapped. The first register is projected onto the state $|\Omega\rangle$, while the remaining registers are embedded back to the physical space thanks to $U$. The role of the circuit depicted in gray is to prepare a state $|\psi\rangle \in \mathcal{M}$. Ignoring that part, one recovers (3).</figcaption></figure>

consequence of the Schur orthogonality relations. The lemma extends to compact topological groups such as $SU(d)$ thanks to the Peter-Weyl theorem. In this case, the sum in (2) should be replaced by a Haar integral over $G$. The assumption that $\lambda$ is irreducible is sufficient but not necessary to obtain an isometric encoding. A weaker condition applicable to the bosonic cat encoding and to rotation-symmetric codes will be discussed in Appendix E.

An easy application of the lemma concerns rank-1 operators $V$ of the form $|\Phi\rangle\langle\Omega|$, where $|\Omega\rangle \in \mathcal{H}_L$ and $|\Phi\rangle \in \mathcal{H}_P$. In particular, (2) immediately implies that the codewords are superpositions of states of the form $\pi(g)|\Phi\rangle$. In the case of bosonic codes for instance, choosing $|\Phi\rangle$ to be a coherent state and $\pi(g)$ to be a Gaussian unitary ensures that the codewords are superpositions of coherent states.

**Encoding circuit for $V = |\Phi\rangle\langle\Omega|$.**— Under the assumptions of Lemma 1, it is possible to write down an explicit circuit for the encoding map. Let $U$ be a unitary operator such that the physical representation decomposes as $\pi(g) = U(\lambda(g) \otimes 1_M \oplus \pi'(g))U^\dagger$ where $M$ is the multiplicity space associated to $\lambda$, and $\lambda$ is not contained in the remaining representation $\pi'$. The encoding map can be understood as follows: the state $|\Phi\rangle$ is first projected onto the isotopic component of $\lambda$, then $U^\dagger$ maps it to a bipartite state $U^\dagger\Pi|\Phi\rangle \in \mathcal{H}_{L'} \otimes \mathcal{M}$, where $\mathcal{H}_{L'} \cong \mathcal{H}_L$. The registers $\mathcal{H}_L$ and $\mathcal{H}_{L'}$ are swapped. The first system is projected onto $|\Omega\rangle$ while the remaining logical state is embedded back into $\mathcal{H}_P$ through the application of $U$. One can see that the final encoding only depends on the choice of the specific state $|\phi\rangle \propto \langle\Omega|U^\dagger|\Phi\rangle \in \mathcal{M}$, and that the encoding map takes the simplified form

$$ \mathcal{E}(|\psi\rangle) = U|\psi\rangle|\phi\rangle. \quad (3) $$

This is displayed on Fig. 1 and detailed in Appendix C.

From the previous discussion, we see that one can specify $G$-covariant encodings, either through a couple $(|\Omega\rangle, |\Phi\rangle) \in \mathcal{H}_L \times \mathcal{H}_P$, or through a single state $|\phi\rangle \in \mathcal{M}$. We will see that this choice influences the correction

capabilities of the code, either its distance for a multiqubit code, or its performance against a given noise channel for more general codes. Both encoding forms can be useful: in some cases, there is a natural family of physical states $|\Phi\rangle$ to consider and one can readily optimize over these states, for instance coherent states for bosonic codes. In other cases, it is more efficient to directly exhaustively search over the multiplicity space $\mathcal{M}$.

We now show how to recover well-known codes with this construction, starting with multiqubit codes and then moving on to bosonic encodings.

**Small codes with large transversal gate sets.**— Transversal gates are an attractive choice of physical gates since they can be applied in depth one, making their implementation naturally fault-tolerant. Exactly transversal gates satisfy $\pi(g) = \lambda(g)^{\otimes n}$. The Eastin-Knill theorem puts severe restrictions on the set of transversal gates for a nontrivial quantum code [7, 8], suggesting some trade-off between the size of the group $G$ and the error protection offered by the encoding. The recent works by Kubischta and Teixeira [9–11] study this interplay by exhibiting nontrivial codes with exotic sets of transversal gates. Here, we simply focus on the simplest cases corresponding to the binary tetrahedral group $2T$ and the binary octahedral group $2O$, which are finite subgroups of respective order $|2T| = 24$ and $|2O| = 48$ of $SU(2)$, given by

$$ 2T = \langle Z, H \rangle, \quad 2O = \langle H, S \rangle \quad (4) $$

with the specific choice of matrices

$$ Z = \begin{bmatrix} i & 0 \\ 0 & -i \end{bmatrix}, \quad S = \begin{bmatrix} \eta & 0 \\ 0 & \eta^{-1} \end{bmatrix}, \quad H = \frac{1}{\sqrt{2}} \begin{bmatrix} \eta & \eta \\ -\eta^{-1} & \eta^{-1} \end{bmatrix} \quad (5) $$

with $\eta = e^{i\pi/4}$. This choice is similar to [9] and guarantees that $Z, S, H \in SU(2)$.

Applying the construction of Lemma 1 to these groups yield $n$-qubit encodings with transversal gates, and the question is whether one can find an ancilla $|\phi\rangle \in \mathcal{M}$ such that the resulting code given by (3) admits a nontrivial distance. Eastin-Knill states that any state $|\phi\rangle$ in the multiplicity space of the irreducible representation of $SU(2)$ gives a trivial code. Therefore, one needs to pick a value of $n$ such that the dimension of the multiplicity space associated with $2T$ or $2O$ is strictly larger than that of $SU(2)$. This occurs for $n = 5$ for the group $2T$ (the multiplicity spaces associated with $SU(2)$ and $2T$ have dimension 5 and 6, respectively) and $n = 7$ for the group $2O$ (the dimensions of the multiplicity spaces are 14 and 15). In both cases, the suitable choice of $|\phi\rangle$ in the multiplicity space yields the $[[5, 1, 3]]$ code and a code equivalent to the Steane $[[7, 1, 3]]$ code, which admit exactly transversal implementations of $2T$ and $2O$ respectively<fnref n="1" />.

<footnote n="1">¹ The standard definition of the Steane code does not admit a</footnote>
Interestingly these codes achieve the minimum possible number of physical qubits allowed for nontrivial codes with these sets of transversal gates. These observations were already made in [9].

While our construction can recover these codes, it is not clear at the moment how to efficiently find the best possible choice of $|\phi\rangle$ in the multiplicity space that yields codes with a large distance. An approach in this direction is laid out in [11], but only seems applicable to very small distances. What we will see next is that for bosonic codes, there is often a natural choice of state $|\Phi\rangle$ leading to interesting encodings.

**The GKP code.**— The GKP code is one of the most studied bosonic codes, with excellent performance against random displacements in phase space, as well as pure loss [3, 12, 13]. It slightly deviates from the construction of Lemma 1 because the relevant group, the discrete Heisenberg group, is infinite, thus leading to unnormalizable states. Ignoring this issue here, let us see how to recover the GKP encoding. The discrete Heisenberg group is $G = H_3(\mathbb{Z}) = \langle x, y \rangle$ with $x = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}$, $y = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix}$. We consider two representations of the Heisenberg group. The d-dimensional logical representation is given by

$$ \lambda(x) = X, \quad \lambda(y) = Z, \qquad (7) $$

where X and Z are the generalized d-dimensional Pauli matrices. The physical representation $\pi$ is infinite-dimensional and acts as displacements on a single bosonic mode with creation and annihilation operators $\hat{a}^\dagger$ and $\hat{a}$:

$$ \pi(x) = \hat{D}(\alpha), \quad \pi(y) = \hat{D}(\beta), \qquad (8) $$

where $\alpha, \beta \in \mathbb{C}$ are chosen to satisfy $e^{\beta\alpha^*-\beta^*\alpha} = \omega$ and the displacement operators are defined by $\hat{D}(\alpha) = e^{\alpha\hat{a}^\dagger-\alpha^*\hat{a}}$. Once the group G and these reasonably natural representations are fixed, the only remaining freedom is the choice of the physical and logical states $|\Phi\rangle$ and $|\Omega\rangle$. Taking the simplest possibility, namely the vacuum state for $|\Phi\rangle$ and $|\Omega\rangle \propto |0\rangle$ yields the standard GKP encoding:

$$ \mathcal{E}(|k\rangle) \propto \sum_{a,b \in \mathbb{Z}} \omega^{abd/2-bk/2} |(da + k)\alpha + b\beta\rangle. \qquad (9) $$

In particular, $\alpha = \sqrt{\pi}/2$, $\beta = i\sqrt{\pi}/2$ with $d=2$ give the GKP qubit with a square lattice. Further details are provided in Appendix D.

$$ \mathcal{E}(|0\rangle) := -i|1\rangle_{\text{Steane}}, \quad \mathcal{E}(|1\rangle) := |0\rangle_{\text{Steane}}. \qquad (6) $$

**The cat qudit code.**— Cat encodings are increasingly popular bosonic codes that may offer a dramatic hardware reduction for quantum fault tolerance [14–16]. They are obtained from constellations of coherent states of the form $\{|\omega^p\alpha\rangle\}_{p=0\dots n-1}$ for some $\alpha > 0$, and $\omega = e^{2\pi i/n}$, the n-root of unity. We choose $n = md$ to encode a d-dimensional qudit with n coherent states. These codes have the property that physical operations are obtained by phase-shifts of the form $\omega^{p\hat{n}}$. They illustrate our framework with the cyclic group $G = C_n := \{\omega^p : 0 \le p \le n-1\}$ and its representations

$$ \lambda(\omega^p) = Z^p \quad \text{and} \quad \pi(\omega^p) = \omega^{p\hat{n}}. \qquad (10) $$

Lemma 1 doesn't directly apply here since the logical representation $\lambda$ is not irreducible: it decomposes as a sum of d irreducible representations, all with trivial multiplicity: for all $g \in G$, $\lambda(g) = \bigoplus_{k=0}^{d-1} \rho_k(g)$, where $\rho_k(\omega^p) = \omega^{kp}$. In particular, it is not the case that all choices of the state $|\Omega\rangle \in \mathbb{C}^d$ give rise to an isometric encoding. Rather, one must choose the corresponding state with some care. We prove in Corollary 4 in Appendix E that one can still obtain an isometric encoding for any choice of state $|\Phi\rangle$ when all the multiplicity spaces of $\lambda$ are trivial. One then recovers the cat qudit encoding by setting $|\Phi\rangle$ to be a coherent state $|\alpha\rangle$.

**Multimode bosonic codes.**— Now that we have seen how to recover many known codes, let us investigate new constructions of bosonic codes encoding a qubit: $\mathcal{H}_L = \mathbb{C}^2$. We will pick two subgroups of $U(2)$: the Pauli group and the single-qubit Clifford group $2O$ and their standard 2-dimensional irreducible representations. We choose $\mathcal{H}_P$ to be a two-mode Fock space with annihilation operators $\hat{a}_1, \hat{a}_2$. The natural representation $\pi$ we consider maps the unitary $U \in U(2)$ to the passive Gaussian unitary acting on the creation operators as follows [17]: $\pi(U) : (\hat{a}_1^\dagger, \hat{a}_2^\dagger) \mapsto (\hat{a}_1^\dagger, \hat{a}_2^\dagger)U$, and mapping a coherent state $|\alpha\rangle$ to $|U\alpha\rangle$. Finally, we choose an initial $|\Phi\rangle \in \mathcal{H}_P$ that is a two-mode coherent state $|\alpha\rangle|\beta\rangle$. Because $\pi(g)|\alpha\rangle|\beta\rangle$ is again a coherent state, we see that the codewords will be superpositions of $|G|$ coherent states. The resulting codes are reminiscent of quantum spherical codes [18] in the sense that the coherent states appearing in the constellations all lie on a sphere in phase-space.

**A first example: the Pauli code.**— Several versions of the Pauli group exist, e.g, $\langle X, Z \rangle$ of order 8 and $\langle i, X, Z \rangle$ of order 16. Picking $\langle X, Z \rangle$ and $|\Omega\rangle \propto |0\rangle$, the construction discussed above gives

$$ \mathcal{E}(|0\rangle) \propto |c_1(\alpha)\rangle|c_0(\beta)\rangle, \quad \mathcal{E}(|1\rangle) \propto |c_0(\beta)\rangle|c_1(\alpha)\rangle, \qquad (11) $$

where $|c_k(\alpha)\rangle := |\alpha\rangle + (-1)^k | -\alpha \rangle$ denotes an unnormalized single-mode cat state. One recovers the dual-rail encoding in the limit $\alpha, \beta \to 0$. Interestingly, the dual-rail code is also an example of the construction for the compact group $G = SU(2)$: while all single-qubit gates can be implemented with passive Gaussian unitaries, it is

<footnote>strongly transversal implementation of the Clifford group, but this can be fixed by a simple change of basis:</footnote>
<figure><img src="image_2.png" /><figcaption>Figure 2. Entanglement infidelity for the pure-loss channel with loss rate $\gamma = 10^{-2}$ for 3 variants of the Pauli code, depending on the group $\langle X, Z \rangle$ or $\langle i, X, Z \rangle$ and initial state. The value at $\alpha = 0$ corresponds to the dual-rail encoding.</figcaption></figure>

a rather bad code since it can only detect a single photon loss, but cannot correct it.

By construction, logical Pauli operators can be implemented with Gaussian unitaries on the codewords of (11): swapping the modes gives a logical X-gate and the phase-gate $(-1)^{\tilde{n}_2}$ on the second mode implements a logical Z-gate. We show in F1 how to obtain a logical S gate $[1_0^0]$ and a CZ gate by applying quartic Hamiltonians, corresponding respectively to unitaries $i^{\tilde{n}_2^2}$ and $(-1)^{\tilde{n}_2 \otimes \tilde{n}_4}$, similarly to the case of rotation-symmetric bosonic codes [19].

For this simple code, it is straightforward to simulate the performance for a pure-loss channel, as was done in [12] and [20]: we plot on Fig. 2 the entanglement infidelity for the pure-loss channel, after the optimal recovery operation. This figure of merit has the advantage of being efficiently computable when the constellation size is not too large. It provides some insight about the protection offered by the encoding. If the group is $\langle X, Z \rangle$, then the initial state $|\alpha\rangle|\alpha\rangle$ for $\alpha > 0$ admits a constellation of minimal size, but the choice $|\alpha\rangle|i\alpha\rangle$ provides a much better tolerance to loss, also compared to the dual-rail encoding. This is consistent with an analysis of the Knill-Laflamme conditions for the Kraus operators of the pure-loss channel, as discussed in App. G. The variant $\langle i, X, Z \rangle$ of the Pauli group leads to a larger constellation, but doesn't improve the protection against loss, even for an optimized choice of initial coherent states satisfying $\beta = e^{i\pi/4}\alpha$.

**The Clifford code.**— We now apply the construction to the single-qubit Clifford group $2O$. Again, all the gates from this group are implemented with beamsplitters and phase-shifts. Lemma 6 proven in App. F2 shows how to obtain the CZ and T gates with quartic Hamiltonians, providing a universal gate set. Choosing as before the initial state $|\Phi\rangle = |\alpha\rangle|\beta\rangle$ and $|\Omega\rangle \propto |0\rangle$ gives

logical states $\mathcal{E}(|0\rangle)$ and $\mathcal{E}(|1\rangle)$ which are superpositions of 40 coherent states (see App. H for details).

**State preparation and measurements.**— The codes obtained through Lemma 1 are not stabilizer codes in general, which suggests that state preparation may be complex. For the Pauli code of (11), however, the two logical basis states are product states with a cat state in each mode. Such states are routinely prepared and manipulated in the lab today, and we expect state preparation to be feasible in the near term. On the other hand, the preparation of a logical state of the Clifford code seems significantly more delicate.

Measuring the states in the (logical) computational basis can be done naively simply by counting the photons in each of the modes. This is because $\mathcal{E}(|0\rangle)$ is a superposition of Fock states of the form $|\text{odd}\rangle|\text{even}\rangle$ while the states in $\mathcal{E}(|1\rangle)$ are of the form $|\text{even}\rangle|\text{odd}\rangle$ for the Pauli code, and $\mathcal{E}(|k\rangle)$ is a superposition of Fock states of the form $|8m + p + 1\rangle|8n + p + 2k\rangle$ for the Clifford code. There again, techniques developed for cat codes may prove useful.

**Discussion and open questions.**— We have introduced a general methodology for designing quantum error-correcting codes that admit a specific logical group implementable with simple physical gates, either transversal gates for qubit codes or Gaussian unitaries for bosonic codes. In the latter case, one can design a code with a universal gate set consisting of such Gaussian unitaries together with some gates corresponding to quartic Hamiltonians. While these gates are certainly more challenging to implement, they do not seem out of reach for circuit QED [21]. On the other hand, such gates are much more difficult for photonic implementations, and it would be interesting to understand whether other gadgets can be used to obtain a universal gate set in that case. A question that we have not addressed at all is how to perform error correction. More generally, the stabilization of such states appears quite daunting since they involve rather large constellations of coherent states, but this might not necessarily be more complicated than stabilizing a GKP state [22].

Beyond bosonic codes, it will be interesting to apply this formalism to other physical systems, for instance rotors [23] or molecules [24]. Concerning multiqubit codes, we have shown that it is easy to recover known codes, basically by picking the right state $|\phi\rangle$ in the multiplicity space. What is unclear is whether there is a simple way to find such a state, when it is not known in advance.

## ACKNOWLEDGMENTS

We thank Mazyar Mirrahimi and Christophe Vuillot for many discussions about bosonic codes. We also thank Victor Albert and Jonathan Gross for discussions on representation theory, Simon Burton for discussions on the
relation between the Clifford group and the binary octa-
hedral group, Markus Heinrich, Richard Küng and Do-
minik Wild for answering a question about unitary t-
designs, and Eric Kubischta and Ian Teixeira for discus-

sions about transversal gates for multiqubit codes. We
acknowledge support from the Plan France 2030 through
the project NISQ2LSQ ANR-22-PETQ-0006.

[1] B. M. Terhal, J. Conrad, and C. Vuillot, “Towards scalable bosonic quantum error correction,” *Quantum Science and Technology* 5, 043001 (2020).

[2] Victor V Albert, “Bosonic coding: introduction and use cases,” arXiv preprint arXiv:2211.05714 (2022).

[3] Daniel Gottesman, Alexei Kitaev, and John Preskill, “Encoding a qubit in an oscillator,” Phys. Rev. A 64, 012310 (2001).

[4] P. T. Cochrane, G. J. Milburn, and W. J. Munro, “Macroscopically distinct quantum-superposition states as a bosonic code for amplitude damping,” Phys. Rev. A 59, 2631–2634 (1999).

[5] Mazyar Mirrahimi, Zaki Leghtas, Victor V Albert, Steven Touzard, Robert J Schoelkopf, Liang Jiang, and Michel H Devoret, “Dynamically protected cat-qubits: a new paradigm for universal quantum computation,” *New Journal of Physics* 16, 045014 (2014).

[6] Jonathan A. Gross, “Designing codes around interactions: The case of a spin,” Phys. Rev. Lett. 127, 010504 (2021).

[7] Bryan Eastin and Emanuel Knill, “Restrictions on transversal encoded quantum gate sets,” Phys. Rev. Lett. 102, 110502 (2009).

[8] Philippe Faist, Sepehr Nezami, Victor V. Albert, Grant Salton, Fernando Pastawski, Patrick Hayden, and John Preskill, “Continuous symmetries and approximate quantum error correction,” Phys. Rev. X 10, 041018 (2020).

[9] Eric Kubischta and Ian Teixeira, “Family of quantum codes with exotic transversal gates,” Phys. Rev. Lett. 131, 240601 (2023).

[10] Eric Kubischta and Ian Teixeira, “The not-so-secret fourth parameter of quantum codes,” arXiv preprint arXiv:2310.17652 (2023).

[11] Eric Kubischta and Ian Teixeira, “Quantum codes from twisted unitary t-groups,” Phys. Rev. Lett. 133, 030602 (2024).

[12] Victor V. Albert, Kyungjoo Noh, Kasper Duivenvoorden, Dylan J. Young, R. T. Brierley, Philip Reinhold, Christophe Vuillot, Linshu Li, Chao Shen, S. M. Girvin, Barbara M. Terhal, and Liang Jiang, “Performance and structure of single-mode bosonic codes,” Phys. Rev. A 97, 032346 (2018).

[13] Arne L. Grimsmo and Shruti Puri, “Quantum Error Correction with the Gottesman-Kitaev-Preskill Code,” PRX Quantum 2, 020101 (2021).

[14] Jérémie Guillaud and Mazyar Mirrahimi, “Repetition cat qubits for fault-tolerant quantum computation,” Phys. Rev. X 9, 041053 (2019).

[15] Shruti Puri, Lucas St-Jean, Jonathan A. Gross, Alexander Grimm, Nicholas E. Frattini, Pavithran S. Iyer, Anirudh Krishna, Steven Touzard, Liang Jiang, Alexandre Blais, Steven T. Flammia, and S. M. Girvin, “Bias-preserving gates with stabilized cat qubits,” Science Advances 6, eaay5901 (2020).

[16] Diego Ruiz, Jérémie Guillaud, Anthony Leverrier, Maz-

yar Mirrahimi, and Christophe Vuillot, “LDPC-cat codes for low-overhead quantum computing in 2D,” arXiv preprint arXiv:2401.09541 (2024).

[17] Christian Weedbrook, Stefano Pirandola, Raúl García-Patrón, Nicolas J. Cerf, Timothy C. Ralph, Jeffrey H. Shapiro, and Seth Lloyd, “Gaussian quantum information,” Rev. Mod. Phys. 84, 621–669 (2012).

[18] Shubham P Jain, Joseph T Iosue, Alexander Barg, and Victor V Albert, “Quantum spherical codes,” Nature Physics , 1–6 (2024).

[19] Arne L. Grimsmo, Joshua Combes, and Ben Q. Baragiola, “Quantum computing with rotation-symmetric bosonic codes,” Phys. Rev. X 10, 011058 (2020).

[20] Aurélie Denys and Anthony Leverrier, “The 2T-qutrit, a two-mode bosonic qutrit,” Quantum 7, 1032 (2023).

[21] Alexandre Blais, Arne L. Grimsmo, S. M. Girvin, and Andreas Wallraff, “Circuit quantum electrodynamics,” Rev. Mod. Phys. 93, 025005 (2021).

[22] Lev-Arcady Sellem, Alain Sarlette, Zaki Leghtas, Mazyar Mirrahimi, Pierre Rouchon, and Philippe Campagne-Ibarcq, “A GKP qubit protected by dissipation in a high-impedance superconducting circuit driven by a microwave frequency comb,” arXiv preprint arXiv:2304.01425 (2023).

[23] Christophe Vuillot, Alessandro Ciani, and Barbara M Terhal, “Homological quantum rotor codes: Logical qubits from torsion,” Communications in Mathematical Physics 405, 53 (2024).

[24] Victor V. Albert, Jacob P. Covey, and John Preskill, “Robust encoding of a qubit in a molecule,” Phys. Rev. X 10, 031050 (2020).

[25] Dave Bacon, Isaac L. Chuang, and Aram W. Harrow, “Efficient quantum circuits for schur and clebsch-gordan transforms,” Phys. Rev. Lett. 97, 170502 (2006).

[26] D. Bacon, J. Kempe, D. A. Lidar, and K. B. Whaley, “Universal fault-tolerant quantum computation on decoherence-free subspaces,” Phys. Rev. Lett. 85, 1758–1761 (2000).

[27] Márton Karácsony, László Oroszlány, and Zoltan Zimboras, “Efficient qudit based scheme for photonic quantum computing,” SciPost Phys. Core 7, 032 (2024).
# SUPPLEMENTARY MATERIAL

We start this supplementary material by brief preliminaries on the representation theory of finite groups in Section A. Sections B and C then provide the proof of Lemma 1 in the main text as well as the corresponding circuit description of the encoding map. Section D provides details on the GKP construction. Section E is devoted to a relaxation of the assumptions of Lemma 1. In particular, Corollary 4 illustrates the case where the logical representation $\lambda$ is not irreducible, but contains several irreducible representations with multiplicity 1. This is the setup relevant to recover the cat qudit encoding. Section F presents possible implementations of physical gates that are not included in the group $G$, for the multimode bosonic encodings introduced in the main text. Section G discusses the Knill-Laflamme conditions for a pure-loss channel applied to these multimode bosonic codes. Finally Section H provides the explicit description of the encoding of the multimode bosonic code obtained when the group $G$ is the single-qubit Clifford group.

## Appendix A: Preliminaries on the representation theory of finite groups

Consider some unitary representation $\rho$ of a finite group $G$ on some Hilbert space $\mathcal{H}$. This representation can be decomposed as a direct sum of irreducible representations: for all $g \in G$,

$$ \rho(g) = U \left( \bigoplus_i \rho_i(g)_{\mathcal{L}_i} \otimes \mathbb{1}_{\mathcal{M}_i} \right) U^\dagger, \qquad (A1) $$

where $U$ is called the intertwiner operator, the index $i$ labels the various irreducible representations $\rho_i$ acting on the space $\mathcal{L}_i$ and $\mathcal{M}_i$ are their respective multiplicity spaces. The existence of an intertwiner means that the representations $\rho$ and $\bigoplus_i \rho_i \otimes \mathbb{1}_{\mathcal{M}_i}$ are equivalent, and therefore that the Hilbert space $\mathcal{H}$ decomposes as

$$ \mathcal{H} \cong \bigoplus_i \mathcal{L}_i \otimes \mathcal{M}_i. \qquad (A2) $$

The following lemma shows that the intertwiner can be assumed unitary, when the representations are unitary.

**Lemma 2.** Let $\pi$ and $\sigma$ be two equivalent unitary representations of a group $G$. Then there exists a unitary intertwiner $U$ such that

$$ U\pi(g) = \sigma(g)U, \quad \forall g \in G. $$

*Proof.* Let $T$ be an intertwiner for the two representations:

$$ T\pi(g) = \sigma(g)T \quad \forall g \in G. $$

Since $\pi(g)$ and $\sigma(g)$ are unitary, we get

$$ T^{\dagger(-1)}\pi(g) = \sigma(g)T^{\dagger(-1)}. $$

Define $|T| = \sqrt{T^\dagger T}$. The operator $U = T|T|^{-1}$ is unitary since

$$ UU^\dagger = T|T|^{-2}T^\dagger = T(T^\dagger T)^{-1}T^\dagger = T T^{-1} T^{\dagger(-1)} T^\dagger = \mathbb{1}, $$

$$ U^\dagger U = |T|^{-1}T^\dagger T|T|^{-1} = \mathbb{1}. $$

Note that $T^\dagger T$ commutes with $\pi(g)$:

$$ T^\dagger T \pi(g) = T^\dagger \sigma(g) T = (\sigma(g^{-1}) T)^\dagger T = (T \pi(g^{-1}))^\dagger T = \pi(g) T^\dagger T. $$

This implies that all polynomials in $T^\dagger T$ also commute with $\pi(g)$, and also all continuous functions, for instance the square-root function. Hence

$$ |T|\pi(g) = \pi(g)|T|. $$

Finally

$$ U\pi(g) = T|T|^{-1}\pi(g) = T\pi(g)|T|^{-1} = \sigma(g)T|T|^{-1} = \sigma(g)U, $$

which is what we wanted. □
Next, the Schur orthogonality relations show that irreducible representations are orthogonal in the following sense: let $\rho_i$ and $\rho_j$ be two irreducible representations of the finite group $G$, of respective dimension $d_i$ and $d_j$. Then,

$$ \frac{1}{|G|} \sum_{g \in G} \rho_i(g)^{\dagger} \otimes \rho_j(g) = \begin{cases} 0 & \text{if } i \neq j, \\ \frac{1}{d_i} \sum_{p,q=0}^{d_i-1} |p\rangle\langle q| \otimes |q\rangle\langle p| & \text{if } i = j. \end{cases} \quad (A3) $$

A last concept that will be useful is the projection of some representation $\rho$ onto the isotypic component associated with some irreducible representation $\rho_i$:

$$ \Pi_i^{\rho} := \frac{\dim(\rho_i)}{|G|} \sum_{g \in G} \mathrm{tr}(\rho_i(g))^* \rho(g). \quad (A4) $$

In other words, $\Pi_i^\rho$ is the orthogonal projection onto $U(\mathcal{L}_i \otimes \mathcal{M}_i)U^\dagger$.

## Appendix B: Proof of Lemma 1

*Proof of Lemma 1.* Let $V: \mathcal{H}_L \to \mathcal{H}_P$. We directly compute $V_G^\dagger V_G$:

$$ V_G^\dagger V_G = \frac{1}{|G|^2} \sum_{g,h \in G} \lambda(g) V^\dagger \pi(g)^\dagger \pi(h) V \lambda(h)^\dagger \quad (B1) $$

$$ = \frac{1}{|G|^2} \sum_{g,h \in G} \lambda(g) V^\dagger \pi(h) V \lambda(h)^\dagger \lambda(g)^\dagger \quad (B2) $$

$$ = \frac{1}{d|G|} \sum_{h \in G} \sum_{p,q=0}^{d-1} (|p\rangle\langle q|)_{\mathcal{H}_L} V^\dagger \pi(h) V \lambda(h)^\dagger (|q\rangle\langle p|)_{\mathcal{H}_L} \quad (B3) $$

$$ = \frac{1}{d|G|} \sum_{h \in G} \mathrm{tr}(V^\dagger \pi(h) V \lambda(h)^\dagger) 1_{\mathcal{H}_L} \quad (B4) $$

$$ = \frac{\mathrm{tr}(V^\dagger V_G)}{d} 1_{\mathcal{H}_L} \quad (B5) $$

where (B2) is a simple change of variable, (B3) is an application of the Schur orthogonality relations for the irreducible representation $\lambda$. In particular, $v = \mathrm{tr}(V^\dagger V_G)/d = \mathrm{tr}(V_G^\dagger V_G)/d \ge 0$. Whenever $v \ne 0$, the map $v^{-1/2}V_G$ is an isometry. $\square$

## Appendix C: Encoding circuit

With the assumptions of Lemma 1 and a rank-one map $V = |\Phi\rangle\langle\Omega|$, it is possible to obtain an explicit circuit for the encoding map. Note that $|\Omega\rangle$ won't be normalized in general.

**Lemma 3.** With the assumptions of Lemma 1, and a rank-one operator $V$ such that $\mathrm{tr}(V^\dagger V_G) = d$, the encoding map $\mathcal{E}: \mathcal{H}_L \to \mathcal{H}_P$ takes the simple form:

$$ \mathcal{E}(|\psi\rangle) = U|\psi\rangle|\phi\rangle \quad (C1) $$

where $U$ is a unitary matrix that decomposes $\pi$ as a sum of irreducible representations, and $|\phi\rangle$ is an arbitrary state in the multiplicity space of the irreducible representation $\lambda$.

*Proof.* Let us write $\lambda = \rho_0$ and decompose the physical representation $\pi$ as a sum of irreducible representations $\rho_k$, with their associated multiplicity space $\mathcal{M}_k$:

$$ \pi(g) = U \left[ \bigoplus_k \rho_k(g) \otimes 1_{\mathcal{M}_k} \right] U^\dagger, \quad (C2) $$

where the intertwiner operator $U$ is assumed to be unitary by Lemma 2.
The operator $V$ can be written as $V = |\Phi\rangle\langle\Omega|$, with $|\Phi\rangle \in \mathcal{H}_L$ and $|\Omega\rangle \in \mathcal{H}_L$. The encoding map is

$$V_G = \frac{1}{|G|} \sum_{g \in G} \pi(g) |\Phi\rangle\langle\Omega|\lambda(g)^\dagger \qquad (C3)$$

$$= \frac{1}{|G|} \sum_{g \in G} U \left( \bigoplus_k \rho_k(g) \otimes \mathbb{1}_{M_k} \right) U^\dagger |\Phi\rangle\langle\Omega| \rho_0(g)^\dagger \qquad (C4)$$

$$= \frac{1}{d} \sum_{p,q=0}^{d-1} U (|p\rangle\langle q| \otimes \mathbb{1}_{M_0}) U^\dagger |\Phi\rangle\langle\Omega|q\rangle\langle p| \qquad (\text{Schur orthogonality}) \qquad (C5)$$

$$= \frac{1}{d} \sum_{p,q=0}^{d-1} U (|p\rangle\langle\Omega|q\rangle\langle q| \otimes \mathbb{1}_{M_0}) U^\dagger |\Phi\rangle\langle p| \qquad (C6)$$

$$= \frac{1}{d} \sum_{p=0}^{d-1} U (|p\rangle\langle\Omega| \otimes \mathbb{1}_{M_0}) U^\dagger |\Phi\rangle\langle p| \qquad (C7)$$

and applied to a state $|\psi\rangle \in \mathcal{H}_L$, it gives

$$\mathcal{E}(|\psi\rangle) = \frac{1}{d} \sum_{p=0}^{d-1} U (|p\rangle\langle\Omega| \otimes \mathbb{1}_{M_0}) U^\dagger |\Phi\rangle\langle p|\psi\rangle \qquad (C8)$$

$$= \frac{1}{d} U (|\psi\rangle\langle\Omega| \otimes \mathbb{1}_{M_0}) U^\dagger |\Phi\rangle \qquad (C9)$$

$$= U|\psi\rangle|\phi\rangle \qquad (C10)$$

where we defined

$$|\phi\rangle = \frac{1}{d} \langle\Omega|U^\dagger|\Phi\rangle. \qquad (C11)$$

Note that this state is normalized since $V_G$ is an isometry. $\square$

## Appendix D: The GKP code

The GKP construction is another interesting example that deviates from the setup of Lemma 1 because the relevant group is infinite. Let $G = H_3(\mathbb{Z}) = \langle x, y \rangle$ be the discrete Heisenberg group with

$$x = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}, \quad y = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{bmatrix}. \qquad (D1)$$

The two generators satisfy the relations:

$$z = xyx^{-1}y^{-1}, \quad xz = zx, \quad yz = zy, \qquad (D2)$$

and a general group element is of the form $y^b z^c x^a = \begin{bmatrix} 1 & a & c \\ 0 & 1 & b \\ 0 & 0 & 1 \end{bmatrix}$, for arbitrary $a, b, c \in \mathbb{Z}$.

We consider two representations of the Heisenberg group. The $d$-dimensional logical representation is given by

$$\lambda(x) = X, \quad \lambda(y) = Z, \qquad (D3)$$

where $X$ and $Z$ are the $d$-dimensional Pauli matrices which satisfy

$$X^d = Z^d = \mathbb{1}_d, \quad XZX^{-1}Z^{-1} = \omega^{-1}\mathbb{1}_d, \qquad (D4)$$

with $\omega = e^{2\pi i/d}$. The physical representation $\pi$ is infinite-dimensional and acts as displacements on a single bosonic mode with creation and annihilation operators $\hat{a}^\dagger$ and $\hat{a}$:

$$\pi(x) = \hat{D}(\alpha), \quad \pi(y) = \hat{D}(\beta), \qquad (D5)$$
where $\alpha, \beta \in \mathbb{C}$ satisfy $e^{\beta\alpha^* - \beta^*\alpha} = \omega$ and the displacement operators are defined by

$$ \hat{D}(\alpha) = e^{\alpha \hat{a}^{\dagger} - \alpha^{*} \hat{a}}. \qquad (D6) $$

This choice ensures that $\pi(x)\pi(y)\pi(x^{-1})\pi(y^{-1}) = \omega^{-1}1$.

The images of a general group element $y^b z^c x^a$ for these two representations are given by

$$ \lambda(y^b z^c x^a) = \omega^{-c} Z^b X^a \qquad (D7) $$

$$ \pi(y^b z^c x^a) = \omega^{-c} \hat{D}(b\beta) \hat{D}(a\alpha) = \omega^{-c+ab/2} \hat{D}(a\alpha + b\beta), \qquad (D8) $$

where we used that $\hat{D}(\gamma)\hat{D}(\delta) = e^{(\gamma\delta^* - \gamma^*\delta)/2}\hat{D}(\gamma + \delta)$, for any complex numbers $\gamma, \delta$. Note that for these representations, it suffices to take $c \in \mathbb{Z}/d\mathbb{Z}$. The natural choice of physical state here is the vacuum state: $|\Phi\rangle = |0\rangle$:

$$ \mathcal{E}(|k\rangle) \propto \sum_{g \in H_3(\mathbb{Z})} \pi(g) |0\rangle \langle \Omega | \lambda(g)^{\dagger} | k\rangle \qquad (D9) $$

$$ \propto \sum_{a,b \in \mathbb{Z}} \sum_{c \in \mathbb{Z}/d\mathbb{Z}} \omega^{-c+ab/2} \hat{D}(a\alpha + b\beta) |0\rangle \langle \Omega | \omega^c X^{-a} Z^{-b} |k\rangle \qquad (D10) $$

$$ \propto d \sum_{a,b \in \mathbb{Z}} \omega^{ab/2} \hat{D}(a\alpha + b\beta) |0\rangle \langle \Omega | X^{-a} Z^{-b} |k\rangle \qquad (D11) $$

$$ \propto d \sum_{a,b \in \mathbb{Z}} \omega^{ab/2-bk} \hat{D}(a\alpha + b\beta) |0\rangle \langle \Omega | X^{-a} |k\rangle \qquad (D12) $$

$$ \propto d \sum_{a,b \in \mathbb{Z}} \omega^{ab/2-bk} |a\alpha + b\beta\rangle \langle \Omega | k - a \mod d \rangle \qquad (D13) $$

Choosing $|\Omega\rangle \propto |0\rangle \in \mathbb{C}^d$ gives

$$ \mathcal{E}(|k\rangle) \propto d \sum_{a,b \in \mathbb{Z}} \omega^{ab/2-bk/2} |(da + k)\alpha + b\beta\rangle. \qquad (D14) $$

In particular, the choice $d=2$, $\alpha = \sqrt{\pi}/2$, $\beta = i\sqrt{\pi}/2$ yields the standard GKP qubit with a square lattice.

## Appendix E: Relaxing the assumption that $\lambda$ is irreducible in Lemma 1

Lemma 1 only applies when the logical representation $\lambda$ is irreducible. This is not the most general case, and indeed, simple examples such as the bosonic cat codes do not satisfy this assumption. In fact, if the group $G$ is abelian, all its irreducible representations are 1-dimensional, which means that the logical representation can never be irreducible as soon as the logical space has dimension at least 2.

Let us therefore consider the encoding when both representations are unitary, but without the assumption that the logical representation $\lambda$ is irreducible. As before, there exist unitaries $U_L$ and $U_P$ on the spaces $\mathcal{H}_L$ and $\mathcal{H}_P$ such that, for all $g \in G$,

$$ \lambda(g) = U_L \left( \bigoplus_i \rho_i(g) \mathcal{L}_i \otimes \mathbb{1}_{\mathcal{N}_i} \right) U_L^{\dagger}, \quad \pi(g) = U_P \left( \bigoplus_i \rho_i(g) \mathcal{L}_i \otimes \mathbb{1}_{\mathcal{N}_i} \right) U_P^{\dagger}, \qquad (E1) $$

where $\{\mathcal{M}_i\}$ and $\{\mathcal{N}_i\}$ are the multiplicity spaces associated with the various irreducible representations of $G$ for $\lambda$ and $\pi$. For simplicity, we denote by $\mathcal{L}_i$ the space on which $\rho_i(g)$ acts, even though the irreducible representations of $\lambda$ and $\pi$ do not act on the same space, but merely on isomorphic spaces.

The encoding map is obtained by averaging a linear map $V: \mathcal{H}_L \to \mathcal{H}_P$ through

$$ V_G = \frac{1}{|G|} \sum_{g \in G} \pi(g) V \lambda(g)^{\dagger}. $$

To decide whether this is an isometry, we compute $V_G^\dagger V_G$:

$$ V_G^\dagger V_G = \frac{1}{|G|^2} \sum_{g,h \in G} \lambda(g) V^\dagger \pi(g^{-1}h) V \lambda(h^{-1}) \qquad (E2) $$

$$ = \frac{1}{|G|^2} \sum_{g,h \in G} \lambda(g) V^\dagger \pi(h) V \lambda(h)^\dagger \lambda(g)^\dagger \qquad (\text{change of variables}) \qquad (E3) $$
Focussing first on the sum on h, and writing both representations as sums of irreducible representations and applying Schur's orthogonality relations, we get

$$ \frac{1}{|G|} \sum_{h \in G} V^\dagger \pi(h) V \lambda(h)^\dagger = \frac{1}{|G|} \sum_{h \in G} V^\dagger U_P \left( \bigoplus_i \rho_i(h) \otimes 1_{\mathcal{N}_i} \right) U_P^\dagger V U_L \left( \bigoplus_j \rho_j(h)^\dagger \otimes 1_{\mathcal{M}_j} \right) U_L^\dagger \quad (E4) $$

$$ = \bigoplus_i \frac{1}{d_i} \sum_{p,q=0}^{d_i-1} V^\dagger U_P(|p, i\rangle\langle q, i| \otimes 1_{\mathcal{N}_i}) U_P^\dagger V U_L(|q, i\rangle\langle p, i| \otimes 1_{\mathcal{M}_i}) U_L^\dagger \quad (E5) $$

where $\{|p, i\rangle\}_{0\le p < d_i}$ is an orthonormal basis of $\mathcal{L}_i$.

Injecting this expression into (E3) and applying again Shur's orthogonality relations yields

$$ V_G^\dagger V_G = \frac{1}{|G|} \bigoplus_i \frac{1}{d_i} \sum_{p,q=0}^{d_i-1} \sum_{g \in G} \lambda(g) V^\dagger U_P(|p, i\rangle\langle q, i| \otimes 1_{\mathcal{N}_i}) U_P^\dagger V U_L(|q, i\rangle\langle p, i| \otimes 1_{\mathcal{M}_i}) U_L^\dagger \lambda(g)^\dagger \quad (E6) $$

$$ = \bigoplus_i \frac{1}{d_i} \sum_{p,q=0}^{d_i-1} \bigoplus_j \frac{1}{d_j} \sum_{r,s=0}^{d_j-1} U_L(|r, j\rangle\langle s, j| \otimes 1_{\mathcal{M}_j}) U_L^\dagger V^\dagger U_P \times (|p, i\rangle\langle q, i| \otimes 1_{\mathcal{N}_i}) U_P^\dagger V U_L(|q, i\rangle\langle p, i| \otimes 1_{\mathcal{M}_i}) U_L^\dagger U_L(|s, j\rangle\langle r, j| \otimes 1_{\mathcal{M}_j}) U_L^\dagger \quad (E7) $$

$$ = \bigoplus_i \frac{1}{d_i^2} \sum_{p,q,r=0}^{d_i-1} U_L(|r, i\rangle\langle p, i| \otimes 1_{\mathcal{M}_i}) U_L^\dagger V^\dagger U_P(|p, i\rangle\langle q, i| \otimes 1_{\mathcal{N}_i}) U_P^\dagger V U_L(|q, i\rangle\langle r, i| \otimes 1_{\mathcal{M}_i}) U_L^\dagger \quad (E8) $$

Let us define the projectors $\Pi_i^\lambda$ and $\Pi_i^\pi$ on the isotopic component of $\rho_i$ of the representations $\lambda$ and $\pi$ onto the irreducible representation $\rho_i$:

$$ \Pi_i^\lambda := \frac{\dim(\rho_i)}{|G|} \sum_{g \in G} \mathrm{tr}(\rho_i(g))^* \lambda(g), \quad \Pi_i^\pi := \frac{\dim(\rho_i)}{|G|} \sum_{g \in G} \mathrm{tr}(\rho_i(g))^* \pi(g). \quad (E9) $$

These project onto $U_L(\mathcal{L}_i \otimes \mathcal{M}_i)U_L^\dagger$ and $U_P(\mathcal{L}_i \otimes \mathcal{N}_i)U_P^\dagger$, respectively.

Then one can define the following operator $\tilde{V}_i : \mathcal{L}_i \otimes \mathcal{M}_i \to \mathcal{L}_i \otimes \mathcal{N}_i$

$$ \tilde{V}_i := U_P^\dagger \Pi_i^\pi V \Pi_i^\lambda U_L. \quad (E10) $$

Observe that $\sum_{q=0}^{d_i-1} (|q, i| \otimes 1_{\mathcal{N}_i}) U_P^\dagger V U_L(|q, i| \otimes 1_{\mathcal{M}_i})$ is nothing but the partial trace $\mathrm{tr}_{\mathcal{L}_i}(\tilde{V}_i)$. In particular, (E8) simplifies to

$$ V_G^\dagger V_G = \bigoplus_i 1_{\mathcal{L}_i} \otimes \left( \frac{1}{d_i} \mathrm{tr}_{\mathcal{L}_i}(\tilde{V}_i) \right)^\dagger \left( \frac{1}{d_i} \mathrm{tr}_{\mathcal{L}_i}(\tilde{V}_i) \right), \quad (E11) $$

which shows that $V_G$ is an isometry if and only if each of the maps $\frac{1}{d_i} \mathrm{tr}_{\mathcal{L}_i}(\tilde{V}_i)$ are isometries from $\mathcal{M}_i$ to $\mathcal{N}_i$.

**Corollary 4.** If the multiplicity spaces of the logical representation are all trivial, i.e. $\dim(\mathcal{M}_i) = 1$, then for any physical state $|\Phi\rangle \in \mathcal{H}_P$, it is possible to find a (generally unnormalized) vector $|\Omega\rangle \in \mathcal{H}_L$ such that the resulting map $V_G$ associated with $V = |\Phi\rangle\langle\Omega|$ is an isometry.

*Proof.* Taking $V = |\Phi\rangle\langle\Omega|$ gives $\tilde{V}_i = |\Phi_i\rangle\langle\Omega_i|$ for $|\Phi_i\rangle \in \mathcal{L}_i \otimes \mathcal{N}_i$ and $|\Omega_i\rangle \in \mathcal{L}_i \otimes \mathcal{M}_i \cong \mathcal{L}_i$. The partial trace $\frac{1}{d_i} \mathrm{tr}_{\mathcal{L}_i}(\tilde{V}_i)$ is then a vector of $V_i$, and one can choose the norm of $|\Omega_i\rangle$ to enforce the desired normalization of $\frac{1}{d_i} \mathrm{tr}_{\mathcal{L}_i}(\tilde{V}_i)$. $\square$

## Appendix F: Additional gates for multimode bosonic codes

We focus here on two codes obtained respectively for the Pauli group $\langle X, Z \rangle$ and the Clifford group $\langle H, S \rangle$. For the Pauli group, we explain how to obtain phase-gates as well as the entangling CZ gate. For the Clifford group, we explain how to use quartic Hamiltonians to get the CZ and T-gates.

We denote by $|\bar{k}\rangle$ the encoded state $\mathcal{E}(|k\rangle)$.
1. Pauli code $\langle X, Z \rangle$

In this subsection, we consider the standard $S$ gate given by $S = [\begin{matrix} 1 & 0 \\ 0 & i \end{matrix}]$.

**Lemma 5.** For the Pauli code associated to the group $\langle X, Z \rangle$, the single-qubit logical phase gate $\overline{S} = |\overline{0}\rangle\langle\overline{0}| + i|\overline{1}\rangle\langle\overline{1}|$ and the two-qubit logical controlled-Z gate $\overline{CZ}$ are obtained by quartic Hamiltonians:

$$i^{\hat{n}_2^2} = \overline{S}, \quad (-1)^{\hat{n}_2 \hat{n}_4} = \overline{CZ}. \qquad (F1)$$

*Proof.* By construction of the code, the logical $Z$ operator, denoted $\overline{Z}$, is obtained as $\overline{Z} = \rho(Z) = (-1)^{\hat{n}_2}$, and therefore $(-1)^{\hat{n}_2}|\overline{k}\rangle = (-1)^k|\overline{k}\rangle$ for $k \in \{0, 1\}$.

It is easy to check that for any integer $n$, it holds that

$$i^{n^2} = e^{i \frac{\pi}{4}} e^{-i \frac{\pi}{4} (-1)^n}, \qquad (F2)$$

which immediately implies that

$$i^{\hat{n}_2^2} |\overline{k}\rangle = e^{i \frac{\pi}{4}} e^{-i \frac{\pi}{4} (-1)^{\hat{n}_2}} |\overline{k}\rangle = e^{i \frac{\pi}{4}} e^{-i \frac{\pi}{4} (-1)^k} |\overline{k}\rangle = i^{k^2} |\overline{k}\rangle = i^k |\overline{k}\rangle,$$

showing that $i^{\hat{n}_2^2}$ implements a logical $S$ gate.

Similarly, for any pair of integers $m, n$, it holds that

$$(-1)^{mn} = e^{i \frac{\pi}{4} (1 - (-1)^m)(1 - (-1)^n)},$$

and therefore

$$\begin{aligned} (-1)^{\hat{n}_2 \hat{n}_4} |\overline{k}\rangle |\overline{l}\rangle &= e^{i \frac{\pi}{4} (1 - (-1)^{\hat{n}_2}) (1 - (-1)^{\hat{n}_4})} |\overline{k}\rangle |\overline{l}\rangle \\ &= e^{i \frac{\pi}{4} (1 - (-1)^k) (1 - (-1)^l)} |\overline{k}\rangle |\overline{l}\rangle \\ &= (-1)^{k\ell} |\overline{k}\rangle |\overline{l}\rangle \end{aligned}$$

which concludes the proof. $\square$

2. Clifford code $\langle H, S \rangle$

For the Clifford code, we recall that we consider variants of the Hadamard and $S$ gates that belong to $SU(2)$:

$$H := \frac{1}{\sqrt{2}} \begin{bmatrix} \eta & \eta \\ -\eta^{-1} & \eta^{-1} \end{bmatrix}, \quad S := \begin{bmatrix} \eta & 0 \\ 0 & \eta^{-1} \end{bmatrix}.$$

**Lemma 6.** For the Clifford code associated to the group $\langle H, S \rangle$, the single-qubit logical $T$-gate $\overline{T} = |\overline{0}\rangle\langle\overline{0}| + e^{i\pi/4}|\overline{1}\rangle\langle\overline{1}|$ and the two-qubit logical controlled-Z gate $\overline{CZ}$ are obtained by Hamiltonians:

$$e^{i \frac{\pi}{16} (\hat{n}_1 - \hat{n}_2 - 1)^2} = \overline{T}, \quad e^{i \frac{\pi}{4} (\hat{n}_1 - \hat{n}_2 - 1)(\hat{n}_3 - \hat{n}_4 - 1)} = \overline{CZ}. \qquad (F3)$$

*Proof.* The property that the logical $S$ operator can be implemented with the Gaussian unitary $\rho(S)$ gives

$$e^{i \frac{\pi}{4} (\hat{n}_1 - \hat{n}_2)} |\overline{k}\rangle = e^{i \frac{\pi}{4} (1 - 2k)} |\overline{k}\rangle$$

and therefore

$$e^{i \frac{\pi}{4} (\hat{n}_1 - \hat{n}_2 - 1)} |\overline{k}\rangle = (-i)^k |\overline{k}\rangle \qquad (F4)$$

for $k \in \{0, 1\}$.

We remark that the operator $e^{i \frac{\pi}{4} (\hat{n}_1 - \hat{n}_2 - 1)}$ can be written as

$$e^{i \frac{\pi}{4} (\hat{n}_1 - \hat{n}_2 - 1)} = \sum_{\ell=0}^{7} e^{i \frac{\pi}{4} \ell} \Pi_{\ell}, \qquad (F5)$$
where

$$ \Pi_{\ell} = \sum_{\substack{n_1, n_2 \text{ s.t.} \\ n_1 - n_2 - 1 \equiv \ell \mod 8}} |n_1\rangle\langle n_1| \otimes |n_2\rangle\langle n_2| $$

is a projector on the space spanned by Fock states $|n_1\rangle|n_2\rangle$ satisfying $n_1 - n_2 - 1 \equiv \ell \mod 8$. From (F4), one can infer that

$$ \Pi_0 |\bar{0}\rangle = |\bar{0}\rangle, \quad \Pi_{-2} |\bar{1}\rangle = |\bar{1}\rangle. $$

We want to understand how $e^{i\frac{\pi}{16}(\hat{n}_1 - \hat{n}_2 - 1)^2}$ acts on the code space. In particular, it is immediate that if $n_1 - n_2 - 1 \equiv 0 \mod 8$, then $(n_1 - n_2 - 1)^2 \equiv 0 \mod 64$ and if $n_1 - n_2 - 1 \equiv -2 \mod 8$, then $(n_1 - n_2 - 1)^2 \equiv 4 \mod 32$. This shows that the operator $e^{i\frac{\pi}{16}(\hat{n}_1 - \hat{n}_2 - 1)^2}$ acts trivially on the support of $\Pi_0$ and acts like $e^{i\frac{\pi}{16}4} = e^{i\frac{\pi}{4}}$ on the support of $\Pi_{-2}$. In other words,

$$ e^{i\frac{\pi}{16}(\hat{n}_1 - \hat{n}_2 - 1)^2} |\bar{k}\rangle = e^{i\frac{\pi}{4}k} |\bar{k}\rangle, $$

which shows that it implements a logical T gate.

Similarly, for $k, \ell \in \{0, 1\}$, if $n_1 - n_2 - 1 \equiv -2k \mod 8$ and $n_3 - n_4 - 1 \equiv -2\ell \mod 8$, then

$$ (n_1 - n_2 - 1)(n_3 - n_4 - 1) \equiv 4k\ell \mod 16 $$

and therefore

$$ e^{i\frac{\pi}{4}(\hat{n}_1 - \hat{n}_2 - 1)(\hat{n}_3 - \hat{n}_4 - 1)} \Pi_{-2k} \otimes \Pi_{-2\ell} = (-1)^{k\ell} \Pi_{-2k} \otimes \Pi_{-2\ell}, $$

which shows that

$$ e^{i\frac{\pi}{4}(\hat{n}_1 - \hat{n}_2 - 1)(\hat{n}_3 - \hat{n}_4 - 1)} |\bar{k}\rangle|\bar{l}\rangle = (-1)^{k\ell} |\bar{k}\rangle|\bar{l}\rangle. \quad \square $$

## Appendix G: Knill-Laflamme conditions for the pure-loss channel

We study here the effect of the pure-loss channel for the Pauli code of (11) defined from the group $\langle X, Z \rangle$, but similar considerations also apply to other variants of the Pauli code or of the Clifford code.

The Kraus operators of the two-mode pure-loss channel $\mathcal{L}_{\gamma}$ with loss rate $\gamma \in [0, 1)$ are given by [12]:

$$ E_{p_1, p_2} = \left( \frac{\gamma}{1-\gamma} \right)^{(p_1+p_2)/2} \frac{\hat{a}_1^{p_1} \hat{a}_2^{p_2}}{\sqrt{p_1! p_2!}} (1-\gamma)^{(\hat{n}_1+\hat{n}_2)/2}, $$

so that the action of the channel $\mathcal{L}_{\gamma}$ on an arbitrary two-mode state $\rho$ is

$$ \mathcal{L}_{\gamma}(\rho) = \sum_{p_1, p_2=0}^{\infty} E_{p_1, p_2} \rho E_{p_1, p_2}^{\dagger}. \qquad (G1) $$

A straightforward calculation shows that these Kraus operators attenuate coherent states: defining $\mu := \sqrt{1-\gamma}$, we get

$$ \hat{a}^p (1 - \gamma)^{\hat{n}/2} |\alpha\rangle = (\mu\alpha)^p e^{-\gamma|\alpha|^2/2} |\mu\alpha\rangle. $$

We can apply $E_{p_1, p_2}$ to a product of two cat states $|c_j(\alpha_j)\rangle|c_{1-j}(\alpha_{1-j})\rangle$ for $j \in \{0, 1\}$, it gives

$$ \begin{aligned} E_{p_1, p_2} |c_j(\alpha_j)\rangle|c_{j-1}(\alpha_{j-1})\rangle &= \left(\frac{\gamma}{1-\gamma}\right)^{(p_1+p_2)/2} \frac{(\mu\alpha_j)^{p_1} (\mu\alpha_{1-j})^{p_2}}{\sqrt{p_1! p_2!}} e^{-\gamma(|\alpha_j|^2+|\alpha_{1-j}|^2)/2} |c_{j-p_1}(\mu\alpha_j)\rangle|c_{1-j-p_2}(\mu\alpha_{1-j})\rangle \\ &= e^{-\gamma(|\alpha_j|^2+|\alpha_{1-j}|^2)/2} \frac{\gamma^{(p_1+p_2)/2} \alpha_j^{p_1} \alpha_{1-j}^{p_2}}{\sqrt{p_1! p_2!}} |c_{j-p_1}(\mu\alpha_j)\rangle|c_{1-j-p_2}(\mu\alpha_{1-j})\rangle \\ &= f(\alpha_j, \alpha_{1-j}, p_1, p_2) |c_{j-p_1}(\mu\alpha_j)\rangle|c_{1-j-p_2}(\mu\alpha_{1-j})\rangle \end{aligned} $$
with indices taken modulo 2, and we defined the function $f(\alpha, \beta, p, q) := e^{-\gamma(|\alpha|^2+|\beta|^2)/2}(\alpha\sqrt{\gamma})^p(\beta\sqrt{\gamma})^q/\sqrt{p!q!}$.

Focusing on the Pauli code with initial state $|\alpha\rangle|\alpha e^{i\theta}\rangle$, and denoting $|\bar{k}\rangle := \mathcal{E}(|k\rangle)$, one can check the Knill-Laflamme conditions for the Kraus operators of the pure-loss channel by applying the previous expression for $\alpha_0 := \alpha e^{i\theta}$, $\alpha_1 := \alpha$,

$$ \langle \bar{k} | E_{p_1, p_2}^{\dagger} E_{q_1, q_2} | \bar{l} \rangle \propto f(\alpha_k, \alpha_{1-k}, p_1, p_2)^* f(\alpha_\ell, \alpha_{1-\ell}, q_1, q_2) \langle c_{k-p_1}(\mu\alpha_k) | c_{\ell-q_1}(\mu\alpha_\ell) \rangle \langle c_{1-k-p_2}(\mu\alpha_{1-k}) | c_{1-\ell-q_2}(\mu\alpha_{1-\ell}) \rangle. $$

Diagonal terms of the form $\langle \bar{k} | E_{p_1, p_2}^{\dagger} E_{q_1, q_2} | \bar{k} \rangle$ are nonzero only if $p_1 = q_1$ and $p_2 = q_2$ since the even and odd cat states are orthogonal (they have support on the even and odd Fock states, respectively). In that case, we have

$$ \begin{aligned} \langle \bar{k} | E_{p_1, p_2}^{\dagger} E_{p_1, p_2} | \bar{k} \rangle &\propto f(\alpha_k, \alpha_{1-k}, p_1, p_2)^* f(\alpha_k, \alpha_{1-k}, p_1, p_2) \\ &= e^{-\gamma(|\alpha_k|^2+|\alpha_{1-k}|^2)} \frac{\gamma^{(p_1+p_2)} |\alpha_k|^{2p_1} |\alpha_{1-k}|^{2p_2}}{p_1! p_2!} \end{aligned} $$

which is independent of $k$, provided that $|\alpha_0| = |\alpha_1|$.

Moreover, for nondiagonal terms, we observe that if $\theta$ is not a multiple of $\pi$, then the overlaps between the cat states of amplitude $\mu\alpha_0$ and $\mu\alpha_1$ always vanish in the limit of large energy, $\alpha \to \infty$,

$$ \lim_{\alpha \to \infty} \langle \bar{0} | E_{p_1, p_2}^{\dagger} E_{q_1, q_2} | \bar{1} \rangle = 0. $$

This suggests to optimize the choice of the phase $\theta$ so as to maximize the distance between the constellations of coherent states for the encoded states $|\bar{0}\rangle$ and $|\bar{1}\rangle$. A similar observation was made in [18] where this distance was computed explicitly for many families of quantum spherical codes. In the case of the Pauli code of (11), we see that the choices $\theta = 0$ and $\theta = \pi/2$ are respectively the worst and best choices with that respect. This is confirmed numerically, and can also be seen on Fig. 2.

## Appendix H: Expression of the Clifford code for an arbitrary initial state

There are various representations of the Clifford group. We consider here the binary octahedral group $2O$, with presentation $\langle s, t | (st)^2 = s^3 = t^4 \rangle$ and generators $s = \frac{1}{2}(1 + i + j + k)$ and $t = \frac{1}{\sqrt{2}}(1 + i)$. It has the advantage of containing only 48 elements. Using the standard representation of a quaternion $a + bi + cj + dk$ as a $2 \times 2$ complex matrix $[ \begin{matrix} a+bi & c+di \\ -c+di & a-bi \end{matrix}]$, we obtain the following generators for the group $2O$:

$$ H := \frac{1}{\sqrt{2}} \begin{bmatrix} \eta & \eta \\ -\eta^{-1} & \eta^{-1} \end{bmatrix}, \quad S := \begin{bmatrix} \eta & 0 \\ 0 & \eta^{-1} \end{bmatrix}, $$

where we defined $\eta = \frac{1}{\sqrt{2}}(1 + i)$ and note that $H$ and $S$ differ from the standard form of the Hadamard and phase gates because we focus here on operators in $SU(2)$. One can readily check that $(HS)^2 = H^3 = S^4 = -1_2$.

The 48 matrices composing the group consist of 8 diagonal matrices, 8 antidiagonal matrices and 32 Hadamard-like matrices:

$$ \begin{gathered} \begin{bmatrix} \eta^k & 0 \\ 0 & \eta^{-k} \end{bmatrix}, \quad \begin{bmatrix} 0 & -\eta^k \\ \eta^{-k} & 0 \end{bmatrix}, \quad k \in \{0, \dots, 7\}, \\ \frac{1}{\sqrt{2}} \begin{bmatrix} \eta^{2\ell} & \eta^{2m} \\ -\eta^{-2m} & \eta^{-2\ell} \end{bmatrix}, \quad \frac{1}{\sqrt{2}} \begin{bmatrix} \eta^{2\ell+1} & \eta^{2m+1} \\ -\eta^{-2m-1} & \eta^{-2\ell-1} \end{bmatrix}, \quad \ell, m \in \{0, 1, 2, 3\}. \end{gathered} $$

One can apply the construction of Lemma 1 for an arbitrary initial coherent state $|\alpha\rangle|\beta\rangle$ and $|\Omega\rangle \propto |0\rangle$. This gives

$$ \mathcal{E}(|0\rangle) \propto \sum_{k=0}^{7} \eta^{-k} |\eta^k \alpha\rangle |\eta^{-k} \beta\rangle + \frac{1}{\sqrt{2}} \sum_{\ell, m=0}^{3} \sum_{p=0}^{1} \eta^{-2\ell-p} |(\eta^{2\ell+p}\alpha + \eta^{2m+p}\beta)/\sqrt{2}\rangle |(-\eta^{-2m-p}\alpha + \eta^{-2\ell-p}\beta)/\sqrt{2}\rangle, $$

and the state $\mathcal{E}(|1\rangle)$ is obtained by swapping the two modes.