# Coherent errors in stabilizer codes caused by quasistatic phase damping

Dávid Pataki  0000-0002-8818-3723 Department of Theoretical Physics, Institute
of Physics, Budapest University of Technology and Economics, Műegyetem rkp.
3., H-1111 Budapest, Hungary  Áron Márton  Department of Theoretical Physics,
Institute of Physics, Budapest University of Technology and Economics,
Műegyetem rkp. 3., H-1111 Budapest, Hungary  János K. Asbóth
0000-0003-0962-7523 Department of Theoretical Physics, Institute of Physics,
Budapest University of Technology and Economics, Műegyetem rkp. 3., H-1111
Budapest, Hungary  Wigner Research Centre for Physics, H-1525 Budapest, P.O.
Box 49., Hungary  András Pályi  Department of Theoretical Physics, Institute
of Physics, Budapest University of Technology and Economics, Műegyetem rkp.
3., H-1111 Budapest, Hungary  HUN-REN–BME Quantum Dynamics and Correlations
Research Group, Műegyetem rkp. 3., H-1111 Budapest, Hungary

###### Abstract

Quantum error correction is a key challenge for the development of practical
quantum computers, a direction in which significant experimental progress has
been made in recent years. In solid-state qubits, one of the leading
information loss mechanisms is dephasing, usually modelled by phase flip
errors. Here, we introduce quasistatic phase damping, a more subtle error
model which describes the effect of Larmor frequency fluctuations due to $1/f$
noise. We show how this model is different from a simple phase flip error
model, in terms of multi-cycle error correction. Considering the surface code,
we provide numerical evidence for an error threshold, in the presence of
quasistatic phase damping and readout errors. We discuss the implications of
our results for spin qubits and superconducting qubits.

###### Contents

  1. I Introduction
  2. II Quasistatic phase damping as a model of random coherent errors
  3. III Example: 2-qubit repetition code
    1. III.1 Single cycle of error detection
      1. III.1.1 Independent phase-flip errors
      2. III.1.2 Quasistatic phase damping
      3. III.1.3 Average effect of coherent errors can be represented as a random Pauli channel
    2. III.2 Two cycles of error detection
      1. III.2.1 Independent phase-flip errors
      2. III.2.2 Quasistatic phase damping
      3. III.2.3 Best approximation of quasistatic phase damping with independent homogeneous phase-flip errors
  4. IV Quasistatic phase damping in stabilizer codes
    1. IV.1 Single cycle of error detection and error correction
    2. IV.2 Multiple cycles
  5. V Surface code error threshold
    1. V.1 Coherent errors on the physical qubits lead to coherent error on the logical qubit
    2. V.2 Error correction with readout errors
    3. V.3 Numerical results
  6. VI Results for the distance-3 surface code, and their relation to experiments
  7. VII Conclusions
  8. A Calculation details for the 2-qubit repetition code for two cycles of error detection

##  I Introduction

Quantum computing [1] promises efficient solutions to technologically relevant
computational problems, but the realization of this great potential is
hindered by errors in the physical implementation. Quantum error correction,
with a thirty-year history from the fundamentals [2, 1] to the most recent
experimental milestones [3, 4, 5, 6, 7, 8, 9], offers a potential solution to
this by the redundant encoding of a small number of logical qubits in a
greater number of physical qubits. The effect of Pauli errors during quantum
error correction is well-understood due to the efficient simulability [10] and
the existence of mappings to classical disordered spin models [11, 12, 13, 14,
15]. However, the exploration of more realistic error models is an ever-
present challenge.

Recently, efficient large-scale numerical simulations of coherent errors
became feasible, due to a newly developed technique [16]. This technique was
originally used to investigate the effect of uniform coherent errors in the
surface code, then follow-up works extended this to arbitrary planar-graph
surface codes [17] and the presence of phenomenological readout errors [18].
These studies have numerically established the threshold behavior of the
surface code in the presence of coherent errors, assuming uniform unwanted
rotations on the data qubits.

In this work, we study the performance of Pauli stabilizer codes against
_quasistatic phase damping_. In this error model, physical qubits suffer
coherent Z-rotations, with rotation angle randomly varying from qubit to
qubit, but timewise constant throughout the entire quantum circuit; however,
for each repetition of the circuit (shot) a new random value for each angle is
chosen. (i) We identify quantum computing architectures where this error model
is relevant, and describes $1/f$ noise. (ii) For Pauli stabilizer codes [19]
we analyze how this error model is related to independent Pauli phase-flip
errors. For a single cycle of error detection or error correction, we find the
two error models are equivalent. For multiple syndrome measurement cycles this
is no longer true, however, quasistatic phase damping is an effective –
correlated – Pauli model on the logical level. It is known that for single
qubit error models stabilizer measurements asymptotically decohere the noise
on the logical level [20]. Our results show that for quasistatic phase damping
this decoherence process is exact for all code sizes. (iii) We utilize the
Fermionic Linear Optics simulation framework based on the Majorana-fermionic
representation of the surface code [16], combined with phenomenological
readout errors [18], to perform numerical experiments predicting the
performance of the surface code in the presence of the quasistatic coherent
error model. (iv) We establish a surface code error-correction threshold at a
physical error rate $p_{\text{th}}\approx 2.85\%$, including the quasistatic
coherent errors and the readout errors. (v) We generate the threshold phase
diagram in the plane spanned by the strengths of the coherent error and the
readout error. (vi) We discuss the implications of our results for spin qubits
and superconducting qubits.

The rest of this paper is structured as follows. In Sec. II, we introduce the
error model of quasistatic phase damping and pinpoint the relevant qubit
platforms affected by this type of noise. In Sec. III, we compare and contrast
our error model with independent Pauli errors through a minimal example of the
2-qubit phase-flip repetition code. We generalize this comparison for Pauli
stabilizer codes in Sec. IV. In Sec. V and Sec. VI, we present our results on
the combined effect of quasistatic phase damping and readout errors on the
surface code, and relate these results to semiconductor spin qubits and
superconducting qubits.

##  II Quasistatic phase damping as a model of random coherent errors

In this section, we introduce _quasistatic phase damping_ , the model of
random coherent errors we study in the rest of this work. We motivate this
error model by its experimental relevance for state-of-the-art solid-state
quantum computing platforms: quantum-dot-based semiconductor spin qubits and
superconducting qubits.

The quasistatic phase damping error model consists of coherent rotations
around the $z$ axis with a random angle for each data qubit. It is described
by the unitary operator

$\hat{U}=\prod_{j=1}^{n}e^{i\theta_{j}\hat{Z}_{j}}.$ (1)

where $n$ is the number of data qubits, and $\theta_{j}$ is the rotation angle
of qubit $j$. We assume that in a single shot of a multi-cycle error detection
or correction experiment, the random angles $\theta_{j}$ do not change for
subsequent cycles. However, in a multi-shot experiment, which is required to
obtain a statistical evaluation of the error correction protocol, the angles
$\theta_{j}$ change randomly from shot to shot. These two properties are
referenced by the adjective _quasistatic_. For concreteness, we assume that
the angles $\theta_{j}$ are drawn randomly from a Gaussian distribution with
zero mean and standard deviation $\sigma$, such that the random values for
different qubits and different shots are statistically independent. Note that
this model can be regarded as an extension of Refs. [16, 17, 21, 18], where
the effect of homogeneous coherent $Z$ rotations was studied in stabilizer
codes. We also note that the simulation method we use to treat this error
model in this work generalizes in a straightforward way to more complicated
angle distributions, including spatially and temporally correlated ones; that
extension is beyond the scope of this work.

Let us now motivate this error model by pointing out its relation to solid-
state qubits. Superconducting quantum computer prototypes hosting around 100
qubits are available, and small-scale quantum error detection and correction
circuits based on Pauli stabilizer codes have been implemented [22, 23, 24,
25, 26, 27, 28]. Qubit-level errors in these devices can be classified as SPAM
errors, gate errors, and idle errors. Insight into the physical mechanism of
idle errors is gained routinely via single-qubit Ramsey, Hahn echo, or more
complex dynamical decoupling experiments.

In certain cases, the inhomogeneous dephasing time $T_{2}^{*}$ of a
superconducting qubit, measured by the Ramsey experiment, is exceeded by the
qubit relaxation time $T_{1}$; furthermore, it is common to find that the Hahn
echo improves qubit coherence, i.e., the corresponding decoherence time
$T_{2,\text{echo}}$ exceeds $T_{2}^{*}$ [29, 30, 31]. The coexistence of these
two features, i.e., (i) a dephasing-limited coherence time, and (ii) a
functioning Hahn echo, is consistent with, and often interpreted as evidence
for, classical electromagnetic noise that induces Larmor-frequency
fluctuations. Furthermore, it is often found that the corresponding noise
spectrum depending on the frequency $f$ is proportional to $1/f$.

The quasistatic phase damping model [32, 33] we study here (see Eq. (1))
describes such Larmor frequency fluctuations of idling data qubits in a
simplified manner. Since $1/f$ noise is dominated by the low-frequency range
of the spectral density, it is reasonable to assume that the noisy component
$\xi_{j}(t)$ of the Larmor frequency of qubit $j$ is constant throughout a
single shot of a multi-cycle quantum error correction circuit, which typically
takes a few microseconds. However, to obtain a statistical evaluation of the
error correction performance, many shots should be taken, and the
corresponding total data acquisition time window is sufficiently long that the
noisy component $\xi_{j}$ explores many random values, represented by a
Gaussian distribution in our model.

A further assumption of our model is the statistical independence of the local
random components of the Larmor frequencies, which is realistic if the Larmor
frequency fluctuations are caused by local noise sources (e.g., gate
electrodes, local flux bias lines, short-range charge fluctuators, etc.). We
note that the numerical methods applied in this work are directly
generalizable to variants of our noise model with more complex temporal and
spatial correlations, which is in fact an interesting direction for future
research.

The quasistatic phase damping model is relevant for semiconductor spin qubits
as well, since spin qubit decoherence is often dominated by $1/f$ noise. [33,
34, 35, 36] Note that in such devices, $1/f$ noise is attributed either to
externally imposed electromagnetic fluctuations, e.g., gate noise, magnet
noise, fluctuating charge traps, or to hyperfine interaction, i.e., magnetic
noise exerted on the electron spin by the nuclear spins covered by the
electron.

