Gottesman-Kitaev-Preskill codes: A lattice perspective

We examine general Gottesman-Kitaev-Preskill (GKP) codes for continuous-variable quantum error correction, including concatenated GKP codes, through the lens of lattice theory, in order to better understand the structure of this class of stabilizer codes. We derive formal bounds on code parameters, show how different decoding strategies are precisely related, propose new ways to obtain GKP codes by means of glued lattices and the tensor product of lattices and point to natural resource savings that have remained hidden in recent approaches. We present general results that we illustrate through examples taken from different classes of codes, including scaled self-dual GKP codes and the concatenated surface-GKP code.


Introduction
It is known that quantum physics can be harnessed to speed-up certain computational tasks. However, it seems challenging to take advantage of such potential in practice. Arguably the biggest hindrance to achieving reliable quantum information processing is the difficulty to control systems and sufficiently isolate them from their environment. The field of quantum error correction (QEC) has been developed to cope with errors by choosing an appropriate encoding to constrain the action of environmental noise on the stored information and by repeated measurements of an associated stabilizer group to remove entropy from the system. With advancing experimental control over superconducting and integrated optical photonic circuits, recent years have witnessed growing interest in bosonic quantum error correction, where information is embedded into bosonic or continuous-variable (CV) systems exploiting the redundancy available in the associate infinite dimensional Hilbert space. In particular, so-called Gottesman-Kitaev-Preskill (GKP) codes [1] have been increasingly studied as promising components towards building a scalable quantum computer [2][3][4][5][6].
While the original proposal for the GKP code was made as early as in 2001, only in recent years experimental efforts of realizing such codes have gained momentum. Quantum error correction with single mode versions of the GKP code has recently been demonstrated experimentally in ion-traps [7] and superconducting hardware [8] while a growing number of theoretical proposals investigate the possibility to concatenate such codes with known qubit codes [9][10][11][12]4] to achieve exponential error suppression by increasing the number of modes. Most works in this direction focus on understanding the single mode GKP code as an effective encoded qubit, with an effective noise channel, and proceed in their analysis using the well established toolbox of qubit quantum error correction. While it allowed rapid progress, this approach significantly limits the class of codes that can be considered and the analytical grasp on the continuous nature of the underlying system. In general, both the structure of the state and that of the stabilizer group of GKP codes can be understood in terms of lattices in phase-space, which is often used to introduce and visualize single-mode examples. But the deep connection with lattices also holds in the multi-mode case, including but, crucially, not limited to codes obtained from concatenating a single-mode GKP code with qubit stabilizer codes. The description of (multi-mode) GKP codes in terms of symplectic lattices was already formulated in the seminal work [1]. However, only a handful of examples can be found in the literature [12][13][14][15] that attempt to use it for a better understanding of the structure and properties of such codes, for constructing new codes or for devising decoding algorithms.
In this work we present an introduction to lattice theory for quantum error correction practitioners and show how the tools it provides can be fruitfully put to use for the analysis and design of GKP codes. The upshot is that, since lattices have long been studied in many branches of pure and applied mathematics, from number theory to string theory, they provide us with a rich toolbox whose potential remains largely untapped for quantum error correction. By elaborating on the connection with lattices, we move some further steps in this direction. We hope that this will motivate a wider adoption of lattice techniques in the study of GKP-and general quantum error correcting codes. The results in the present work suggest that this could lead to further insight as well as potential practical advantages towards fault-tolerant quantum computation with GKP codes.
To demonstrate the power of the lattice formalism, we derive a number of new results relating the parameters of GKP codes, such as the distance and encoding rate. We study the equivalence of codes under symplectic transformations, formulate the general decoding problem in terms of lattice quantities and provide two constructions leading to new codes that cannot be described (to the best of our knowledge) within the usual concatenated GKP-qubit paradigm. This highlights that the latter only captures very special cases, that, while easy to conceive, have no a priori reason to be considered optimal in taking advantage of the underlying bosonic nature of the system. This article is structured as follows. In Section 2, we set the stage by introducing the relevant notions from lattice theory that will be used in the rest of this manuscript and we discuss their relation to GKP codes. Section 3 explores how the choice of the lattice basis corresponding to the stabilizer generators influences the properties of the latter. We focus in particular on suitable generalizations of Calderbank-Shor-Steane (CSS) codes and low-density-parity-check (LDPC) codes to the GKP setting. We show that significant savings in the number of stabilizer measurements with respect to the procedure usually employed for concatenated GKP-qubit codes are possible by measuring a minimal set of stabilizers at each error correction cycle. Furthermore, we show that concatenation of qubit stabilizer codes with single mode GKP codes provides a natural embedding of the qubit code into a lattice through the so-called Construction A [16], which leads to a no-go result that impacts the complexity of the decoding problem, in particular exact minimum-energydecoding.
In Section 4, we prove a necessary and sufficient condition for two GKP codes to be equivalent up to a symplectic transformation, extending the single mode case mentioned in ref. [12]. This can be interpreted as code-switching by means of a Gaussian unitary. Section 5 is focused on defining a notion of distance for GKP codes via the length of the shortest non-trivial dual coset element of the lattice that describes the stabilizers. This definition is motivated by the structure of common noise models used for GKP codes in the literature. We discuss tradeoffs between the distance and other code parameters, such as encoding rate and the "length" of stabilizers. Furthermore, we show how to estimate the distance of a GKP code from the theta functions of the corresponding lattice, which are central quantities in lattice theory. Finally, we show that the distance of a CSS qubit stabilizer code is fully determined by the weight distribution of its stabilizer group, i.e., the number of stabilizers of particular Hamming weight in their representation by symplectic binary vectors. Although a similar statement can be derived from the seminal work of Shor, Laflamme [17] and Rains [18], it follows straightforwardly from the lattice theoretic concepts we introduce, showcasing that a lattice theoretic standpoint can also benefit the examination of qubit stabilizer codes.
Theta functions are central in the general formulation of the maximum likelihood (coset) decoding problem for general GKP codes, as we detail in Section 6. This hints at the existence of new decoding strategies that do not rely on the concatenated code structure, and are hence more general than those adapted from qubit codes. A detailed discussion of such strategies is beyond the scope of the present work and is therefore postponed to a separate publication.
Finally, we discuss in Section 7 two constructions, based on glued lattices and the lattice tensor product operation, respectively, to obtain GKP codes beyond scaled and concatenated codes, the two main code constructions featured in previous works and the rest of this work. We foresee that such alternative constructions may become of practical relevance in the near future, especially in setups with limited locality constraints, such as photonic architectures. Furthermore, we show that some properties of these codes can be computed easily, potentially making them also useful examples to probe the limits of GKP codes. Concluding remarks and future perspectives in Section 8 complete this work.

