# Correcting biased noise using Gottesman-Kitaev-Preskill repetition code with
noisy ancilla

Zhifei Li  Daiqin Su<EMAIL_ADDRESS>MOE Key Laboratory of Fundamental
Physical Quantities Measurement, Hubei Key Laboratory of Gravitation and
Quantum Physics, PGMF, Institute for Quantum Science and Engineering, School
of Physics, Huazhong University of Science and Technology, Wuhan 430074, China

###### Abstract

Concatenation of a bosonic code with a qubit code is one of the promising ways
to achieve fault-tolerant quantum computation. As one of the most important
bosonic codes, Gottesman-Kitaev-Preskill (GKP) code is proposed to correct
small displacement error in phase space. If the noise in phase space is
biased, square-lattice GKP code can be concatenated with XZZX surface code or
repetition code that promises a high fault-tolerant threshold to suppress the
logical error. In this work, we study the performance of GKP repetition codes
with physical ancillary GKP qubits in correcting biased noise. We find that
there exists a critical value of noise variance for the ancillary GKP qubit
such that the logical Pauli error rate decreases when increasing the code
size. Furthermore, one round of GKP error correction has to be performed
before concatenating with repetition code. Our study paves the way for
practical implementation of error correction by concatenating GKP code with
low-level qubit codes.

##  I Introduction

Noise is the main hindrance to achieve large-scale fault-tolerant quantum
computation. Quantum error correcting code is introduced to correct errors by
using redundancy in the Hilbert space Shor (1995); Gottesman (1997); Terhal
(2015). Bosonic codes protect finite-dimensional logical space by encoding it
in an infinite-dimensional bosonic quantum system Weedbrook et al. (2012);
Braunstein and Van Loock (2005), e.g., a simple harmonic oscillator. Compared
to the standard qubit codes that encode a single logical qubit using many
physical qubits, the bosonic code is more hardware efficient and is subject to
a smaller number of noisy channels Albert et al. (2018a); Cai et al. (2021).
Currently well established bosonic codes include Gottesman-Kitaev-Preskill
(GKP) code Gottesman et al. (2001); Grimsmo and Puri (2021), cat code Cochrane
et al. (1999); Ralph et al. (2003), binomial code Michael et al. (2016); Hu et
al. (2019); Albert et al. (2018b), and rotation-symmetric code Grimsmo et al.
(2020); Endo et al. (2022). The GKP code is one of the most promising bosonic
codes, which corrects small displacement errors in phase space and also photon
loss Albert et al. (2018a); Noh et al. (2018). Although the GKP code has been
proposed for two decades Gottesman et al. (2001), it is prepared only recently
in ion-trapped Flühmann et al. (2019); De Neeve et al. (2022) and
superconducting Campagne-Ibarcq et al. (2020) platforms, and is used to extend
the decoherence time of the logical qubit through error correction. The GKP
code has promising advantages in optical quantum information processing
Baragiola et al. (2019), however optical GKP states have not been
experimentally generated due to the stringent requirement for strong
nonlinearity, though various preparation schemes have been proposed
Vasconcelos et al. (2010); Su et al. (2019); Eaton et al. (2019); Hastrup and
Andersen (2022); Dahan et al. (2023).

In order to achieve fault tolerance, the common strategy is to concatenate the
GKP code with qubit codes to further suppress the logical error. Examples
include concatenation with surface/toric codes Fukui et al. (2018); Vuillot et
al. (2019); Hänggli et al. (2020); Noh and Chamberland (2020); Bourassa et al.
(2021); Noh et al. (2022), color code Bombin and Martin-Delgado (2006); Fowler
(2011); Zhang et al. (2021) etc. Concatenation with qubit codes with a high
threshold enables a low squeezing threshold for the GKP states around 10 dB
Fukui et al. (2018), which is within the reach of near-term technologies. A
variant of the original surface code, known as the XZZX surface code Bonilla
Ataides et al. (2021), has recently been shown to have a higher threshold for
biased noise. It is expected that concatenation of GKP code with XZZX surface
code would enable lower squeezing threshold if the displacement error is
biased Zhang et al. (2023). This can happen in two cases, either the noise is
biased and a square-lattice (isotropic) GKP code is used, or the noise is
isotropic and a biased GKP code is used. However, syndrome measurement and
decoding are still complicated for the XZZX surface code Higgott (2022), which
therefore consume more physical and computational resources. A relatively
easier scheme to suppress biased noise is to concatenate GKP code with
repetition code Stafford and Menicucci (2022), which requires easier syndrome
measurement and decoding, and has a higher threshold. In Ref. Stafford and
Menicucci (2022), the error threshold has been estimated for biased GKP
repetition code with isotropic noise, which outperforms the biased planar
surface code Hänggli et al. (2020). However, both the data and ancillary GKP
qubits are assumed to be ideal, namely, with infinitely energy. The error
threshold as derived in Ref. Stafford and Menicucci (2022) therefore only
provides an upper bound, and the requirement is more stringent when the
imperfections from the ancillary GKP qubits are taken into account.

In this work, we study the concatenation of square-lattice GKP code with
classical repetition code to correct biased displacement errors, where both
the data and ancillary GKP qubits are physical. The error correction procedure
consists of four steps: encoding, one round GKP error correction, syndrome
measurement on repetition code and recovery operation according to the
measurement outcomes. We find that the GKP error correction before
concatenation in general increases the error rate of the GKP code and modifies
the error profile, however, it is necessary in order to exploit the power of
code concatenation. We also find that the logical Pauli error rate decreases
when increasing the size of the repetition code if the noise variance of the
ancillary GKP qubits is sufficiently small, while the the logical Pauli error
rate increases when increasing the size of the repetition code if the noise
variance is too large. This implies that there exists a critical value of
noise variance for the ancillary GKP qubits below which the code concatenation
shows advantages. Our results set an upper bound for the noise variance of the
ancillary GKP qubit such that the concatenation with repetition code is
useful.

The paper is organized as follows. In Sec. II we briefly review the ideal and
physical GKP states, and introduce the biased noise model. We then discuss the
GKP error correction with physical ancillary GKP qubits to correct small
displacement error in position space in Sec. III. In Sec. IV we concatenate
the GKP code with repetition code to reduce the logical Pauli error rate in
position space and estimate the critical value of noise variance for the
ancillary GKP qubit. Then in Sec. V we use GKP repetition code to correct
biased noise to reduce the overall logical error rate, taking into account the
displacement errors in both position space and momentum space. We finally
conclude in Sec. VI.

##  II Background

###  II.1 Preliminaries

We briefly review the notations used throughout this paper Gerry and Knight
(2005); Weedbrook et al. (2012). The annihilation and creation operators of a
single bosonic mode are denoted as $\hat{a}$ and $\hat{a}^{\dagger}$,
respectively, and satisfy the commutation relation
$[\hat{a},\hat{a}^{\dagger}]=1$. The position quadrature $\hat{q}$ and
momentum quadrature $\hat{p}$ are defined as

$\displaystyle\hat{q}=\frac{1}{\sqrt{2}}(\hat{a}+\hat{a}^{\dagger}),~{}~{}~{}~{}~{}~{}\hat{p}=\frac{i}{\sqrt{2}}(\hat{a}^{\dagger}-\hat{a}),$
(1)

and they satisfy the commutation relation $[\hat{q},\hat{p}]=i$, where we have
used the unit $\hbar=1$. This definition implies that the variance of the
vacuum state is normalized to $1/2$.

The displacement operator
$\hat{D}(\alpha)=e^{\alpha\hat{a}^{\dagger}-\alpha^{*}\hat{a}}$, with $\alpha$
a complex number, represents a displacement of the quantum state in phase
space. It is also useful to define $\hat{X}(u)$ and $\hat{Z}(v)$ as

$\displaystyle\hat{X}(u)=e^{-iu\hat{p}},~{}~{}~{}~{}~{}~{}\hat{Z}(v)=e^{iv\hat{q}},$
(2)

which represent a displacement of the position quadrature with $u$ and a
displacement of the momentum quadrature with $v$, namely,

$\displaystyle\hat{X}^{\dagger}(u)\hat{q}\hat{X}(u)=\hat{q}+u,~{}~{}~{}~{}~{}~{}\hat{Z}^{\dagger}(v)\hat{p}\hat{Z}(v)=\hat{p}+v.$
(3)

If $\ket{s}_{q}$ and $\ket{s}_{p}$ are the position and momentum eigenstates,
respectively, then

$\displaystyle\hat{X}(u)\ket{s}_{q}=\ket{s+u}_{q},~{}~{}~{}~{}~{}~{}\hat{Z}(v)\ket{s}_{p}=\ket{s+v}_{p}.$
(4)

A general displacement operator can be written as

$\displaystyle\hat{D}(u,v)=e^{-iu\hat{p}+iv\hat{q}}=e^{iuv/2}\hat{X}(u)\hat{Z}(v).$
(5)

The squeezing operator $\hat{S}(s)$ is defined as

$\displaystyle\hat{S}(s)=e^{i\ln(s)(\hat{q}\hat{p}+\hat{p}\hat{q})/2},$ (6)

where $s>0$ is the squeezing factor, and its action on the position and
momentum quadratures is

$\displaystyle\hat{S}^{\dagger}(s)\hat{q}\hat{S}(s)=\frac{1}{s}\,\hat{q},~{}~{}~{}~{}~{}~{}\hat{S}^{\dagger}(s)\hat{p}\hat{S}(s)=s\,\hat{p}.$
(7)

It is evident that if $s>1$ then the position is squeezed and the momentum is
anti-squeezed, while if $s<1$ then the position is anti-squeezed and the
momentum is squeezed. A squeezed vacuum state is obtained by applying the
squeezing operator to the vacuum state,

$\displaystyle\ket{s}_{\rm sq}=\hat{S}(s)\ket{0}.$ (8)

The variance of any quadrature in the vacuum state is the same, $\sigma_{\rm
vac}^{2}=1/2$; while in the squeezed vacuum state, the variances of the
position and momentum are not the same and are given by

$\displaystyle\sigma_{\rm q}^{2}=\frac{1}{2s},~{}~{}~{}~{}~{}~{}\sigma_{\rm
p}^{2}=\frac{1}{2}s,$ (9)

respectively.

A two-mode unitary operator that is frequently used throughout this paper is

$\displaystyle\hat{U}_{2}=e^{-i\hat{q}_{1}\hat{p}_{2}},$ (10)

which is known as the SUM gate Gottesman et al. (2001). The action of the SUM
gate on the position and momentum quadratures is given by

$\displaystyle\hat{q}_{1}\rightarrow\hat{q}_{1},\quad\hat{p}_{1}\rightarrow\hat{p}_{1}-\hat{p}_{2},$
(11)
$\displaystyle\hat{q}_{2}\rightarrow\hat{q}_{2}+\hat{q}_{1},\quad\hat{p}_{2}\rightarrow\hat{p}_{2}.$

The state of a continuous-variable (CV) quantum system can be represented by
the Wigner function, which is defined in the $q$-$p$ phase space as

$\displaystyle W(q,p)=\frac{1}{\pi}\int{\rm
d}y\,e^{-2ipy}{}_{q}\bra{q-y}\hat{\rho}\ket{q+y}_{q},$ (12)

where $\hat{\rho}$ is the density matrix.

###  II.2 GKP states

The ideal GKP states are common eigenstates of two commuting operators,
$\hat{S}_{q}=\hat{X}(2\sqrt{\pi})$ and $\hat{S}_{p}=\hat{Z}(2\sqrt{\pi})$,
known as the stabilizers Gottesman et al. (2001). Therefore, they form a two-
dimensional code subspace of an infinite-dimensional Hilbert space of a
bosonic system, the computational bases of which can be chosen as

$\displaystyle\ket{\bar{j}}=\sum_{n=-\infty}^{+\infty}\ket{(2n+j)\sqrt{\pi}}_{q},$
(13)

where $j=0,1$, and the subscript “$q$” indicates a position eigenstate. An
arbitrary ideal GKP state is a linear superposition of $\ket{\bar{0}}$ and
$\ket{\bar{1}}$. The wave functions of the basis states $\ket{\bar{0}}$ and
$\ket{\bar{1}}$ in position space are given by

$\displaystyle\bar{\psi}_{j}(q)=\sum_{n=-\infty}^{+\infty}\delta\big{(}q-(2n+j)\sqrt{\pi}\,\big{)}.$
(14)

It is evident that the wave function of an ideal GKP state is a superposition
of a sequence of Dirac delta functions with a fixed period $2\sqrt{\pi}$.

Ideal GKP states are unphysical and cannot be prepared in experiments, though
sometimes it is easier to analyze them and some instructive results can be
derived. A physical GKP state is a linear superposition of squeezed coherent
states with finite squeezing. Mathematically, the physical GKP state can be
obtained through coherently superposing randomly displaced ideal GKP states
that follow a given probability distribution Gottesman et al. (2001); Grimsmo
and Puri (2021), namely,

$\ket{\tilde{\psi}}=N\int{\rm d}u{\rm
d}v\,\eta(u,v)e^{-iu\hat{p}+iv\hat{q}}\ket{\bar{\xi}},$ (15)

where $\ket{\bar{\xi}}$ is an ideal GKP state, $N$ is a normalization factor
and $\eta(u,v)$ is the probability amplitude describing the quantum diffusion
process, which is chosen as a two-dimensional Gaussian distribution throughout
this paper,

$\eta(u,v)=\frac{1}{\sqrt{\pi\kappa\Delta}}\exp\left[-\frac{1}{2}\left(\frac{u^{2}}{\Delta^{2}}+\frac{v^{2}}{\kappa^{2}}\right)\right],$
(16)

with $\Delta$ and $\kappa$ the standard deviations of the Gaussian
distribution. It can be shown that the physical GKP state defined in Eq. (15)
is normalizable (see Appendix A for details) and therefore contains a finite
amount of energy. In the limit of $\Delta\rightarrow 0$ and $\kappa\rightarrow
0$, the physical computational basis states can be approximated as

$\displaystyle\tilde{\psi}_{j}(q)=\bigg{(}\frac{4\kappa^{2}}{\pi\Delta^{2}}\bigg{)}^{1/4}\sum_{n=-\infty}^{+\infty}e^{-\pi(2n+j)^{2}\kappa^{2}}$
$\displaystyle\times\exp\bigg{\\{}-\frac{\big{[}q-(2n+j)\sqrt{\pi}\,\big{]}^{2}}{2\Delta^{2}}\bigg{\\}}.$
(17)

###  II.3 Noise model

The noise model that we consider is an anisotropic Gaussian displacement
channel (GDC), namely, the noise in one quadrature and its conjugate
quadrature may not be the same. Since we use the square-lattice GKP code, a
biased logical error will be induced due to the anisotropic GDC, which is
further corrected by concatenating with repetition code. This is equivalent to
the scheme where an isotropic GDC is considered while the GKP code is biased
Stafford and Menicucci (2022).

(a) $\Delta=0.25,r=1$

(b) $\Delta=0.25,r=\sqrt{2}$

Figure 1:  Wigner function for physical GKP states. (a) Wigner function of GKP
state with unbiased noise. (b) Wigner function of GKP state with biased noise.
The noise of momentum quadrature is suppressed, while the noise of position
quadrature is amplified.

Suppose $\hat{\rho}_{0}$ is an input density matrix, then the output density
matrix $\hat{\rho}$ after the anisotropic GDC is

$\displaystyle\hat{\rho}=\mathcal{N}_{f}(\hat{\rho}_{0})=\int{\rm d}u{\rm
d}vf(u,v)\hat{D}(u,v)\hat{\rho}_{0}\hat{D}^{\dagger}(u,v),$ (18)

where $\hat{D}(u,v)$ is the general displacement operator defined in Eq. (5),
and $f(u,v)$ is a bivariate Gaussian distribution,

$f(u,v)=\frac{1}{\pi\delta_{q}\delta_{p}}\exp\left(-\frac{u^{2}}{\delta_{q}^{2}}-\frac{v^{2}}{\delta_{p}^{2}}\right),$
(19)

with $\delta_{q}$ and $\delta_{p}$ the standard deviation of the position and
momentum quadratures, respectively. According to the definition of the GDC,
the input state is imposed a random displacement $\hat{D}(u,v)$ each time, and
the output state is an incoherent mixture of all possible displacements. This
implies that one can focus on a specific displacement each time when analyzing
the error correction.

Under the GDC, the Wigner function is transformed in a simple way,

$\displaystyle W(q,p;\hat{\rho})=\int{\rm d}u{\rm
d}vf(u-q,v-p)W_{0}(u,v;\hat{\rho}_{0}).$ (20)

This shows that the output Wigner function is a convolution of the input
Wigner function and the error distribution function. Although the physical GKP
state is not Gaussian, its Wigner function is a weighted sum of a sequence of
Gaussian functions. Since the convolution of two Gaussian functions gives also
a Gaussian function, the Wigner function of a physical GKP state after the GDC
is still a weighted sum of a sequence of Gaussian functions. In addition, the
variances of the output Gaussian functions are the sum of the variances of the
input Gaussian functions and error distribution function. Therefore, the
Wigner function is blurred after the GDC.