In this work, we consider stabilizer codes as a way of countering quasistatic
phase damping on idling qubits. As mentioned above, Hahn echo, and other
dynamical decoupling schemes provide established alternative solutions for the
same problem. An important and timely research direction is to compare these
solutions, and to explore their combinations [27, 24, 28] to maximize the
coherence of logical qubits.

##  III Example: 2-qubit repetition code

In this section, we study quasistatic phase damping using the example of a
2-qubit phase-flip code, as depicted on Fig. 1. We start with the analysis of
a single cycle of syndrome measurement in Sec. III.1, and show that in this
case, quasistatic phase damping is equivalent to a simple uncorrelated phase-
flip channel. In Sec. III.2, explicit calculation of the density matrix
reveals that this is not the case for two cycles of error detection. We
quantify the difference between our model and the simple Pauli phase-flip
model in Sec. III.2.3.

In the two-qubit phase-flip repetition code, errors are detected by repeatedly
measuring a single _parity-check_ (or _stabilizer_) operator $\hat{S}$. After
each measurement, the state of the two qubits is altered by projectors
$\hat{\Pi}_{s}$ that depend on the measurement outcome $s\in\\{+1,-1\\}$ (also
called even or odd parity, respectively),

$\displaystyle\hat{\Pi}_{s}$
$\displaystyle=\dfrac{1}{2}(\hat{\mathds{1}}+s\hat{S});$
$\displaystyle\hat{S}$ $\displaystyle=\hat{X}_{A}\hat{X}_{B};$ $\displaystyle
s\in\\{+1,-1\\}.$ (2)

Here, $A$ and $B$ label the two data qubits. The protocol aims to preserve the
value of the logical $\hat{Z}$ operators of the code, which reads,

$\displaystyle\hat{Z}^{L}$ $\displaystyle=\hat{Z}_{A}\hat{Z}_{B}.$ (3)

[width=0.75]repetition-2-setup.pdf

Figure 1: Schematic circuit representation of the $2$-qubit phase-flip
repetition code, data qubits A and B suffering quasistatic phase damping. The
figure shows elements of two subsequent cycles in a multi-cycle error
detection procedure. The gates labelled as $R_{z}(\theta_{A,B})$ represent
coherent errors.

###  III.1 Single cycle of error detection

A single cycle of the two-qubit phase-flip repetition code, as an error
detection protocol, is capable of detecting a single Pauli Z error. The list
of all possible 2-qubit Pauli Z error strings is brief:

$\displaystyle\hat{E}\in\\{\hat{\mathds{1}},\hat{Z}_{A},\hat{Z}_{B},\hat{Z}_{A}\hat{Z}_{B}\\}.$
(4)

####  III.1.1 Independent phase-flip errors

We first consider independent phase-flip errors on the two physical qubits
constituting the code. If the error probability on both qubits is $p$, the
Pauli error channel of the qubits reads,

$\displaystyle\mathcal{E}_{p}(\hat{\rho}_{0})$
$\displaystyle=\sum_{\hat{E}}P(\hat{E})\hat{E}\hat{\rho}_{0}\hat{E}=(1-p)^{2}\hat{\rho}_{0}+p(1-p)\hat{Z}_{A}\hat{\rho}_{0}\hat{Z}_{A}$
$\displaystyle\quad+(1-p)p\hat{Z}_{B}\hat{\rho}_{0}\hat{Z}_{B}+p^{2}\hat{Z}_{A}\hat{Z}_{B}\hat{\rho}_{0}\hat{Z}_{A}\hat{Z}_{B},$
(5)

for an arbitrary logical state of the two qubits
$\hat{\rho}_{0}=\outerproduct{\psi_{L}}{\psi_{L}}$, where $\ket{\psi_{L}}$ is
an eigenstate of $\hat{S}$,

$\hat{S}\ket{\psi_{L}}=\ket{\psi_{L}}.$ (6)

After the stabilizer measurement, for the trivial $s=+1$ outcome, the state of
the two data qubits is projected to

$\hat{\rho}_{1,p}(+1)=\hat{\Pi}_{+}\mathcal{E}_{p}(\hat{\rho}_{0})\hat{\Pi}_{+}=(1-p)^{2}\hat{\rho}_{0}+p^{2}\hat{Z}^{L}\hat{\rho}_{0}\hat{Z}^{L}.$
(7)

####  III.1.2 Quasistatic phase damping

We next consider independent coherent errors on the two qubits. The
corresponding quantum channel reads,

$\mathcal{E}_{\text{coh}}(\hat{\rho}_{0})=\hat{U}\hat{\rho}_{0}\hat{U}^{\dagger},\quad\text{with}\quad\hat{U}=e^{i\theta_{A}\hat{Z}_{A}}e^{i\theta_{B}\hat{Z}_{B}}.$
(8)

As mentioned in the previous section, we sample the rotation angles from
Gaussian distributions with zero mean, and identical standard deviations
$\sigma$, i.e., with probability density function $f(\theta_{A},\theta_{B})$,
which reads,

$\displaystyle f(\theta_{A},\theta_{B})$
$\displaystyle=f(\theta_{A})f(\theta_{B});$ $\displaystyle f(\theta)$
$\displaystyle=\frac{1}{\sqrt{2\pi\sigma^{2}}}e^{-\frac{\theta^{2}}{2\sigma^{2}}},$
(9)

for $-\pi<\theta\leq\pi$. Note that in this single-cycle setting, our
quasistatic phase damping model is the same as phase damping, as described in
Sec. 8.3.6 of [1], independently on each qubit.

In this case, for the $s=+1$ measurement outcome, the density matrix of the
two data qubits, averaged over the random angle distribution, reads

$\displaystyle\hat{\rho}_{1,{\text{coh}}}(+1)$
$\displaystyle=\int\mathrm{d}\theta_{A}\mathrm{d}\theta_{B}f(\theta_{A},\theta_{B})\hat{\Pi}_{+}\mathcal{E}_{\text{coh}}(\hat{\rho}_{0})\hat{\Pi}_{+}$
$\displaystyle\quad=\langle\cos^{2}\theta\rangle^{2}\hat{\rho}_{0}+\langle\sin^{2}\theta\rangle^{2}\hat{Z}^{L}\hat{\rho}_{0}\hat{Z}^{L},$
(10)

where $\langle.\rangle$ denotes averaging over the random angle distribution:

$\displaystyle\langle g(\theta)\rangle=\int_{-\pi}^{\pi}\mathrm{d}\theta
g(\theta)f(\theta).$ (11)

####  III.1.3 Average effect of coherent errors can be represented as a random
Pauli channel

Comparing Eqs. (7) and (10) we find that for a single cycle of error
detection, choosing

$p=\langle\sin^{2}\theta\rangle=\dfrac{1}{2}\left(1-e^{-2\sigma^{2}}\right),$
(12)

the two density matrices are identical,

$\hat{\rho}_{1,p}(+1)=\hat{\rho}_{1,\text{coh}}(+1).$ (13)

This is also true for the syndrome $s=-1$. Hence, we conclude that in the case
of a single cycle of error detection, the effect of uncorrelated random Pauli
phase-flip errors is equivalent to the effect of phase damping. This simple
equivalence is broken in the multi-cycle case, as we show below.

###  III.2 Two cycles of error detection

We now consider two cycles of error detection. There are altogether 4
different measurement outcomes, _syndromes_ , in the two cycles,

$\boldsymbol{s}\in\\{(+1,+1),(-1,+1),(+1,-1),(-1,-1)\\}.$ (14)

There are 16 different cycle-resolved error scenarios $\boldsymbol{E}$; these
error scenarios are the configurations of $Z$ error strings occurred in the
different cycles:

$\displaystyle\boldsymbol{E}=(\hat{E}_{1},\hat{E}_{2}),$ (15)

with the two error strings $\hat{E}_{1}$ and $\hat{E}_{2}$ occurring in the
1st and 2nd cycles, respectively, are elements of the error set defined in Eq.
(4). We denote the _merged_ error operators as

$\displaystyle\hat{E}(\boldsymbol{E})=\hat{E}_{1}\hat{E}_{2}.$ (16)

The set of the merged error operators is the same as the error set defined in
Eq. (4). The list of the 16 cycle-resolved error scenarios and corresponding
merged error operators is given in Table 1 in the Appendix.

####  III.2.1 Independent phase-flip errors

For independent phase-flip errors, after two cycles of syndrome measurements,
the density matrix can be written in a Pauli-diagonal form

$\hat{\rho}_{2}(\boldsymbol{s})=\sum_{\boldsymbol{E}\in\mathcal{D}_{\boldsymbol{s}}}P(\boldsymbol{E})\hat{E}(\boldsymbol{E})\hat{\rho}_{0}\hat{E}(\boldsymbol{E}),$
(17)

where $\mathcal{D}_{\boldsymbol{s}}$ denotes the set of cycle-resolved error
scenarios consistent with the syndrome $\boldsymbol{s}$. For example, for the
trivial syndrome $(+1,+1)$, there are 4 compatible scenarios:
$\boldsymbol{E}\in\\{(\hat{\mathds{1}},\hat{\mathds{1}}),(\hat{Z}^{L},\hat{\mathds{1}}),(\hat{\mathds{1}},\hat{Z}^{L}),(\hat{Z}^{L},\hat{Z}^{L})\\}$,
corresponding to 2 different merged error strings only,
$\hat{E}(\hat{\mathds{1}},\hat{\mathds{1}})=\hat{E}(\hat{Z}^{L},\hat{Z}^{L})=\hat{\mathds{1}}$
and
$\hat{E}(\hat{Z}^{L},\hat{\mathds{1}})=\hat{E}(\hat{\mathds{1}},\hat{Z}^{L})=\hat{Z}^{L}$.
(Table 1 lists all merged error operators along with the syndrome each of them
implies.) For this syndrome, Eq. (17) implies:

$\displaystyle\hat{\rho}_{2}(+1,+1)$
$\displaystyle=\left(P(\hat{\mathds{1}},\hat{\mathds{1}})+P(\hat{Z}^{L},\hat{Z}^{L})\right)\hat{\rho}_{0}$
$\displaystyle+\left(P(\hat{Z}^{L},\hat{\mathds{1}})+P(\hat{\mathds{1}},\hat{Z}^{L})\right)\hat{Z}^{L}\hat{\rho}_{0}\hat{Z}^{L}.$
(18)