Preliminaries and notation
In this section, we review the basic setup of GKP codes as proposed in ref. [1] and introduce some basic concepts of lattice theory to analyze their structure. Good introductions to lattice theory are found in refs. [19,16], from which many of the following definitions and lattice theoretic arguments presented here are adapted. A stabilizer code [20] embeds information into a physical Hilbert space by defining the code-space as fixed point of a finitely generated, abelian group S, i.e., logical information is stored in terms of state vectors |ψ : s |ψ = +1 |ψ ∀s ∈ S. (1) The GKP code [1] is a stabilizer code acting on the Hilbert space of n bosonic modes, where stabilizers are given by displacement operators where is the symplectic form and ξ ∈ R 2n are phase-space vectors that specify the displacement. When no index is specified, we follow the convention J = J 2n and I = I 2n . We also adopt the convention = 1, such that [x k ,x l ] = iJ k,l for k, l = 1, . . . , 2n. Throughout this work, we use bold symbols to denote (column) vectors. Displacement operators implement a shift of the 2n−quadratures commute as and satisfy Given the metaplectic representation of a symplectic operator [21] S → U S , S T JS = J, we have such that Displacement operators are orthogonal, and form a complete basis such that any operatorÔ ∈ L (H) can be resolved as 1 We can now define the GKP stabilizer group.
Definition 1 (GKP stabilizer group [1]). The stabilizer group of a GKP code is given by a set of displacements where are linearly independent and we have ξ T i Jξ j ∈ Z∀ i, j. Exploiting the structure of the displacement operators, the GKP construction defines a stabilizer group isomorphic to a lattice with generator matrix which is simply the set of integer linear combinations of basis elements We follow the convention of ref. [1] such that the basis vectors of the lattice L constitute the rows of the generator matrix. For S to constitute a stabilizer group, it needs to be (1.) a group and (2. ) abelian. By construction in Definition 1, S is a group and by means of eq. (5) it can be observed that S is abelian if and only if the symplectic Gram matrix associated with any generator M of the lattice has only integer entries. We then say that the lattice L(M ) is symplectically integral. The symbol A will be reserved to the symplectic Gram matrix throughout the manuscript and although it depends on the particular generator M we will mostly leave this understood when the generator is clear from the context.
Using eq. (6), it can be verified that each element of the stabilizer group S can be written as where a ∈ Z 2n is an integer vector and A : (A ) i,j = A i,j ∀ i > j is the lower triangular matrix of A. The stabilizer group S is hence given by where denotes the phase-sector when we have chosen M to be the pivot basis, i.e. the set of basis vectors for which each associated displacement operator is fixed to eigenvalue +1 by definition 1. We will also use the notation S = S(M, φ M ) to specify GKP stabilizer groups from its generator M when the phase-sector is relevant. The pair (M, φ N ) specifies that the generator for the stabilizer group . When L is symplectically integral, we also have e iφ(ξ) = ±1 ∀ ξ ∈ L, which is also already apparent from eq. (6). The additional phases in front of the displacement operators act trivially on the projective Hilbert space, such that they are irrelevant when considering stabilizer operators S as symmetries of the effective code. However, they play a role in error correction, where the goal is to fix each stabilizer s ∈ S to the +1 eigenvalue to define a code space and the phases determine to which ±1 eigenvalue the associated displacement operator needs to be fixed.
Remark (Definition of the GKP stabilizer group). We remark that the definition of the GKP stabilizer group we make here differs from the one presented in ref. [1], which has been stated as S = {D (ξ) |ξ ∈ L}, where L is a symplectically integral lattice. Although this defines a commuting set of stabilizers, S is in fact not closed in general due to the extra phases appearing when combining two displacement operators eq. (6) and would also not equal S as defined above. Definition 1 follows more closely the practical reality, where error correction is performed by measuring minimal generating set of the stabilizer group and by fixing (correcting) their eigenvalues to +1.
The definition S is closed and identical to S in the special case where A ∈ (2Z) 2n×2n , i.e., the associated lattice L is symplectically even. We found, however, that this would restrict us too severely in the classes of codes to analyze (e.g. the concatenated GKP -surface code introduced later is described by a symplectically integral, but not symplectically even lattice). We illustrate the difference between the sets S and S using the stabilizer group for the sensor state [22], where e j are canonical basis vectors, so that code-states should have eigenvalue −1 on displacement for which mn is odd if they have eigenvalue +1 on each generator D (e 1 ) , D (e 2 ). Given the conventional definition S , D (e 1 ) D (e 2 ) = (−1)D (e 1 + e 2 ) would formally not be included in the stabilizer group.
A system of n bosonic modes can be associated with an infinite dimensional Hilbert space and a 2n−dimensional phase space, whose axes correspond to the quadratures of the system, each corresponding to an observable taking continuous values. To encode discrete quantum information, such as a qubit, the state space needs to be fully "discretized" by introducing suitable constraints. This is done by choosing a generating set for the stabilizer group with 2n linearly independent generators. Each linearly independent generator can be seen as "discretizing" one direction in phase space. This is the reason why we require the lattice L to be full rank, that is, we demand that M has full row-rank. It is always possible to specify a lattice in R 2n using more than 2n basis vectors, (we will see an example of such a scenario later), but they can always be reduced to 2n linearly independent vectors, a process for which a number of (efficient) algorithms are known [19]. We note that also non-full rank (or degenerate) lattices had recently been explored to define effective GKP codes [23,15]. The code space of such codes retains undiscretized quadratures which allows to encode and perform error correction on general CV states. In this work we focus on encoding qubits or qudits defined via full-rank lattices while encoding of continuous information using degenerate lattices is briefly explained in appendix B.
Such transformation also transforms Note that A has even entries if and only if A does. Due to the phases appearing in eq. (17), when a different basis M is used to fix the stabilizer group as in Definition 1, the generating set for the stabilizer group needs to be chosen as to yield the same stabilizer group and, effectively, the same code and fix the same code-space. The symplectic Gram matrix is invariant under a symplectic transformation Note that, unlike the change of basis, a symplectic transformation generally changes the lattice but also leaves the symplectic Gram matrix invariant. As a result, symplectic transformations can serve as useful tool to adapt the code to the properties of the noise while keeping the same encoding rate, as we will see in the following. When a GKP code is specified by its generator S = S(M, 0), the corresponding phase sector transforms under symplectic transformation as Any basis M of the full rank lattice L partitions R 2n = R 2n M into lattice translates of the fundamental parallelepiped (note the row-vector convention adopted here), such that every point x T ∈ R 2n is uniquely associated to a lattice point x T ∈ a T M + P (M ). Equivalently, one can choose to partition R 2n using the centered fundamental parallelepiped Any set that exactly partitions the space under lattice translations is called fundamental and has volume det (L) : where G := M M T is the euclidean Gram matrix associated to the generator M . The determinant det (G) is a lattice invariant known as its discriminant. The determinant (discriminant) can be geometrically interpreted as measure of inverse density of lattice points. A sublattice L ⊆ L is a subset of L(M ) that is itself a lattice. A basis for any d−dimensional sublattice of L(M ), where d < 2n, can be given by where B ∈ Z d×2n is an integer matrix of full row rank. The symplectic dual (simply "dual" in the following) of a lattice L is the lattice L ⊥ that consists of all vectors that have integer symplectic inner product with any vector from L Within the GKP code construction vectors ξ ⊥ ∈ L ⊥ correspond to the displacement amplitudes that are associated to the centralizer of the stabilizers within the set of displacement operators. A canonical choice of basis M ⊥ for the symplectic dual is specified by fixing M ⊥ to satisfy Since we will focus on full rank lattices, for which M is non-singular, we obtain the canonical dual basis as Together with the definition of A it can be shown that that is, the symplectic Gram-matrix A describes how the sublattice L = L (M ) ⊆ L ⊥ = L M ⊥ associated to stabilizer operators embeds into the lattice associated to its centralizer. The dual quotient (or glue group) of L, L ⊥ /L thus lists the logically distinct displacements admitted by the GKP code S. Since we are interested in effective qubit encodings with logical dimension d = 2 k , these displacements form the effective logical Pauli group. Finally, the number of logically distinct centralizer elements associated to S is One can verify this formula geometrically by imagining the partition of P (M ) with patches P M ⊥ . Under basis transformation of the direct lattice M → U M the canonical dual basis transforms as and under symplectic transformations M → M S T we obtain The symplectic Gram matrix of the dual lattice can be shown to satisfy where adj (A) is the adjugate of A. It is similarly common to define the euclidean dual of a lattice L which we shall denote by L * . This is the lattice in R 2n consisting of all vectors with integer euclidean inner product with every vector in L.
The euclidean dual is more common than the symplectic one in the lattice theory literature, and hence often simply called dual. Similar to the symplectic case, a canonical basis M * for the dual lattice can be fixed to satisfy M * M T = I (37) or equivalently (since we only deal with full rank lattices) Since J ∈ O(2n) is an orthogonal matrix, we can observe that the symplectic dual is equivalent to the euclidean dual up to an orthogonal rotation. In particular, the distribution of lengths of vectors in L ⊥ is equal to the distribution of lengths of vectors in L * . We will take advantage of this fact when analyzing the code distance of GKP codes in Section 5. We close this section by introducing the two most studied classes of GKP codes, which we will use for illustrations throughout this manuscript. The first class, which we will refer to as scaled codes, have been thoroughly examined in ref. [13] and build on symplectic self-dual lattices. A symplectic self-dual lattice is a symplectically integral lattice for which | det (M ) | = | det (A) | = 1 and, consequently, L = L ⊥ . The associated code-space is one-dimensional.