Note that the GDC is essentially different from the coherent superposition of
random displacements that involved in defining physical GKP states in Eq.
(15), in particular, a physical GKP state cannot be generated by simply
passing an ideal GKP state through a GDC (see Appendix A for details). The
physical GKP states have finite energy while the states obtained by passing
ideal GKP states through GDC are unphysical and have infinite energy. However,
these two sets of state have exactly the same noise property if we set

$f(u,v)=\left|\eta(u,v)\right|^{2}.$ (21)

This is clear when comparing their Wigner functions: the Wigner function of
the former is a weighted sum of a sequence of Gaussian functions, with the
weight decreases exponentially for large integers; the Wigner function of the
latter is a sum of the same Gaussian functions but with equal weight for all
integers. Therefore, we can treat the noise in the physical GKP state in the
same way as we treat the noise from the GDC when the envelope is irrelevant.

Since the displacement errors in position and momentum spaces are independent,
the error distribution of the physical GKP state given by Eq. (21) can be
factored into the position and momentum parts,

$f(u,v)=f_{q}(u)f_{p}(v),$ (22)

where the error distribution in position and momentum space is respectively
given by

$f_{q}(u)=\frac{1}{\sqrt{\pi}\Delta}e^{-\frac{u^{2}}{\Delta^{2}}},\quad
f_{p}(v)=\frac{1}{\sqrt{\pi}\kappa}e^{-\frac{v^{2}}{\kappa^{2}}}.$ (23)

The displacement noise we usually consider is unbiased, i.e., $\Delta=\kappa$.
In this paper, we consider GKP code with biased noise, where the noise in one
quadrature is suppressed while that in the conjugate quadrature is amplified.
The error distribution of biased noise can be parameterized as

$f_{q}(u)=\frac{1}{\sqrt{\pi}\,r\Delta}e^{-\frac{u^{2}}{(r\Delta)^{2}}},\quad
f_{p}(v)=\frac{r}{\sqrt{\pi}\,\Delta}e^{-\frac{v^{2}}{(\Delta/r)^{2}}},$ (24)

where $r$ is a real positive number and represents the bias level. By choosing
$r>1$, the noise in momentum space is suppressed while that in position space
is amplified. In this case, we can concatenate GKP code with repetition code
to suppress the logical Pauli error induced by the large displacement error in
position space. The Wigner function of GKP code with unbiased and biased noise
is shown in Fig. 1, where we choose $\Delta=0.25,r=1$ and
$\Delta=0.25,r=\sqrt{2}$ for comparison.

##  III GKP error correction with noisy ancillary qubits

In this section, we discuss the correction of displacement error in position
space using GKP code with ideal and noisy ancillary GKP qubits.

###  III.1 GKP error correction with ideal ancilla

Figure 2: Quantum circuit for GKP error correction. The ancillary GKP qubit is
prepared in state $\ket{\bar{+}}$ and then couples with the data GKP qubit via
a SUM gate. The position shift of the data qubit propagates to the ancillary
qubit and is detected by measuring the position of the ancillary qubit.
Recovery is finally executed according to the measurement outcome.

The quantum error correction circuit using SUM gate is shown in Fig. 2. The
ancillary qubit couples with the data qubit via the SUM gate, then its
position quadrature is measured and the measurement outcome is fed forward to
the data qubit Gottesman et al. (2001). Suppose the data qubit is prepared in
a physical GKP state $\ket{\tilde{\psi}}$ with $\eta(u,v)$ given by Eqs. (15)
and (16). Now we only consider correcting the displacement in position space
and rewrite $\ket{\tilde{\psi}}$ as

$\ket{\tilde{\psi}}=\int{\rm d}v\,\eta(v)e^{iv\hat{q}}\cdot\int{\rm
d}u\,\eta(u)e^{-iuv/2}\ket{\psi(u)},$ (25)

where $\ket{\psi(u)}$ is an ideal GKP state with position shifted by $u$,

$\left|\psi(u)\right\rangle=\alpha\sum_{s}\left|2s\sqrt{\pi}+u\right\rangle_{q_{1}}+\beta\sum_{s}\left|(2s+1)\sqrt{\pi}+u\right\rangle_{q_{1}}.$

The ancillary qubit is assumed to be in the ideal GKP $\ket{\bar{+}}$ state,

$\ket{\bar{+}}=\sum_{k}\left|k\sqrt{\pi}\right\rangle_{q_{2}}.$ (26)

According to the transformation rule of the SUM gate given by Eq. (11), the
state after the SUM gate is given by

$\displaystyle\int{\rm d}v\,\eta(v)e^{iv\hat{q}}\cdot\int{\rm
d}u\,\eta(u)e^{-iuv/2}$
$\displaystyle\times\bigg{[}\alpha\sum_{s,k}\ket{2s\sqrt{\pi}+u}_{q_{1}}\ket{(2s+k)\sqrt{\pi}+u}_{q_{2}}$
$\displaystyle+\beta\sum_{s,k}\ket{(2s+1)\sqrt{\pi}+u}_{q_{1}}\ket{(2s+k+1)\sqrt{\pi}+u}_{q_{2}}\bigg{]}$
$\displaystyle=\int{\rm d}v\,\eta(v)e^{iv\hat{q}}\cdot\int{\rm
d}u\,\eta(u)e^{-iuv/2}$
$\displaystyle\times\ket{\psi(u)}\bigg{(}\sum_{k}\ket{k\sqrt{\pi}+u}_{q_{2}}\bigg{)}.$
(27)

The homodyne measurement of the ancillary qubit gives a fixed value for
$\hat{q}_{2}$,

$q_{2}=k\sqrt{\pi}+u,$ (28)

with $k$ an integer. This implies that the superposition of different
displacements is destroyed and the state in Eq. (III.1) collapses to a
component with a fixed $u$. However, the superposition between GKP states
$\ket{\bar{0}}$ and $\ket{\bar{1}}$ (shifted by $u$) is preserved, since they
cannot be distinguished by the measurement outcome.

Figure 3: Distribution of no Pauli error zone (NPZ) and Pauli error zone (PZ).
$\text{PZ}_{0}$ is not defined for the sake of symmetry.

Since we consider small displacement errors, so with a high probability
$q_{2}$ deviates from $k\sqrt{\pi}$ in a small amount. Therefore, we infer the
true value of $u$ by subtracting from $q_{2}$ the nearest $k\sqrt{\pi}$.
Define a function $g(x)$, which gives the distance between $x$ and its nearest
$k\sqrt{\pi}$,

$g(x)=x-k\sqrt{\pi},~{}~{}~{}\text{ for }(k-\frac{1}{2})\sqrt{\pi}\leq
x<(k+\frac{1}{2})\sqrt{\pi}.$ (29)

So our guess for the value of $u$ is $g(q_{2})$ and we apply a displacement
$-g(q_{2})$ to the data qubit in order to correct the error. With a high
probability the displacement error can be corrected successfully, while
sometimes the error correction procedure can introduce a large displacement
error and therefore result in a logical Pauli error. Define the residual
displacement of the GKP state after the SUM gate and feed forward as

$u^{\prime}=u-g(q_{2})=u-g(u).$ (30)

If $\left|u-2k\sqrt{\pi}\right|<\sqrt{\pi}/2$, then $g(u)=u-2k\sqrt{\pi}$ and
$u^{\prime}=u-(u-2k\sqrt{\pi})=2k\sqrt{\pi}$, which means a stabilizer is
applied to the GKP state and no error occurs. If
$\left|u-(2k+1)\sqrt{\pi}\right|<\sqrt{\pi}/2$, then $g(u)=u-(2k+1)\sqrt{\pi}$
and $u^{\prime}=u-[u-(2k+1)\sqrt{\pi}]=(2k+1)\sqrt{\pi}$, which means a
stabilizer and a logical Pauli operator $\bar{X}$ that flips the computational
basis states are applied to the GKP state and a logical Pauli error occurs. We
divide the displacement error in position space into two different zones,
denoted as Pauli error zone (PZ) and no Pauli error zone (NPZ), according to
whether they lead to a logical Pauli error or not,

$\displaystyle\text{PZ}_{~{}}$ $\displaystyle=$
$\displaystyle\left\\{u:|u-(2k+1)\sqrt{\pi}|<\frac{\sqrt{\pi}}{2},~{}k\in\mathbb{Z}\right\\},$
NPZ $\displaystyle=$
$\displaystyle\left\\{u:|u-2k\sqrt{\pi}|<\frac{\sqrt{\pi}}{2},~{}k\in\mathbb{Z}\right\\}.$
(31)

For narrative convenience we define a serial number for PZ and NPZ,

$\displaystyle\text{PZ}_{m~{}}$ $\displaystyle=$
$\displaystyle\left[(2m-\frac{m}{\left|m\right|}-\frac{1}{2})\sqrt{\pi},(2m-\frac{m}{\left|m\right|}+\frac{1}{2})\sqrt{\pi}\right),$
$\displaystyle\text{NPZ}_{m}$ $\displaystyle=$
$\displaystyle\left[2m\sqrt{\pi}-\frac{\sqrt{\pi}}{2},2m\sqrt{\pi}+\frac{\sqrt{\pi}}{2}\right),$
(32)

with $m\in\mathbb{Z}$. Note that $\text{PZ}_{0}$ is not defined for the sake
of symmetry. The location of NPZm and PZm is shown in Fig. 3.

Figure 4: Relation between the logical Pauli $\bar{X}$ error rate and the
standard deviation of the probability distribution of the physical GKP state.

With these definitions the error correction procedure can be summarized as
follows:

$\displaystyle u$ $\displaystyle\in$ $\displaystyle\text{NPZ}\Rightarrow
u^{\prime}(\text{mod}\sqrt{\pi})=0~{}\Rightarrow~{}\text{perfect correction},$
$\displaystyle u$ $\displaystyle\in$ ${}_{~{}}\text{PZ}_{~{}}\Rightarrow
u^{\prime}(\text{mod}\sqrt{\pi})=\sqrt{\pi}~{}\Rightarrow~{}\text{Pauli}~{}\bar{X}~{}\text{error}.$

The failure probability of error correction, $P_{\bar{X}}$, which is also
known as the logical Pauli $\bar{X}$ error rate, is the probability that $u$
falls in the PZ.

$\displaystyle P_{\bar{X}}$ $\displaystyle=$
$\displaystyle\int_{\text{PZ}}f_{q}(u){\rm
d}u=\sum_{n=-\infty}^{+\infty}\int_{\sqrt{\pi}/2+2n\sqrt{\pi}}^{3\sqrt{\pi}/2+2n\sqrt{\pi}}f_{q}(u){\rm
d}u$ $\displaystyle=$
$\displaystyle\frac{1}{2}\sum_{n=-\infty}^{+\infty}\left[\text{erf}\left(\frac{4n+3}{2\Delta}\sqrt{\pi}\right)-\text{erf}\left(\frac{4n+1}{2\Delta}\sqrt{\pi}\right)\right].$

The relation between $P_{\bar{X}}$ and $\Delta$ is plotted in Fig. 4. We can
see that a smaller $\Delta$, which corresponds to a higher degree of
squeezing, leads to a lower logical Pauli $\bar{X}$ error rate.

###  III.2 GKP error correction with physical ancilla

We now consider a more realistic error correction procedure with physical
ancillary GKP qubits. Suppose the variances of the data and ancillary qubit of
the position quadrature are $\Delta^{2}$ and $\tilde{\Delta}^{2}$, and the
displacement errors in position space are $u_{1}$ and $u_{2}$, respectively.
The probability distribution of $u_{1}$ and $u_{2}$ are given by

$f_{q_{1}}(u_{1})=\frac{1}{\sqrt{\pi}\Delta}e^{-\frac{u_{1}^{2}}{\Delta^{2}}},\quad
f_{q_{2}}(u_{2})=\frac{1}{\sqrt{\pi}\tilde{\Delta}}e^{-\frac{u_{2}^{2}}{\tilde{\Delta}^{2}}}.$
(34)

According to the transformation rule of the SUM gate, one can show that the
measurement outcome of the ancillary qubit is

$q_{2}=k\sqrt{\pi}+u_{1}+u_{2}.$ (35)

However, both $u_{1}$ and $u_{2}$ are unknown. By using the same procedure as
before, we infer the true value of $u_{1}$ by subtracting from $q_{2}$ the
nearest $k\sqrt{\pi}$. This means our guess for the error in the data qubit is
$g(u_{1}+u_{2})$. This is not exactly the same as $u_{1}$ except that
$u_{2}=m\sqrt{\pi}$. However, this procedure is acceptable when $u_{2}$ is
sufficiently small. We then apply a displacement $-g(u_{1}+u_{2})$ to the data
qubit in order to correct its displacement error. The residual displacement in
the data qubit is

$\displaystyle u^{\prime}$ $\displaystyle=$ $\displaystyle
u_{1}-g(u_{1}+u_{2})=k\sqrt{\pi}-u_{2},$ (36) $\displaystyle\text{for
}(k-\frac{1}{2})\sqrt{\pi}\leq u_{1}+u_{2}<(k+\frac{1}{2})\sqrt{\pi}.$

It is evident that the residual displacement $u^{\prime}$ is continuous, in
contrary to the ideal case where $u^{\prime}$ is discrete. However, one can
still define whether a logical Pauli error occurs or not. When $u^{\prime}$ is
close to $2k\sqrt{\pi}$, no logical Pauli error occurs; when $u^{\prime}$ is
close to $(2k+1)\sqrt{\pi}$, a Pauli $\bar{X}$ error occurs.

In order to understand the error correcting property with physical ancillary
qubit and to evaluate the logical Pauli error rate, one needs to compute the
probability distribution of $u^{\prime}$, which is given by (see Appendix B
for details)

$\displaystyle F(u^{\prime})$ $\displaystyle=$
$\displaystyle\frac{1}{2\sqrt{\pi}\tilde{\Delta}}\left[{\rm
erf}\left(\frac{u^{\prime}+\frac{\sqrt{\pi}}{2}}{\Delta}\right)-{\rm
erf}\left(\frac{u^{\prime}-\frac{\sqrt{\pi}}{2}}{\Delta}\right)\right]$ (37)
$\displaystyle\times\sum_{t}{\rm
exp}\left[-\frac{(u^{\prime}-t\sqrt{\pi})^{2}}{\tilde{\Delta}^{2}}\right].$

We can see that $F(u^{\prime})$ is determined by a modulating term ${\rm
erf}[(u^{\prime}+\sqrt{\pi}/2)/\Delta]-{\rm
erf}[(u^{\prime}-\sqrt{\pi}/2)/\Delta]$ and a wave packet term
$\sum_{t}\exp\left[-\frac{(u^{\prime}-t\sqrt{\pi})^{2}}{\tilde{\Delta}^{2}}\right]$.
The former is determined by the degree of squeezing of the data qubit, while
the latter is determined by the degree of squeezing of the ancillary qubit.

Figure 5: Error distribution of GKP state after error correction with a
physical ancillary qubit. We choose $\Delta=0.5$ and compare results with
several different $\tilde{\Delta}$. The peaks outside $\text{PZ}_{\pm 1}$ are
strongly suppressed and a smaller $\tilde{\Delta}$ leads to a narrower peak in
$\text{NPZ}_{0}$, indicating a better correction to the small displacement
error. Figure 6: Relation between the failure probability
$P_{F}(\Delta,\tilde{\Delta})$ with physical ancillary qubit and
$\tilde{\Delta}$, with $\Delta$ fixed for each curve.

To have an intuitive feeling of the probability distribution, we plot several
examples of $F(u^{\prime})$ in Fig. 5. It can be seen that the distribution
has a high peak at $u^{\prime}=0$ and two low peaks that are located
symmetrically with respect to $u^{\prime}=0$. The peaks outside the ${\rm
PZ}_{\pm 1}$ are strongly suppressed by the modulating term, so the residual
displacement outside the ${\rm PZ}_{\pm 1}$ can be neglected. Additionally, a
smaller $\tilde{\Delta}$ leads to a narrower distribution of $u^{\prime}$ in
the ${\rm NPZ}_{0}$, showing a better performance of error correction. This
can be understood in an intuitive way: error correction using the SUM gate is
basically to substituting the error of the data qubit by the error of the
ancillary qubit, hence an ancillary qubit with higher quality naturally leads
to a better performance of error correction. If the ancillary qubit is ideal,
i.e., $\tilde{\Delta}=0$, then the distribution of $u^{\prime}$ approaches to
a delta function, which means the state can be perfectly corrected.

The error correction is successful when $u^{\prime}$ is in NPZ and fails when
$u^{\prime}$ is in PZ. Therefore, the failure probability of error correction,
namely, the logical Pauli error rate is given by