We introduce the notation ${c}_{\boldsymbol{s}}$ and ${d}_{\boldsymbol{s}}$
for the coefficients of various operators in the post-measurement state,

$\hat{\rho}_{2}(\boldsymbol{s})\\!=\\!\begin{cases}{c}_{\boldsymbol{s}}\hat{\rho}_{0}+{d}_{\boldsymbol{s}}\hat{Z}^{L}\hat{\rho}_{0}\hat{Z}^{L},&\text{for
}s_{2}=+1;\\\
{c}_{\boldsymbol{s}}\hat{Z}_{A}\hat{\rho}_{0}\hat{Z}_{A}+{d}_{\boldsymbol{s}}\hat{Z}_{B}\hat{\rho}_{0}\hat{Z}_{B},&\text{for
}s_{2}=-1.\\\ \end{cases}$ (19)

The coefficients ${c}_{\boldsymbol{s}},{d}_{\boldsymbol{s}}$ are positive and
fulfill

$\sum_{\boldsymbol{s}}\left({c}_{\boldsymbol{s}}+{d}_{\boldsymbol{s}}\right)=1,$
(20)

and thus can be interpreted as probabilities. From Eq. (17), we obtain

$\displaystyle{c}_{++}$ $\displaystyle=(1-p)^{4}+p^{4},$ (21a)
$\displaystyle{d}_{++}$ $\displaystyle={c}_{-+}={d}_{-+}=2p^{2}(1-p)^{2},$
(21b) $\displaystyle{c}_{+-}$
$\displaystyle={d}_{+-}={c}_{--}={d}_{--}=p(1-p)^{3}+p^{3}(1-p),$ (21c)

where we have compactified the notation, e.g., $c_{++}\equiv c_{(+1,+1)}$.

####  III.2.2 Quasistatic phase damping

Next, we consider quasistatic phase damping, with random rotation angles
$\theta_{A}$ and $\theta_{B}$ for the two qubits taken from the same Gaussian
distribution, and the same values used before both measurement cycles, as
illustrated in Fig. 1. Before performing the averaging for the error angles,
the effect of the coherent errors cannot be written as a Pauli diagonal
channel as in Eq. (17). However, the angle distribution is symmetric with
respect to zero. Therefore, after averaging over the angle distribution
according to the quasistatic phase damping model, we do obtain a Pauli
diagonal channel, which can be written in the form of Eq. (19), although with
different $\tilde{c}_{\boldsymbol{s}}$ and $\tilde{d}_{\boldsymbol{s}}$
coefficients - we use $\tilde{}$ to specify the case of quasistatic phase
damping:

$\displaystyle\tilde{c}_{++}$
$\displaystyle=\frac{1}{16}\left(e^{-16\sigma^{2}}+2e^{-8\sigma^{2}}+8e^{-4\sigma^{2}}+5\right),$
(22a) $\displaystyle\tilde{d}_{++}$
$\displaystyle=\tilde{d}_{-+}=\frac{1}{16}\left(1-e^{-8\sigma^{2}}\right)^{2},$
(22b) $\displaystyle\tilde{c}_{-+}$
$\displaystyle=\frac{1}{16}\left(e^{-16\sigma^{2}}+2e^{-8\sigma^{2}}-8e^{-4\sigma^{2}}+5\right),$
(22c) $\displaystyle\tilde{c}_{+-}$
$\displaystyle=\tilde{d}_{+-}=\tilde{c}_{--}=\tilde{d}_{--}=\frac{1}{16}\left(1-e^{-16\sigma^{2}}\right).$
(22d)

From this result, we conclude that in this two-cyle case, the effect of
quasistatic phase damping cannot be described as random independent phase-flip
errors with the same error rate $p$ on both qubits. This is apparent by a
comparison of Eqs. (21) and (22): for independent homogeneous phase-flip
errors, there are only 3 different ${c}_{\boldsymbol{s}}$,
${d}_{\boldsymbol{s}}$ coefficients, while for quasistatic phase damping,
there are 4 different coefficients.

####  III.2.3 Best approximation of quasistatic phase damping with independent
homogeneous phase-flip errors

As discussed just above, with two subsequent cycles of error detection in the
two-qubit phase-flip code, the effect of quasistatic phase damping cannot be
described as random independent phase-flip errors with the same error
parameter $p$ on both qubits. In this section, we try to find the best
independent homogeneous phase-flip approximation of the quasistatic phase
damping channel.

We will quantify the quality of the approximation by the total variational
distance (TVD). This distance is defined as

$\displaystyle\delta(p,\sigma)=\max_{\boldsymbol{s}}\left(\max\left\\{\left|{c}_{\boldsymbol{s}}-\tilde{c}_{\boldsymbol{s}}\right|,\left|{d}_{\boldsymbol{s}}-\tilde{d}_{\boldsymbol{s}}\right|\right\\}\right),$
(23)

where the right-hand-side depends on the single parameter of the random Pauli
channel, $p$, through the coefficients $c_{\boldsymbol{s}}$ and
$d_{\boldsymbol{s}}$, and on the single parameter of the quasistatic phase
damping channel, the standard deviation of the coherent error distribution
$\sigma$, through the coefficients $\tilde{c}_{\boldsymbol{s}}$ and
$\tilde{d}_{\boldsymbol{s}}$. The best Pauli approximation (i.e., the best
approximation with independent homogeneous phase-flip) of a quasistatic phase
damping channel with $\sigma$ has the parameter $p_{\text{best}}$, such that

$\delta(p_{\text{best}}(\sigma),\sigma)\leq\delta(p,\sigma)\quad\text{for all
}p.$ (24)

We computed the best Pauli approximation numerically, and show the
corresponding total variational distance in Fig. 2. For small $\sigma$, we
find good agreement with the power series expansion,

$\displaystyle\sigma\ll 1:\quad p_{\text{best}}(\sigma)$
$\displaystyle\approx\sigma^{2};$
$\displaystyle\delta(p_{\text{best}},\sigma)$ $\displaystyle\approx
6\sigma^{4},$ (25)

with less than a few percent distance between our noise model and the optimal
single-parameter Pauli error model (see Fig. 2). Increasing $\sigma$, the
distance to the best Pauli approximation is also increased, for $\sigma=0.5$
it is around $10\%$.

[width=0.45]repetition-code-TVDmin.pdf

Figure 2: Distance to best Pauli approximation as a function of error
parameter $\sigma$ for the $2$-qubit phase-flip repetition code.

##  IV Quasistatic phase damping in stabilizer codes

In this section, we generalize the results above, i.e., compare the
quasistatic phase damping (quasistatic random coherent error) model with the
uncorrelated phase-flip model, for Pauli stabilizer codes in general. In Sec.
IV.1, we prove that the two models are equivalent in the case of a single
cycle of error detection or error correction. In Sec. IV.2, we show that on
the logical level, quasistatic phase damping is equivalent to a Pauli channel,
however, this is not the one resulting from the simple uncorrelated phase-flip
error model in general (see previous section as an example).

###  IV.1 Single cycle of error detection and error correction

Now let us consider any $\llbracket n,k,d\rrbracket$ Pauli stabilizer code,
encoding $k$ logical qubits into $n$ physical qubits with code distance $d$,
whose stabilizers are tensor products of Pauli matrices and they commute with
each other [37]. The stabilizer generators (independent parity checks) of the
code are denoted by $\hat{S}_{f}$, with $f=1,\ldots,N$, with $N=n-k$. Upon
measuring the stabilizer generators, we obtain the syndrome

$s=(s_{1},s_{2},\dots s_{N})\in\\{+1,-1\\}^{N},$ (26)

and the quantum state of the qubits is projected to the code space with the
projector

$\hat{\Pi}_{s}=\prod_{f=1}^{N}\dfrac{1}{2}\left(1+s_{f}\hat{S}_{f}\right).$
(27)

We aim to investigate the form of the quasistatic coherent error channel
combined with error detection. To this end, we have to perform an averaging
over the random angle distribution for the post-measurement state. We will
denote this average by

$\langle\dots\rangle_{\boldsymbol{\theta}}\equiv\int\mathrm{d}\boldsymbol{\theta}f(\boldsymbol{\theta})\dots,$
(28)

where $f(\boldsymbol{\theta})=f(\theta_{A})f(\theta_{B})\cdots f(\theta_{n})$
is the probability density function of the independent random rotation angles.
The following derivation is also true for any (discrete or continuous)
probability distribution that is symmetric and has zero mean value, i.e.,

$\displaystyle f(\theta)$ $\displaystyle=-f(\theta),\quad\text{with
}-\pi<\theta\leq\pi.$ (29)

Note that in this case, the average of any odd function of $\theta_{j}$ will
vanish.

For a single cycle of error detection, the effect of quasistatic phase damping
is expressed as:

$\displaystyle\hat{\rho}_{1}(s)$
$\displaystyle=\big{\langle}\hat{\Pi}_{s}\hat{U}\hat{\rho}_{0}\;\hat{U}^{\dagger}\hat{\Pi}_{s}\big{\rangle}_{\boldsymbol{\theta}}$
$\displaystyle=\sum_{\hat{E},\hat{E}^{\prime}}\Big{\langle}A_{\boldsymbol{\theta}}(\hat{E})A^{\ast}_{\boldsymbol{\theta}}(\hat{E}^{\prime})\Big{\rangle}_{\boldsymbol{\theta}}\hat{\Pi}_{s}\hat{E}\hat{\rho}_{0}\hat{E}^{\prime}\hat{\Pi}_{s}.$
(30)

Here, $\hat{\rho}_{0}=\outerproduct{\psi_{L}}{\psi_{L}}$ is the density matrix
of an arbitrary initial logical state, i.e., with $\ket{\psi_{L}}$ being a
common eigenstate of all stabilizer operators with +1 eigenvalue. Furthermore,
the $2^{n}$ error strings corresponding to $\hat{Z}$ phase-flip operations on
either of the qubits are denoted as $\hat{E}$, and we have rewritten the
product of coherent single qubit rotations as

$\hat{U}=\sum_{\hat{E}}A_{\boldsymbol{\theta}}(\hat{E})\hat{E},$ (31)

by introducing the amplitudes