Scaled GKP codes.
A scaled GKP code L(M ) is obtained by rescaling a symplectically self-dual The associated symplectic Gram matrix becomes A = λA 0 and the dimension of the code-space is d = | det (λA 0 )| = λ n . By e.g. choosing λ = 2 this yields a code with k = n log 2 (λ) = n. Let be the length of the shortest vector in L 0 = L ⊥ 0 . Note that throughout this manuscript · = · 2 denotes the euclidean 2-norm. The rescaling implies λ 1 (L) = λ 1 2 λ 1 (L 0 ) and λ 1 L ⊥ = λ − 1 2 λ 1 (L 0 ). For λ > 1 the symplectic dual vector corresponding to λ 1 L ⊥ cannot be in L and hence constitutes the shortest logically non-trivial displacement, the length of which decreases with the number of logical dimensions that are squeezed into the code. Prominent examples of scaled GKP codes that have already been discussed in ref. [1] are generated by also known as the square GKP code, that encodes k = 1 qubit into n = 1 oscillator and which is known as the hexagonal GKP code, similarly with k = n = 1 but with a different lattice geometry that requires a slightly larger displacement amplitude to implement a logical operator.
Concatenated square GKP codes. The second class that will be extensively discussed throughout this work is that of concatenated codes built from the square GKP code and a qubit quantumerror correcting code. Let Q ⊂ Z 2n 2 be a set of binary symplectic vectors 2 such that qubit quantum error correcting code. We can embed binary vectors in R 2n in the trivial way. The lattice associated to the concatenated GKP code will be given by and equally describes an encoding of k logical qubits into n modes. Such lattices are known in the literature as Construction A lattices [16]. Given r = n − k symplectic vectors associated to a set of generators for S Q that we stack row-wise into a generator B Q ∈ Z r×2n 2 , we can write down the generator for the concatenated code This basis is overcomplete and can be row-reduced to only consist of 2n generators. We discuss basis choices in the next section.

Bases of GKP codes
The 2n rows of the generator matrix M of a GKP code stand in one-to-one correspondence with a minimal number of generators for the stabilizer group which are measured to deduce the error syndrome for recovery. Hence the choice of basis M strongly influences the physical implementation of the code and certain basis choices may be beneficial over others. Natural desiderata include the following properties.

CSS property.
A CSS code is known in qubit quantum error correction as a code for which the set of stabilizer operators disjointly separates into one that only contains Pauli-Z type operators and one that only contains Pauli-X type operators (or any other pairing). In practice, this has the advantage that ancillary qubits used to measure the stabilizers only need to come in two different initial states and only need to couple with their associated data qubits in one particular way, i.e., via a CN OT or CZ operations. Furthermore, for sufficiently simple error models, decoding algorithms only need to be tailored to the respective subcodes. The most studied quantum error correcting codes are indeed CSS codes, such as homological codes [24] including the celebrated toric code [25] or planar versions of it [26], which at the time of writing yield the best promise of protection from noise and allow for geometrically local implementations. A natural generalization to GKP codes is to call CSS a code whose lattice admits a basis that can be written as [1] where M q , M p ∈ R n×n describe stabilizers that contain onlyp andq quadrature operators, respectively. Equivalentely, the corresponding lattice can be decomposed into the direct sum of two disjoint sublattices A trivial example of GKP-CSS code is the single-mode square GKP code. Concatenating a CSS qubit code with the square GKP code trivially preserves the CSS property. The decomposition eq. (45) holds concretely for the Hermite normal form [27,28] of a lattice basis when M is (or can be rescaled to) integer, which is defined as follows.

the pivot of each row is the largest element of its column.
The Hermite normal form is special in that, for integer M , the HNF is unique [29] and can be computed efficiently (see also ref. [19]). It can hence be used to verify the CSS property or compare whether two stabilizer groups are equivalent whenever we are given bases that can be scaled to be integer (and scaled back after applying the preferred HNF algorithm). In particular, this applies to concatenated square GKP codes such that we can always check whether a given code is CSS by computing its HNF.

Short basis vectors.
Besides being CSS, the homological qubit codes mentioned above are lowdensity-parity-check (LDPC) codes, meaning that they admit a choice of generators such that the support of each generator is bounded and each qubit only interacts with a bounded number of generators. Here "low" typically means constant in the number of physical qubits. The LDPC property can be generalized in two different ways. Analogous to the qubit picture we can ask for the stabilizers of the GKP code to only act non-trivially on a low number of modes and that each mode be only touched upon by a low number of stabilizers. It is straightforward to see that this property is inherited whenever a qubit LDPC code is concatenated with single mode bosonic codes such as the square-or hexagonal-GKP code and can more generally be quantified by counting the number of non-zero elements of a choice of generator M per row/column. On the other hand, in the bosonic case, it would also be natural to demand for the lattice basis vectors to be short in the sense of the euclidean norm. If one imagines that the stabilizer checks are implemented by coupling in and subsequently measuring ancillary systems, the length of the basis vectors depends both on the number of modes that each ancilla is coupled to as well as on the interaction-strength/-time required. We will see shortly how a minimal basis (that is, consisting of only 2n generators) with short vectors can be constructed for concatenated GKP codes. In general, when no extra structure is specified, short bases can also be computed by means of lattice reduction algorithms, such as the Lenstra-Lenstra-Lovász (LLL) algorithm [30], which efficiently finds a short and almost orthogonal basis.
Orthogonality. On top of shortening the basis vectors, the LLL algorithm also attempts to find a basis that is nearly orthogonal. A basis M is orthogonal when M M T is diagonal and we say a lattice L is orthogonal if such a basis exists.
We will see later in Sections 5, 6 how orthogonality is useful when attempting to quantify the distance of a GKP code or for the task of decoding. The single-mode square and rectangular GKP codes correspond to orthogonal lattices. However, when a qubit code is concatenated to the square-GKP code, leading to Construction A lattices, this can only be the case if the qubit stabilizer generators act disjointly on at most two quadratures at once [31], i.e., if the qubit stabilizer code decomposes as up to permutation of coordinates. Since stabilizer codes require stabilizer generators to overlap non-trivially to achieve long-range entangled states, we arrive at the following claim.

Claim 1 (Orthogonality of concatenated GKP codes). Concatenated GKP codes with long-range entangled code states have a non-orthogonal lattice L.
Phrased differently, this means that codes associated to orthogonal lattices cannot produce long-range entanglement. Finally, we can also relate the length of stabilizer generators to the possibly admitted encoding rate.
which is also known as Hadamard's bound. Taking the logarithm on both sides yields the result.
This simple inequality based on Hadamard's bound constrains the encoding rate of a GKP code by the maximum length of the stabilizers. For a fixed basis M , C quantifies the size of the displacement that needs to be measured to extract the syndrome, which can loosely be interpreted as the "experimental hardness" to implement a code with stabilizer generators described by the rows of M . C is large whenever many modes are involved in a single stabilizer generator (compare with the LDPC property) or the displacement to be measured is large (requiring stronger coupling). We note that the value of C is basis-dependent, while the LHS of the inequality is not. Hence any fixed basis M yields an upper bound on the encoding rate but the bound will only be saturated when all M i are orthogonal and of similar length. We have already observed in Claim 1 that interesting concatenated codes do not yield orthogonal lattices, such that in these cases the bound will not hold tightly.