$\displaystyle P_{F}(\Delta,\tilde{\Delta})$ $\displaystyle=$
$\displaystyle\sum_{n=-\infty}^{+\infty}\int_{\sqrt{\pi}/2+2n\sqrt{\pi}}^{3\sqrt{\pi}/2+2n\sqrt{\pi}}F(u^{\prime}){\rm
d}u^{\prime}$ (38) $\displaystyle\approx$ $\displaystyle
2\int_{\sqrt{\pi}/2}^{3\sqrt{\pi}/2}F(u^{\prime}){\rm d}u^{\prime}.$

The relation between $P_{F}(\Delta,\tilde{\Delta})$ and $\tilde{\Delta}$ for a
fixed $\Delta$ is plotted in Fig. 6. We can see that $P_{F}$ monotonically
decreases as $\tilde{\Delta}$ decreases, showing that an ancillary GKP qubit
with higher quality naturally leads to lower logical Pauli error rate. In
addition, it can be shown that

$P_{F}(\Delta,\tilde{\Delta}\to 0)=P_{\bar{X}}(\Delta).$ (39)

It is an important property that error correction by SUM gate with a physical
ancillary qubit always increases logical Pauli error rate as compared to that
with an ideal ancillary qubit. In the case of ideal ancillary qubit, a logical
Pauli error occurs when $u_{1}\in{\rm PZ}$ and no error occurs when
$u_{1}\in{\rm NPZ}$. While in the case of physical ancillary qubit,
$u_{1}\in{\rm NPZ}$ may lead to a logical Pauli error because of the presence
of an additional displacement $u_{2}$. Although $u_{1}\in{\rm PZ}$ may not
lead to a logical Pauli error due to the same reason, its probability is much
less than the former.

##  IV Concatenation with repetition code

In the previous section, we discuss GKP error correction with ideal and
physical ancillary GKP qubits, and found that small displacement error can be
effectively corrected. The logical Pauli error rate with physical ancillary
GKP qubits is generally higher than that with ideal ancillary GKP qubits. To
further suppress the logical Pauli error, we concatenate the GKP code with
repetition code Stafford and Menicucci (2022); Fukui et al. (2017); Xu et al.
(2023). Note that by concatenating with repetition code we only correct the
displacement error in position space.

###  IV.1 Concatenation with three-qubit repetition code

Figure 7: Quantum circuit of encoding for 3-qubit GKP repetition code. The
three GKP states before encoding are assumed to be ideal. After the encoding,
three data qubits entangle with each other. A physical GKP repetition code
state is constructed by coherently superposing the ideal GKP states undergoing
random displacements.  Figure 8: Quantum error correction circuit of 3-qubit
GKP repetition code. It consists of one round of GKP error correction,
syndrome measurement of repetition code, and recovery operation according to
the measurement outcomes $M_{1}$ and $M_{2}$. Three data qubits $D_{1}$,
$D_{2}$ and $D_{3}$ are all physical GKP states with noise variance
$\Delta^{2}$ in position quadrature. Ancillary qubits $A_{1}$, $A_{2}$ and
$A_{3}$ are prepared in the state $\ket{\tilde{+}}$, ancillary qubits
$A_{1}^{\prime}$ and $A_{2}^{\prime}$ are prepared in the state
$\ket{\tilde{0}}$, and we assume noise variances in position quadrature of all
ancillary qubits to be $\tilde{\Delta}^{2}$. Residual displacements of three
data qubits $D_{1}$, $D_{2}$ and $D_{3}$ after the GKP error correction are
denoted as $u_{1}^{\prime}$, $u_{2}^{\prime}$ and $u_{3}^{\prime}$,
respectively.

In the 3-qubit bit-flip repetition code Nielsen and Chuang (2010); Devitt et
al. (2013), three physical qubits are introduced to encode one logical qubit,
in particular, the single-qubit state $\alpha\ket{0}+\beta\ket{1}$ is encoded
as follows:

$\ket{\psi}=\alpha\ket{0}+\beta\ket{1}\to\ket{\bar{\psi}}=\alpha\ket{000}+\beta\ket{111}.$
(40)

If one of the three qubits was flipped, the flipped qubit can be detected by
comparing any two of the three qubits and then applying the majority rule,
which is known as the syndrome measurement. Once the flipped qubit is
identified, it can be corrected by applying a Pauli $X$ operator. The 3-qubit
repetition code can only correct single-qubit bit flip, and bit flip on two or
more qubits result in logical error. Denote the bit-flip error rate of a
single physical qubit as $p$, then the probability of failure is given by

$p_{f,\text{3-rep}}^{{\rm class}}=3p^{2}(1-p)+p^{3}.$ (41)

To realize the comparison between physical qubits without collapsing the
encoded state, one needs to introduce ancillary qubits to perform the syndrome
measurement. Since one has to identify no error and three single-qubit bit-
flip errors, there are $C_{3}^{0}+C_{3}^{1}=4$ syndromes and therefore two
ancillary qubits are needed. The comparison of states of two qubits is
implemented by the CNOT gate.

To concatenate the GKP code with repetition code, one needs to replace the
standard qubits by the GKP qubits and find a CV gate that corresponds to the
CNOT gate. It turns out that the SUM gate we used to perform GKP error
correction plays the role as a CNOT gate. The quantum circuit of encoding is
shown in Fig. 7, which is a generalization of the encoding circuit for
repetition code. Before encoding, the first GKP qubit is prepared in the state
$\ket{\xi}=\alpha\ket{\bar{0}}+\beta\ket{\bar{1}}$, and the other two data
qubits are prepared in the same state
$\ket{\xi_{1}}=\ket{\xi_{2}}=\ket{\bar{0}}$. After the encoding procedure,
namely, the application of two SUM gates, three GKP states become entangled
with each other,

$\ket{\xi,\xi_{1},\xi_{2}}=(\alpha\ket{\bar{0}}+\beta\ket{\bar{1}})\ket{\bar{0}}\ket{\bar{0}}\to\ket{\bar{\psi}_{3}}=\alpha\ket{\bar{0}\bar{0}\bar{0}}+\beta\ket{\bar{1}\bar{1}\bar{1}}.$
(42)

The state $\ket{\bar{\psi}_{3}}$ as defined is an ideal GKP repetition code
state. One way to construct a physical GKP repetition code state is to
coherently superpose the randomly displaced ideal GKP repetition code states,
namely,

$\begin{split}&\ket{\tilde{\Psi}_{3}}=\int{\rm d}u_{1}{\rm d}v_{1}{\rm
d}u_{2}{\rm d}v_{2}{\rm d}u_{3}{\rm
d}v_{3}\,\eta(u_{1},v_{1})\eta(u_{2},v_{2})\\\
&\eta(u_{3},v_{3})e^{i(-u_{1}\hat{p}_{1}+v_{1}\hat{q}_{1})}e^{i(-u_{2}\hat{p}_{2}+v_{2}\hat{q}_{2})}e^{i(-u_{3}\hat{p}_{3}+v_{3}\hat{q}_{3})}\ket{\bar{\psi}_{3}}.\end{split}$
(43)

Here we assume that the displacement in each ideal GKP qubit is independent
and follows the same probability distribution. This definition of the physical
code state is similar to the definition of a single-qubit physical GKP state
(15). The GKP repetition code state defined in Eq. (43) is different from the
state generated by applying two SUM gates to three single-qubit physical GKP
states, since the latter would generate correlated noise between different GKP
qubits. We use the GKP repetition code state (43) only to seek convenience for
calculation, and we will leave the discussion on its experimental preparation
for future work.

Error correction is performed after the encoding, which is implemented by the
quantum circuit shown in Fig. 8. The full process of error correction consists
of three steps: one round of GKP error correction, syndrome measurement and
feed forward based on the measurement outcome. The three data GKP qubits,
denoted as $D_{1}$, $D_{2}$, $D_{3}$, are physical and their noise variances
of the position quadrature are the same, which is assumed to be $\Delta^{2}$.
Three ancillary GKP qubits, denoted as $A_{1},A_{2}$ and $A_{3}$, are
introduced to perform the GKP error correction, and they are prepared in the
GKP $\ket{\tilde{+}}$ state. Another two ancillary GKP qubits, denoted as
$A_{1}^{\prime}$ and $A_{2}^{\prime}$, are introduced to perform the syndrome
measurement, and they are prepared in the GKP $\ket{\tilde{0}}$ state. The
noise variances of the position quadrature of all ancillary GKP qubits are
assumed to be the same and is $\tilde{\Delta}^{2}$. The residual displacements
of the three data qubits after the GKP error correction are denoted as
$u_{1}^{\prime}$, $u_{2}^{\prime}$, $u_{3}^{\prime}$, respectively. Their
probability distribution is given by Eq. (37). Denote the displacement errors
of the ancillary qubits $A_{1}^{\prime}$ and $A_{2}^{\prime}$ as $\alpha_{1}$
and $\alpha_{2}$, respectively, whose probability distribution is given by

$f_{q_{i}^{\prime}}(\alpha_{i})=\frac{1}{\sqrt{\pi}\tilde{\Delta}}e^{-\frac{\alpha_{i}^{2}}{\tilde{\Delta}^{2}}},~{}~{}~{}~{}~{}~{}i=1,2.$
(44)

The purpose of the syndrome measurement is to compare the states of three data
GKP qubits, which is implemented by applying four SUM gates that act on the
data qubits and the ancillary qubits in an appropriate way, as shown in Fig.
8. After these SUM gates, the displacement errors of the ancillary qubits
$A_{1}^{\prime}$ and $A_{2}^{\prime}$ become
$u_{1}^{\prime}+u_{2}^{\prime}+\alpha_{1}$ and
$u_{1}^{\prime}+u_{3}^{\prime}+\alpha_{2}$, respectively. Then measurement of
the ancillary qubits $A_{1}^{\prime}$ and $A_{2}^{\prime}$ gives
$M_{1}=2k_{1}\sqrt{\pi}+u_{1}^{\prime}+u_{2}^{\prime}+\alpha_{1}$ and
$M_{2}=2k_{2}\sqrt{\pi}+u_{1}^{\prime}+u_{3}^{\prime}+\alpha_{2}$, with
$k_{1}\in\mathbb{Z}$ and $k_{2}\in\mathbb{Z}$.

Table 1:  Correspondence between syndromes and single-qubit bit-flip errors for the classical 3-qubit repetition code. syndrome | Final state | Error
---|---|---
0 0 |  $\alpha\ket{000}+\beta\ket{111}$ | no error
1 1 |  $\alpha\ket{100}+\beta\ket{011}$ |  bit flip on data qubit 1
1 0 | $~{}~{}\alpha\ket{010}+\beta\ket{101}$ |  bit flip on data qubit 2
0 1 |  $\alpha\ket{001}+\beta\ket{110}$ |  bit flip on data qubit 3
Table 2: Correspondence between syndromes and single-qubit bit-flip errors for the 3-qubit GKP repetition code. The syndromes are defined according to whether $M_{1}$ and $M_{2}$ belong to PZ or NPZ. Measurement outcome | Error
---|---
$M_{1}\in\text{NPZ},M_{2}\in\text{NPZ}$ |  no error
$M_{1}\in\text{PZ},~{}~{}M_{2}\in\text{PZ}$ |  $\bar{X}$ on data qubit 1
$M_{1}\in\text{PZ},M_{2}\in\text{NPZ}$ |  $\bar{X}$ on data qubit 2
$M_{1}\in\text{NPZ},M_{2}\in\text{PZ}$ |  $\bar{X}$ on data qubit 3

For the classical 3-qubit repetition code, the qubit with bit-flip error is
identified through the measurement outcome of the ancillary qubits, known as
the syndrome. The one-to-one correspondence between the syndrome and the
single-qubit bit-flip error Nielsen and Chuang (2010); Devitt et al. (2013) is
summarized in Tab. 1. As an example, if the ancillary qubit $A_{1}^{\prime}$
is flipped while $A_{2}^{\prime}$ is not, then the states of the data qubits
$D_{1}$ and $D_{2}$ are different, while the states of the data qubits $D_{1}$
and $D_{3}$ are the same. This implies that the data qubit $D_{2}$ is flipped.

For the GKP repetition code, the way to identify the bit-flip error through
the syndrome is similar. The correspondence between measurement outcomes
$\\{M_{1},M_{2}\\}$ and the logical Pauli $\bar{X}$ error on different GKP
qubits is summarized in Tab. 2. However, this decoding procedure has a subtle
difference from that of the classical repetition code: sometimes a single-
qubit Pauli $\bar{X}$ error could be misidentified. As an example, if
$u_{1}^{\prime}=\sqrt{\pi}\in\text{PZ}$,
$u_{2}^{\prime}=\sqrt{\pi}/3\in\text{NPZ}$,
$u_{3}^{\prime}=\sqrt{\pi}/3\in\text{NPZ}$,
$\alpha_{1}=\alpha_{2}=\sqrt{\pi}/3$, then
$M_{1}=2k_{1}\sqrt{\pi}+u_{1}^{\prime}+u_{2}^{\prime}+\alpha_{1}=2k_{1}\sqrt{\pi}+5\sqrt{\pi}/3\in\text{NPZ}$,
$M_{2}=2k_{2}\sqrt{\pi}+u_{1}^{\prime}+u_{3}^{\prime}+\alpha_{2}=2k_{2}\sqrt{\pi}+5\sqrt{\pi}/3\in\text{NPZ}$,
from which we infer that no Pauli $\bar{X}$ error occurs but in fact a Pauli
$\bar{X}$ error did occur in the qubit $D_{1}$. Continuity of the phase space
is what makes GKP repetition code different from the classical repetition code
Fukui et al. (2017).

Our objective is to calculate the failure probability of 3-qubit GKP
repetition code. In contrary to the classical repetition code, we need to
reverse the decoding process and impose some conditions to be satisfied
instead. For example, if no error occurs, we need $M_{1}\in\text{NPZ}$ and
$M_{2}\in\text{NPZ}$ to give the correct identification, and the area outside
$M_{1}\in\text{NPZ}$ and $M_{2}\in\text{NPZ}$ must lead to failure. Similar
rules apply for other cases. All possible circumstances are summarized as
follows:

  * •

Case 1: If no error occurs $\Rightarrow$we require
$M_{1}\in\text{NPZ},M_{2}\in\text{NPZ}$;

  * •

Case 2: If $\bar{X}$ applies on data qubit $D_{1}$ $\Rightarrow$ we require
$M_{1}\in\text{PZ},M_{2}\in\text{PZ}$;

  * •

Case 3: If $\bar{X}$ applies on data qubit $D_{2}$ $\Rightarrow$ we require
$M_{1}\in\text{PZ},M_{2}\in\text{NPZ}$;

  * •

Case 4: If $\bar{X}$ applies on data qubit $D_{3}$ $\Rightarrow$ we require
$M_{1}\in\text{NPZ},M_{2}\in\text{PZ}$;

  * •

Case 5: If errors occur on more than one data qubit, with probability
$3P_{F}^{2}(1-P_{F})+P_{F}^{3}$ $\Rightarrow$ error correction fails.

Now we calculate the failure probability for the above five cases, the sum of
which gives the total failure probability. Consider case 1, there are five
constraints needed to be satisfied simultaneously,

No Pauli $\bar{X}$ error $\displaystyle\Rightarrow$
$\displaystyle\left|u_{1}^{\prime}-2m_{1}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},\left|u_{2}^{\prime}-2m_{2}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},\left|u_{3}^{\prime}-2m_{3}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},$
$\displaystyle M_{1}\in\text{NPZ},M_{2}\in\text{NPZ}$
$\displaystyle\Rightarrow$
$\displaystyle\left|u_{1}^{\prime}+u_{2}^{\prime}+\alpha_{1}-2n_{1}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},\left|u_{1}^{\prime}+u_{3}^{\prime}+\alpha_{2}-2n_{2}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},$
(45)

where $m_{i}\in\mathbb{Z}$ and $n_{i}\in\mathbb{Z}$. The probability of
success is obtained by integrating the probability distribution of five
variables in the domain defined by these five inequalities. However, it is
challenging to derive an analytic expression for the success probability,
which requires a five-dimensional linear programming. Therefore, a numerical
integration method is used instead, which proceeds in two steps. We first fix
a point $(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})$ in the domain defined
by the first three inequalities in Eq. (IV.1), then the success probability at
this given point is