$A_{\boldsymbol{\theta}}(\hat{E})=\prod_{j=1}^{n}(\cos\theta_{j})^{1-n_{\hat{E}}(j)}(i\sin\theta_{j})^{n_{\hat{E}}(j)}.$
(32)

Here $n_{\hat{E}}(j)=0$ or $1$ denotes the number of Pauli Z operators acting
on qubit $j$ in error string $\hat{E}$.

Now, we show that Eq. (IV.1) can be simplified. First, averaging over the
random angles in Eq. (IV.1) yields:

$\Big{\langle}A_{\boldsymbol{\theta}}(\hat{E})A^{\ast}_{\boldsymbol{\theta}}(\hat{E}^{\prime})\Big{\rangle}_{\boldsymbol{\theta}}=\delta_{\hat{E},\hat{E}^{\prime}}\Big{\langle}|A_{\boldsymbol{\theta}}(\hat{E})|^{2}\Big{\rangle}_{\boldsymbol{\theta}}\equiv
P(\hat{E}).$ (33)

Second, we note that since the stabilizers are products of Pauli operators,
they either commute or anti-commute with the error strings. Therefore applying
the error string $\hat{E}$ and then measuring the syndrome $s$ compatible with
that ($\hat{E}\in\mathcal{D}_{s}$) has the same effect as first projecting the
collective quantum state of the qubits to the trivial syndrome (all parity
checks are +1) and then applying the error string; i.e., it holds that

$\hat{\Pi}_{s}\hat{E}=\hat{E}\hat{\Pi}_{0},\quad\text{if}\quad\hat{E}\in\mathcal{D}_{s}.$
(34)

Hence, by exploiting Eqs. (33) and (34) in Eq. (IV.1), we obtain a simplified
formula for the error channel,

$\hat{\rho}_{1}(s)=\sum_{\hat{E}\in\mathcal{D}_{s}}P(\hat{E})\hat{E}\hat{\rho}_{0}\hat{E},$
(35)

where the $P(\hat{E})$ probabilities follow from Eq. (32) as

$P(\hat{E})=\prod_{j=1}^{n}\langle\cos^{2}\theta_{j}\rangle_{\boldsymbol{\theta}}^{1-n_{\hat{E}}(j)}\langle\sin^{2}\theta_{j}\rangle_{\boldsymbol{\theta}}^{n_{\hat{E}}(j)}$
(36)

Since the $\hat{E}$ error strings are products of Pauli Z and identity
matrices, the result, Eq. (35), is a simple phase flip channel with equal and
independent error probabilities on each qubit,
$p=\langle\sin^{2}\theta_{j}\rangle_{\boldsymbol{\theta}}$, for each syndrome
$s$. Consequently, for a single cycle of experiment performed with any Pauli
stabilizer code, quasistatic phase damping is equivalent to uncorrelated
phase-flip errors on average. Indeed that is what we expected, since for a
single physical qubit, phase damping is the same as the phase flip channel
[1].

A result analogous to Eq. (35) holds for a single cycle of error _correction_
as well, since the correction operation $\hat{C}_{s}$ depends only on the
syndrome $s$. Hence, the state of the code after error correction has the
following form:

$\hat{C}_{s}\hat{\rho}_{1}(s)\hat{C}_{s}=\sum_{\hat{E}\in\mathcal{D}_{s}}P(\hat{E})\hat{C}_{s}\hat{E}\hat{\rho}_{0}\hat{E}\hat{C}_{s}.$
(37)

###  IV.2 Multiple cycles

We next consider multiple, $t$ cycles of error detection: we apply the
independent coherent rotations of the qubits with angles
$\theta_{1},\ldots,\theta_{n}$, and the measurements repeatedly. We show that
in this case, the average effect of quasistatic phase damping can be
represented only with a more complicated Pauli channel.

Altogether, there are $2^{tn}$ cycle-resolved error scenarios
$\boldsymbol{E}$, corresponding to different combinations of $\hat{Z}$ phase-
flip operations on either of the qubits during either of the cycles, and
$2^{n}$ different merged Pauli-Z error strings $\hat{E}(\boldsymbol{E})$,

$\displaystyle\boldsymbol{E}$
$\displaystyle=\left(\hat{E}_{1},\hat{E}_{2},\dots\hat{E}_{t}\right);$
$\displaystyle\hat{E}(\boldsymbol{E})$
$\displaystyle=\prod_{r=1}^{t}\hat{E}_{r}.$ (38)

With this notation, we express the syndrome-dependent state of the code after
$t$ error detection cycles as follows:

$\displaystyle\hat{\rho}_{t}$
$\displaystyle(\boldsymbol{s})=\Big{\langle}\hat{Q}(\boldsymbol{\theta})\hat{\rho}_{0}\hat{Q}(\boldsymbol{\theta})^{\dagger}\Big{\rangle}_{\boldsymbol{\theta}}$
$\displaystyle=\sum_{\boldsymbol{E}\in\mathcal{D}_{\boldsymbol{s}}}\sum_{\boldsymbol{E^{\prime}}\in\mathcal{D}_{\boldsymbol{s}}}\Big{\langle}A_{\boldsymbol{\theta}}(\boldsymbol{E})A^{\ast}_{\boldsymbol{\theta}}(\boldsymbol{E^{\prime}})\Big{\rangle}_{\boldsymbol{\theta}}\hat{E}(\boldsymbol{E})\hat{\rho}_{0}\hat{E}(\boldsymbol{E^{\prime}})$
$\displaystyle=\sum_{\boldsymbol{E}\in\mathcal{D}_{\boldsymbol{s}}}\tilde{P}(\boldsymbol{E})\hat{E}(\boldsymbol{E})\hat{\rho}_{0}\hat{E}(\boldsymbol{E}),$
(39)

where
$\hat{Q}(\boldsymbol{\theta})=\hat{\Pi}_{s_{t}}\hat{U}\hat{\Pi}_{s_{t-1}}\hat{U}\dots\hat{\Pi}_{s_{1}}\hat{U}$,
and we introduced the notation

$A_{\boldsymbol{\theta}}(\boldsymbol{E})=\prod_{r=1}^{t}A_{\boldsymbol{\theta}}(\hat{E}_{r}).$
(40)

The density matrix in Eq. (IV.2) is again Pauli-diagonal, but the newly
defined quantities

$\displaystyle\tilde{P}(\boldsymbol{E}\in\mathcal{D}_{\boldsymbol{s}})$
$\displaystyle=\sum_{\boldsymbol{E^{\prime}}\in\mathcal{D}_{\boldsymbol{s}}}\Big{\langle}A_{\boldsymbol{\theta}}(\boldsymbol{E})A^{\ast}_{\boldsymbol{\theta}}(\boldsymbol{E^{\prime}})\Big{\rangle}_{\boldsymbol{\theta}}$
(41)
$\displaystyle=\sum_{\begin{subarray}{c}\boldsymbol{E^{\prime}}\in\mathcal{D}_{\boldsymbol{s}}\\\
\hat{E}(\boldsymbol{E})=\hat{E}(\boldsymbol{E^{\prime}})\end{subarray}}\Big{\langle}A_{\boldsymbol{\theta}}(\boldsymbol{E})A^{\ast}_{\boldsymbol{\theta}}(\boldsymbol{E^{\prime}})\Big{\rangle}_{\boldsymbol{\theta}},$
(42)

obtained by regrouping the terms in the double sum, are not probabilities:
they add up to 1,

$\sum_{\boldsymbol{E}}\tilde{P}(\boldsymbol{E})=1,$ (43)

but they can be negative as well (see Table 1 in the Appendix), depending on
which power of the imaginary unit appears in the corresponding terms. Real
values are guaranteed by the fact that the terms containing odd powers of
$(i\sin\theta_{j})$ will vanish after averaging. In Eq. (41), we only get a
non-zero contribution when
$\hat{E}(\boldsymbol{E})=\hat{E}(\boldsymbol{E^{\prime}})$.

Upon performing the last sum in Eq. (IV.2), we obtain the following result:

$\hat{\rho}_{t}(\boldsymbol{s})=\sum_{\boldsymbol{\alpha}}\tilde{\mathcal{P}}_{\boldsymbol{\alpha}}(\boldsymbol{s})\hat{Z}_{\boldsymbol{\alpha}}\hat{E}_{\boldsymbol{s}}\hat{\rho}_{0}\hat{E}_{\boldsymbol{s}}\hat{Z}_{\boldsymbol{\alpha}},$
(44)

where

$\hat{Z}_{\boldsymbol{\alpha}}=(\hat{Z}^{L}_{1})^{\alpha_{1}}(\hat{Z}^{L}_{2})^{\alpha_{2}}\ldots(\hat{Z}^{L}_{k})^{\alpha_{k}};$
(45)
$\tilde{\mathcal{P}}_{\boldsymbol{\alpha}}(\boldsymbol{s})=\sum_{\begin{subarray}{c}\boldsymbol{E}\in\mathcal{D}_{\boldsymbol{s}}\\\
\hat{E}(\boldsymbol{E})=\hat{Z}_{\boldsymbol{\alpha}}\hat{E}_{\boldsymbol{s}}\end{subarray}}\tilde{P}(\boldsymbol{E}).$
(46)

Furthermore, we defined
$\boldsymbol{\alpha}=(\alpha_{1},\ldots,\alpha_{k})\in\\{0,1\\}^{k}$, the
operator $\hat{Z}^{L}_{j}$ is defined as the logical Z operator acting on the
$j$-th logical qubit, and $\hat{E}_{\boldsymbol{s}}$ is an arbitrary merged
error string consistent with the syndrome $s$. The
$\tilde{\mathcal{P}}_{\boldsymbol{\alpha}}(\boldsymbol{s})$ quantities are
syndrome-dependent probabilities, meaning that they are positive (cf. Eq.
(8.152) of [1]), and satisfy

$\sum_{\alpha,\boldsymbol{s}}\tilde{\mathcal{P}}_{\boldsymbol{\alpha}}(\boldsymbol{s})=1.$
(47)

These probabilities are the generalization of the single-logical-qubit
coefficients $\tilde{c}_{\boldsymbol{s}}$ and $\tilde{d}_{\boldsymbol{s}}$ of
Eq. (22), e.g. $\tilde{c}_{++}=\tilde{\mathcal{P}}_{0}(++)$,
$\tilde{d}_{++}=\tilde{\mathcal{P}}_{1}(++)$. As discussed in Sec. III.2,
these probabilities cannot be derived from independent single-qubit Z error
probabilities.