Minimal bases for concatenated GKP codes
As an example of an interesting application of lattice basis reduction, we present a procedure to find a minimal basis for the lattice obtained as concatenation of the single square-GKP code with the Surface-17 code in Fig. 1. This basis is derived by first noting that 2n stabilizers suffice to fully specify the code, in contrast to the usual 3n − k generators of the union individual GKP stabilizers and concatenated stabilizers. Starting from this set, it is clear that removing any of the r = n − k independent qubit stabilizers from the union of generators necessarily changes the dimension of the code space. The redundant stabilizers, that can be omitted without affecting the encoded subspace, must hence be found among the single-mode GKP ones. We identify the redundant single-mode GKP stabilizers as follows. Squaring the concatenated qubit code stabilizers S Z/X i yields a product of square GKP-code stabilizers, such that not all GKP stabilizer overlapping on supp S Z/X i need to be included on that local region to generate the full local stabilizer group, e.g. in Fig. 1 one can obtain S p 2 by multiplying (S X 3 ) 2 with S p 3 , such that locally S p 3 and S X 3 suffice to reconstruct the full p−type syndrome. We note that the pattern of the included local GKP-code stabilizers depicted in Fig. 1 can be extended to larger surface code layouts.
In general, given a concatenated square GKP code we obtain a procedure to find a minimal generating set as detailed in Figs. 2, 3, 4. Let B = B Q ∈ Z r×2n 2 be a minimal generator matrix for the qubit code. We iterate through all GKP-stabilizer generators and check whether they are already member of the lattice generated by B. If not, we append this generator to the basis and proceed to the next. This algorithm will terminate once 2n − r GKP stabilizer generators are added. Importantly, it preserves the qubit stabilizers and hence the LDPC property. If the qubit code had a generating set with maximal weight w, the longest basis vector will be of length max{ w/2, √ 2}. Note that the membership test outlined in Fig. 4, that applies when dealing with rational lattice (in which case the lattice can be rescaled to integer, such that the HNF is unique), can be executed in polynomial time. The above procedure can trivially be generalized to the concatenation of a qubit code with a different single-mode GKP code. In particular if we use single mode GKP codes that are locally described by generator matrix M GKP , the algorithm outlined in Fig. 2 is adapted by iterating through the rows of M ⊕n GKP and matching the non-trivial entries in B Q to elements in L (M GKP ) ⊥ ⊕n . A python implementation of the algorithm can be found under ref. [32]. We conclude this section by noting a practical advantage following from the existence of minimal bases. In the literature, an error correction cycle for concatenated GKP codes typically contains two steps: first all single-mode GKP stabilizers are measured and the state is corrected to the corresponding sublattice. Then all qubit level stabilizers are measured and the syndrome is fed  labeled by red filled circles and S q i = e i2 √ πq i on the vertices drawn in blue. It suffices to measure only one type of square GKP generator on most modes, except for mode 5, where both S q 5 and S p 5 need to be measured. The · † 's are chosen such that all qubit stabilizers commute on the full bosonic Hilbert space [10], i.e. such that BQJB T Q = 0. 3 We follow the convention for the stabilizers in ref. [11].  to a modified qubit decoder, possibly taking into account the analogue measurement information.
The existence of a minimal set of 2n lattice basis vectors implies that checking whether a given state is a code-state can be done with only 2n measurements. This has to be contrasted with the usual 2n + n − k measurements in typical two-step schemes. Using a minimal basis foregoes measuring the GKP stabilizers whose eigenvalues are already fixed by the results on the minimal set, and can thus lead to a reduction of about 1/3 in the number of (GKP) ancillas required for an error correction cycle. Although the eigenvalues of the redundant, unmeasured, GKP stabilizers can be deduced from the other measurements, in the presence of measurement errors other strategies might be more effective.

Symplectic equivalence
By definiton of the symplectic Gram matrix, it remains invariant under symplectic transformations of the GKP code M → N = M S T . Symplectic transformations are physically implemented by Gaussian unitaries which have a special role in bosonic quantum information processing, for a number of reasons, including the fact that they are often the easiest to implement in the laboratory. As far as error correction is concerned, the fact that they act linearly on the quadratures implies that potential errors, such as small displacements on the modes, remain bounded in their amplitude. By construction of the GKP code, the logical Clifford group can be implemented using only symplectic transformations. 4 Here, we show that two GKP codes are equivalent under symplectic transformations if and only if their standard form (introduced below) is equal and show that every code is symplectically equivalent to a standard form where each stabilizer acts on a single mode. This is a generalization of the symplectic equivalence of the square-and hexagonal GKP code noticed in ref. [12]. We say a symplectic Gram matrix is in standard form if where D is a positive diagonal n × n integer matrix with non-increasing diagonal elements. A symplectically integral matrix A can always be brought into standard form via basis transformation [1].
We haveM i.e., bothM ,Ñ are symplectic. Since symplectic matrices are invertible, we define R T :=Ñ −1M such thatM =Ñ R T . R is symplectic since the symplectic group is closed under transpose and inverse. Left-multiplying by Z −1 we obtain M = N R T . It is important to note that since the symplectic equivalence above is established using the bases M, N chosen such that A M , A N are in standard form, one needs to be careful in accounting for possible phases in front of the associated stabilizer operators stemming from the basis transformation. When the above assumptions of the theorem above are satisfied we obtain that the stabilizer group S (N, 0) can, by symplectic transformation R T , be transformed into S (M, φ N R T ) . I.e. code states |ψ of the code S (N, 0) can be transformed into states U R −T |ψ by means of a Gaussian unitary (see eq. (8)) which are stabilized by phased displacement operators Note that phases above are absent in the symplectic transformation between a single-mode square GKP code and hexagonal GKP code shown in ref. [12], which is because each of these codes have symplectically even lattices, such that the overall phase factors are trivial. The same discussion on phase-assignement is relevant for the application of the following immediate corollaries.
is symplectically equivalent to the one specified by M .
Note that here, we understand the direct sum as happening mode-wise, such that it corresponds to the usual matrix direct sum if the quadratures are ordered as (q 1 ,p 1 ,q 2 ,p 2 , . . .) with symplectic form J 2n = I n ⊗ J 2 but not if they are ordered as (q 1 ,q 2 , . . . ,p 1 ,p 2 , . . .) in the standard choice J 2n = J 2 ⊗I n . This convention will be understood in the following whenever clear from the context. Note that N is diagonal, so its stabilizers act each on a single quadrature at a time. Since N decomposes into a direct sum over each mode, we can always prepare a code state of M by locally preparing a code state of N and applying the corresponding symplectic transformation.
The same symplectically equivalent local decomposition can equally be done using the hexagonal GKP code on each local mode and is based on the fact that the square and hexagonal GKP code, as scaled GKP codes with scaling factor λ, have both A = A = λJ 2 . Similarly, any other scaled GKP codes can also be used. This is an example of code switching. Even more generally, this implies code switching between two GKP codes L (M ) and L (N ) on the same number of modes is possible whenever D N = D M in their respective standard bases. Similarly, we can also deduce the following corollary.
Corollary 2 (Normal form in prime dimensions). For d = | det(M )| prime, the lattice L ⊂ R 2n is symplectically equivalent to a code specified by Proof. For a basis of L in standard form, we have Since D is a positive integer diagonal matrix, if d is prime, the eigenvalues of D are uniquely specified by D = diag(d, 1, 1, . . .) up to permutations. Hence by Theorem 2 we have that L is symplectically equivalent to the code specified by eq. (55).
From the proof above one can also see that the number of symplectically inequivalent classes of codes with given logical dimension d corresponds to the number of different factorizations of d. For example, for two modes encoding two qubits there are two inequivalent choices: D = diag (4, 1) or D = diag (2, 2), corresponding to two symplectically inequivalent classes of codes.

Distance of a GKP code
We need a benchmark to assess how well the logical content of a GKP state is protected from noise. In qubit codes, a simple standard assumption is that noise is stochastic i.i.d. for each physical qubit, such that the likelihood of an error decreases exponentially with its support or weight. This assumption makes the definition of a code distance as weight of the shortest nontrivial logical operator meaningful. This model no longer makes sense in the bosonic setting. In the bosonic setting, a reasonable assumption about the underlying error model is that weak coupling to the environment results in effectively small displacements. Concrete examples are loss, thermal noise [34], and to a limited extent, finite squeezing errors [35,36,2]. For simplicity, we assume a stochastic displacement noise model such that small displacements are more likely than large displacements, this is in particular the case for the Gaussian displacement noise model which we will analyse more in-depth later, where that displaces the quadratures of the state by some random amplitude drawn from a centered Gaussian distribution with varianceσ 2 . Although this error model is widely used in the analysis of GKP codes [10][11][12] for its simplicity, one needs to be careful to note that in real implementations of GKP error correction, this is not a physically accurate model [2,37] in general, but only reproduces the correct measurement statistics in specific cases in practice, such as when the finite squeezing error is applied to a perfect GKP state and interpreted as channel or when GKP states undergo a 0−photon loss event. The distance measure that we introduce in the following merely assumes that larger phase-space displacements are more likely than smaller ones, which is a natural choice and is sufficiently meaningful to indicate the robustness of the code with respect to realistic noise sources as also demonstrated in recent experiments [8]. x .
For CSS GKP codes, i.e., for which we have L = L q ⊕ L p as specified earlier, we can further distinguish ∆ q := min

Tradeoffs and bounds for GKP codes
Before discussing how the distance of GKP codes can be computed in general, we present a few results that relate the distance of GKP codes to other code properties such as number of modes n of the code, the encoded logical dimension d = 2 k and size of stabilizers.