$\displaystyle
P_{\alpha}^{1}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})=\left(\sum_{n_{1}}\int_{-\sqrt{\pi}/2+2n_{1}\sqrt{\pi}-u_{1}^{\prime}-u_{2}^{\prime}}^{\sqrt{\pi}/2+2n_{1}\sqrt{\pi}-u_{1}^{\prime}-u_{2}^{\prime}}f_{q_{1}^{\prime}}(\alpha_{1}){\rm
d}\alpha_{1}\right)\left(\sum_{n_{2}}\int_{-\sqrt{\pi}/2+2n_{2}\sqrt{\pi}-u_{1}^{\prime}-u_{3}^{\prime}}^{\sqrt{\pi}/2+2n_{2}\sqrt{\pi}-u_{1}^{\prime}-u_{3}^{\prime}}f_{q_{2}^{\prime}}(\alpha_{2}){\rm
d}\alpha_{2}\right)$ $\displaystyle\approx\frac{1}{4}\left[{\rm
erf}\left(\frac{\frac{\sqrt{\pi}}{2}-u_{1}^{\prime}-u_{2}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{-\frac{\sqrt{\pi}}{2}-u_{1}^{\prime}-u_{2}^{\prime}}{\tilde{\Delta}}\right)\right]\left[{\rm
erf}\left(\frac{\frac{\sqrt{\pi}}{2}-u_{1}^{\prime}-u_{3}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{-\frac{\sqrt{\pi}}{2}-u_{1}^{\prime}-u_{3}^{\prime}}{\tilde{\Delta}}\right)\right],$
(46)

where we have only kept one term with $n_{1}=n_{2}=0$ in the summation because
the contribution from other terms is negligible. Then the failure probability
of case 1 is given by integrating the failure probability
$1-P_{\alpha}^{1}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})$ over all
points satisfying the first three constraints in Eq. (IV.1), weighted by the
probability distribution
$F(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})=F(u_{1}^{\prime})F(u_{2}^{\prime})F(u_{3}^{\prime})$,