We have seen that Eq. (IV.2) is not a well-defined Pauli channel on the
physical level, because the $\tilde{P}(\boldsymbol{E})$ weights can be
negative, thus these are not probabilities. However, we can rephrase Eq.
(IV.2) by a new set of amplitudes $\tilde{P}^{\prime}(\boldsymbol{E})$ that
are positive, and hence define a proper Pauli channel on the physical level as
well. This new set of amplitudes can be defined by redistributing the
amplitudes within each class of cycle-resolved error scenarios
($\boldsymbol{E}$), where the classes are indexed by $\boldsymbol{s}$ and
$\boldsymbol{\alpha}$, and are defined via
$\boldsymbol{E}\in\mathcal{D}_{\boldsymbol{s}}$,
$\hat{E}(\boldsymbol{E})=\hat{Z}_{\boldsymbol{\alpha}}\hat{E}_{\boldsymbol{s}}$.
In words, two cycle-resolved error scenarios belong to the same class, if they
imply the same syndrome and the same merged error string. By performing such a
redistribution $\tilde{P}\to\tilde{P}^{\prime}$ of amplitudes, the error
channel in Eq. (44) does not change: the
$\tilde{\mathcal{P}}_{\boldsymbol{\alpha}}(\boldsymbol{s})$ probabilities
remain the same. Note that this redistribution is not unique; one way to do it
is to choose one representative cycle-resolved error scenario
$\boldsymbol{E}^{\prime}_{\boldsymbol{s},\boldsymbol{\alpha}}$ from each error
class, and define new amplitudes, which are in fact non-negative, as:

$\tilde{P}^{\prime}(\boldsymbol{E}^{\prime}_{\boldsymbol{s},\boldsymbol{\alpha}})=\tilde{\mathcal{P}}_{\boldsymbol{\alpha}}(\boldsymbol{s}),$
(48)

and $\tilde{P}^{\prime}(\boldsymbol{E})=0$ for all $\boldsymbol{E}$ that is
not in the set of
$\boldsymbol{E}^{\prime}_{\boldsymbol{s},\boldsymbol{\alpha}}$
representatives. This shows that our error model can be described as a Pauli
model on the physical level. However, this Pauli model is highly correlated.
It is an open question whether it is possible to construct an error model with
local (in both space and time) correlations by redefining these weights
differently. This question is beyond the scope of this work.

We conclude that for multiple cycles, the quasistatic phase damping channel is
equivalent to an incoherent Pauli channel as written in Eq. (IV.2), as well as
an incoherent Pauli channel on the logical level, as written Eq. (44).
However, the Pauli channel in Eq. (IV.2) does not describe, in general,
independent homogeneous single-qubit phase flips, as we illustrated by the
counterexample in Sec. III.2.2.

##  V Surface code error threshold

In this section, we numerically demonstrate that the surface code in the
presence of quasistatic phase damping and readout errors exhibits a threshold
behavior. To this end, we apply the Fermionic Linear Optics (FLO) simulation
technique [16, 17, 18]. In Sec. V.1 we briefly summarize the basics of the
surface code and the effect of coherent errors. In Sec. V.2 we discuss error
correction in the presence of readout errors. Finally, we present our
numerical results in Sec. V.3.

[width=0.48]surface-code-layout.pdf

Figure 3: Layout of a distance 5 surface code patch. Blue (light gray)
plaquettes represent X-type (Z-type) stabilizer operators. Green (red) string
denotes a logical X (Z) operator.

###  V.1 Coherent errors on the physical qubits lead to coherent error on the
logical qubit

The surface code encodes a logical qubit in the common $+1$ eigenspace of the
X-type and Z-type parity check operators (stabilizers), as shown in Fig. 3.
Since we consider coherent $Z$ errors, only the $X$-type parity checks,
$\hat{S}_{f}=\prod_{j\in\partial f}\hat{X}_{j}$, can return a $-1$ value. As a
result of a single cycle of measurements, which we assume to be free of
readout error for now, a syndrome $s$ is obtained. If this syndrome $s$ is
non-trivial, then a non-identity correction operation $\hat{C}_{s}$ is applied
as an attempt to bring the state back into the code space. In this case,
$\hat{C}_{s}$ involves a collection of Pauli Z phase flips. The specific
correction operation for a given syndrome is the solution of the decoding
problem, which we discuss briefly in Sec. V.2.

Coherent errors on the physical qubits, upon error correction, lead to a
coherent error of the same type on the logical level [18]. Starting from an
arbitrary logical state $\ket{\psi_{L}}$, the quantum state of $n=d^{2}$ data
qubits after measuring syndrome $s$, and applying the corresponding
correction, can be written as [16]

$\ket{\Phi_{s}}=\dfrac{1}{\sqrt{P(s)}}\hat{C}_{s}\hat{\Pi}_{s}\hat{U}\ket{\psi_{L}}=e^{i\theta_{L}\hat{Z}^{L}}\ket{\psi_{L}},$
(49)

where $P(s)$ is the probability of syndrome $s$, and the logical rotation
angle $\theta_{L}$ depends on the syndrome, the decoder, and the physical
rotation angles, $\theta_{L}=\theta_{L}(s,\boldsymbol{\theta})$, but _not_ on
the initial state $\ket{\psi_{L}}$.

For a given syndrome $s$, we quantify the logical error by the maximum
infidelity of the final state $\ket{\Phi_{s}}$ with the initial state
$\ket{\psi_{L}}$, maximized over all initial states. Logical rotations around
the $z$ axis are the most harmful for the eigenstates of the $\hat{X}^{L}$
operator, thus we obtain the logical error rate as

$p_{L}(s,\boldsymbol{\theta})\equiv\max_{\ket{\psi_{L}}}\left(1-|\bra{\Psi_{L}}\ket{\Phi_{s}}|^{2}\right)=\sin^{2}\theta_{L}(s,\boldsymbol{\theta}),$
(50)

with this maximum attained for $\ket{\Psi_{L}}=\ket{+_{L}}$, the common
eigenstate of $\hat{X}^{L}$ as well as of all the stabilizer generators
$\hat{S}_{f}$ with eigenvalue +1.

To characterize the strength of the quasistatic phase damping errors, we will
use either the standard deviation $\sigma$ of the single-qubit random coherent
rotations, or the _physical error rate_ $p$ which is defined as for the
repetition code, Eq. (12). This definition is motivated by the fact that for
single-cycle error detection and error correction, it provides an exact
correspondence with the uncorrelated phase-flip channel.

###  V.2 Error correction with readout errors

We use a phenomenological noise model for readout errors where the syndrome
measurements are perfect, but the outcomes are unreliably recorded, with
readout error probability $q$,

$P(-1\to+1)=P(+1\to-1)=q$ (51)

and $P(-1\to-1)=P(+1\to+1)=1-q$. To solve the decoding problem in the presence
of readout errors, we consider $d$ consecutive cycles of syndrome
measurements. As a result, we get the noisy multi-cycle syndrome

$\boldsymbol{s}=(s_{1},s_{2},\dots
s_{d})\to\boldsymbol{s}^{\prime}=(s_{1}^{\prime},s_{2}^{\prime},\dots
s_{d}^{\prime}).$ (52)

The state of the code after measuring the noisy multi-cycle syndrome
$\boldsymbol{s}^{\prime}$, decoding it, and applying the corresponding
correction operator, reads:

$\ket{\Phi_{\boldsymbol{s},\boldsymbol{s^{\prime}}}}=\dfrac{1}{\sqrt{P(\boldsymbol{s})}}\hat{C}_{\boldsymbol{s^{\prime}}}\hat{\Pi}_{s_{d}}\hat{U}\dots\hat{\Pi}_{s_{1}}\hat{U}\ket{\psi_{L}}=e^{i\theta_{L}\hat{Z}^{L}}\ket{\psi_{L}},$
(53)

where the logical rotation angle $\theta_{L}$ now depends on the noisy multi-
cycle syndrome as well,
$\theta_{L}=\theta_{L}(\boldsymbol{s},\boldsymbol{s^{\prime}},\boldsymbol{\theta})$.

To correct errors based on the noisy multi-cycle syndrome that is contaminated
by readout error, we use the 3-dimensional version of the minimum weight
perfect matching (MWPM) decoder [38], as implemented in PyMatching [39]. The
decoder sees the measurement outcomes as a 3-dimensional grid that has
$(d^{2}-1)/2\times(d^{2}-1)/2$ ‘space’ coordinates, characterizing the
positions of the measured X stabilizers, and $d$ ‘time’ coordinates, numbering
the measurement cycles. Vertices, where the measured parity check differs from
the value measured in the previous cycle, are marked, and the decoder needs to
identify the set of edges with the smallest weight that connects the marked
vertices to the left/right boundaries or pairs them up. The correction
operation is inferred from the resulting set of edges. ‘Spacelike’ and
‘timelike’ edges on the grid correspond to readout errors and physical errors.
These carry different weights

$w_{s}=\log\left(\dfrac{1-p}{p}\right)\quad\text{and}\quad
w_{t}=\log\left(\dfrac{1-q}{q}\right),$ (54)

since the rate $p$ of coherent errors can differ from the rate $q$ of readout
errors. To ensure that the correction operator brings the state back to the
code space, the last measurement cycle is assumed to be free of any readout
errors, and the decoder is aware of this assumption.

The logical error rate is obtained by averaging over all (noisy) syndromes and
the $\boldsymbol{\theta}$ angle distribution as well,

$p_{L}(\sigma)=\sum_{\boldsymbol{s},\boldsymbol{s^{\prime}}}P\left(\boldsymbol{s}\right)P\left(\boldsymbol{s}\to\boldsymbol{s^{\prime}}\right)\Big{\langle}\sin^{2}\theta_{L}(\boldsymbol{s},\boldsymbol{s^{\prime}},\boldsymbol{\theta})\Big{\rangle}_{\boldsymbol{\theta}}.$
(55)

###  V.3 Numerical results