Lemma 1 (Distance bound).
Remember that λ 1 L ⊥ denotes the shortest non-zero vector in the dual lattice. We have Proof. Because the lattice vector 0 = x ∈ L ⊥ /L for which x is minimal is also in L ⊥ this holds trivially.
We have already seen in the previous section that for GKP codes obtained from scaling a symplectically self-dual lattice so the distance decreases while the size of the stabilizers and number of encoded logical dimensions increases. In particular, scaled codes are not straightforwardly scalable in the sense that we cannot increase the distance by adding generators while keeping the encoded logical dimensions fixed. It has been shown [38], however (see also ref. [13]), that symplectically self dual lattices in R 2n with λ 1 ≥ 2 n πe exist, implicating that it is possible to find sequences of codes that can be scaled to achieve rates R = log 2 λ, where ∆ loc is the distance of the local single mode GKP codes, such as ∆ = 2 − 1 2 for the square GKP code or ∆ = 3 − 1 4 for the hexagonal GKP code. Equality in eq. (65) holds when the code we consider is CSS or the local code is the hexagonal GKP code (such that all shortest nontrivial logical vectors have the same distance). Eq. (65) is verified by decomposing a shortest representative non-trivial logical vector L = ⊕ n i=1 l i into n local sub-blocks, where l i is a logical operator of the respective local code, such that we have L 2 ≥ d∆ 2 loc . The distance of a concatenated code is typically strictly larger than λ 1 L ⊥ , because the shortest dual vectors would correspond to stabilizer displacements, in particular if the input qubit stabilizer code is LDPC . This is e.g. the case for the concatenation of the square GKP code with surface-17 (see Fig. 1), where we have ∆ = 3/2, while λ 1 L ⊥ = λ 1 (L) = 1.
The length of the shortest vector in a lattice λ 1 (L) is the first of 2n successive minima of the lattice. Generally, the ith successive minimum λ i (L) , i ≤ 2n is defined to be the smallest r > 0, such that L contains i linearly independent vectors of length at most r. It holds that µ (L) ≥ λ 2n (L)/2, where µ (L) is the covering radius of the lattice L, i.e., the minimum radius µ, such that the union of closed balls B µ (x) , x ∈ L centred around each lattice point of L cover the entire space R 2n . A related quantity is the packing radius of the lattice ρ (L) = λ 1 (L)/2. Successive minima of the direct and dual lattice L * are related by so-called transference theorems, in particular we have We have noticed earlier that L ⊥ and L * differ only by an orthogonal transformation, therefore it holds that and we can apply eq. (66) to relate the distance to the length of stabilizer vectors.

Theorem 3 (Distance bound). For a GKP code with lattice L, distance ∆ and maximal length C of a basis vector for a fixed basis M we have
as well as Proof. The first bound follows immediately from Lemma 1 and eq. (66) by swapping the roles of L ⊥ and L, which is possible because L ⊥ ⊥ = L and further from C ≥ λ 2n (L). Similar for the second bound.
These bounds indicate an intimate relation between the lengths of the stabilizers in L and the distance of the GKP code, which we will expand on further in the next section.

Symplectic transformations
It is interesting to study how symplectic transformations change the code distance. In particular, since we have seen in Theorem 2 that GKP codes with equal standard form are symplectically equivalent, it is possible that for specific noise models a symplectic transformation of the stabilizers M → M S T can be used to improve the codes resilience to noise. It is clear that orthogonal (symplectic) transformations S satisfying S T S = I leave the distance invariant. This is not the case for squeezing. In particular if we consider a uniform squeeze applied to a CSS code, we have so that we can adapt the squeezing to account for potential bias in the noise, e.g. when For concatenated CSS GKP codes, we generally have such that squeezing the local codes by η is equivalent to increasing (decreasing) the upper level X/Z− distances d X/Z by a factor of η 2 . On the other hand, for natively unbiased noise it is also possible to squeeze the local code and employ a qubit quantum error correcting codes tailored towards biased noise such that ∆ q = ∆ p remains constant. Although such a setup leaves the distance invariant, it can still lead to improvements in the error correction procedure when dedicated decoders for the qubit error correcting codes are used, as was recently demonstrated in ref. [12]. Corollary 2 can also be used to derive an upper bound on the distance of a given code from symplectic equivalence as follows. Let us first consider a code L with generator M , encoding a single qubit within n modes. Suppose M is in canonical form, such that Corollary 2 implies that there exists a symplectic matrix S such that M = N S T with N the generator of the code in the corollary with logical dimension two. Since N is diagonal, the corresponding lattice L is trivially orthogonal, and so is the dual L ⊥ . The shortest non-trivial logical operators are thus immediately found as η T ,1 = 1/ √ 2, 0 T 2n−1 and η T ,2 = 0, −1/ √ 2, 0 T n−2 , . We can now recall that commutation relations for the displacements are related to symplectic products of the corresponding phase space vectors and that S preserves symplectic products. Hence the transformation S maps all points in L ⊥ that correspond to stabilizers, x ∈ L ⊂ L ⊥ , to direct lattice points Sx ∈ L, which are stabilizers of L, and all non-trivial logical operators to non-trivial logical operators. Therefore, we can readily write down two logical operators, η 1 , η 2 ∈ L ⊥ \ L, as η j = Sη ,j whose lengths are Note that the bound is not necessarily tight. One can further relate the distance to the squeezing contained in S. Applying the Bloch-Messiah or Euler decomposition [39] we can write S = R 2 KR 1 with R j symplectic orthogonal matrices and K = diag {k 1 , . . . , k n , 1/k 1 , . . . , 1/k n } with k l ∈ (0, ∞) denoting an effective squeezing operation. Similar to ref.
[15], we denote by sq (S) = EV max (S T S) the root of largest eigenvalue of S T S, or equivalently, the largest squeezing factor in the Bloch-Messiah decomposition of the associated symplectic matrix. Finally, we obtain The bound presented above generalizes straightforwardly to codes with higher logical dimension, such that we obtain the following bound.

Theorem 4 (Squeezing bound to the distance). Let L = L (M ) specify a GKP code with symplectic Gram matrix A = J 2 ⊗ D in its canonical form. Further let S denote the symplectic matrix that transforms between M and the generator N as specified in Corollary 2. We have
This bound is interesting since it, similar to the bound presented in ref. [15], bounds a benchmark for error correcting capabilities of a code by the squeezing measure of the Gaussian unitary necessary to prepare the code state. In ref. [15] that bound implies a no-go theorem on the existence of thresholds for oscillator into (many-) oscillator codes by the assumption that the squeezing measure sq (S) is naturally bounded. Here, it is already known that code families with increasing distance exist, e.g., given by concatenation of single mode GKP codes with the surface code which have distance scaling as ∆ ∝ n 1/4 , where n is the number of modes. The crucial difference between our scenarios is, however, that ref. [15] focuses on the channel coding setup such that each code state necessarily is prepared by a Gaussian unitary encoding channel, while in the general quantum error correction setting such as considered here, code states can be formed by measurements of stabilizers (possibly of a LDPC code) and correction via application of displacement operators, forgoing the absolute constraint posed by the squeezing measure. Similar to the argument in ref. [15], Theorem 4, however, does restrict the possible effective protection a code state prepared via a Gaussian unitary acting on code states obtained from the associated normal form as in Corollary 2. Finally, it is worth mentioning that, by the Bloch-Messiah decomposition, a non-trivial squeezing content sq (S) as specified in Theorem 4 is a necessary ingredient to obtain codes with non-orthogonal lattices and, effectively, non-trivial distance scaling.