$\displaystyle P_{f,\text{3-rep}}^{1}$ $\displaystyle=$
$\displaystyle\int_{u_{1}^{\prime}\in{\rm NPZ}}\int_{u_{2}^{\prime}\in{\rm
NPZ}}\int_{u_{3}^{\prime}\in{\rm
NPZ}}F(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\left[1-P_{\alpha}^{1}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\right]{\rm
d}u_{1}^{\prime}{\rm d}u_{2}^{\prime}{\rm d}u_{3}^{\prime}$ (47)
$\displaystyle\approx$
$\displaystyle\int_{u_{1}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\int_{u_{2}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\int_{u_{3}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}F(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\left[1-P_{\alpha}^{1}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\right]{\rm
d}u_{1}^{\prime}{\rm d}u_{2}^{\prime}{\rm d}u_{3}^{\prime},$

where we have only kept one term with $m_{1}=m_{2}=m_{3}=0$ in the summation
because the contribution from other terms is negligible.

In a similar way, we can derive the failure probability for case 2 by taking
into account the condition that $u_{1}^{\prime}\in{\rm
PZ},u_{2}^{\prime}\in{\rm NPZ}$ and $u_{3}^{\prime}\in{\rm NPZ}$,

$\displaystyle P_{f,\text{3-rep}}^{2}$ $\displaystyle=$
$\displaystyle\int_{u_{1}^{\prime}\in{\rm PZ}}\int_{u_{2}^{\prime}\in{\rm
NPZ}}\int_{u_{3}^{\prime}\in{\rm
NPZ}}F(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\left[1-P_{\alpha}^{2}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\right]{\rm
d}u_{1}^{\prime}{\rm d}u_{2}^{\prime}{\rm d}u_{3}^{\prime}$ (48)
$\displaystyle\approx$ $\displaystyle
2\int_{u_{1}^{\prime}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\int_{u_{2}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\int_{u_{3}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}F(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\left[1-P_{\alpha}^{2}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\right]{\rm
d}u_{1}^{\prime}{\rm d}u_{2}^{\prime}{\rm d}u_{3}^{\prime},$

where $P_{\alpha}^{2}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})$ is the
success probability for a given point
$(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})$ when $M_{1}\in\text{PZ}$ and
$M_{2}\in\text{PZ}$,

$\displaystyle
P_{\alpha}^{2}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})=\left(\sum_{n_{1}}\int_{\sqrt{\pi}/2+2n_{1}\sqrt{\pi}-u_{1}^{\prime}-u_{2}^{\prime}}^{3\sqrt{\pi}/2+2n_{1}\sqrt{\pi}-u_{1}^{\prime}-u_{2}^{\prime}}f_{q_{1}^{\prime}}(\alpha_{1}){\rm
d}\alpha_{1}\right)\left(\sum_{n_{2}}\int_{\sqrt{\pi}/2+2n_{2}\sqrt{\pi}-u_{1}^{\prime}-u_{3}^{\prime}}^{3\sqrt{\pi}/2+2n_{2}\sqrt{\pi}-u_{1}^{\prime}-u_{3}^{\prime}}f_{q_{2}^{\prime}}(\alpha_{2}){\rm
d}\alpha_{2}\right)$ $\displaystyle\approx\frac{1}{4}\left[{\rm
erf}\left(\frac{\frac{3\sqrt{\pi}}{2}-u_{1}^{\prime}-u_{2}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{\frac{\sqrt{\pi}}{2}-u_{1}^{\prime}-u_{2}^{\prime}}{\tilde{\Delta}}\right)\right]\left[{\rm
erf}\left(\frac{\frac{3\sqrt{\pi}}{2}-u_{1}^{\prime}-u_{3}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{\frac{\sqrt{\pi}}{2}-u_{1}^{\prime}-u_{3}^{\prime}}{\tilde{\Delta}}\right)\right].$
(49)

$P_{\alpha}^{3}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})$ and
$P_{\alpha}^{4}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})$ can also be
calculated by the similar way, and it can be shown that the failure
probabilities of cases 3 and 4 are the same as that of the case 2, namely,

$P_{f,\text{3-rep}}^{2}=P_{f,\text{3-rep}}^{3}=P_{f,\text{3-rep}}^{4}.$ (50)

The failure probability of case 5 is

$P_{f,\text{3-rep}}^{5}=3P_{F}^{2}(1-P_{F})+P_{F}^{3}.$ (51)

Finally, the total failure probability of the 3-qubit GKP repetition code is

$\displaystyle P_{f,\text{3-rep}}(\Delta,\tilde{\Delta})$ $\displaystyle=$
$\displaystyle
P_{f,\text{3-rep}}^{1}+P_{f,\text{3-rep}}^{2}+P_{f,\text{3-rep}}^{3}+P_{f,\text{3-rep}}^{4}+P_{f,\text{3-rep}}^{5}$
(52) $\displaystyle\approx$
$\displaystyle\int_{u_{1}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\int_{u_{2}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\int_{u_{3}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}F(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\left[1-P_{\alpha}^{1}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\right]{\rm
d}u_{1}^{\prime}{\rm d}u_{2}^{\prime}{\rm d}u_{3}^{\prime}$
$\displaystyle+6\int_{u_{1}^{\prime}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\int_{u_{2}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\int_{u_{3}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}F(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\left[1-P_{\alpha}^{2}(u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime})\right]{\rm
d}u_{1}^{\prime}{\rm d}u_{2}^{\prime}{\rm d}u_{3}^{\prime}$
$\displaystyle+3P_{F}^{2}(1-P_{F})+P_{F}^{3}.$

The last two terms correspond to the failure probability of the classical
3-qubit repetition code, and the first two terms correspond to the failure
probability when error occurs on no more than one data qubit, which is what
makes GKP repetition code different from the classical repetition code.

The relation between the failure probability
$P_{f,\text{3-rep}}(\Delta,\tilde{\Delta})$ and $\tilde{\Delta}$ for
$\Delta=0.5$ is shown in Fig. 9, in which $P_{F}(\Delta,\tilde{\Delta})$ is
also included for comparison. From Fig. 9 we can see that
$P_{f,\text{3-rep}}(\Delta,\tilde{\Delta})$ is monotonically decreasing as
$\tilde{\Delta}$ decreases. This implies that ancillary qubits with higher
quality lead to a lower logical Pauli error rate. When $\tilde{\Delta}\to 0$,
the logical Pauli error rate approaches to that of the classical 3-qubit
repetition code, namely,

$\displaystyle P_{f,\text{3-rep}}(\Delta,\tilde{\Delta}\to 0)$
$\displaystyle=$ $\displaystyle
3P_{\bar{X}}^{2}(\Delta)[1-P_{\bar{X}}(\Delta)]+P_{\bar{X}}^{3}(\Delta)$ (53)
$\displaystyle=$ $\displaystyle P_{f,\text{3-rep}}^{\rm class}(\Delta).$

This can be understood as follows. The probability distribution of
$u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime},\alpha_{1}$ and $\alpha_{2}$ are
determined by $\tilde{\Delta}$,

Figure 9: Comparison of logical Pauli error rate
$P_{f,\text{3-rep}}(\Delta,\tilde{\Delta})$ and $P_{F}(\Delta,\tilde{\Delta})$
for a fixed $\Delta$, where we choose $\Delta=0.5$ as an example. When
$\tilde{\Delta}\to 0$, the failure probability of the 3-qubit GKP repetition
code approaches to that of the classical 3-qubit repetition code. There exists
a critical value at $\tilde{\Delta}=\tilde{\Delta}_{\rm cr}$, below which
$P_{f,\text{3-rep}}(\Delta,\tilde{\Delta})<P_{F}(\Delta,\tilde{\Delta})$ and
above which
$P_{f,\text{3-rep}}(\Delta,\tilde{\Delta})>P_{F}(\Delta,\tilde{\Delta})$.

and when $\tilde{\Delta}\to 0$ the distribution is highly localized and is
close to a $\delta$ function. As a result, the probability of misidentifying
no error and single-qubit Pauli $\bar{X}$ errors is almost zero. When
$\tilde{\Delta}$ is large, the failure probability
$P_{f,\text{3-rep}}(\Delta,\tilde{\Delta})$ is greater than
$P_{F}(\Delta,\tilde{\Delta})$. However, the former decreases faster than the
latter as $\tilde{\Delta}$ decreases. There exists a critical value for
$\tilde{\Delta}$, denoted as $\tilde{\Delta}_{\rm cr}$, such that
$P_{f,\text{3-rep}}(0.5,\tilde{\Delta}_{\rm cr})=P_{F}(0.5,\tilde{\Delta}_{\rm
cr})$, and from Fig. 9 we can see that $\tilde{\Delta}_{\rm cr}\approx 0.3$.
When $\tilde{\Delta}<\tilde{\Delta}_{\rm cr}$, the logical Pauli error rate of
the 3-qubit GKP repetition code is lower than that of the GKP code with noisy
ancillary qubits. The concatenation with repetition code therefore shows its
advantage in this regime. Furthermore, the failure probability
$P_{f,\text{3-rep}}(\Delta,\tilde{\Delta})$ can be even lower than that of the
GKP code with ideal ancillary qubits, namely,
$P_{f,\text{3-rep}}(0.5,\tilde{\Delta})<P_{\bar{X}}(0.5)$.

###  IV.2 Concatenation with $n$-qubit repetition code

Figure 10: Encoding circuit for $n$-qubit GKP repetition code. The $n$ GKP
states before encoding are assumed to be ideal. After encoding, $n$ data
qubits entangle with each other. Then a physical GKP $n$-qubit repetition code
state is constructed by coherently superposing the ideal GKP states undergoing
random displacements.

In the theory of quantum error correction, introducing more qubits would allow
more errors to be corrected and therefore achieve a lower logical error rate
Shor (1995); Gottesman (1997); Terhal (2015). In this section, we generalize
the previous scheme and concatenate the GKP code with $n$-qubit repetition
code, with $n$ an odd integer. We are gonna to show that increasing the size
of the GKP repetition code can further reduce the logical Pauli error rate,
though one needs to prepare ancillary GKP qubits with higher quality.

For the classical $n$-qubit repetition code Nielsen and Chuang (2010); Devitt
et al. (2013), $n$ physical qubits are introduced to encode one logical qubit,
in particular, the single-qubit state $\alpha\ket{0}+\beta\ket{1}$ is encoded
as follows:

$\ket{\psi}=\alpha\ket{0}+\beta\ket{1}\to\ket{\bar{\psi}}=\alpha\ket{00\cdots
0}+\beta\ket{11\cdots 1}.$ (54)

The $n$-qubit repetition code is able to correct any $m$-qubit bit-flip error,
with $1\leq m\leq(n-1)/2$. Denote the bit-flip error rate of a single physical
qubit as $p$, then the failure

Table 3: Correspondence between syndromes and single-qubit bit-flip errors for the $n$-qubit GKP repetition code. Measurement outcome | Error
---|---
$M_{1},M_{2},\cdots,M_{n-1}\in\text{NPZ}$ | no error
$M_{1},M_{2},\cdots,M_{n-1}\in\text{PZ}$ | data qubit 1
$M_{1}\in PZ,M_{2},\cdots,M_{n-1}\in\text{NPZ}$ | data qubit 2
$M_{1}\in NPZ,M_{2}\in PZ,M_{3},\cdots,M_{n-1}\in\text{NPZ}$ | data qubit 3
$\cdots\cdots$ | $\cdots\cdots$
$M_{1}\in NPZ,M_{2},\cdots,M_{n-1}\in\text{PZ}$ | data qubit 1,2
$M_{1}\in PZ,M_{2}\in NPZ,M_{3},\cdots,M_{n-1}\in\text{PZ}$ | data qubit 1,3
$\cdots\cdots$ | $\cdots\cdots$
$M_{1},M_{2}\in NPZ,M_{3},\cdots,M_{n-1}\in\text{PZ}$ |  data qubit 1,2,3
$\cdots\cdots$ | $\cdots\cdots$

probability of the $n$-qubit repetition code is given by

$P_{f,\text{n-rep}}^{\rm
class}=\sum_{i=(n+1)/2}^{n}C_{n}^{i}\,p^{i}(1-p)^{n-i}.$ (55)

There are $C_{n}^{0}+C_{n}^{1}+...+C_{n}^{(n-1)/2}=2^{n-1}$ possibilities that
up to $(n-1)/2$ quibts are flipped, i.e., $2^{n-1}$ correctable errors.
Therefore, $2^{n-1}$ syndromes are needed to decode these errors, which
implies $(n-1)$ ancillary GKP qubits are required to perform syndrome
measurement.

Figure 11:  Quantum error correction circuit for $n$-qubit GKP repetition
code. It consists of one round of GKP error correction, syndrome measurement
of repetition code, and recovery operation according to the measurement
outcomes $\\{M_{i}\\}_{i=1}^{n-1}$. Here $\\{D_{i}\\}_{i=1}^{n}$ denote the
data qubits and $\\{A_{i}^{\prime}\\}_{i=1}^{n-1}$ denote the ancillary qubits
introduced to perform syndrome measurement.

We now concatenate the GKP code with the $n$-qubit repetition code. The
quantum circuit of encoding is shown in Fig. 10, where we assume all input GKP
states are ideal. Before encoding, the first GKP qubit is prepared in the
state $\alpha\ket{\bar{0}}+\beta\ket{\bar{1}}$, and all other GKP qubits are
prepared in the state $\ket{\bar{0}}$. After the encoding procedure, namely,
the application of ($n-1$) SUM gates, the $n$ GKP qubits become entangled with
each other,

$\ket{\xi,\xi_{1},\xi_{2},\cdots,\xi_{n-1}}\to\ket{\bar{\psi}_{n}}=\alpha\ket{\bar{0}\bar{0}\bar{0}\cdots\bar{0}}+\beta\ket{\bar{1}\bar{1}\bar{1}\cdots\bar{1}}.$
(56)

We then construct a physical GKP repetition code state by coherently
superposing the randomly displaced ideal GKP repetition code states, namely

$\displaystyle\ket{\tilde{\Psi}_{n}}$ $\displaystyle=$ $\displaystyle\int{\rm
d}u_{1}{\rm d}v_{1}\cdots{\rm d}u_{n}{\rm
d}v_{n}\,\eta(u_{1},v_{1})\cdots\eta(u_{n},v_{n})$ (57)
$\displaystyle\times\exp\bigg{\\{}-i\sum_{k=1}^{n}(u_{k}\hat{p}_{k}-v_{k}\hat{q}_{k})\bigg{\\}}\ket{\bar{\psi}_{n}}.$

We assume that the displacement in each ideal GKP qubit is independent and
follows the same probability distribution.

The quantum circuit of error correction is shown in Fig. 11, which is a direct
generalization to that of the 3-qubit GKP repetition code, and the procedure
of quantum error correction is also similar. The residual displacements of the
$n$ data qubits after the GKP error correction are denoted as
$\\{u_{i}^{\prime}\\}_{i=1}^{n}$, and their probability distribution is given
by Eq. (37). The displacement errors of the $(n-1)$ ancillary qubits for
syndrome measurement are denoted as $\\{\alpha_{i}\\}_{i=1}^{n-1}$, and their
probability distribution is given by Eq. (44). The outcomes of the syndrome
measurement are given by

$\displaystyle
M_{i}=2k_{i}\sqrt{\pi}+u_{1}^{\prime}+u_{i+1}^{\prime}+\alpha_{i},~{}~{}i=1,2,\cdots,n-1,$
(58)

with $k_{i}\in\mathbb{Z}$. Similarly, there is a one-to-one correspondence
between the syndromes and correctable errors, which is summarized in Tab. 3.

Using the same method, we can calculate the failure probability of the
$n$-qubit GKP repetition code (see Appendix C for details),

$\displaystyle
P_{f,\text{n-rep}}=\int_{u_{1}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\cdots\int_{u_{n}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\bigg{[}\prod_{i=1}^{n}F(u_{i}^{\prime})\bigg{]}\big{[}1-P_{\alpha}^{1}(u_{1}^{\prime},\cdots,u_{n}^{\prime})\big{]}{\rm
d}u_{1}^{\prime}\cdots{\rm d}u_{n}^{\prime}$
$\displaystyle+\sum_{m=1}^{\frac{n-1}{2}}C_{n}^{m}2^{m}\int_{u_{1}^{\prime}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\cdots\int_{u_{m}^{\prime}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\int_{u_{m+1}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\cdots\int_{u_{n}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\bigg{[}\prod_{i=1}^{n}F(u_{i}^{\prime})\bigg{]}\big{[}1-P_{\alpha}^{m+1}(u_{1}^{\prime},\cdots,u_{n}^{\prime})\big{]}{\rm
d}u_{1}^{\prime}\cdots{\rm d}u_{n}^{\prime}$
$\displaystyle+\sum_{i=\frac{n+1}{2}}^{n}C_{n}^{i}P_{F}^{i}(1-P_{F})^{n-i}.$
(59)

The last summation represents the failure probability of the classical
$n$-qubit repetition code, and the first two terms represent the failure
probability when no more than $(n-1)/2$ data qubits are flipped. Here
$P_{\alpha}^{s}(u_{1}^{\prime},...,u_{n}^{\prime})$ $(1\leq
s\leq\frac{n+1}{2})$ is the success probability for a fixed point
$(u_{1}^{\prime},...,u_{n}^{\prime})$ when $(s-1)$ qubits are flipped.
Although there are many possible ways that $(s-1)$ qubits are flipped, it can
be shown that the success probabilities corresponding to these cases are the
same. The expressions for $P_{\alpha}^{s}(u_{1}^{\prime},...,u_{n}^{\prime})$
are given by

$\begin{split}P_{\alpha}^{1}(u_{1}^{\prime},\cdots,u_{n}^{\prime})=&\frac{1}{2^{n-1}}\prod_{k=2}^{n}\left[{\rm
erf}\left(\frac{\sqrt{\pi}/2-u_{1}^{\prime}-u_{k}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{-\sqrt{\pi}/2-u_{1}^{\prime}-u_{k}^{\prime}}{\tilde{\Delta}}\right)\right],\\\
P_{\alpha}^{2}(u_{1}^{\prime},\cdots,u_{n}^{\prime})=&\frac{1}{2^{n-1}}\prod_{k=2}^{n}\left[{\rm
erf}\left(\frac{3\sqrt{\pi}/2-u_{1}^{\prime}-u_{k}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{\sqrt{\pi}/2-u_{1}^{\prime}-u_{k}^{\prime}}{\tilde{\Delta}}\right)\right],\\\
P_{\alpha}^{s}(u_{1}^{\prime},\cdots,u_{n}^{\prime})=&\frac{1}{2^{n-1}}\prod_{k_{1}=2}^{s-1}\left[{\rm
erf}\left(\frac{5\sqrt{\pi}/2-u_{1}^{\prime}-u_{k_{1}}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{3\sqrt{\pi}/2-u_{1}^{\prime}-u_{k_{1}}^{\prime}}{\tilde{\Delta}}\right)\right]\\\
&\times\prod_{k_{2}=s}^{n}\left[{\rm
erf}\left(\frac{3\sqrt{\pi}/2-u_{1}^{\prime}-u_{k_{2}}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{\sqrt{\pi}/2-u_{1}^{\prime}-u_{k_{2}}^{\prime}}{\tilde{\Delta}}\right)\right],~{}\text{for}~{}3\leq
s\leq\frac{n+1}{2}.\end{split}$ (60)

We calculate the failure probability
$P_{f,\text{n-rep}}(\Delta,\tilde{\Delta})$ for the GKP repetition code with
the number of data quabits up to $n=9$. The results for a fixed $\Delta$ are
shown in Fig. 12, in which we choose $\Delta=0.5$ as an example. Firstly, it
can be seen that the failure probability
$P_{f,\text{n-rep}}(\Delta,\tilde{\Delta})$ for all $n$ monotonically
decreases as $\tilde{\Delta}$ decreases. This implies that ancillary qubits
with higher quality lead to a lower logical Pauli error rate. In the limit of
$\tilde{\Delta}\to 0$, the logical Pauli error rate approaches to that of the
classical $n$-qubit repetition code, namely,

$\displaystyle P_{f,{\text{n-rep}}}(\Delta,\tilde{\Delta}\to 0)$
$\displaystyle=$
$\displaystyle\sum_{i=\frac{n+1}{2}}^{n}C_{n}^{i}P_{\bar{X}}^{i}(\Delta)[1-P_{\bar{X}}(\Delta)]^{n-i}$
(61) $\displaystyle=$ $\displaystyle P_{f,\text{n-rep}}^{\rm class}(\Delta).$

The second observation is that when $\tilde{\Delta}$ is sufficiently large,
the logical Pauli error rate increases as the size of the code increases; when
$\tilde{\Delta}$ is sufficiently small, the logical Pauli error rate decreases
as the size of the code increases. This implies that the concatenation of GKP
code with repetition code can reduce the logical Pauli error rate under the
condition that the quality of the ancillary qubit is sufficiently high. Figure
12 indicates that there exists some threshold for $\tilde{\Delta}$, below
which the concatenation shows advantages. However, the location of the
threshold is not sharp. Define the critical noise variance
$\tilde{\Delta}_{nm}^{2}$ as the variance of the ancillary qubit when the
$n$-qubit GKP repetition code and the $m$-qubit GKP repetition code have the
same logical Pauli error rate for a fixed $\Delta$. From Fig. 12 it can be
seen that $\tilde{\Delta}_{97}<\tilde{\Delta}_{75}<\tilde{\Delta}_{53}$. They
are close but not the same. When $\tilde{\Delta}>\tilde{\Delta}_{53}$, we have
$P_{f,\text{9-rep}}>P_{f,\text{7-rep}}>P_{f,\text{5-rep}}>P_{f,\text{3-rep}}$.
Therefore, $\tilde{\Delta}_{53}^{2}$ can be considered as the minimal noise
variance that the concatenation with repetition code is completely useless.
When $\tilde{\Delta}<\tilde{\Delta}_{97}$, we have
$P_{f,\text{9-rep}}<P_{f,\text{7-rep}}<P_{f,\text{5-rep}}<P_{f,\text{3-rep}}$.
Therefore, $\tilde{\Delta}_{97}^{2}$ is the noise variance that one needs to
achieve in order to realize the power of repetition code concatenation with at
least 9 GKP qubits.

The critical noise variance $\tilde{\Delta}_{nm}^{2}$ depends on the noise
variance of the data qubits. The relation between $\tilde{\Delta}_{nm}$ and
$\Delta$ is shown in Fig. 13. We can see that $\tilde{\Delta}_{nm}$ increases
monotonically as $\Delta$ increases. This implies that a lower-quality GKP
repetition code requires lower quality ancillary qubits to achieve its
advantage. This is rather surprising and counter intuitive. However, one
should keep in mind that this does not imply that a low-quality GKP repetition
code is preferred in the experimental realization. This is because one also
needs to take into account the displacement error in momentum space, which we
will discuss later in Sec. V. From Fig. 13 it can be seen that the relation
between $\tilde{\Delta}_{nm}$ and $\tilde{\Delta}$ is almost linear, we
therefore define an approximate ratio $\tilde{\Delta}_{nm}/\Delta$ (or an
average ratio). The ratio depends on the size of the code, and is upper
bounded by 0.5 and lower bounded by 0.25 for the code size that we consider.
This means if we choose $\tilde{\Delta}=\Delta$, the logical Pauli error rate
increases as the size of the code increases, implying that concatena-

Figure 12:  Comparison of logical Pauli error rate
$P_{f,\text{n-rep}}(\Delta,\tilde{\Delta})$ of $n$-qubit GKP repetition codes
for $n$ from 3 to 9, with $\Delta=0.5$ as an example. The inset shows the
location of various critical values.  Figure 13: Relation between
$\tilde{\Delta}_{nm}$ and $\Delta$. The ratio $\tilde{\Delta}_{nm}/\Delta$ is
upper bounded by 0.5 and lower bounded by 0.25 for the code size $n$ from 3 to
9.

tion with repetition code is useless; while if we choose
$\tilde{\Delta}=0.25\Delta$, the logical Pauli error rate decreases as the
size of the code increases, implying that concatenation with repetition code
with at least 9 GKP qubits is useful.

We are not able to calculate the failure probability for arbitrarily large $n$
since it involves a very high-dimensional integral, which is a rather
challenging task. Based on the results with $n$ up to nine, we conjecture that
there exists a nonzero threshold for $\tilde{\Delta}$ such that for
sufficiently small $\Delta$ the logical Pauli error rate can be exponentially
suppressed by increasing the size of the code. This threshold can be
calculated by using the Monte Carlo simulation and we leave it for future
work.

###  IV.3 Comparison with no GKP error correction

Although the GKP error correction increases the probability of Pauli $\bar{X}$
error for all values of $\tilde{\Delta}$, it narrows down the error
distribution of the GKP state when $\tilde{\Delta}<\Delta$ such that the
concatenation with repetition code is advantageous. However, the GKP error
correction requires the same number of ancillary GKP qubits as the data
qubits. A question arises as to whether the GKP error correction is necessary
in order to reduce the logical Pauli error rate. If the GKP error correction
is not necessary, then we only need to supply ancillary GKP qubits for
syndrome measurement and therefore can save a substantial amount of physical
resources.

To calculate the failure probability of GKP repetition code without one round
of GKP error correction, we only need to replace $\\{u_{i}^{\prime}\\}$ with
distribution $F(u_{1}^{\prime},...,u_{n}^{\prime})$ in Eq. (IV.2) by
$\\{u_{i}\\}$ with distribution $f_{q}(u_{1},...,u_{n})$ given by Eq. (23),
and replace $P_{F}$ by $P_{\bar{X}}$, where $\\{u_{i}\\}$ are displacement
errors of $n$ data qubits. The result is then given by

$\displaystyle
P_{f,\text{n-rep}}^{\,\prime}(\Delta,\tilde{\Delta})=\int_{u_{1}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\cdots\int_{u_{n}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}f_{q}(u_{1},\cdots,u_{n})[1-P_{\alpha}^{1}(u_{1},\cdots,u_{n})]{\rm
d}u_{1}{\rm d}u_{n}$
$\displaystyle+\sum_{m=1}^{\frac{n-1}{2}}C_{n}^{m}2^{m}\int_{u_{1}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\cdots\int_{u_{m}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\int_{u_{m+1}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\cdots\int_{u_{n}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}f_{q}(u_{1},\cdots,u_{n})[1-P_{\alpha}^{m+1}(u_{1},\cdots,u_{n})]{\rm
d}u_{1}\cdots{\rm d}u_{n}$
$\displaystyle+\sum_{i=\frac{n+1}{2}}^{n}C_{n}^{i}P_{\bar{X}}^{i}(1-P_{\bar{X}})^{n-i}.$
(62)

We calculate the failure probability
$P_{f,\text{n-rep}}^{\,\prime}(\Delta,\tilde{\Delta})$ for the GKP repetition
code with the number of data qubits up to $n=9$. The results for a fixed
$\Delta$ are shown in Fig. 14, in which we choose $\Delta=0.5$ as an example.
We also plot $P_{f,\text{n-rep}}(\Delta,\tilde{\Delta})$ in Fig. 14 for
comparison. We can see that GKP repetition code without one round of GKP error
correction cannot reduce the logical Pauli error rate even when
$\tilde{\Delta}\rightarrow 0$, and increasing the size of the code leads to a
higher logical Pauli error rate. We have confirmed that this is true for
$\Delta\geq 0.2$, and we expect that this should also be the case when
$\Delta<0.2$. Therefore, one round of GKP error correction before
concatenation is necessary. This can be understood in an intuitive way as
follows. In the repetition code without GKP error correction, the distribution
of $u_{1},u_{2},...,u_{n}$ depends only on $\Delta$. If we want to reduce the
logical Pauli error rate using repetition code, we need to replace the
distribution of $u_{1},u_{2},...u_{n}$ with a narrower distribution.
Repetition code with GKP error correction achieves this by replacing the
distribution of $u_{1},u_{2},...,u_{n}$ with a narrower distribution of
$u_{1}^{\prime},u_{2}^{\prime},...,u_{n}^{\prime}$ when
$\tilde{\Delta}\ll\Delta$.

##  V Biased noise corrected by GKP repetition code

Until now we have only considered correcting displacement errors in position
space and neglected those in momentum space. Therefore, previous results are
only valid in the limit of no errors in momentum space. However, a physical
GKP state does have noise in both position and

Figure 14:  Comparison of failure probabilities for GKP repetition codes
without (blue) and with (red) one round of GKP error correction before
concatenation. Here we choose $\Delta=0.5$.

momentum spaces. In this section, we take into account the momentum
displacement error and assume a biased noise model, namely, with unequal
position and momentum noise, and introduce a GKP repetition code to suppress
the logical error.

The scheme of correcting biased noise using GKP repetition code is
schematically shown in Fig. 15, where “q-GKP-EC” represents GKP error
correction in position space, “q-rep code” represents error correction in
position space by concatenating with repetition code. The GKP states before
encoding are assumed to be ideal. Biased noise is imposed to the data qubits
after encoding, with the error probability distribution given by Eq. (24). By
choosing $r>1$, the error in momentum space is suppressed at the expense of
amplifying the error in position space. Fortunately, this is not a trouble
because the displacement error in position space can be efficiently corrected
by concatenating the GKP code with repetition code.

However, it should be noted that further error correction in position space
will contaminate the momentum quadrature. From the transformation rule of the
SUM gate given by Eq. (11), the momentum displacement error of the ancillary
qubits can propagate to the momentum space of the data qubits, therefore the
variance of the error distribution in momentum space will be amplified. The
initial noise variance of the physical GKP state in momentum space is
$(\Delta/r)^{2}$. After one round of GKP error correction, the momentum
displacement error of the ancillary GKP qubit propagates to the data qubit,
resulting in a noise variance $(\Delta/r)^{2}+\tilde{\Delta}^{2}$.
Concatenation with repetition code will further increase the noise in momentum
space because of the sequential application of SUM gates during the syndrome
measurement. By concatenating with an $n$-qubit repetition code, the noise
variance of the first data qubit in momentum space becomes
$(\Delta/r)^{2}+n\tilde{\Delta}^{2}$ since it couples with $(n-1)$ ancillary
qubits via the SUM gate; while the noise variance of all other data qubits in
momentum space becomes $(\Delta/r)^{2}+2\tilde{\Delta}^{2}$ since each of them
couples with only one ancillary qubit.

Figure 15:  Scheme to correct biased noise using GKP repetition code. Ideal
GKP repetition code is first generated by injecting ideal GKP states into the
encoding circuit. Biased noise is then imposed to the ideal GKP repetition
code to produce a physical GKP repetition code. The error correction consists
of one round of GKP error correction, syndrome measurement on repetition code
and decoding.  Figure 16: Relation between $P_{\rm fail}$ and $r$, with
$\Delta=0.5,~{}\tilde{\Delta}=0$ and $n=3,5,7,9$. For a fixed code size $n$,
$P_{\text{fail}}$ first decreases to a minimum and then increases, and the
bias level corresponding to the minimal failure probability is the optimal
bias level $r_{\text{opt}}$. The optimal bias level $r_{\rm opt}$ increases as
the size of the code increases.

The logical information is protected when the momentum displacement is in NPZ
and the correction of the position displacement using the GKP repetition code
succeeds. The overall logical error rate after the error correction is given
by

$\begin{split}&P_{\rm
fail}=1-\bigg{[}1-P_{\bar{Z}}\left(\sqrt{(\Delta/r)^{2}+2\tilde{\Delta}^{2}}\right)\bigg{]}^{n-1}\\\
&\times\bigg{[}1-P_{\bar{Z}}\left(\sqrt{(\Delta/r)^{2}+n\tilde{\Delta}^{2}}\right)\bigg{]}\bigg{[}1-P_{f,\text{n-rep}}(r\Delta,\tilde{\Delta})\bigg{]},\end{split}$
(63)

where the expression for $P_{\bar{Z}}(\Delta)$ is the same as
$P_{\bar{X}}(\Delta)$, which is given by Eq. (III.1).

The contribution from momentum displacement in Eq. (63) scales approximately
like $(1-P_{\bar{Z}})^{n}$, which exponentially decreases with increasing $n$
since $P_{\bar{Z}}$ is positive and smaller than one. In the case where
$P_{f,\text{n-rep}}(r\Delta,\tilde{\Delta})$ increases with increasing $n$,
the logical error rate $P_{\rm fail}$ becomes higher for a larger code,
indicating that concatenation with repetition code shows no advantages.
Therefore, in order to exploit the power of code concatenation,
$\tilde{\Delta}$ has to be at least smaller than the upper bound of those
critical values, namely, $\tilde{\Delta}_{53}$. This imposes a minimal
requirement for the variance of the ancillary GKP quibts. However, the actual
condition needed to be satisfied is generally more stringent. The failure
probability $P_{f,\text{n-rep}}(r\Delta,\tilde{\Delta})$ has to decrease fast
enough with increasing $n$, so that the decreasing of the contribution from
the momentum displacement can be compensated and the logical error rate
$P_{\rm fail}$ decreases with increasing $n$. The calculation of the exact
threshold for $\tilde{\Delta}$ is challenging and we leave it for future work.
We conjecture that there exists a nonzero threshold for $\tilde{\Delta}$.

As an indirect evidence for our conjecture, we show that for ideal ancillary
GKP qubits, i.e., $\tilde{\Delta}=0$, the code concatenation can show
advantages in reducing the logical error rate. Note that the error rate
$P_{\rm fail}$ is also a function of the bias level $r$. When $r$ is small,
the displacement error from momentum space dominates; while when $r$ is large,
the displacement error from position space dominates. It is expected that the
error correction achieves its best performance in the intermediate regime
where we can find an optimal bias level $r_{\rm opt}$. The relation between
$P_{\rm fail}$ and $r$ is plotted in Fig. 16 for $\Delta=0.5$ and
$\tilde{\Delta}=0$. It is evident that, for every $n$, the logical error rate
has a minimum corresponding to the optimal bias level $r_{\rm opt}$. In
addition, the optimal bias level increases when the code size increases. Most
importantly, the minimal logical error rate is lower for a larger repetition
code, showing advantages of concatenating the GKP code with repetition code.
However, one should note that $\Delta$ has a threshold when
$\tilde{\Delta}=0$, above which the concatenation with repetition code shows
no advantages. The threshold is estimated to be $0.599\times\sqrt{2}\approx
0.847$ in Ref. Stafford and Menicucci (2022) (Note that the variance of error
distribution of GKP state in our work is twice of that in Ref. Stafford and
Menicucci (2022)).

##  VI Conclusions and outlooks

We study the concatenation of GKP code with repetition code to correct biased
random displacement errors with noisy ancillary GKP qubits. The error
correction procedure consists of one round of GKP error correction,
concatenation with repetition code, syndrome measurement and recovery
operation. The purpose of the GKP error correction is to correct displacement
errors before concatenation to alleviate the heavy burden of the repetition
code.

We find that, after the GKP error correction, the probability of the logical
Pauli $\bar{X}$ error with noisy ancillary qubits always increases as compared
to the case where ideal ancillary qubits are used. This is expected because
the displacement errors from the noisy ancillary qubits can propagate to the
data qubits. We then concatenate the GKP code with repetition code to suppress
the logical Pauli $\bar{X}$ error. We find that there exists a critical value
for the noise variance of the ancillary qubits, below which the logical Pauli
$\bar{X}$ error rate decreases as the size of the repetition code increases;
and there is a slightly different critical value for the noise variance of the
ancillary qubits, above which the logical Pauli $\bar{X}$ error rate increases
as the size of the repetition code increases. These critical values for the
noise variance of the ancillary qubits are dependent on the noise variance of
the data qubits, and they increases monotonically as the noise variance of the
data qubits increases. Their ratio is lower bounded by $1/16$ and upper
bounded by 1. This means if we take $\tilde{\Delta}^{2}=1/16\Delta^{2}$, the
logical Pauli $\bar{X}$ error can be efficiently suppressed by concatenating
with repetition code; while if we take $\tilde{\Delta}^{2}=\Delta^{2}$, the
logical Pauli $\bar{X}$ error rate increases as the code size increases, at
least for repetition codes with the number of data qubits up to nine. We also
show that the GKP error correction before concatenation with repetition code
is necessary, otherwise the logical Pauli $\bar{X}$ error rate cannot be
reduced even for ideal ancillary GKP qubits

We then use the GKP repetition code to correct biased noise, for which the
random displacement errors in momentum space are assumed to be smaller than
that in position space, and therefore no further concatenation is introduced
to correct them. We conjecture that if the noise variance of the ancillary
qubit is below a threshold and $\Delta$ is also below a threshold estimated to
be 0.847, the concatenation with repetition code can efficiently reduce the
overall logical error rate. A GKP repetition code with more data qubits leads
to a lower overall logical error rate, albeit with a higher level of noise
bias.

Although we have taken into account the effects of noisy ancillary GKP qubits,
there are still some assumptions needed to be relaxed in future work. For
example, quantum operations (SUM gates and recovery operations) are assumed to
be ideal, measurement is assumed to be unbiased, and most importantly, the
generation of the encoded states of GKP repetition code is not well studied.
Actually, the $n$ input GKP states before encoding are non-ideal states, so
the degree of squeezing of the $n$ data qubits after encoding are not the
same. However, we use an encoded state with equal degree of squeezing only to
facilitate calculations, and focus on the relation between performance of the
error correction and the quality of the ancillary qubits. Hence, our work only
provides a lower limit of the logical error rate of the error correction code.
There are some other aspects needed to further explore. It is interesting and
important to check whether there is a non-infinite squeezing threshold for the
ancillary GKP qubits for an arbitrarily large GKP repetition code. This can be
estimated for example by using the Monte Carlo simulation. In addition, one
needs to consider the physical encoded states that can be efficiently prepared
in the experiment, and take into account the imperfect Homodyne measurement
and SUM gate.

Acknowledgements: This work is supported by the Fundamental Research Funds for
the Central Universities, HUST (Grant No. 5003012068).

##  Appendix A Physical GKP state

By discussing some examples, we can see that the GKP states defined in Eq.
(15) are physical and have finite energy. In the first example, we assume
$\ket{\bar{\xi}}=\ket{\bar{0}}$, then

$\ket{\tilde{0}}=N_{0}\int{\rm d}u{\rm
d}v\,\eta(u,v)e^{-iu\hat{p}+iv\hat{q}}\ket{\bar{0}}.$ (64)

Consider the wave function of state $\ket{\tilde{0}}$ in position space,

$\displaystyle\tilde{\psi}_{0}(q)$ $\displaystyle=$ $\displaystyle\langle
q\ket{\tilde{0}}=N_{0}\int{\rm d}u{\rm
d}v\,\eta(u,v)\bra{q}e^{-iu\hat{p}+iv\hat{q}}\ket{\bar{0}}=N_{0}\sum_{n=-\infty}^{+\infty}\int{\rm
d}u{\rm d}v\,\eta(u,v)e^{-iuv/2}e^{ivq}\langle q\ket{2n\sqrt{\pi}+u}_{q}$ (65)
$\displaystyle=$ $\displaystyle N_{0}\sum_{n=-\infty}^{+\infty}\int{\rm
d}v\,\eta(q-2n\sqrt{\pi},v)e^{-i(q-2n\sqrt{\pi})v/2}e^{ivq}=\sqrt{2}N_{0}\sqrt{\frac{\kappa}{\Delta}}\sum_{n=-\infty}^{+\infty}e^{-\frac{(q-2n\sqrt{\pi})^{2}}{2\Delta^{2}}}e^{-\frac{\kappa^{2}(q+2n\sqrt{\pi})^{2}}{8}}$
$\displaystyle=$
$\displaystyle\sqrt{2}N_{0}\sqrt{\frac{\kappa}{\Delta}}\sum_{n=-\infty}^{+\infty}\exp\left\\{-\frac{4\pi
n^{2}\kappa^{2}}{2(1+\Delta^{2}\kappa^{2}/4)}\right\\}\exp\left\\{-\frac{1+\Delta^{2}\kappa^{2}/4}{2\Delta^{2}}\left[q-\left(\frac{1-\Delta^{2}\kappa^{2}/4}{1+\Delta^{2}\kappa^{2}/4}\right)2n\sqrt{\pi}\right]^{2}\right\\}.$

It is evident that the wave function $\tilde{\psi}_{0}(q)$ is a sum of a
sequence of Gaussian functions weighted by a function that rapidly decreases
when $n$ increases, therefore the wave function is normalizable and is
physical. Note that the spacing between the Gaussian peaks is slightly
modified,

$\displaystyle 2\sqrt{\pi}\rightarrow
2\sqrt{\pi}\left(\frac{1-\Delta^{2}\kappa^{2}/4}{1+\Delta^{2}\kappa^{2}/4}\right),$
(66)

and the variance is also slightly changed,

$\displaystyle\Delta^{2}\rightarrow\frac{\Delta^{2}}{1+\Delta^{2}\kappa^{2}/4}.$
(67)

When both $\Delta$ and $\kappa$ are sufficiently small, the higher order term
$\Delta^{2}\kappa^{2}$ can be neglected, then the wave function
$\tilde{\psi}_{0}(q)$ can be approximated as

$\displaystyle\tilde{\psi}_{0}(q)\approx\sqrt{2}N_{0}\sqrt{\frac{\kappa}{\Delta}}\sum_{n=-\infty}^{+\infty}e^{-2\pi
n^{2}\kappa^{2}}e^{-\left(q-2n\sqrt{\pi}\right)^{2}/2\Delta^{2}}\approx\left(\frac{4\kappa^{2}}{\pi\Delta^{2}}\right)^{1/4}\sum_{n=-\infty}^{+\infty}e^{-2\pi
n^{2}\kappa^{2}}e^{-\left(q-2n\sqrt{\pi}\right)^{2}/2\Delta^{2}},$

where we have used the approximation that $N_{0}^{2}\approx 1/\sqrt{\pi}$ when
$\Delta$ and $\kappa$ are small.

Then the wave function of state $\ket{\tilde{0}}$ in the momentum space can be
calculated in a similar way,

$\displaystyle\tilde{\psi}_{0}(p)$ $\displaystyle=$ $\displaystyle\langle
p\ket{\tilde{0}}=N_{0}\int{\rm d}u{\rm
d}v\,\eta(u,v)\bra{p}e^{-iu\hat{p}+iv\hat{q}}\ket{\bar{0}}=N_{0}\sum_{n=-\infty}^{+\infty}\int{\rm
d}u{\rm d}v\,\eta(u,v)e^{iuv/2}e^{-iup}\langle p\ket{n\sqrt{\pi}+v}_{p}$ (68)
$\displaystyle=$ $\displaystyle N_{0}\sum_{n=-\infty}^{+\infty}\int{\rm
d}v\,\eta(u,p-n\sqrt{\pi})e^{i(p-n\sqrt{\pi})u/2}e^{-iup}=\sqrt{2}N_{0}\sqrt{\frac{\Delta}{\kappa}}\sum_{n=-\infty}^{+\infty}e^{-\frac{(p-n\sqrt{\pi})^{2}}{2\kappa^{2}}}e^{-\frac{\Delta^{2}(p+n\sqrt{\pi})^{2}}{8}}$
$\displaystyle=$
$\displaystyle\sqrt{2}N_{0}\sqrt{\frac{\Delta}{\kappa}}\sum_{n=-\infty}^{+\infty}\exp\left\\{-\frac{\pi
n^{2}\Delta^{2}}{2(1+\Delta^{2}\kappa^{2}/4)}\right\\}\exp\left\\{-\frac{1+\Delta^{2}\kappa^{2}/4}{2\kappa^{2}}\left[p-\left(\frac{1-\Delta^{2}\kappa^{2}/4}{1+\Delta^{2}\kappa^{2}/4}\right)n\sqrt{\pi}\right]^{2}\right\\}.$

Note that the spacing between the Gaussian peaks is slightly modified,

$\displaystyle\sqrt{\pi}\rightarrow\sqrt{\pi}\left(\frac{1-\Delta^{2}\kappa^{2}/4}{1+\Delta^{2}\kappa^{2}/4}\right),$
(69)

and the variance is also slightly changed,

$\displaystyle\kappa^{2}\rightarrow\frac{\kappa^{2}}{1+\Delta^{2}\kappa^{2}/4}.$
(70)

When both $\Delta$ and $\kappa$ are small, the higher order term
$\Delta^{2}\kappa^{2}$ can be neglected, then the wave function
$\tilde{\psi}_{0}(p)$ can be approximated as

$\displaystyle\tilde{\psi}_{0}(p)\approx\left(\frac{4\Delta^{2}}{\pi\kappa^{2}}\right)^{1/4}\sum_{n=-\infty}^{+\infty}e^{-\pi
n^{2}\Delta^{2}/2}e^{-\left(p-n\sqrt{\pi}\right)^{2}/2\kappa^{2}}.$ (71)

In the second example, we consider $\ket{\bar{\xi}}=\ket{\bar{1}}$, then

$\ket{\tilde{1}}=N_{1}\int{\rm d}u{\rm
d}v\,\eta(u,v)e^{-iu\hat{p}+iv\hat{q}}\ket{\bar{1}}.$ (72)

Using the expression of $\ket{\bar{1}}=\sum_{n}\ket{(2n+1)\sqrt{\pi}}_{q}$ in
position space, we can similarly derive its wave function,

$\displaystyle\tilde{\psi}_{1}(q)=\langle q\ket{\tilde{1}}=N_{1}\int{\rm
d}u{\rm
d}v\,\eta(u,v)\bra{q}e^{-iu\hat{p}+iv\hat{q}}\ket{\bar{1}}=\sqrt{2}N_{1}\sqrt{\frac{\kappa}{\Delta}}\sum_{n=-\infty}^{+\infty}e^{-\frac{\left[q-(2n+1)\sqrt{\pi}\,\right]^{2}}{2\Delta^{2}}}e^{-\frac{\kappa^{2}\left[q+(2n+1)\sqrt{\pi}\right]^{2}}{8}}$
$\displaystyle=\sqrt{2}N_{1}\sqrt{\frac{\kappa}{\Delta}}\sum_{n=-\infty}^{+\infty}\exp\left\\{-\frac{\pi(2n+1)^{2}\kappa^{2}}{2(1+\Delta^{2}\kappa^{2}/4)}\right\\}\exp\left\\{-\frac{1+\Delta^{2}\kappa^{2}/4}{2\Delta^{2}}\left[q-\left(\frac{1-\Delta^{2}\kappa^{2}/4}{1+\Delta^{2}\kappa^{2}/4}\right)(2n+1)\sqrt{\pi}\right]^{2}\right\\}.$
(73)

When both $\Delta$ and $\kappa$ are sufficiently small, the higher order term
$\Delta^{2}\kappa^{2}$ can be neglected, then the wave function
$\tilde{\psi}_{1}(q)$ can be approximated as

$\displaystyle\tilde{\psi}_{1}(q)\approx\sqrt{2}N_{1}\sqrt{\frac{\kappa}{\Delta}}\sum_{n=-\infty}^{+\infty}e^{-\frac{(2n+1)^{2}\pi\kappa^{2}}{2}}e^{-\frac{\left[q-(2n+1)\sqrt{\pi}\right]^{2}}{2\Delta^{2}}}\approx\left(\frac{4\kappa^{2}}{\pi\Delta^{2}}\right)^{1/4}\sum_{n=-\infty}^{+\infty}e^{-\frac{(2n+1)^{2}\pi\kappa^{2}}{2}}e^{-\frac{\left[q-(2n+1)\sqrt{\pi}\right]^{2}}{2\Delta^{2}}},$
(74)

where we have used the approximation that $N_{1}^{2}\approx 1/\sqrt{\pi}$ when
$\Delta$ and $\kappa$ are small.

The wave function in momentum space can be calculated in a similar way,

$\displaystyle\tilde{\psi}_{1}(p)=\langle p\ket{\tilde{0}}=N_{1}\int{\rm
d}u{\rm
d}v\,\eta(u,v)\bra{p}e^{-iu\hat{p}+iv\hat{q}}\ket{\bar{1}}=\sqrt{2}N_{1}\sqrt{\frac{\Delta}{\kappa}}\sum_{n=-\infty}^{+\infty}(-1)^{n}e^{-\frac{(p-n\sqrt{\pi})^{2}}{2\kappa^{2}}}e^{-\frac{\Delta^{2}(p+n\sqrt{\pi})^{2}}{8}}$
$\displaystyle=\sqrt{2}N_{1}\sqrt{\frac{\Delta}{\kappa}}\sum_{n=-\infty}^{+\infty}(-1)^{n}\exp\left\\{-\frac{\pi
n^{2}\Delta^{2}}{2(1+\Delta^{2}\kappa^{2}/4)}\right\\}\exp\left\\{-\frac{1+\Delta^{2}\kappa^{2}/4}{2\kappa^{2}}\left[p-\left(\frac{1-\Delta^{2}\kappa^{2}/4}{1+\Delta^{2}\kappa^{2}/4}\right)n\sqrt{\pi}\right]^{2}\right\\}.$
(75)

When both $\Delta$ and $\kappa$ are small, the higher order term
$\Delta^{2}\kappa^{2}$ can be neglected, then the wave function
$\tilde{\psi}_{1}(p)$ can be approximated as

$\displaystyle\tilde{\psi}_{1}(p)\approx\left(\frac{4\Delta^{2}}{\pi\kappa^{2}}\right)^{1/4}\sum_{n=-\infty}^{+\infty}(-1)^{n}e^{-\pi
n^{2}\Delta^{2}/2}e^{-\left(p-n\sqrt{\pi}\right)^{2}/2\kappa^{2}}.$ (76)

According to the definition of the Wigner function in Eq. (12) and the
expression for $\tilde{\psi}_{0}(q)$, it is straightforward to calculate the
Wigner function of the physical GKP state $\ket{\tilde{0}}$,

$\displaystyle W(q,p;\ket{\tilde{0}}\bra{\tilde{0}})$ $\displaystyle=$
$\displaystyle\sqrt{\pi}N_{0}^{2}\sum_{m,n}e^{-\pi\Delta_{s}^{2}m^{2}/4-4\pi\kappa_{s}^{2}n^{2}}\exp\left\\{-\frac{(p-m\sqrt{\pi}\gamma/2)^{2}}{\kappa_{s}^{2}}-\frac{(q-2n\sqrt{\pi}\gamma)^{2}}{\Delta_{s}^{2}}\right\\}$
(77)
$\displaystyle+\sqrt{\pi}N_{0}^{2}\sum_{m,n}(-1)^{m}e^{-\pi\Delta_{s}^{2}m^{2}/4-\pi\kappa_{s}^{2}(2n+1)^{2}}\exp\left\\{-\frac{(p-m\sqrt{\pi}\gamma/2)^{2}}{\kappa_{s}^{2}}-\frac{[q-(2n+1)\sqrt{\pi}\gamma\,]^{2}}{\Delta_{s}^{2}}\right\\},$

where $\Delta_{s}=\Delta/\sqrt{1+\Delta^{2}\kappa^{2}/4}$,
$\kappa_{s}=\kappa/\sqrt{1+\Delta^{2}\kappa^{2}/4}$ and
$\gamma=\frac{1-\Delta^{2}\kappa^{2}/4}{1+\Delta^{2}\kappa^{2}/4}$. When both
$\Delta$ and $\kappa$ are sufficiently small, the higher order term
$\Delta^{2}\kappa^{2}$ can be neglected, namely,
$\Delta_{s}\rightarrow\Delta$, $\kappa_{s}\rightarrow\kappa$ and
$\gamma\rightarrow 1$. The Wigner function of the physical GKP state can be
approximated as

$\displaystyle W(q,p;\ket{\tilde{0}}\bra{\tilde{0}})$ $\displaystyle\approx$
$\displaystyle\sum_{m,n}e^{-\pi\Delta^{2}m^{2}/4-4\pi\kappa^{2}n^{2}}\exp\left\\{-\frac{(p-m\sqrt{\pi}/2)^{2}}{\kappa^{2}}-\frac{(q-2n\sqrt{\pi})^{2}}{\Delta^{2}}\right\\}$
(78)
$\displaystyle+\sum_{m,n}(-1)^{m}e^{-\pi\Delta^{2}m^{2}/4-\pi\kappa^{2}(2n+1)^{2}}\exp\left\\{-\frac{(p-m\sqrt{\pi}/2)^{2}}{\kappa^{2}}-\frac{[q-(2n+1)\sqrt{\pi}\,]^{2}}{\Delta^{2}}\right\\}.$

Consider the Wigner function of the ideal GKP state $\ket{\bar{0}}$ after
going through a GDC. The density matrix is

$\displaystyle\hat{\rho}$ $\displaystyle=$ $\displaystyle\int{\rm d}u{\rm
d}vf(u,v)\hat{D}(u,v)\ket{\bar{0}}\bra{\bar{0}}\hat{D}^{\dagger}(u,v)=\sum_{n,m}\int{\rm
d}u{\rm
d}vf(u,v)e^{2i\sqrt{\pi}v(n-m)}\ket{2n\sqrt{\pi}+u}_{q}\bra{2m\sqrt{\pi}+u}.$
(79)

According to Eq. (12), the Wigner function can be calculated as

$\displaystyle W(q,p;\hat{\rho})$ $\displaystyle=$
$\displaystyle\frac{1}{4\pi\sqrt{\pi}\Delta\kappa}\sum_{m,n}\exp\left\\{-\frac{(p-m\sqrt{\pi}/2)^{2}}{\delta_{p}^{2}}-\frac{(q-2n\sqrt{\pi})^{2}}{\delta_{q}^{2}}\right\\}$
(80)
$\displaystyle+\frac{1}{4\pi\sqrt{\pi}\Delta\kappa}\sum_{m,n}(-1)^{m}\exp\left\\{-\frac{(p-m\sqrt{\pi}/2)^{2}}{\delta_{p}^{2}}-\frac{[q-(2n+1)\sqrt{\pi}\,]^{2}}{\delta_{q}^{2}}\right\\}.$

After the action of GDC, the new Wigner function $W(q,p)$ is related to the
old Wigner function $W_{0}(q,p)$ via

$\displaystyle W(q,p)=\int{\rm d}u{\rm d}vf(u,v)W_{0}(q+u,p+v)=\int{\rm
d}u{\rm d}vf(u-q,v-p)W_{0}(u,v),$ (81)

Which implies that the new Wigner function is the convolution of the old
Wigner function and the noise distribution function $f$. Although the physical
GKP state is not Gaussian, their Wigner function can be written as a sum of a
sequence of Gaussian functions. Since the convolution of two Gaussian
functions gives also a Gaussian function, the Wigner function of a physical
GKP state after going through a GDC is still a sum of a sequence of Gaussian
functions. Furthermore, the variances of the new Gaussian functions are the
sum of the variances of the old Gaussian functions and those of noise
distribution function. Suppose
$W_{0}(q,p)=W(q,p;\ket{\tilde{0}}\bra{\tilde{0}})$, then the Wigner function
after going through the GDC is given by

$\displaystyle W_{\rm GDC}(q,p;\ket{\tilde{0}}\bra{\tilde{0}})$
$\displaystyle\approx$
$\displaystyle\frac{\Delta\kappa}{\sqrt{(\delta_{q}^{2}+\Delta^{2})(\delta_{p}^{2}+\kappa^{2})}}\bigg{\\{}\sum_{m,n}e^{-\pi\Delta^{2}m^{2}/4-4\pi\kappa^{2}n^{2}}\exp\left[-\frac{(p-m\sqrt{\pi}/2)^{2}}{\kappa^{2}+\delta_{p}^{2}}-\frac{(q-2n\sqrt{\pi})^{2}}{\Delta^{2}+\delta_{q}^{2}}\right]$
(82)
$\displaystyle+\sum_{m,n}(-1)^{m}e^{-\pi\Delta^{2}m^{2}/4-\pi\kappa^{2}(2n+1)^{2}}\exp\left[-\frac{(p-m\sqrt{\pi}/2)^{2}}{\kappa^{2}+\delta_{p}^{2}}-\frac{(q-(2n+1)\sqrt{\pi}\,)^{2}}{\Delta^{2}+\delta_{q}^{2}}\right]\bigg{\\}}.$

##  Appendix B Error distribution of GKP state after SUM gate with physical
ancillary qubit

We give the detailed calculation of the error distribution of GKP state after
GKP error correction with a physical ancillary qubit, i.e., we calculate the
probability distribution of the variable $u^{\prime}$ given by Eq. (36), with
the probability distribution of $u_{1}$ and $u_{2}$ given by Eq. (34). We
first need to calculate the probability $P(u^{\prime}\leq x)$ for a given $x$,

$\displaystyle P(u^{\prime}\leq x)$ $\displaystyle=$
$\displaystyle\sum_{k}P\left[u_{2}\geq k\sqrt{\pi}-x\text{ and
}(k-\frac{1}{2})\sqrt{\pi}\leq u_{1}+u_{2}<(k+\frac{1}{2})\sqrt{\pi}\right]$
(83) $\displaystyle=$
$\displaystyle\sum_{k}\int_{k\sqrt{\pi}-x}^{+\infty}f_{q_{2}}(u_{2}){\rm
d}u_{2}\int_{(k-1/2)\sqrt{\pi}-u_{2}}^{(k+1/2)\sqrt{\pi}-u_{2}}f_{q_{1}}(u_{1}){\rm
d}u_{1}$ $\displaystyle=$
$\displaystyle\frac{1}{2}\sum_{k}\int_{k\sqrt{\pi}-x}^{+\infty}{\rm
d}u_{2}f_{q_{2}}(u_{2})\left[\text{erf}\left(\frac{(k+1/2)\sqrt{\pi}-u_{2}}{\Delta}\right)-\text{erf}\left(\frac{(k-1/2)\sqrt{\pi}-u_{2}}{\Delta}\right)\right].$

Then the probability distribution of $u^{\prime}$ is obtained by taking
derivative with respect to $x$,

$\displaystyle F(u^{\prime}=x)$ $\displaystyle=$
$\displaystyle\frac{\mathrm{d}P(u^{\prime}\leq x)}{\mathrm{d}x}$ (84)
$\displaystyle=$
$\displaystyle\frac{1}{2}\sum_{k}f_{q_{2}}(u_{2}=k\sqrt{\pi}-x)\cdot\left[\text{erf}\left(\frac{\sqrt{\pi}/2+x}{\Delta}\right)-\text{erf}\left(\frac{-\sqrt{\pi}/2+x}{\Delta}\right)\right]$
$\displaystyle=$
$\displaystyle\frac{1}{2\sqrt{\pi}\tilde{\Delta}}\left[\text{erf}\left(\frac{\sqrt{\pi}/2+x}{\Delta}\right)-\text{erf}\left(\frac{-\sqrt{\pi}/2+x}{\Delta}\right)\right]\cdot\sum_{t}\text{exp}\left[-\frac{(x-t\sqrt{\pi})^{2}}{\tilde{\Delta}^{2}}\right].$

Finally Eq. (37) is obtained by simply rewriting the above result.

##  Appendix C Calculation of the failure probability of $n$-qubit GKP
repetition code

The correspondence between measurement outcomes and correctable errors is
given by Tab. 3. However, this decoding procedure may result in
misidentification of the error, which is different from that of the classical
$n$-qubit repetition code. Here we provide the detailed calculation of the
failure probability of $n$-qubit GKP repetition code. Similar to the
discussion in Sec. IV.1, we need to reverse the decoding process and impose
some conditions to be satisfied. All possible cases are summarized as follows:

  * •

Case 1: If no error occurs $\Rightarrow$we require
$M_{1},M_{2},\cdots,M_{n-1}\in\text{NPZ}$;

  * •

Case 2: If $\bar{X}$ applies on data qubit $D_{1}$ $\Rightarrow$ we require
$M_{1},M_{2},\cdots,M_{n-1}\in\text{PZ}$. We find that this failure
probability is the same as all $C_{n}^{1}$ cases where $\bar{X}$ applies on a
single data qubit.

  * •

Case $i$ ($3\leq i\leq\frac{n+1}{2}$): If $\bar{X}$ applies on data qubit
$D_{1},D_{2},\cdots,D_{i-1}$ $\Rightarrow$ we require
$M_{1},\cdots,M_{i-2}\in\text{NPZ},M_{i-1},\cdots,M_{n-1}\in\text{PZ}$. This
failure probability is the same as all $C_{n}^{i-1}$ cases where $\bar{X}$
applies on $i-1$ data qubits.

  * •

Case $\frac{n+3}{2}$: If errors occur on more than $(n-1)/2$ data qubits, with
probability $\sum_{j=\frac{n+1}{2}}^{n}C_{n}^{j}P_{F}^{j}(1-P_{F})^{n-j}$
$\Rightarrow$ the error correction fails.

Note that we incorporate all $C_{n}^{s}$ possibilities where errors occur on
$s$ data qubits into one case, and we consider a representative where errors
occur on the first $s$ data qubits $D_{1},D_{2},\cdots,D_{s}$, for all
possibilities have the same failure probability.

Now we calculate the failure probability for these $(n+3)/2$ cases, the sum of
which gives the total probability of failure. Consider case 1, there are
$2n-1$ constraints needed to be satisfied simultaneously,

No Pauli $\bar{X}$ error $\displaystyle\Rightarrow$
$\displaystyle\left|u_{1}^{\prime}-2s_{1}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},\left|u_{2}^{\prime}-2s_{2}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},\cdots,\left|u_{n}^{\prime}-2s_{n}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},$
$\displaystyle M_{1},M_{2},\cdots,M_{n-1}\in\text{NPZ}$
$\displaystyle\Rightarrow$
$\displaystyle\left|u_{1}^{\prime}+u_{2}^{\prime}+\alpha_{1}-2t_{1}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},\cdots,\left|u_{1}^{\prime}+u_{n}^{\prime}+\alpha_{n-1}-2t_{n-1}\sqrt{\pi}\right|<\frac{\sqrt{\pi}}{2},$
(85)

where $s_{i}\in\mathbb{Z}$ and $t_{i}\in\mathbb{Z}$. The probability of
success is obtained by integrating the probability distribution of $2n-1$
variables in the domain defined by these $2n-1$ inequalities. Similar to the
discussion in Sec. IV.1, we use the numerical method to calculate the
integration. We first fix a point
$(u_{1}^{\prime},u_{2}^{\prime},...,u_{n}^{\prime})$ defined by the first $n$
inequalities in Eq. (C), then success probability at this given point is

$\displaystyle P_{\alpha}^{1}(u_{1}^{\prime},\cdots,u_{n}^{\prime})$
$\displaystyle=$
$\displaystyle\left(\sum_{t_{1}}\int_{-\sqrt{\pi}/2+2t_{1}\sqrt{\pi}-u_{1}^{\prime}-u_{2}^{\prime}}^{\sqrt{\pi}/2+2t_{1}\sqrt{\pi}-u_{1}^{\prime}-u_{2}^{\prime}}f_{q_{1}^{\prime}}(\alpha_{1}){\rm
d}\alpha_{1}\right)\times\cdots\times\left(\sum_{t_{n-1}}\int_{-\sqrt{\pi}/2+2t_{n-1}\sqrt{\pi}-u_{1}^{\prime}-u_{n}^{\prime}}^{\sqrt{\pi}/2+2t_{n-1}\sqrt{\pi}-u_{1}^{\prime}-u_{n}^{\prime}}f_{q_{n-1}^{\prime}}(\alpha_{n-1}){\rm
d}\alpha_{n-1}\right)$ (86) $\displaystyle\approx$
$\displaystyle\frac{1}{2^{n-1}}\prod_{k=2}^{n}\left[{\rm
erf}\left(\frac{\sqrt{\pi}/2-u_{1}^{\prime}-u_{k}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{-\sqrt{\pi}/2-u_{1}^{\prime}-u_{k}^{\prime}}{\tilde{\Delta}}\right)\right],$

where we have only kept one term $t_{1}=t_{2}=\cdots=t_{n-1}=0$ in the
summation because the contribution from other terms is negligible. Then the
failure probability of case 1 is given by integrating the failure probability
$1-P_{\alpha}^{1}(u_{1}^{\prime},...,u_{n}^{\prime})$ over all points
satisfying the constraints in Eq. (C), weighted by the probability
distribution $\prod_{i=1}^{n}F(u_{i}^{\prime})$,

$\displaystyle P_{f,\text{n-rep}}^{1}$ $\displaystyle=$
$\displaystyle\int_{u_{1}^{\prime}\in{\rm
NPZ}}\cdots\int_{u_{n}^{\prime}\in{\rm
NPZ}}\left[\prod_{i=1}^{n}F(u_{i}^{\prime})\right]\left[1-P_{\alpha}^{1}(u_{1}^{\prime},\cdots,u_{n}^{\prime})\right]{\rm
d}u_{1}^{\prime}...{\rm d}u_{n}^{\prime}$ (87) $\displaystyle\approx$
$\displaystyle\int_{u_{1}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\cdots\int_{u_{n}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\left[\prod_{i=1}^{n}F(u_{i}^{\prime})\right]\left[1-P_{\alpha}^{1}(u_{1}^{\prime},\cdots,u_{n}^{\prime})\right]{\rm
d}u_{1}^{\prime}...{\rm d}u_{n}^{\prime},$

where we have only kept one term with $s_{1}=s_{2}=\cdots=s_{n}=0$ in the
summation because the contribution form other terms is negligible.

Similarly, we can derive the failure probability of case 2 by taking into
account the condition that
$u_{1}^{\prime}\in\text{PZ},u_{2}^{\prime}\in\text{NPZ},\cdots,u_{n}^{\prime}\in\text{NPZ}$,

$\displaystyle P_{f,\text{n-rep}}^{2}$ $\displaystyle=$
$\displaystyle\int_{u_{1}^{\prime}\in{\rm PZ}}\int_{u_{2}^{\prime}\in{\rm
NPZ}}\cdots\int_{u_{n}^{\prime}\in{\rm
NPZ}}\left[\prod_{i=1}^{n}F(u_{i}^{\prime})\right]\left[1-P_{\alpha}^{2}(u_{1}^{\prime},\cdots,u_{n}^{\prime})\right]{\rm
d}u_{1}^{\prime}\cdots{\rm d}u_{n}^{\prime}$ (88) $\displaystyle\approx$
$\displaystyle
2\int_{u_{1}^{\prime}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\int_{u_{2}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\cdots\int_{u_{n}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\left[\prod_{i=1}^{n}F(u_{i}^{\prime})\right]\left[1-P_{\alpha}^{2}(u_{1}^{\prime},\cdots,u_{n}^{\prime})\right]{\rm
d}u_{1}^{\prime}\cdots{\rm d}u_{n}^{\prime},$

where $P_{\alpha}^{2}(u_{1}^{\prime},\cdots,u_{n}^{\prime})$ is the success
probability for a given point
$(u_{1}^{\prime},u_{2}^{\prime},\cdots,u_{n}^{\prime})$ when
$M_{1},M_{2},\cdots,M_{n-1}\in{\rm PZ}$,

$\displaystyle P_{\alpha}^{2}(u_{1}^{\prime},\cdots,u_{n}^{\prime})$
$\displaystyle=$
$\displaystyle\left(\sum_{t_{1}}\int_{\sqrt{\pi}/2+2t_{1}\sqrt{\pi}-u_{1}^{\prime}-u_{2}^{\prime}}^{3\sqrt{\pi}/2+2t_{1}\sqrt{\pi}-u_{1}^{\prime}-u_{2}^{\prime}}f_{q_{1}^{\prime}}(\alpha_{1}){\rm
d}\alpha_{1}\right)\times\cdots\times\left(\sum_{t_{n-1}}\int_{\sqrt{\pi}/2+2t_{n-1}\sqrt{\pi}-u_{1}^{\prime}-u_{n}^{\prime}}^{3\sqrt{\pi}/2+2t_{n-1}\sqrt{\pi}-u_{1}^{\prime}-u_{n}^{\prime}}f_{q_{n-1}^{\prime}}(\alpha_{n-1}){\rm
d}\alpha_{n-1}\right)$ (89) $\displaystyle\approx$
$\displaystyle\frac{1}{2^{n-1}}\prod_{k=2}^{n}\left[{\rm
erf}\left(\frac{3\sqrt{\pi}/2-u_{1}^{\prime}-u_{k}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{\sqrt{\pi}/2-u_{1}^{\prime}-u_{k}^{\prime}}{\tilde{\Delta}}\right)\right].$

Note that there are $C_{n}^{1}$ cases giving the same result as case 2, so we
need to plus $P_{f,\text{n-rep}}^{2}$ with $C_{n}^{1}$ in the total failure
probability.

In a similar way, the failure probability of case $i$ ($3\leq
i\leq\frac{n+1}{2}$) is given by taking into account the condition that
$u_{1}^{\prime},\cdots,u_{i-1}^{\prime}\in{\rm PZ}$,
$u_{i}^{\prime},\cdots,u_{n}^{\prime}\in{\rm NPZ}$,

$\displaystyle P_{f,\text{n-rep}}^{i}$ $\displaystyle=$
$\displaystyle\int_{u_{1}^{\prime}\in{\rm
PZ}}\cdots\int_{u_{i-1}^{\prime}\in{\rm PZ}}\int_{u_{i}^{\prime}\in{\rm
NPZ}}\cdots\int_{u_{n}^{\prime}\in{\rm
NPZ}}\left[\prod_{i=1}^{n}F(u_{i}^{\prime})\right]\left[1-P_{\alpha}^{i}(u_{1}^{\prime},\cdots,u_{n}^{\prime})\right]{\rm
d}u_{1}^{\prime}\cdots{\rm d}u_{n}^{\prime}$ $\displaystyle\approx$
$\displaystyle
2^{i-1}\int_{u_{1}^{\prime}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\cdots\int_{u_{i-1}^{\prime}=\sqrt{\pi}/2}^{3\sqrt{\pi}/2}\int_{u_{i}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\cdots\int_{u_{n}^{\prime}=-\sqrt{\pi}/2}^{\sqrt{\pi}/2}\left[\prod_{i=1}^{n}F(u_{i}^{\prime})\right]\left[1-P_{\alpha}^{i}(u_{1}^{\prime},\cdots,u_{n}^{\prime})\right]{\rm
d}u_{1}^{\prime}\cdots{\rm d}u_{n}^{\prime},$

where $P_{\alpha}^{i}(u_{1}^{\prime},\cdots,u_{n}^{\prime})$ is the success
probability for the point
$(u_{1}^{\prime},u_{2}^{\prime},\cdots,u_{n}^{\prime})$ when
$M_{1},\cdots,M_{i-2}\in\text{NPZ}$, $M_{i-1},\cdots,M_{n-1}\in\text{PZ}$,

$\displaystyle P_{\alpha}^{i}(u_{1}^{\prime},\cdots,u_{n}^{\prime})$
$\displaystyle=$
$\displaystyle\frac{1}{2^{n-1}}\prod_{k_{1}=2}^{i-1}\left[{\rm
erf}\left(\frac{5\sqrt{\pi}/2-u_{1}^{\prime}-u_{k_{1}}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{3\sqrt{\pi}/2-u_{1}^{\prime}-u_{k_{1}}^{\prime}}{\tilde{\Delta}}\right)\right]$
(91) $\displaystyle=$ $\displaystyle\times\prod_{k_{2}=i}^{n}\left[{\rm
erf}\left(\frac{3\sqrt{\pi}/2-u_{1}^{\prime}-u_{k_{2}}^{\prime}}{\tilde{\Delta}}\right)-{\rm
erf}\left(\frac{\sqrt{\pi}/2-u_{1}^{\prime}-u_{k_{2}}^{\prime}}{\tilde{\Delta}}\right)\right].$

There are $C_{n}^{i-1}$ cases giving the same result as the case $i$, so we
need to add a factor $C_{n}^{i-1}$ in the expression of the failure
probability.

The failure probability of case $\frac{n+3}{2}$ is given by

$P_{f,\text{n-rep}}^{\frac{n+3}{2}}=\sum_{j=\frac{n+1}{2}}^{n}C_{n}^{j}P_{F}^{j}(1-P_{F})^{n-j}.$
(92)

Finally, the total failure probability of the $n$-qubit GKP repetition code is
summation of the failure probabilities of all $(n+3)/2$ cases,

$P_{f,\text{n-rep}}=P_{f,\text{n-rep}}^{1}+C_{n}^{1}P_{f,\text{n-rep}}^{2}+\sum_{i=3}^{\frac{n+1}{2}}C_{n}^{i-1}P_{f,\text{n-rep}}^{i}+P_{f,\text{n-rep}}^{\frac{n+3}{2}}.$
(93)

## References

  * Shor (1995) P. W. Shor, Phys. Rev. A 52, R2493 (1995), URL https://link.aps.org/doi/10.1103/PhysRevA.52.R2493.
  * Gottesman (1997) D. Gottesman, _Stabilizer codes and quantum error correction_ (California Institute of Technology, 1997).
  * Terhal (2015) B. M. Terhal, Reviews of Modern Physics 87, 307 (2015), URL https://doi.org/10.1103/RevModPhys.87.307.
  * Weedbrook et al. (2012) C. Weedbrook, S. Pirandola, R. García-Patrón, N. J. Cerf, T. C. Ralph, J. H. Shapiro, and S. Lloyd, Reviews of Modern Physics 84, 621 (2012), URL https://doi.org/10.1103/RevModPhys.84.621.
  * Braunstein and Van Loock (2005) S. L. Braunstein and P. Van Loock, Reviews of modern physics 77, 513 (2005), URL https://doi.org/10.1103/RevModPhys.77.513.
  * Albert et al. (2018a) V. V. Albert, K. Noh, K. Duivenvoorden, D. J. Young, R. T. Brierley, P. Reinhold, C. Vuillot, L. Li, C. Shen, S. M. Girvin, et al., Phys. Rev. A 97, 032346 (2018a), URL https://link.aps.org/doi/10.1103/PhysRevA.97.032346.
  * Cai et al. (2021) W. Cai, Y. Ma, W. Wang, C.-L. Zou, and L. Sun, Fundamental Research 1, 50 (2021), URL https://doi.org/10.1016/j.fmre.2020.12.006.
  * Gottesman et al. (2001) D. Gottesman, A. Kitaev, and J. Preskill, Phys. Rev. A 64, 012310 (2001), URL https://link.aps.org/doi/10.1103/PhysRevA.64.012310.
  * Grimsmo and Puri (2021) A. L. Grimsmo and S. Puri, PRX Quantum 2, 020101 (2021), URL https://doi.org/10.1103/PRXQuantum.2.020101.
  * Cochrane et al. (1999) P. T. Cochrane, G. J. Milburn, and W. J. Munro, Phys. Rev. A 59, 2631 (1999), URL https://link.aps.org/doi/10.1103/PhysRevA.59.2631.
  * Ralph et al. (2003) T. C. Ralph, A. Gilchrist, G. J. Milburn, W. J. Munro, and S. Glancy, Phys. Rev. A 68, 042319 (2003), URL https://link.aps.org/doi/10.1103/PhysRevA.68.042319.
  * Michael et al. (2016) M. H. Michael, M. Silveri, R. T. Brierley, V. V. Albert, J. Salmilehto, L. Jiang, and S. M. Girvin, Phys. Rev. X 6, 031006 (2016), URL https://link.aps.org/doi/10.1103/PhysRevX.6.031006.
  * Hu et al. (2019) L. Hu, Y. Ma, W. Cai, X. Mu, Y. Xu, W. Wang, Y. Wu, H. Wang, Y. Song, C.-L. Zou, et al., Nature Physics 15, 503 (2019), URL https://doi.org/10.1038/s41567-018-0414-3.
  * Albert et al. (2018b) V. V. Albert, K. Noh, K. Duivenvoorden, D. J. Young, R. Brierley, P. Reinhold, C. Vuillot, L. Li, C. Shen, S. Girvin, et al., Physical Review A 97, 032346 (2018b), URL https://doi.org/10.1103/PhysRevA.97.032346.
  * Grimsmo et al. (2020) A. L. Grimsmo, J. Combes, and B. Q. Baragiola, Phys. Rev. X 10, 011058 (2020), URL https://link.aps.org/doi/10.1103/PhysRevX.10.011058.
  * Endo et al. (2022) S. Endo, Y. Suzuki, K. Tsubouchi, R. Asaoka, K. Yamamoto, Y. Matsuzaki, and Y. Tokunaga, arXiv preprint arXiv:2211.06164 (2022), URL https://doi.org/10.48550/arXiv.2211.06164.
  * Noh et al. (2018) K. Noh, V. V. Albert, and L. Jiang, IEEE Transactions on Information Theory 65, 2563 (2018).
  * Flühmann et al. (2019) C. Flühmann, T. L. Nguyen, M. Marinelli, V. Negnevitsky, K. Mehta, and J. Home, Nature 566, 513 (2019), URL https://doi.org/10.1038/s41586-019-0960-6.
  * De Neeve et al. (2022) B. De Neeve, T.-L. Nguyen, T. Behrle, and J. P. Home, Nature Physics 18, 296 (2022), URL https://doi.org/10.1038/s41567-021-01487-7.
  * Campagne-Ibarcq et al. (2020) P. Campagne-Ibarcq, A. Eickbusch, S. Touzard, E. Zalys-Geller, N. E. Frattini, V. V. Sivak, P. Reinhold, S. Puri, S. Shankar, R. J. Schoelkopf, et al., Nature 584, 368 (2020), URL https://doi.org/10.1038/s41586-020-2603-3.
  * Baragiola et al. (2019) B. Q. Baragiola, G. Pantaleoni, R. N. Alexander, A. Karanjai, and N. C. Menicucci, Phys. Rev. Lett. 123, 200502 (2019), URL https://link.aps.org/doi/10.1103/PhysRevLett.123.200502.
  * Vasconcelos et al. (2010) H. M. Vasconcelos, L. Sanz, and S. Glancy, Optics letters 35, 3261 (2010), URL https://doi.org/10.1364/OL.35.003261.
  * Su et al. (2019) D. Su, C. R. Myers, and K. K. Sabapathy, Phys. Rev. A 100, 052301 (2019), URL https://link.aps.org/doi/10.1103/PhysRevA.100.052301.
  * Eaton et al. (2019) M. Eaton, R. Nehra, and O. Pfister, New Journal of Physics 21, 113034 (2019).
  * Hastrup and Andersen (2022) J. Hastrup and U. L. Andersen, Phys. Rev. Lett. 128, 170503 (2022), URL https://link.aps.org/doi/10.1103/PhysRevLett.128.170503.
  * Dahan et al. (2023) R. Dahan, G. Baranes, A. Gorlach, R. Ruimy, N. Rivera, and I. Kaminer, Phys. Rev. X 13, 031001 (2023), URL https://link.aps.org/doi/10.1103/PhysRevX.13.031001.
  * Fukui et al. (2018) K. Fukui, A. Tomita, A. Okamoto, and K. Fujii, Phys. Rev. X 8, 021054 (2018), URL https://link.aps.org/doi/10.1103/PhysRevX.8.021054.
  * Vuillot et al. (2019) C. Vuillot, H. Asasi, Y. Wang, L. P. Pryadko, and B. M. Terhal, Phys. Rev. A 99, 032344 (2019), URL https://link.aps.org/doi/10.1103/PhysRevA.99.032344.
  * Hänggli et al. (2020) L. Hänggli, M. Heinze, and R. König, Phys. Rev. A 102, 052408 (2020), URL https://link.aps.org/doi/10.1103/PhysRevA.102.052408.
  * Noh and Chamberland (2020) K. Noh and C. Chamberland, Physical Review A 101, 012316 (2020), URL https://doi.org/10.1103/PhysRevA.101.012316.
  * Bourassa et al. (2021) J. E. Bourassa, R. N. Alexander, M. Vasmer, A. Patil, I. Tzitrin, T. Matsuura, D. Su, B. Q. Baragiola, S. Guha, G. Dauphinais, et al., Quantum 5, 392 (2021), ISSN 2521-327X, URL https://doi.org/10.22331/q-2021-02-04-392.
  * Noh et al. (2022) K. Noh, C. Chamberland, and F. G. Brandão, PRX Quantum 3, 010315 (2022), URL https://link.aps.org/doi/10.1103/PRXQuantum.3.010315.
  * Bombin and Martin-Delgado (2006) H. Bombin and M. A. Martin-Delgado, Physical review letters 97, 180501 (2006), URL https://doi.org/10.1103/PhysRevLett.97.180501.
  * Fowler (2011) A. G. Fowler, Physical Review A 83, 042310 (2011), URL https://doi.org/10.1103/PhysRevA.83.042310.
  * Zhang et al. (2021) J. Zhang, J. Zhao, Y.-C. Wu, and G.-P. Guo, Phys. Rev. A 104, 062434 (2021), URL https://link.aps.org/doi/10.1103/PhysRevA.104.062434.
  * Bonilla Ataides et al. (2021) J. P. Bonilla Ataides, D. K. Tuckett, S. D. Bartlett, S. T. Flammia, and B. J. Brown, Nature communications 12, 2172 (2021), URL https://doi.org/10.1038/s41467-021-22274-1.
  * Zhang et al. (2023) J. Zhang, Y.-C. Wu, and G.-P. Guo, Physical Review A 107, 062408 (2023), URL https://doi.org/10.1103/PhysRevA.107.062408.
  * Higgott (2022) O. Higgott, ACM Transactions on Quantum Computing 3, 1 (2022).
  * Stafford and Menicucci (2022) M. P. Stafford and N. C. Menicucci, arXiv preprint arXiv:2212.11397 (2022), URL https://doi.org/10.48550/arXiv.2212.11397Focustolearnmore.
  * Gerry and Knight (2005) C. Gerry and P. L. Knight, _Introductory quantum optics_ (Cambridge university press, 2005).
  * Fukui et al. (2017) K. Fukui, A. Tomita, and A. Okamoto, Physical review letters 119, 180507 (2017), URL https://doi.org/10.1103/PhysRevLett.119.180507.
  * Xu et al. (2023) Y. Xu, Y. Wang, E.-J. Kuo, and V. V. Albert, PRX Quantum 4, 020342 (2023), URL https://doi.org/10.1103/PRXQuantum.4.020342.
  * Nielsen and Chuang (2010) M. A. Nielsen and I. L. Chuang, _Quantum computation and quantum information_ (Cambridge university press, 2010).
  * Devitt et al. (2013) S. J. Devitt, W. J. Munro, and K. Nemoto, Reports on Progress in Physics 76, 076001 (2013).