Standard Pauli errors in quantum error correction can be simulated efficiently
with Clifford simulators [37, 10]. Unfortunately, to simulate quasistatic
coherent errors we could not use this tool. To explore the effect of coherent
errors in the surface code, several numerical methods have been considered.
Brute-force simulations of small systems [40, 41], tensor-network simulations
for slightly larger systems [42], and Fermionic Linear Optics (FLO) methods
[16, 17, 18] have emerged as possible options. In this work, we used the FLO
method, as implemented in [18], to simulate the surface code under quasistatic
phase damping and readout errors for code sizes up to $d=17$. For further
details of the simulation method, we recommend the appendices of Refs. [16,
18].

We sampled the distribution of the logical rotation angle, and computed the
logical error rate in the following way:

$p_{L}(\sigma)\approx\dfrac{1}{N_{\text{sample}}}\sum_{i=1}^{N_{\text{sample}}}\sin^{2}\left(\theta_{L}(\boldsymbol{s}^{(i)},\boldsymbol{s^{\prime}}^{(i)},\boldsymbol{\theta}^{(i)})\right),$
(56)

where $N_{\text{sample}}$ denotes the sample size.

Fig. 4 shows that by increasing the code distance, we observe threshold
behavior. When the rates of physical and readout errors are the same,
$p=q=\langle\sin^{2}\theta\rangle$, we find that the threshold is
$p_{\text{th}}\approx 2.85\%$. This is close to the threshold with Pauli Z
errors and readout errors, which for the toric code is $2.93\pm 0.02\%$ [12].
We also carried out Monte Carlo simulations to investigate phase-flip errors.
Interestingly, we have found that the threshold value coincides with the above
mentioned $2.85\%$, however, the corresponding logical error rate is different
for the two error models: in our case $p_{L}(p_{\text{th}})\approx 7\%$, but
for the combination of phase-flip and readout errors it is slightly higher,
around $8.5\%$. This relative difference is sustained throughout the physical
error rate window of Fig. 4 (not shown).

[width=0.45]surface-code-threshold.pdf

Figure 4: Surface code threshold with quasistatic phase damping and readout
errors for $p=q$. Data points show the numerically obtained logical error rate
(maximum infidelity), for different code distances $d$, with
$p=q=\langle\sin^{2}\theta\rangle$ being the physical error rate $p$ and
readout error rate $q$, that are kept equal for this plot. Each point is a
result of $N_{\text{sample}}=10,000\times d\times 100$ simulations: we sampled
the multi-cycle syndrome $\boldsymbol{s}$ for $10,000$ random
$\boldsymbol{\theta}$ angles, simulating $100$ random readout error
configurations in each case. The graph confirms the existence of a threshold
at $p_{\text{th}}\approx 2.85\%$.

We have also investigated how varying the rate $p$ of random coherent errors
and $q$ of readout errors independently affect the threshold of the surface
code. Results are shown in 5. For many pairs of $p$ and $q$ we numerically
assessed whether scaling up the surface code decreases the logical error rate
(scalable QEC, green area) or increases it (unscalable QEC, red area). The
threshold should be in between these regions. The results shown in Fig. 5 show
that the surface code is more sensitive to quasistatic phase damping than to
readout errors. If the physical error rate is at the $1\%$ level, the surface
code is quite robust against readout errors, scalable even with relatively
high $q\approx 8\%$. However, if the readout error rate is at the $1\%$ level,
the surface code still requires the coherent error rate to be below $4\%$.

[width=0.45]surface-code-pq-lines.pdf

Figure 5: Surface code threshold with quasistatic phase damping and readout
errors. On the $(p,q)$ plane, threshold lines were identified by simulating 16
different values of $p$ (equidistant in $0<p\leq 9\%$) for a fixed $q$ value,
for code distances $d=7,9,11,13,15$. For each $q$ and $d$, a lower and an
upper bound for the $p$ threshold was estimated. The lower estimate is the
greatest value of $p$ at which the maximum infidelity decreases as the code
distance increases. The upper estimate is the smallest value of $p$ at which
the logical error rate increases as the code distance increases. We also
carried out Monte Carlo simulations to investigate phase-flip errors and
numerically determined the threshold values for asymmetric $p$ and $q$ values.

##  VI Results for the distance-3 surface code, and their relation to
experiments

In this section, we discuss the implications of our results for the smallest
surface code ($d=3$) capable of error correction and their relation to
experiments.

We consider an error correction experiment useful when the logical error rate
of the encoded qubit is lower than the error rate of a single physical qubit,
$p_{L}<p$. To study when this break-even condition is achieved, we compute the
logical error rate $p_{L}$ for several fixed values of physical error rate $p$
and the readout error rate $q$ for $d=3$. Results are shown in Fig. 6. Again,
we see that coherent errors are more harmful to the surface code quantum
memory than readout errors: to achieve break-even, the physical error rate
needs to be pushed below $1\%$, however, in this regime, readout errors up to
$6\%$ are tolerated.

We now connect these results to experimentally relevant error parameters,
focusing on semiconductor spin qubits, to estimate the expected performance of
a small surface code experiment based on currently available spin qubit
hardware. Our considerations expand upon earlier theoretical quantum error
correction studies focusing on spin qubits [43, 44, 45, 46, 47, 48, 49]. We
remark that the first error correction experiments with semiconductor spin
qubits realized the phase-flip repetition code [50, 51] with a single round of
measurement and without feedforward; however, the surface code has yet to be
realized.

The solid black curve in Fig. 6 shows our estimate for the physical and
readout error rates, based on recent experimental data [52] obtained for spin
qubit readout in a double quantum dot. Points of the curve correspond to
different measurement integration times, as we explain below. The black curve
lies inside the break-even region (green), indicating that scaling up the
hardware with the same high-quality components could make useful surface-code-
based quantum error correction attainable with semiconductor spin qubits.

[width=0.45]surface-code-d-3-break-even.pdf

Figure 6: Comparison of logical and physical error rates on the $(p,q)$ plane
for the surface code with code distance $d=3$. The green color indicates
$p_{L}<p$, while the red color is for $p_{L}\geq p$. The black line shows
estimated physical and readout error rates based on state-of-the-art spin
qubit experiment, Ref. [52]. It corresponds to readout time $0.5-0.7\,\mu$s.

The black curve in Fig. 6 is obtained from the data [52] as follows. We
connect our coherent error strength $\sigma$, and the corresponding physical
error rate $p$, to the experimentally available inhomogeneous dephasing time
$T_{2}^{*}$ and measurement integration time $T_{\text{meas}}$ by assuming
that the Larmor angular frequency $\omega_{L}$ of each idling data qubit
exhibits spatially uncorrelated, Gaussian, quasistatic fluctuations, with
standard deviation $\sigma_{\omega_{L}}=\sqrt{2}/T_{2}^{*}$. This detuning of
the Larmor frequency of the $j$th data qubit of the code implies a small
random rotation $\theta_{j}$ around the z axis on that qubit. Typically, the
duration of a quantum error correction cycle is dominated by the measurement
integration time $T_{\text{meas}}$ of the measure qubits, therefore we
estimate the standard deviation $\sigma$ of the angle $\theta_{j}$ of the
coherent error as

$\sigma(T_{\text{meas}})=\sigma_{\omega_{L}}\cdot
T_{\text{meas}}=\sqrt{2}\dfrac{T_{\text{meas}}}{T_{2}^{*}}.$ (57)

From this result, we express the physical error rate $p(T_{\text{meas}})$
using Eq. (12).

We can also provide a realistic estimate for the dependence of the readout
error rate $q$ on the measurement integration time. For this, we use
experimental data, namely, the data set corresponding to the initial state
$T_{-}$ in Fig. 3d of Ref. [52]. In the measurement integration time range
$[0.5,0.7]\,\mu$s, the data is well approximated by this power law:

$q(T_{\text{meas}})\approx\left(\frac{\tau}{T_{\text{meas}}}\right)^{5},$ (58)

where $\tau=0.21\,\mathrm{\mu s}$ is a time constant.

The solid black curve in Fig. 6 shows the parametric dependence of $q$ and $p$
on $T_{\text{meas}}$, based on the considerations and numerical factors of the
previous two paragraphs, and inhomogeneous dephasing time value [52] of
$T_{2}^{\ast}=10\,\mathrm{\mu s}$. The black curve lies in the green region,
where the logical error rate is lower than the physical error rate. Based on
these considerations, we conclude that although it is challenging to perform a
9-qubit surface code experiment, semiconductor spin qubits have the potential
to achieve break-even in the near future. In experiments, where the readout is
significantly slower than in the one we cited, it could be fruitful to convert
high readout fidelity to shorter readout time duration [47], since the surface
code is more robust against readout errors than coherent errors. Note that the
above considerations can be significantly improved with the goal of a more
realistic description of quantum memory experiments, e.g., by taking into
account gate errors both on data and measure qubits, etc.

Finally, we also relate our simulation results to superconducting quantum
computing platforms. On the one hand, transmons are designed to be protected
from dephasing [53], and hence their decoherence is often dominated by
relaxation, which is excluded from our model. On the other hand, alternative
superconducting qubits have been developed [54, 55, 56, 57], in which qubit
relaxation is suppressed and pure dephasing due to charge noise or flux noise
is the dominant decoherence mechanism. (For an informative summary, see Ref.
[58], and Table 1 therein.) For such novel superconducting qubits, the
quasistatic phase damping model is a good starting point. Therefore, it is an
interesting and relevant future task to assess the performance of quantum
error correction based on such qubits, utilizing the efficient simulation
methodology (fermionic linear optics) applied in this paper.

##  VII Conclusions

In the context of multi-cycle quantum error correction, we introduced the
error model of quasistatic phase damping, which is a simplified model
describing Larmor-frequency fluctuations due to $1/f$ noise. These Larmor-
frequency fluctuations amount to unwanted coherent rotations whose axis is
uniform, but the rotation angle is random across the qubit register. We showed
that this quasistatic phase damping error is equivalent to independent single-
qubit Pauli phase-flip errors in the case of a single cycle of error detection
or error correction. However, for multiple cycles, quasistatic phase damping
is distinct from a phase-flip error.