Computing the distance
In general, computing the distance of a GKP code given only the lattice L or a corresponding basis M is computationally hard. Given a non-trivial logical displacement ξ ⊥ ∈ L ⊥ , a candidate for the distance is computed by fully reducing ξ ⊥ with respect to the lattice L, that is one needs to find the length of the shortest representative of ξ ⊥ modulo the lattice L. Equivalently, it is necessary to solve the optimization-closest vector problem (optCVP) defined as optCVP (x, L) := min A related problem is the (search) closest vector problem (CVP) that aims at identifying the closest lattice vector to the input CVP (x, L) := arg min which given inputs ξ ⊥ and L, outputs the shortest representative of ξ ⊥ . These problems are known to be NP-hard. Naively, one may be tempted to try to identify the shortest logical vectors by going through the rows of M ⊥ i = ξ ⊥ T i and rounding it element-wise to the closest element in L, i.e.
where x denotes the closest integer to x, 5 in other words identifying the shortest logical representatives with non-zero rows of Indeed, we have found numerically for the concatenated GKP code built on Surface-17 with M given in its HNF that this rounding method outputs the shortest logical representatives. This is, however, a lucky coincidence. It is known that the rounding method for solving CVP [40] perform poorly in general and only returns an accurate solution if the lattice basis is sufficiently well-behaved, e.g. when the rows of M are orthogonal. This is consistent with the fact that in general the solution of CVP is also hard to approximate better than up to an exponential factor in the dimension. In addition, it is not a priori granted that the basis for the symplectic dual M ⊥ consists of those vectors that correspond to the shortest logical displacements only up to stabilizers. Hence while this method allows to upper bound the distance ∆ of a general GKP code by the r.h.s. is not guaranteed to yield an accurate estimate of the code distance. Here, we propose a different strategy to compute the distance that is feasible in particular for scaled GKP codes and concatenated codes. We introduce the theta function of a lattice [16] where q = e iπz . D = x 2 2 , x ∈ L is the set of squared distances of L. We have also introduced the number of lattice vectors of a given length For integral lattices, i.e., when the corresponding (euclidean) Gram matrix satisfies G = M M T ∈ Z 2n×2n , we can set D = N and N m is given by the number of integer solutions n ∈ Z 2n to the equation n T Gn = m, which is an example of a Diophantine equation. We call the pair (D, N δ ) the distance distribution of the lattice L. The theta function converges and is holomorphic for Im(z) > 0. The first summands are given by where λ 1 = λ 1 (L) is the length of the shortest vector of the lattice and τ is known as the kissing number, the number of minimal-length vectors of L. It is known that the theta function for the (euclidean) dual of a lattice L ⊂ R 2n is given by which follows from the Poisson summation formula (see also ref. [41]). In particular, since we have seen that L * and L ⊥ only differ by an orthogonal transformation, which does not change the length of lattice vectors, and hence the theta function, we also have such that we can immediately obtain the theta function of L ⊥ whenever the the theta function of the direct lattice Θ L (z) is known. By definition of the theta function, the distance of a GKP code specified by L is given by the smallest non-zero power of q in and furthermore since we have that Θ L (z) is uniquely determined by the distance distribution (D, N δ ) of L, which by eq. (86) also fully specifies Θ L ⊥ (z). Note that Q L (z) > 0 since L ⊆ L ⊥ . We arrive at the following insight.
Theorem 5 (Code distance is specified by the distance distribution). The distance of a GKP code specified by L is uniquely determined by its distance distribution (D, N δ ).
The theta function of a scaled lattice is Many expressions of theta functions of symplectically self dual lattices, in particular those that also correspond to euclidean self-dual lattices are known in the literature [16] such that their corresponding distances can e.g. be estimated from a logarithmic fit for small q 1 of eq. (88), or by expressing Q in a basis for which the distance distribution is known. We have verified that this method works numerically for some small examples including single mode scaled codes and the concatenated GKP-repetition code using the weight-distribution as outlined below.
For concatenated (square) GKP codes, where L = Λ (Q) is given by a Construction A lattice, we can express the theta function using the weight enumerator. We first introduce the weight distribution of a linear code Q, which is given by the numbers with Hamming weight wt(q) = i. Crucially, the weight distribution {A i } 2n i=0 here refers to the Hamming-weight distribution of the symplectic representation of the qubit stabilizers. The weight enumerator is given by Using this definition, we can express the theta function of a construction A lattice [16] by straightforward computation where Since we see that we can find the theta function of a Construction A lattice corresponding to a concatenated code by means of the (Hamming) weight distribution of its (qubit) stabilizer group, we have similar to Theorem 5 and by eq. (65),

Corollary 3 (Distance of CSS qubit stabilizer code from weight distribution ). The distance d of a CSS qubit stabilizer code is fully determined by the weight distribution
i=0 of its stabilizers. We note that this corollary also follows from a quantum version of the weight enumerators defined by Shor and Laflamme [17] and Rains [18], which through their immediate relationship to the Quantum error correction conditions [42] impose strong restrictions on possible quantum error correcting codes. Generally, when L is integral (rational), Θ L (z) is a modular form 6 , i.e., it remains invariant under certain Möbius transformations and as a result can be expressed in a finite basis depending on the specific symmetry group of the theta function [43,41,16]. This avenue is interesting for the explicit computation of distances but extends beyond the scope of the present article. We thus defer further analysis of a modular forms approach to finding distances to future work.

Maximum likelihood decoding GKP codes
In this section, we discuss active quantum error correction and maximum likelihood decoding (MLD) for general GKP codes using the tools discussed in this work. The introduction to MLD follows closely the discussion in ref. [10]. We assume a stochastic Gaussian displacement noise channel as specified in eq. (57) with varianceσ 2 . For comparison with the literature, when the displacement operators are defined by a more "standard" convention without the overall constant √ 2π, this corresponds to a physical variance of σ 2 = 2πσ 2 . Upon sampling an error e and measuring the stabilizers, a syndrome vector of the form where M i = ξ T i is the i'th row of M . Since we are dealing with full rank lattices, given the syndrome, we can assign a pure error that has the same syndrome s as e as "initial guess" for the correction. The net displacement of amplitude e − η is necessarily in the dual lattice, and hence maps the code space to itself, but it may be logically non-trivial. It might thus be necessary to modify the initial guess by a logical vector (leaving the syndrome invariant), such that e − η is a stabilizer. Note that any η + l with l ∈ L ⊥ will lead to the same syndrome, so the choice of the additional logical displacement cannot be inferred from the syndrome alone. Rather, it is necessary to take the noise model into account. To find the appropriate logical post-correction, for every ξ ⊥ ∈ L ⊥ /L we evaluate the probabilities that, given syndrome s, the actual error is stabilizer equivalent to η(s) + ξ ⊥ , which is given by where [x] = {x + ξ, ξ ∈ L} and Pσ is as specified in eq. (57). This can be rewritten as proportional to the theta series of the packing P = L + η(s) + ξ ⊥ evaluated in z = i 2πσ 2 7 . Let D , Nδ denote the distance distribution of P. We can write the coset probabilities above in a small error or "low temperature expansion". 8 (101) 7 P as the translate of a lattice L is formally not a lattice, in particular P may not contain the origin. evaluated at q = exp −1/2σ 2 . Finally, MLD decoding is implemented by applying the total correction η = η(s) + arg max Methods to evaluate or sample the theta function of a lattice have been discussed in the literature [43]. Here, we find that, given an algorithm that reliably estimates the theta function of a packing, we can also approximately solve MLD decoding.

Minimum energy decoding (MED).
In the limitσ, q → 0 the sum (101) becomes sharply distributed around solutions with minimalδ. That is, the bulk of the sum (101) is determined by arg min The MLD correction then becomes η = η(s) + arg min The last line Eq (106) shows that this immediate version of MED requires solving CVP on the lattice L ⊥ . In the special case of a concatenated code, L = Λ (Q), we have that L GKP := x : √ 2x mod 2 = 0 with generator matrix M GKP = √ 2I 2n is a sublattice of L and its dual contains L ⊥ ⊆ L ⊥ GKP . In the literature, a common approach to solve MLD for concatenated GKP codes is to apply the above outlined CVP decoder to the superlattice L ⊥ GKP , which leaves a net qubit level syndrome to be decoded with a standard qubit decoder [12,11,10]. Solving CVP on L ⊥ GKP is easy since it is an orthogonal lattice and one can straightforwardly apply the rounding trick outlined in the previous section. However, as we see below in such a two-step approach the initial guess for the correction on the sublattice L GKP is arbitrary.
MLD decoding concatenated codes. For concatenated (square) GKP codes, we dissect the initial correction in two components such that reproduces the syndrome detected by the single-mode GKP stabilizers L GKP and η Q ∈ L ⊥ GKP = Z 2n / √ 2 is such that the composite initial guess is consistent with the overall syndrome. For notational clarity we suppress the explicit dependency on the syndrome s. The relevant theta function evaluates to where we see that we can w.l.o.g. reduce η Q , ξ ⊥ ∈ 1 √ 2 Z 2n 2 and consider the sum in the exponent x + √ 2η Q + √ 2ξ ⊥ to be carried out modulo 2. 9 We interpret the individual terms as proportional to an indicator for the likelihood of a local bit value where we have used the definition Overall, eq. (109) can then be rewritten as reproducing a form for the MLD probability similar to those provided in ref. [12] for the surface-GKP code. It is clear that this derivation can be carried out similarly for the concatenation with other single-mode GKP codes or more general codes, such as those derived from glued lattices discussed in the next section. The MLD probability in eq. (112) can be expressed using a local tensor network whenever the underlying qubit code is LDPC as has been demonstrated in refs. [44,12]. Although qualitatively similar, the effective local error probabilities in this formulation are not exactly the same as in refs. [11,12] since normalization constants bi∈Z2 f b i |η GKP i cannot be immediately pulled in from the global normalization P (s) below each f b i |η GKP i term. Besides the generality of this formulation of the MLD for GKP codes, it would be interesting to test whether it also provides a quantitative advantage in decoding. We examine this question more in-depth in a forthcoming publication.