Furthermore, we numerically investigated the performance of the surface code
as quantum memory in the presence of quasistatic random coherent errors on the
physical qubits as well as (phenomenological) readout errors. We utilized the
Fermionic Linear Optics simulation framework to perform large-scale numerical
experiments and established the surface code error correction threshold. The
threshold is found to be close to that with independent phase-flip errors and
readout errors. However, at the threshold, the logical error rate for
quasistatic phase damping combined with readout errors is lower than for
independent phase flips and readout errors. This suggests that in terms of
surface code quantum memory, quasistatic phase damping is less harmful.
Threshold line estimates in the plane spanned by the strengths of the coherent
error and the readout error also show that quasistatic phase damping and the
independent phase-flip error model have similar threshold values.

We have evaluated the effects of our error model on the distance-3 surface
code, and established the break-even boundary line for this code on the
parameter plane of the physical error rate and the readout error rate.
Finally, we have discussed the relevance of our results to solid-state qubit
platforms, including semiconductor spin qubits and novel superconducting
qubits. Our results are expected to provide useful design guidelines for
future experiments based on these quantum computing platforms.

## Acknowledgments

We thank A. Gyenis and B. Hetényi for helpful discussions. This research was
supported by the Ministry of Culture and Innovation and the National Research,
Development and Innovation Office within the Quantum Information National
Laboratory of Hungary (Grant No. 2022-2.1.1-NL-2022-00004). This research has
been supported by the Horizon Europe research and innovation programme of the
European Union through the IGNITE project and by the HORIZON-
CL4-2022-QUANTUM01-SGA project 101113946 OpenSuperQPlus100 of the EU Flagship
on Quantum Technologies. This research was supported by the National Research,
Development and Innovation Office via the OTKA Grant No. 132146, and the
”Frontline” Research Excellence Programme (Grant No. KKP133827). This project
has received funding from the HUN-REN Hungarian Research Network.

## References

  * Nielsen and Chuang [2012] M. A. Nielsen and I. L. Chuang,  _Quantum Computation and Quantum Information: 10th Anniversary Edition_ (Cambridge University Press, 2012).
  * Shor [1995] P. W. Shor, Scheme for reducing decoherence in quantum computer memory, Phys. Rev. A 52, R2493 (1995).
  * Ryan-Anderson  _et al._ [2021] C. Ryan-Anderson _et al._ , Realization of real-time fault-tolerant quantum error correction, Phys. Rev. X 11, 041058 (2021).
  * Egan  _et al._ [2021] L. Egan _et al._ , Fault-tolerant control of an error-corrected qubit, Nature 598, 281–286 (2021).
  * Linke  _et al._ [2017] N. M. Linke, M. Gutierrez, K. A. Landsman, C. Figgatt, S. Debnath, K. R. Brown, and C. Monroe, Fault-tolerant quantum error detection, Science Advances 3 (2017).
  * Nigg  _et al._ [2014] D. Nigg, M. Müller, E. A. Martinez, P. Schindler, M. Hennrich, T. Monz, M. A. Martin-Delgado, and R. Blatt, Quantum computations on a topologically encoded qubit, Science 345, 302–305 (2014).
  * Abobeih  _et al._ [2022] M. H. Abobeih, Y. Wang, J. Randall, S. J. H. Loenen, C. E. Bradley, M. Markham, D. J. Twitchen, B. M. Terhal, and T. H. Taminiau, Fault-tolerant operation of a logical qubit in a diamond quantum processor, Nature 606, 884–889 (2022).
  * Bluvstein  _et al._ [2022] D. Bluvstein _et al._ , A quantum processor based on coherent transport of entangled atom arrays, Nature 604, 451–456 (2022).
  * Bluvstein  _et al._ [2023] D. Bluvstein _et al._ , Logical quantum processor based on reconfigurable atom arrays, Nature (2023).
  * Aaronson and Gottesman [2004] S. Aaronson and D. Gottesman, Improved simulation of stabilizer circuits, Physical Review A 70 (2004).
  * Dennis  _et al._ [2002] E. Dennis, A. Kitaev, A. Landahl, and J. Preskill, Topological quantum memory, Journal of Mathematical Physics 43, 4452–4505 (2002).
  * Wang  _et al._ [2003] C. Wang, J. Harrington, and J. Preskill, Confinement-Higgs transition in a disordered gauge theory and the accuracy threshold for quantum memory, Annals of Physics 303, 31–58 (2003).
  * Katzgraber  _et al._ [2009] H. G. Katzgraber, H. Bombin, and M. A. Martin-Delgado, Error threshold for color codes and random three-body Ising models, Physical Review Letters 103 (2009).
  * Bombin  _et al._ [2012] H. Bombin, R. S. Andrist, M. Ohzeki, H. G. Katzgraber, and M. A. Martin-Delgado, Strong resilience of topological codes to depolarization, Physical Review X 2 (2012).
  * Chubb and Flammia [2021] C. T. Chubb and S. T. Flammia, Statistical mechanical models for quantum codes with correlated noise, Annales de l’Institut Henri Poincaré D 8, 269–321 (2021).
  * Bravyi  _et al._ [2018] S. Bravyi, M. Englbrecht, R. König, and N. Peard, Correcting coherent errors with surface codes, npj Quantum Information 4 (2018).
  * Venn and Béri [2020] F. Venn and B. Béri, Error-correction and noise-decoherence thresholds for coherent errors in planar-graph surface codes, Phys. Rev. Res. 2, 043412 (2020).
  * Márton and Asbóth [2023] Á. Márton and J. K. Asbóth, Coherent errors and readout errors in the surface code, Quantum 7, 1116 (2023).
  * ecz [2022] Qubit stabilizer code, in  _The Error Correction Zoo_, edited by V. V. Albert and P. Faist (2022).
  * Beale  _et al._ [2018] S. J. Beale, J. J. Wallman, M. Gutiérrez, K. R. Brown, and R. Laflamme, Quantum error correction decoheres noise, Phys. Rev. Lett. 121, 190501 (2018).
  * Venn  _et al._ [2023] F. Venn, J. Behrends, and B. Béri, Coherent-error threshold for surface codes from Majorana delocalization, Physical Review Letters 131 (2023).
  * Takita  _et al._ [2017] M. Takita, A. W. Cross, A. D. Córcoles, J. M. Chow, and J. M. Gambetta, Experimental demonstration of fault-tolerant state preparation with superconducting qubits, Phys. Rev. Lett. 119, 180501 (2017).
  * Gong  _et al._ [2021] M. Gong _et al._ , Experimental exploration of five-qubit quantum error-correcting code with superconducting qubits, National Science Review 9, nwab011 (2021).
  * Zhao  _et al._ [2022] Y. Zhao _et al._ , Realization of an error-correcting surface code with superconducting qubits, Phys. Rev. Lett. 129, 030501 (2022).
  * Andersen  _et al._ [2020] C. K. Andersen, A. Remm, S. Lazar, S. Krinner, N. Lacroix, G. J. Norris, M. Gabureac, C. Eichler, and A. Wallraff, Repeated quantum error detection in a surface code, Nature Physics 16, 875–880 (2020).
  * Marques  _et al._ [2021] J. F. Marques _et al._ , Logical-qubit operations in an error-detecting surface code, Nature Physics 18, 80–86 (2021).
  * Krinner  _et al._ [2022] S. Krinner _et al._ , Realizing repeated quantum error correction in a distance-three surface code, Nature 605, 669–674 (2022).
  * Google Quantum AI [2023] Google Quantum AI, Suppressing quantum errors by scaling a surface code logical qubit, Nature 614, 676–681 (2023).
  * Nakamura  _et al._ [2002] Y. Nakamura, Y. A. Pashkin, T. Yamamoto, and J. S. Tsai, Charge echo in a Cooper-pair box, Phys. Rev. Lett. 88, 047901 (2002).
  * Yoshihara  _et al._ [2006] F. Yoshihara, K. Harrabi, A. O. Niskanen, Y. Nakamura, and J. S. Tsai, Decoherence of flux qubits due to $1/f$ flux noise, Phys. Rev. Lett. 97, 167001 (2006).
  * Kakuyanagi  _et al._ [2007] K. Kakuyanagi, T. Meno, S. Saito, H. Nakano, K. Semba, H. Takayanagi, F. Deppe, and A. Shnirman, Dephasing of a superconducting flux qubit, Phys. Rev. Lett. 98, 047004 (2007).
  * Ithier  _et al._ [2005] G. Ithier _et al._ , Decoherence in a superconducting quantum bit circuit, Phys. Rev. B 72, 134519 (2005).
  * Paladino  _et al._ [2014] E. Paladino, Y. M. Galperin, G. Falci, and B. L. Altshuler, $1/f$ noise: Implications for solid-state quantum information, Rev. Mod. Phys. 86, 361 (2014).
  * Burkard  _et al._ [2023] G. Burkard, T. D. Ladd, A. Pan, J. M. Nichol, and J. R. Petta, Semiconductor spin qubits, Reviews of Modern Physics 95 (2023).
  * Struck  _et al._ [2020] T. Struck _et al._ , Low-frequency spin qubit energy splitting noise in highly purified 28Si/SiGe, npj Quantum Information 6 (2020).
  * Yoneda  _et al._ [2017] J. Yoneda _et al._ , A quantum-dot spin qubit with coherence limited by charge noise and fidelity higher than 99.9%, Nature Nanotechnology 13, 102–106 (2017).
  * Gottesman [1997] D. Gottesman, Stabilizer codes and quantum error correction (1997), arXiv:quant-ph/9705052 [quant-ph] .
  * Fowler [2015] A. G. Fowler, Minimum weight perfect matching of fault-tolerant topological quantum error correction in average o(1) parallel time, Quantum Information and Computation 15, 145–158 (2015).
  * Higgott and Gidney [2023] O. Higgott and C. Gidney, Sparse blossom: correcting a million errors per core second with minimum-weight matching (2023), arXiv:2303.15933 [quant-ph] .
  * Tomita and Svore [2014] Y. Tomita and K. M. Svore, Low-distance surface codes under realistic quantum noise, Physical Review A 90 (2014).
  * O’Brien  _et al._ [2017] T. E. O’Brien, B. Tarasinski, and L. DiCarlo, Density-matrix simulation of small surface codes under current and projected experimental noise, npj Quantum Information 3 (2017).
  * Darmawan and Poulin [2017] A. S. Darmawan and D. Poulin, Tensor-network simulations of the surface code under realistic noise, Physical Review Letters 119 (2017).
  * Nigg  _et al._ [2017] S. E. Nigg, A. Fuhrer, and D. Loss, Superconducting grid-bus surface code architecture for hole-spin qubits, Physical Review Letters 118 (2017).
  * Helsen  _et al._ [2018] J. Helsen, M. Steudtner, M. Veldhorst, and S. Wehner, Quantum error correction in crossbar architectures, Quantum Science and Technology 3, 035005 (2018).
  * Buonacorsi  _et al._ [2019] B. Buonacorsi, Z. Cai, E. B. Ramirez, K. S. Willick, S. M. Walker, J. Li, B. D. Shaw, X. Xu, S. C. Benjamin, and J. Baugh, Network architecture for a topological quantum computer in silicon, Quantum Science and Technology 4, 025003 (2019).
  * Cai  _et al._ [2019] Z. Cai, M. A. Fogarty, S. Schaal, S. Patomäki, S. C. Benjamin, and J. J. L. Morton, A silicon surface code architecture resilient against leakage errors, Quantum 3, 212 (2019).
  * Rispler  _et al._ [2020] M. Rispler, P. Cerfontaine, V. Langrock, and B. M. Terhal, Towards a realistic GaAs-spin qubit device for a classical error-corrected quantum memory, Physical Review A 102 (2020).
  * Rozgonyi and Széchenyi [2023] Á. Rozgonyi and G. Széchenyi, Break-even point of the phase-flip error correcting code, New Journal of Physics 25, 103004 (2023).
  * Hetényi and Wootton [2023] B. Hetényi and J. R. Wootton, Tailoring quantum error correction to spin qubits (2023), arXiv:2306.17786 [quant-ph] .
  * Takeda  _et al._ [2022] K. Takeda, A. Noiri, T. Nakajima, T. Kobayashi, and S. Tarucha, Quantum error correction with silicon spin qubits, Nature 608, 682–686 (2022).
  * van Riggelen  _et al._ [2022] F. van Riggelen, W. I. L. Lawrie, M. Russ, N. W. Hendrickx, A. Sammak, M. Rispler, B. M. Terhal, G. Scappucci, and M. Veldhorst, Phase flip code with semiconductor spin qubits, npj Quantum Information 8 (2022).
  * Takeda  _et al._ [2023] K. Takeda, A. Noiri, T. Nakajima, L. C. Camenzind, T. Kobayashi, A. Sammak, G. Scappucci, and S. Tarucha, Rapid single-shot parity spin readout in a silicon double quantum dot with fidelity exceeding 99% (2023), arXiv:2309.00225 [cond-mat.mes-hall] .
  * Koch  _et al._ [2007] J. Koch, T. M. Yu, J. Gambetta, A. A. Houck, D. I. Schuster, J. Majer, A. Blais, M. H. Devoret, S. M. Girvin, and R. J. Schoelkopf, Charge-insensitive qubit design derived from the Cooper pair box, Phys. Rev. A 76, 042319 (2007).
  * Fedorov  _et al._ [2011] A. Fedorov, P. Macha, A. K. Feofanov, C. J. P. M. Harmans, and J. E. Mooij, Tuned transition from quantum to classical for macroscopic quantum states, Phys. Rev. Lett. 106, 170404 (2011).
  * Earnest  _et al._ [2018] N. Earnest _et al._ , Realization of a $\mathrm{\Lambda}$ system with metastable states of a capacitively shunted fluxonium, Phys. Rev. Lett. 120, 150504 (2018).
  * Lin  _et al._ [2018] Y.-H. Lin, L. B. Nguyen, N. Grabon, J. San Miguel, N. Pankratova, and V. E. Manucharyan, Demonstration of protection of a superconducting qubit from energy decay, Phys. Rev. Lett. 120, 150503 (2018).
  * Gyenis  _et al._ [2021a] A. Gyenis, P. S. Mundada, A. Di Paolo, T. M. Hazard, X. You, D. I. Schuster, J. Koch, A. Blais, and A. A. Houck, Experimental realization of a protected superconducting circuit derived from the $0$–$\pi$ qubit, PRX Quantum 2, 010339 (2021a).
  * Gyenis  _et al._ [2021b] A. Gyenis, A. Di Paolo, J. Koch, A. Blais, A. A. Houck, and D. I. Schuster, Moving beyond the transmon: Noise-protected superconducting quantum circuits, PRX Quantum 2, 030101 (2021b).