Other constructions of GKP codes
In this section we present two constructions of GKP codes that go beyond the scaled and concatenated GKP codes that are based on lattice glueing and the lattice tensor product. We expect that such alternative constructions allow for more flexibility in designing codes in the future, in particular when noise varies in strength for different modes or when no physical locality restrictions are present such as in photonic architectures. The following constructions are adapted from the discussion of glued (euclidean) lattices and the lattice tensor product in refs. [16,45].

Glued codes beyond concatenation
We can understand concatenated GKP codes as GKP codes built on certain types of glued lattices, which include those obtained through Construction A. Here, we give a brief overview of glueing theory for symplectic lattices, leaning on the description in ref. [16]. We begin by dissecting a (glued) symplectic lattice with symplectic sublattice in a top-down approach to understand its structure and then move to a bottom-up approach to construct a glued lattice from a base lattice by appending an appropriate glue group. Let us assume that we have a 2n−dimensional symplectic lattice L that has a (symplectic) sublattice L 0 with direct sum structure Vectors v ∈ L can be written as where v i ∈ R ⊗ L i . The symplectic inner product of any v i with any vector of L i is integer, such that it can be concluded that v i ∈ L ⊥ i . Moreover we can add to any v i a vector from L i without changing the fact that v has integer symplectic inner product with any other vector of L. It hence suffices to demand v i ∈ L ⊥ i /L i . Such vectors are called glue vectors for L i , which in the coding language correspond to logical representatives of a local code. L ⊥ i /L i is also known as the (symplectic) dual quotient or glue group for L i . We can thus obtain symplectic lattices from a base lattice L 0 = k i=1 L i by adding vectors v of the form in eq. (114), where each v i ∈ L ⊥ i /L i . We also refer to the set of extra vectors v as the glue group G.
Conversely, in a bottom-up approach, a glued lattice L can be constructed by considering a general glue group G ⊆ L ⊥ 0 /L 0 and forming L = L 0 [G] = L 0 ∪G. G is cyclic and isomorphic to Z n1 ×..×Z nr , where Z n is the cyclic group of order n, and each n i is the order of the corresponding generator g i , i.e the smallest positive integer such that n i g i ∈ L 0 . The determinant of the glued lattice L 0 [G] can be computed as [45] To construct a symplectic glued lattice from a symplectic base lattice L 0 , it is important to take care that every g i has integer symplectic inner product with every other g j -i.e., G is itself a finite symplectic group and that each G has integer symplectic inner product with each x ∈ L 0 , i.e., G ⊂ L ⊥ 0 . It is easy to see that the earlier considerations are reproduced for L 0 = k i=1 L i . Using (116) we can obtain the logical dimension of GKP codes associated to glued lattices L 0 [G]. E.g. for a concatenated GKP-qubit code, G ⊂ L ⊥ 0 /L 0 is identified with the outer code with, say, r lineary independent generators, each with order n i = 2 in L 0 . L 0 = L( √ 2I 2n ), such that we compute |L 0 [G]| = 2 n−r = 2 k , consistent with what we would expect. Similar to the derivation for concatenated codes, we do not expect it to be hard to derive the distance of a glued lattice L 0 [G]. However, this quantity strongly depends on the specifications of the glue group L ⊥ 0 /L 0 and G which makes it difficult to write down a general solution in closed form.

Tensor product codes
Aside from the glueing construction, it is also possible to obtain new codes by taking outer products of lattices. The idea behind this construction is akin to product constructions known for qubit quantum error correcting codes, namely the hypergraph product codes by Tillich and Zemor [46], where the defining structure of the code is a hypergraph, and Homological product codes by Bravyi and Hastings [47], where the code is defined via a cell complex. For GKP codes, the defining structure of the codes is given by a lattices, such that the tensor product for lattices serves as an immediate candidate for a similar construction.
Let L 1 = L(M 1 ) ⊂ R 2 be a symplectic lattice with symplectic Gram matrix A 1 = M 1 J 2 M T 1 and L 2 = L(M 2 ) ⊂ R n an integral lattice with euclidean Gram matrix G 2 = M 2 M T 2 . The tensor product lattice is defined as L ⊗ = L(M 1 ⊗ M 2 ) = L 1 ⊗ L 2 ⊂ R 2n , i.e., a basis for L ⊗ is given by {(M 1 ) i ⊗ (M 2 ) j , i = 1, 2, j = 1, . . . , n}. L ⊗ is a symplectic lattice due to the decomposition J 2n = J 2 ⊗ I n , and its symplectic Gram matrix reads which is integral by construction. The canonical dual basis is given by which forms a basis for the symplectically dual lattice L ⊥ ⊗ = L ⊥ 1 ⊗ L * 2 . We have Theorem 6 (Distance of tensor product codes). The distance of the tensor product code where x .
Proof. The proof is analogous to that of Lemma 2 in ref. [47]. To prove the upper bound, let x ∈ L ⊥ 1 /L 1 , y ∈ L * 2 /L 2 , be minimal non-trivial logical representatives of each component codes.
∈ Z (note that the symplectic inner product sets the commutation phase for the associated displacement operators). As such, we have obtained a non-trivial logical operator x⊗y ∈ L ⊥ ⊗ /L ⊗ and ∆ ⊗ ≤ x⊗y = ∆ 1 ∆ 2 . Let 0 = ψ ∈ L ⊥ ⊗ /L ⊗ be a minimal length non-trivial vector. We can always choose 0 = c ∈ L ⊥ 1 /L 1 and d ∈ L 2 such that Let vec −1 (ψ) be the un-vectorization of ψ, i.e., if ψ for all choices of c, d, such that ψ is logically trivial, which is not the case by assumption. Hence, vec −1 (ψ)d is a non-trivial representative of L ⊥ 1 /L 1 . Using where · F is the Frobenius norm. We can always choose d ∈ L 2 with length at most the covering radius λ n (L 2 ) that satisfies eq. (123). This is because any d ∈ L 2 can be written in a basis When d satisfies eq. (123), we have There must be at least one summand i = x, for which a x (c ⊗ ξ x ) T (J 2 ⊗ I n )ψ ∈ Z. Since a x ∈ Z, it must hold that (c ⊗ ξ x ) T (J 2 ⊗ I n )ψ ∈ Z. Finally, we obtain Following the same procedure, we choose c ∈ L 1 , d ∈ L ⊥ 2 /L 2 such that eq. (123) is satisfied to show that ψ c ≥ ∆ 2 .