##  Appendix A Calculation details for the 2-qubit repetition code for two
cycles of error detection

# | $\boldsymbol{E}$ | $\hat{E}(\boldsymbol{E})$ | $\boldsymbol{s}$ | $P(\boldsymbol{E})$ | $\tilde{P}(\boldsymbol{E})$
---|---|---|---|---|---
1 | $(\hat{\mathds{1}},\hat{\mathds{1}})$ | $\hat{\mathds{1}}$ | $(+1,+1)$ | $(1-p)^{4}$ | $1-4p+11p^{2}-26p^{3}+46p^{4}-60p^{5}+56p^{6}-32p^{7}+8p^{8}$
2 | $(\hat{Z}_{A}\hat{Z}_{B},\hat{Z}_{A}\hat{Z}_{B})$ | $\hat{\mathds{1}}$ | $(+1,+1)$ | $p^{4}$ | $p^{2}-6p^{3}+26p^{4}-52p^{5}+56p^{6}-32p^{7}+8p^{8}$
3 | $(\hat{\mathds{1}},\hat{Z}_{A}\hat{Z}_{B})$ | $\hat{Z}_{A}\hat{Z}_{B}$ | $(+1,+1)$ | $(1-p)^{2}p^{2}$ | $2p^{2}-12p^{3}+34p^{4}-56p^{5}+56p^{6}-32p^{7}+8p^{8}$
4 | $(\hat{Z}_{A}\hat{Z}_{B},\hat{\mathds{1}})$ | $\hat{Z}_{A}\hat{Z}_{B}$ | $(+1,+1)$ | $(1-p)^{2}p^{2}$ | $2p^{2}-12p^{3}+34p^{4}-56p^{5}+56p^{6}-32p^{7}+8p^{8}$
5 | $(\hat{Z}_{A},\hat{Z}_{A})$ | $\hat{\mathds{1}}$ | $(-1,+1)$ | $(1-p)^{2}p^{2}$ | $4p^{2}-16p^{3}+36p^{4}-56p^{5}+56p^{6}-32p^{7}+8p^{8}$
6 | $(\hat{Z}_{B},\hat{Z}_{B})$ | $\hat{\mathds{1}}$ | $(-1,+1)$ | $(1-p)^{2}p^{2}$ | $4p^{2}-16p^{3}+36p^{4}-56p^{5}+56p^{6}-32p^{7}+8p^{8}$
7 | $(\hat{Z}_{A},\hat{Z}_{B})$ | $\hat{Z}_{A}\hat{Z}_{B}$ | $(-1,+1)$ | $(1-p)^{2}p^{2}$ | $2p^{2}-12p^{3}+34p^{4}-56p^{5}+56p^{6}-32p^{7}+8p^{8}$
8 | $(\hat{Z}_{B},\hat{Z}_{A})$ | $\hat{Z}_{A}\hat{Z}_{B}$ | $(-1,+1)$ | $(1-p)^{2}p^{2}$ | $2p^{2}-12p^{3}+34p^{4}-56p^{5}+56p^{6}-32p^{7}+8p^{8}$
9 | $(\hat{\mathds{1}},\hat{Z}_{A})$ | $\hat{Z}_{A}$ | $(+1,-1)$ | $(1-p)^{3}p$ | $p-6p^{2}+19p^{3}-40p^{4}+58p^{5}-56p^{6}+32p^{7}-8p^{8}$
10 | $(\hat{Z}_{A}\hat{Z}_{B},\hat{Z}_{B})$ | $\hat{Z}_{A}$ | $(+1,-1)$ | $(1-p)p^{3}$ | $-p^{2}+9p^{3}-30p^{4}+54p^{5}-56p^{6}+32p^{7}-8p^{8}$
11 | $(\hat{\mathds{1}},\hat{Z}_{B})$ | $\hat{Z}_{B}$ | $(+1,-1)$ | $(1-p)^{3}p$ | $p-6p^{2}+19p^{3}-40p^{4}+58p^{5}-56p^{6}+32p^{7}-8p^{8}$
12 | $(\hat{Z}_{A}\hat{Z}_{B},\hat{Z}_{A})$ | $\hat{Z}_{B}$ | $(+1,-1)$ | $(1-p)p^{3}$ | $-p^{2}+9p^{3}-30p^{4}+54p^{5}-56p^{6}+32p^{7}-8p^{8}$
13 | $(\hat{Z}_{A},\hat{\mathds{1}})$ | $\hat{Z}_{A}$ | $(-1,-1)$ | $(1-p)^{3}p$ | $p-6p^{2}+19p^{3}-40p^{4}+58p^{5}-56p^{6}+32p^{7}-8p^{8}$
14 | $(\hat{Z}_{B},\hat{Z}_{A}\hat{Z}_{B})$ | $\hat{Z}_{A}$ | $(-1,-1)$ | $(1-p)p^{3}$ | $-p^{2}+9p^{3}-30p^{4}+54p^{5}-56p^{6}+32p^{7}-8p^{8}$
15 | $(\hat{Z}_{A},\hat{Z}_{A}\hat{Z}_{B})$ | $\hat{Z}_{B}$ | $(-1,-1)$ | $(1-p)p^{3}$ | $-p^{2}+9p^{3}-30p^{4}+54p^{5}-56p^{6}+32p^{7}-8p^{8}$
16 | $(\hat{Z}_{B},\hat{\mathds{1}})$ | $\hat{Z}_{B}$ | $(-1,-1)$ | $(1-p)^{3}p$ | $p-6p^{2}+19p^{3}-40p^{4}+58p^{5}-56p^{6}+32p^{7}-8p^{8}$
Table 1: Summary of cycle-resolved error scenarios $\boldsymbol{E}$, merged
error operators $\hat{E}(\boldsymbol{E})$, syndromes $\boldsymbol{s}$,
independent Pauli phase-flip probabilities $P(\boldsymbol{E})$, and coherent
error amplitudes $\tilde{P}(\boldsymbol{E})$ (written as a function of
$p=\langle\sin^{2}\theta\rangle$) calculated from Eq. (41), for the 2-qubit
repetition code, for two cycles of error detection.