Conclusions and future work
In this work, we have shown how some of the core concepts of lattice theory can be fruitfully used to analyse the structure of GKP codes. We have introduced the notion of a euclidean code distance for GKP codes and shown its relation with other relevant code parameters, in particular the trade-off with the encoding rate and length of stabilizer operators. We have examined the structure of particular GKP code constructions, such as scaled and concatenated GKP codes and shown how extensions of those constructions can be obtained using tools already present in the lattice theory literature. Using a lattice theoretic perspective when discussing bounds on GKP code parameters, we observed that the distance of the code is intimately related to the length of the stabilizers. Leveraging the natural embedding of qubit codes in R 2n provided by the concatenation with GKP codes we have shown in Corollary 3 how this result leads to a new proof of a similar property for qubit stabilizer codes, which is simpler than those found in the literature. This highlights how concepts from lattice theory can also become valuable tools to understand qubit stabilizer codes. Concerning the role of symplectic operations, which are central both in the theory and experiments with bosonic systems, we have clarified which GKP codes are related through a symplectic transformation, extending previous results for the single-mode case. This can also be interpreted as code-switching via Gaussian unitaries. In particular, we have identified a necessary and sufficient condition in the equality of the symplectic Gram matrix in standard form.
We have discussed how the GKP codes highlighted in this work can be decoded in terms of a general maximum likelihood decoder for the GKP code, for which the defining logical coset probability is given by the lattice theta function. Algorithms to approximate or sample theta functions have been discussed in the literature [43], which we identify as possible route forward to build general purpose decoders for GKP codes. More details on the practical implementation of decoders are, however, to appear in a separate publication.
The theta function of the GKP code lattice is also proven to encode information about the distance of GKP codes. It is known that, depending on the lattice, the theta function may possess certain symmetries under conformal transformations, which allow it to be represented in a finitely generated basis. In other words, if the theta function has certain symmetries (e.g. invariance under z → z + 2 for integral lattices) there exists a finite basis classified by the symmetry which can be used to write the theta function. This can also potentially be useful for decoding. In general, it would be interesting to further investigate the connection between the code distance and possible conformal symmetries of the theta function of the lattice.
It is worth mentioning that the theta function of glued lattices also appears in place of the partition function of certain string theories [45]. Given that it represents the MLD probability discussed in the Section 6, which has also been interpreted in the past as the partition function of a statistical mechanics model [48,10], it is an interesting open question whether a rigorous connection between string theories and the statistical mechanics model for decoding GKP codes can be leveraged to obtain a deeper understanding for either.
Finally, we have discussed constructions of GKP codes beyond scaled-and concatenated codes. We have seen that the toolbox of lattice theory allows for a remarkably versatile set of code constructions which have great potential for the search of good code families with potentially better parameters, better performance tailored to particular physical implementations or allowing for better decoders relying on the structure of the lattice, without reference to an intermediate qubit decoder. Further generalizations of GKP code constructions, such as subsystem variants by constructions on shifted lattices [45] also seem possible. Overall, we hope that this work will stimulate further interest in examining stabilizer codes, and in particular GKP codes, through the lens of lattice theory and will provide a foundation to import useful tools for the study of bosonic error correction.

A Code space of GKP codes
In this section, we show how the code space of a general GKP code can be represented in terms of the Wigner function of the code space projector In particular, this illustrates in how far the code space is non-trivially influenced by the choice of pivot basis for the GKP code and the phase-sector φ M . Consistent with our non-standard definition of the displacement operator, we define the generalized Wigner function of an operator O [49,50] such that we also have And we equip us with the following lemma.
Lemma 2 (Dirac comb representation). Let L ⊆ R 2n be a lattice with generator M with symplectic dual L ⊥ , we have Proof. We compute straightforwardly using one dimensional Poisson We compute the Wigner function of the code space projector of a GKP code defined with primal basis M When φ M = 0 mod 2π, such as when the GKP code is defined with symplectically even lattice, we can compute the sum using Lemma 2, such that the Wigner function is precisely given by a generalized Dirac comb over the dual lattice L ⊥ . When φ M = 0 mod 2π, however, this is no longer true. The above expression will also be substantially different from a mere shift of the Dirac comb over the lattice since φ M is generally a quadratic function. We can express it compactly using the general Riemann theta function [51] ϑ as Note, however, that A does not have positive definite imaginary part so that, similar to the Dirac comb above, this expression does not converge. This is a general artefact of exact GKP states discussed here which are unphysical as presented and, in practice, will be endowed with particular regularizing functions depending on the concrete physical implementation. When such regularization is present, the corresponding sum can be expressed using the following generalization of Poisson resummation.

Lemma 3 (Poisson resummation).
Let L ⊆ R 2n be a lattice with symplectic dual L ⊥ , we have for all Schwartz functions f : R 2n → C, wheref is the symplectic Fourier transform of f .
Proof. We proof this fact following the analogous proof using the usual Fourier transform provided in [41]. First define F (z) = ξ∈L f (z + ξ) .
This function is invariant under transformations z → z + L, such that it descends to a function on R 2n /L and has Fourier expansion whereF (y) = 1 det (L) R 2n /L dx F (x) e i2πx T Jy .
Using lemma 2 the correctness of the Fourier expansion can be straightforwardly verified. Let P ∼ R 2n /L be a fundamental domain of L. We compute for y ∈ L ⊥ (such that e i2πx T Jy is well defined on x ∈ R 2n /L) det (L)F (y) = such that we have F (z) = 1 det (L) Taking z = 0 completes the proof.
We use Lemma 3 to compute the Wigner function of a GKP code, where we include generic Gaussian regularization parametrized by > 0.
where we have defined B = I − iM −1 A M −T . We observe that for A = 0 in the limit → 0 we again obtain eq. (139). However, in general for odd A the Wigner function is modified nontrivially. In this example the regularization was chosen generically without reference to a clear physical motivation other than that physical states need to be normalizable. It would be interesting to further study how the structure of a physical model of the code space changes with A in the Wigner representation for alternative regularization schemes such as ones discussed in ref. [52].

B GKP Codes from degenerate lattices
In this section we briefly discuss how degenerate symplectic lattices can be used for encoding continuous degrees of freedom into a collection of n oscillators, following the definition and analysis in [23,15]. To simplify the notation we will work in the convention wherex = (q 1 ,p 1 , . . . ,q n ,p n , ) and the symplectic form is J = I n ⊗ J 2 . We encode a state vector |ψ ∈ H ⊗k describing k oscillator modes into H ⊗n by appending it with the ancillary state vector |A = |GKP ⊗r , where r = n − k, and acting on the composite state with a Gaussian unitary U S (see fig. 5). Each state vector |GKP is the unique code state of the GKP stabilizer group described by M GKP = I 2 , the symplectic self-dual square lattice, such that the overall ancillary state vector |A is stabilized by a GKP stabilizer group S A associated to a lattice generated by M A = I 2r which we denote by L A = L (M A ). The code state is hence described by and is stabilized by displacements associated to the lattice L osc generated by the rows of where we used 0 2k to denote the 2k ×2k zero-matrix. We denote the corresponding stabilizer group by S osc . It is immediate that M osc is not a full rank matrix, such that there will be a continuum of solutions x to M Jx = 0 mod 1.
In contrast to the encoding of qubits and qudits, where logical operations are encoded in the discrete collection of cosets of the quotient lattice, the oscillator-to-oscillator encoding does not immediately inherit error correction properties from an underlying notion of (euclidean) distance, where displacements of amplitude below a certain threshold are guaranteed to not harm the logical information. Instead, the protection stems from that fact that the encoding unitary can be tailored to correlate error displacements between the data-and the ancillary modes such that measuring the stabilizers S A of the ancillary system allows to diagnose the error that incurred on the data modes. That is, when the error is promised to be sufficiently small, the modular quadrature information gained from measuring S A reveals the actual displacement error value. Let N denote the Gaussian displacement channel. We then have that ρ 0 = |ψ ψ| ⊗ |A A| undergoes the evolution that is ρ 0 effectively undergoes a Gaussian displacement channel with covariance Σ = σ 2 S T S −1 .
This scheme can be understood as generalization and QEC application of the displacement-sensor setup developed in [53].
For concrete examples and further details on the oscillator-to-oscillator encoding we refer the reader to ref. [23] and for analysis of the possibility of a threshold to ref. [15]. Figure 5: Oscillator-to-oscillator encoding of ref. [23].sA denotes the Eigenvalues obtained from measuring the generating set of stabilizers in SA and h(·) an estimator function that estimates the logical shift based onsA.
To go beyond the encoding of either continuous or discrete information into a collection of oscillators, we remark that this scheme can be extended to host both continuous and discrete information. One way to do so is by choosing as input ancillary state vector |A a code state of a non-trivial GKP code described by a lattice L (M A ) with | det M A J 2r M T A | > 1 such as one discussed in the main body of this work. Here, the ancillary state on the second register H ⊗r would host all the discrete information with the addition that the errors applied to it may be (depending on the choice of S) strongly correlated with the errors on the first register H ⊗k that hosts continuous information. The stabilizer measurements S A would hence also reveal information about the exact displacement the first register H ⊗k has undergone where λ 1 L ⊥ A sets the scale for the variance up to which the modular measurement outcomess A still accurately estimate the exact shift on the first register (it needs to lie inside the dual Voronoi cell V ⊥ of L ⊥ A ). As far as we know (see, e.g., Theorem 3) this does not need to limit the euclidean distance ∆ with which the discrete information is protected. We note that this hybrid scheme is equivalent to a setup where a GKP encoded discrete variable state is considered part of the CV input |ψ . A more in-depth analysis of such hybrid scheme extends beyond the scope of this work and is therefore deferred to future work.