#  Quantum error thresholds for gauge-redundant digitizations of lattice field
theories

Marcela Carena<EMAIL_ADDRESS>Fermi National Accelerator Laboratory,
Batavia, Illinois, 60510, USA  Enrico Fermi Institute, University of Chicago,
Chicago, Illinois, 60637, USA  Kavli Institute for Cosmological Physics,
University of Chicago, Chicago, Illinois, 60637, USA  Department of Physics,
University of Chicago, Chicago, Illinois, 60637, USA  Henry Lamm
<EMAIL_ADDRESS>Fermi National Accelerator Laboratory, Batavia, Illinois,
60510, USA  Ying-Ying Li<EMAIL_ADDRESS>Peng Huanwu Center for
Fundamental Theory, Hefei, Anhui 230026, China  Interdisciplinary Center for
Theoretical Study, University of Science and Technology of China, Hefei, Anhui
230026, China  Wanqiang Liu<EMAIL_ADDRESS>Department of Physics,
University of Chicago, Chicago, Illinois, 60637, USA

###### Abstract

In the quantum simulation of lattice gauge theories, gauge symmetry can be
either fixed or encoded as a redundancy of the Hilbert space. While gauge-
fixing reduces the number of qubits, keeping the gauge redundancy can provide
code space to mitigate and correct quantum errors by checking and restoring
Gauss’s law. In this work, we consider the correctable errors for generic
finite gauge groups and design the quantum circuits to detect and correct
them. We calculate the error thresholds below which the gauge-redundant
digitization with Gauss’s law error correction has better fidelity than the
gauge-fixed digitization. Our results provide guidance for fault-tolerant
quantum simulations of lattice gauge theories.

††preprint: USTC-ICTS/PCFT-24-06, FERMILAB-PUB-23-570-T

##  I Introduction

Gauge symmetries in quantum field theories give rise to extremely rich
phenomena. Most prominently, $SU(3)\times SU(2)\times U(1)$ gauge symmetry
describes the interactions of the Standard Model. Making ab initio predictions
for comparison to experiment requires large computational resources. In
particular, Monte Carlo methods in lattice gauge theory (LGT) have been
fruitful in the past couple of decades, thanks to the advancement of
supercomputers and algorithms. However, problems involving dynamics such as
out-of-equilibrium evolution in the early universe [1, 2, 3, 4], transport
coefficients of the quark-gluon plasma [5] and parton physics in hadron
collisions [6, 7, 8, 9, 10, 11] present sign problems, as the Boltzmann weight
becomes complex-valued. Future, large-scale quantum computers can avoid this
obstacle by performing real-time simulations in the Hamiltonian formalism [12,
13, 14, 15].

In order to use quantum computers for simulations, the infinite-dimensional
Hilbert space of the gauge theory must be addressed. To allow a mapping to a
finite quantum memory, many digitization proposals to truncate this space have
been studied (see Sec VI.b of [15]). All truncations break the continuous
symmetries to some degree and produce theories with smaller symmetries.
Understanding the theoretical errors introduced by this is an area of active
research [16, 17, 18, 19, 20, 21, 22]. Broadly speaking, methods to encode
these regularized theories in quantum computers fall into two classes. The
first class digitizes all the states connected through gauge transformations
as redundancy and uses Gauss’s law to project the gauge-invariant subspace,
where the physical theory should be simulated. This can be done in group
element basis [23, 24, 25, 26, 27, 18, 28, 29, 30, 31], the group
representation basis [32, 33, 23, 34, 35, 36, 37], the mixed basis [38], as a
fuzzy gauge theory [39, 40], as a quantum link model [41, 42, 43, 44], and
more. The second class digitizes only gauge-invariant states. We refer to this
as fixing the gauge in the sense that it eliminates the redundant degrees of
freedom. One can digitize the independent Wilson loops in the lattice, which
can be identified as the plaquettes in $(2+1)$ dimensions [45, 46, 47, 48, 49,
50, 51, 52], and as the states outside the maximal tree in higher dimensions
[20]. Other digitizations to eliminate redundancy include the Fock basis in
the light-front Hamiltonian [53, 7], the local multiplet basis [54, 55], and
spin networks [56, 57]. Besides reducing the qubit cost, gauge fixing also
simplifies the quantum state preparation, but can complicate the Hamiltonian
[45, 58, 59, 60, 61, 62, 63, 56, 20, 54, 55, 57]. At present, it is an open
question whether gauge fixing is ultimately advantageous for quantum
simulation.

The effect of noisy hardware has been generally neglected in the above
discussion. Naively, gauge-redundant digitizations suffer more severely from
quantum noise because more qubits introduce more errors. However, not all the
errors are equally harmful. Noise which breaks symmetries can change the
universality class simulated [36, 35, 64, 65, 66, 39] and thus sufficient
symmetry preservation is crucial [67, 61, 68, 69, 70, 71]. In the gauge-
redundant digitization, quantum errors can be classified as gauge-preserving
or gauge-violating operators [71, 72, 73, 74, 75, 76]. The gauge-violating
errors can be mitigated by introducing energy penalties [77, 78, 79, 80, 81]
or random gauge transformations [68] in the Hamiltonian evolution. They can
also be corrected by measuring and restoring Gauss’s law [67, 82]. The gauge-
fixed digitization – while precluded from noise-based gauge violations– does
not have such natural error mitigation or correction methods, and thus relies
on generic methods for the residual errors.

Notably, redundancy and symmetry play a central role in both quantum error
correction (QEC) and mitigation (QEM). QEC deliberately designs a redundant
full Hilbert space $\mathcal{H}_{\mathrm{full}}$ on the physical qudits and
encodes quantum information in a much smaller code subspace
$\mathcal{H}_{\mathrm{code}}$ on logical qudits with certain symmetries, thus
allowing for correction without disrupting the coherent quantum information in
$\mathcal{H}_{\mathrm{code}}$ [83, 84]. As an active field of research,
estimates for the overhead – the physical to logical qubit ratio – vary from
$\mathcal{O}(10)$ to $\mathcal{O}(10^{5})$ [85, 86, 87]. QEM uses the existing
symmetries without introducing redundancy to mitigate errors [88]. Indeed, it
is this structural similarity between QEC, QEM and LGT that inspires the above
mentioned works [72, 74, 75, 76, 77, 81, 68, 67, 82, 69, 70, 71] to use gauge
redundancy as a resource for error correction and mitigation. Given the huge
variance of the overhead in QEC, and that gauge fixing saves logical qubits
only by a factor of approximately $(1-1/d)$ in $d$ spatial dimensions, keeping
the gauge redundancy for QEC or QEM may be more resource efficient for
achieving a desired accuracy. This idea has only just begun to be explored for
field theories [89, 90, 91, 76] including fermionic systems [92, 93].

The answer to when this is true can be phrased as a threshold theorem of QEC
[94, 95, 96], which states that there is a threshold for the error rate of
physical qubits, below which more redundancy makes the code more error-proof.
In this work, we compute the threshold below which gauge redundancy makes the
digitization more robust. After reviewing the connection between gauge
symmetry and QEC in Sec. II and Sec. III, we present the circuits to encode
and decode via Gauss’s law. This paves the way for calculations in Sec. IV of
the thresholds, below which the gauge-redundant digitization combined with QEC
has a better fidelity than the gauge-fixed one.

##  II Gauge symmetry and fixing

We will briefly review gauge symmetry on lattice in both the group element
(magnetic) and the group representation (electric) basis, as the former is
closer to the path-integral quantization and the latter to Gauss’s law in
classical fields. These bases are related by the group Fourier transform. In
the group element basis, one assigns an element of the group $G$ (link
variable) to each link on the lattice, representing the Wilson line [97]. For
continuous gauge groups, the link variables are related to the vector
potentials of the continuum theory via:

$U_{\mathbf{x},i}=P\exp(-i\int_{\mathbf{x}}^{\mathbf{x+i}}d\mathbf{l}\cdot\mathbf{A})\approx
e^{-iaA_{i}(\mathbf{x})},$ (1)

where $P$ denotes path ordering, $a$ is the lattice spacing, and $i$ the
spacial direction of the link. The gauge-redundant Hilbert space
$\mathcal{H}_{\mathrm{gauge}}$ is the tensor product of $N_{L}$ local spaces,
each spanned by the group elements:

$\displaystyle\mathcal{H}_{\mathrm{gauge}}=\mathrm{span}(\\{\ket{U},U\in
G\\})^{\otimes N_{L}}$ (2)

where $N_{L}$ is the total number of links and
$\braket{U}{U^{\prime}}=\delta_{U^{\prime},U}$.

For a continuous gauge group, $\mathrm{dim}(\mathcal{H}_{\rm gauge})=\infty$,
and digitization is required to render it finite. Here we will focus on the
discrete subgroup digitization. Some discussion of the continuous theory can
be found in [98] and other digitization schemes remain for future works. For a
discrete gauge group $G$, the dimension of the one-link Hilbert space is
$|G|$. The dimension of $\mathcal{H}_{\mathrm{gauge}}$ is given by:

$\mathrm{dim}\,\mathcal{H}_{\mathrm{gauge}}=|G|^{N_{L}}.$ (3)

A gauge transformation $\hat{T}_{g_{\mathbf{x}}}$ is a unitary operator that
transforms all out-going (in-coming) links connected to a site $\mathbf{x}$ by
a left (right) product with $g\in G$ ($g^{-1}\in G$):

$\displaystyle\hat{T}_{g_{\mathbf{x}}}=\prod_{i=1}^{d}[\hat{L}_{g}(\mathbf{x},i)\hat{R}_{g^{-1}}(\mathbf{x-i},i)],$
(4)

where $\hat{L}_{g},\hat{R}_{g}$ are left and right multiplication operators,

$\displaystyle\hat{L}_{g}=\sum_{U\in
G}\ket{gU}\bra{U},\,\hat{R}_{g^{-1}}=\sum_{U\in G}\ket{Ug^{-1}}\bra{U}.$ (5)

Typical lattice gauge Hamiltonians preserves gauge symmetry as they commutes
with the gauge transformation operator $\hat{T}_{g_{\mathbf{x}}}$. This
includes the Kogut-Susskind [97], the Symanzik-improved [99, 100, 101, 102]
and the Similarity-Renormalization-Group-improved ones [21].

Gauge-invariant states satisfy a lattice version of Gauss’s law:

$\hat{T}_{g_{\mathbf{x}}}\ket{\Psi_{\mathrm{inv}}}=\ket{\Psi_{\mathrm{inv}}},\forall\,g_{\mathbf{x}}\in
G.$ (6)

In the $\ket{U}$ basis, Gauss’s law requires the wave functions on gauge-
equivalent configurations to be the same, as taking an inner product of Eq.
(6) with $\bra{U}$ gives

$\displaystyle\braket{U}{\hat{T}_{g_{\mathbf{x}}}}{\Psi_{\mathrm{inv}}}=\braket{U}{\Psi_{\mathrm{inv}}}$
(7)

Such states are in the gauge-invariant subspace $\mathcal{H}_{\mathrm{inv}}$,
which can be projected from $\mathcal{H}_{\mathrm{gauge}}$ with the operator
$\hat{P}_{\mathrm{inv}}\equiv\prod_{\mathbf{x}}\hat{P}_{0}(\mathbf{x})$, where
the local Gauss’s law projector is

$\displaystyle\hat{P}_{0}(\mathbf{x})$
$\displaystyle=\frac{1}{|G|}\sum_{g_{\mathbf{x}}\in
G}\hat{T}_{g_{\mathbf{x}}}.$ (8)

To get a clearer physical picture, it is useful to introduce the electric
basis $\ket{\sigma_{mn}}$, which is the group Fourier transform of the group
element basis:

$\braket{\sigma_{mn}}{U}=\sqrt{d_{\sigma}/|G|}\Gamma^{(\sigma)}_{mn}(U),$ (9)

where $\Gamma^{(\sigma)}_{mn}(U)$ is the $m,n$ matrix element of the unitary
irreducible representation (irrep) $\sigma$ for $U$, $d_{\sigma}$ is the
dimension of $\sigma$. The dimension of the one-link Hilbert space $|G|$ also
equals $\sum_{\sigma}d_{\sigma}^{2}$. For the Abelian groups, all irreps are
1d and $m,n$ can therefore be suppressed with $\sigma$ being the Abelian
electric flux. For non-Abelian groups, $\ket{\sigma_{mn}}$ is a tensor
representation comprised of the left vector representation $\ket{\sigma_{m}}$
and the right vector representation $\ket{\bar{\sigma}_{n}}$:

$\ket{\sigma_{mn}}=\ket{\sigma_{m}}\otimes\ket{\bar{\sigma}_{n}},$ (10)

where $\bar{\sigma}$ is the complex conjugate dual of representation $\sigma$,
i.e. $\Gamma^{(\bar{\sigma})}_{nq}(g)=\Gamma^{(\sigma)}_{qn}(g^{-1})$. This is
because gauge transformations act on the links going out from the vertex via

$\displaystyle\hat{L}_{g}=\sum_{\sigma,m,q}\Gamma^{(\sigma)}_{mq}(g)\ket{\sigma_{m}}\bra{\sigma_{q}}\otimes\sum_{n}\ket{\bar{\sigma}_{n}}\bra{\bar{\sigma}_{n}},$
(11)

thus transforming only the left vector. Similarly, the in-coming links
transform in the dual representation, and only the right vectors are
transformed:

$\displaystyle\hat{R}_{g^{-1}}=\sum_{\sigma,m}\ket{\sigma_{m}}\bra{\sigma_{m}}\otimes\sum_{n,q}\Gamma^{(\bar{\sigma})}_{nq}(g)\ket{\bar{\sigma}_{n}}\bra{\bar{\sigma}_{q}}.$
(12)

Thus, one can define the local charge at vertex $\mathbf{x}$ as the tensor
product representation:

$\displaystyle\ket{Q(\mathbf{x})}=\prod_{i=1}^{d}\otimes\ket{\sigma_{m}(\mathbf{x},i)}\otimes\ket{\bar{\sigma}_{n}(\mathbf{x-i},i)}$
(13)

$\hat{P}_{0}(\mathbf{x})$ projects the tensor product to the trivial
representation according to the Clebsch-Gordan coefficients of the group.
Physically, one can interpret $Q(\mathbf{x})$ as the net flux, and
$\hat{P}_{0}(\mathbf{x})$ selects states with neutral net flux. As the result
of the constraints, one lacks the freedom to independently assign all the
links variables. Naively, applying $\hat{P}_{0}(\mathbf{x})$ to all the
$N_{V}$ vertices in the lattice implies $N_{V}$ different constraints.
However, the global charge, defined as the tensor product of all the local
charges,

$\ket{Q_{\mathrm{gl}}}=\prod_{\mathbf{x}}\otimes\ket{Q(\mathbf{x})}=\prod_{\mathbf{x},i}\otimes\ket{\sigma_{m}(\mathbf{x},i)}\otimes\ket{\bar{\sigma}_{n}(\mathbf{x},i)}$
(14)

is not a gauge constraint but rather the physically-conserved charge of the
state under the global transformation with $h\in G$:

$\displaystyle\hat{T}_{h}^{\rm{Gl}}\prod_{\mathbf{x},i}\ket{U_{\mathbf{x},i}}=\prod_{\mathbf{x},i}\ket{hU_{\mathbf{x},i}h^{-1}}.$
(15)

In the case of an Abelian group like $U(1)$ or $\mathbb{Z}_{N}$, the links
cannot carry charge as the charges of the left and right vector always cancel,
making the global charge automatically neutral. This can also be easily seen
in the group element basis as all states are invariant under Eq. (15). In
contrast, non-Abelian gauge fields can carry charge, as indicated by the
difference between the left and right vectors, and the non-trivial global
transformations. If one allows for all the possible global charges, the number
of independent constraints is thus $N_{V}-1$. This makes $N_{L}-N_{V}+1$ links
dynamical with the rest $N_{V}-1$ links dependent on the dynamical ones. Thus,

$\mathrm{dim}\mathcal{H}_{\mathrm{inv}}=|G|^{N_{L}-N_{V}+1}.$ (16)

If one fixes the global transformations as well, thereby selecting the
subspace with neutral global charge, the dimension of
$\mathcal{H}_{\mathrm{inv}}$ might be reduced by a factor greater or equal to
$|H|/|G|$ where $H$ is the Abelian center of the group, as derived in Appendix
A.

Choosing which degrees of freedom are independent and eliminating others is
equivalent to gauge fixing. On the lattice, the maximal tree method fixes the
gauge up to the global transformations Eq. (15), by explicitly solving the
local Gauss’s law constraints which forces some links to be functions of the
remaining ones (See [103] for a good discussion). For example, consider the
links connected to the vertex $\mathbf{x}$ shown in the left of Fig. 1, the
state are given by 111We have suppressed the vector indices of representations
here for simplicity.

$\ket{\Psi_{\mathrm{gauge}}}=\sum_{\sigma,\rho,\tau}a(\sigma,\rho,\tau)\ket{\sigma,\rho,\tau}.$
(17)

Constraining $\ket{Q(\mathbf{x})}$ to be in the trivial representation, the
variable $\rho$ in the maximal tree can be determined as
$\rho=\sigma\otimes\bar{\tau}$, which produces the gauge-invariant state:

$\displaystyle\ket{\Psi_{\mathrm{inv}}}$ $\displaystyle=$
$\displaystyle\sum_{\sigma,\tau}a(\sigma,\tau)\ket{\sigma,\tau}\otimes\left|\rho=\sigma\otimes\bar{\tau}\right>.$
(18)

The same procedure can be repeated till the dependent links form a maximal
tree in the lattice, i.e. a set of links which contains one and only one path
between any pair of vertices, the size of which is $N_{T}=N_{V}-1$. We will
define the Hilbert space spanned by the variables completely determined by
Gauss law (in the maximal tree in the above example) as
$\mathcal{H}_{\mathrm{red}}$, and the rest as $\mathcal{H}_{\mathrm{fixed}}$.
Clearly,

$\displaystyle\mathcal{H}_{\mathrm{inv}}\cong\mathcal{H}_{\mathrm{fixed}}=\mathrm{span}(\\{\ket{U},U\in
G\\})^{\otimes N_{L}-N_{V}+1}.$ (19)

Similar to choice of gauge fixing in the continuum, for a given lattice there
is no unique maximal tree. One popular method [104, 105, 106, 20] is to pick a
site $\mathbf{x}_{0}$, and the set of links which uniquely connects
$\mathbf{x}_{0}$ via a comb-like path to any other site form a tree of size
$N_{T}=N_{V}-1$ . This maximal tree is shown in Fig. 1 for 2d with open (OBC)
and periodic (PBC) boundary conditions. Notably, the charge at
$\mathbf{x}_{0}$ is not fixed by the maximal tree, but left to carry the
charge under global transformations in Eq. (15) [106, 20].

Figure 1: Maximal trees (dashed lattice links) of lattices with (left) OBC and
(right) PBC. The site at the lower left corner is chosen as the root of the
maximal tree.

In the gauge-redundant quantum simulations digitized with Hilbert space
$\mathcal{H}_{\mathrm{gauge}}$ and a quantum computer made of qudits of
dimension $N$, the number of qudits required is
$\log_{N}(\mathrm{dim}\,\mathcal{H}_{\mathrm{gauge}})=N_{L}\log_{N}|G|$. Gauge
fixing eliminates the redundancy by digitizing the subspace
$\mathcal{H}_{\mathrm{inv}}$ instead, thus reducing the number of qudits to
$\log_{N}(\mathrm{dim}\,\mathcal{H}_{\mathrm{inv}})$. For the rest of the
work, we take
$\log_{N}(\mathrm{dim}\,\mathcal{H}_{\mathrm{inv}})\approx(N_{L}-N_{T})\log_{N}|G|$,
which is accurate for fixing the maximal tree in both the Abelian and non-
Abelian cases, and an upper bound for non-Abelian $G$ if the global symmetry
is also fixed. The numbers of sites, links, links in a maximal tree are listed
in Tab. 1 for different boundary conditions.

Table 1: The number of degrees of freedom in a lattice with $L$ links per side in $d$ dimensions. $b=0,1$ for PBC and OBC respectively. Sites $N_{V}$ | $(L+b)^{d}$
---|---
Links $N_{L}$ | $dL(L+b)^{d-1}$
Maximal Tree Links $N_{T}$ | $(L+b)^{d}-1$

Gauge fixing reduces the number of qubits, but often at the price of
complicating the lattice gauge Hamiltonian $\hat{H}_{\mathrm{LGT}}$. Written
with the gauge-redundant degrees of freedom, $\hat{H}_{\mathrm{LGT}}$ only
consists of local electric and magnetic energy operators. In the gauge-fixed
formalism with Hamiltonian $\hat{H}_{\mathrm{fixed}}$, the electric operators
of the redundant links in the maximal tree cannot be discarded, but are non-
local combinations of operators outside the tree [106, 20]. Thus
$\hat{H}_{\mathrm{fixed}}$ is generically denser and non-local. It is easier
to fix the gauge while keeping the Hamiltonian simple in 1d or 2d. In 2d,
$\log_{|G|}\mathrm{dim}\,\mathcal{H}_{\mathrm{inv}}$ is

$\displaystyle N_{L}-N_{T}=N_{L}-N_{V}+1=N_{P}-\chi+1,$ (20)

where $N_{P}$ is the number of plaquettes, and $\chi$ is the Euler
characteristic. This also follows from counting the number of plaquettes with
independent magnetic fluxes (Wilson loops), plus the topological degrees of
freedom. For an OBC lattice ($\chi=1$), all $N_{P}$ plaquettes are independent
and there are no topological degrees of freedom. This plaquette magnetic flux
basis keeps the Hamiltonian local and sparse for Abelian gauge groups [45, 46,
47, 48, 49, 50, 51, 38, 52]. For a PBC lattice ($\chi=0$), the total magnetic
flux is zero, thus there are $(N_{P}-1)$ plaquettes with independent magnetic
fluxes. Additionally, considering the two independent Wilson loops with
winding number one, this yields
$\mathrm{dim}\,\mathcal{H}_{\mathrm{inv}}=|G|^{N_{P}+1}$.

##  III Lattice gauge symmetries as stabilizer codes

Figure 2: Schematic circuit of LGT as QEC. g represents a color-neutral state.

In this section, we construct quantum circuits to use gauge redundancy as
partial error correction codes for generic finite groups. The method is based
on the similarity between stabilizer codes and lattice gauge theories, which
we review in III.1. Without redundancy, any error in
$\mathcal{H}_{\mathrm{fixed}}$ causes irrecoverable information loss. In the
gauge-redundant formalism, as a result of gauge symmetry Eq. (7), all the
states equivalent under gauge transformation carry copies of the same wave
function. This allows one to detect and correct some gauge-symmetry violating
errors, as is analyzed in III.2. Fig. 2 outlines the circuit to realize such
error corrections. The preparation of gauge invariant states is a process to
encode the quantum information with the maximal-tree redundancy. To decode, we
introduce an ancillary register at each site to compute and measure the net
flux. Nonzero fluxes indicates occurrence of quantum errors which can be
mitigated via post-selection, with the associated sampling overhead exhibiting
exponential growth in the system size [107]. One can also correct these errors
by applying the optimal recoveries after deducing the most likely errors. The
details of the construction are in III.3.

###  III.1 Stabilizer codes

Stabilizer codes perform error correction by using a redundant full Hilbert
space $\mathcal{H}_{\mathrm{full}}$ of physical qubits (qudits), but encoding
quantum information only in states with certain symmetries. The symmetry group
that defines the code states is called the stabilizer group $\mathcal{S}$,
usually a subgroup of the (generalized) Pauli group on the physical qubits
(qudits). A code state satisfies

$\hat{s}\ket{\psi}_{\mathrm{code}}=\ket{\psi}_{\mathrm{code}},\forall\,\hat{s}\in\mathcal{S}.$
(21)

All code states are in the code space, $\mathcal{H}_{\mathrm{code}}$. The sum
of all $\hat{s}$ is proportional to the projector from
$\mathcal{H}_{\mathrm{full}}$ to $\mathcal{H}_{\mathrm{code}}$:

$\hat{P}_{\mathrm{code}}=\frac{1}{|\mathcal{S}|}\sum_{\hat{s}\in\mathcal{S}}\hat{s}.$
(22)

Note that Eq. (21) is similar to Eq. (6), and Eq. (22) to Eq. (8). Applying
the above concepts to LGT, the group of gauge transformations $\mathcal{G}$ is
a stabilizer group, and $\mathcal{H}_{\mathrm{inv}}$ corresponds to the code
space. The projection operator $\hat{P}_{\rm inv}$ from
$\mathcal{H}_{\mathrm{gauge}}$ to $\mathcal{H}_{\mathrm{inv}}$ is the
(normalized) sum of all stabilizers. 222We will reserve the terms “physical
states (space)” for the gauge-symmetric ones in the LGT which is unfortunately
different from the convention of the QEC literature. Terms “physical qubits
(qudits, noise)” still refer to any qubits (qudits, noise) in
$\mathcal{H}_{\mathrm{full}}$, consistent with QEC literature. Measuring
whether and how gauge symmetry is violated allows one to detect and correct
gauge-violating errors.

In active QEC, one measures a minimum generating set of $\mathcal{S}$, and the
results are syndromes. To avoid collapsing the quantum information in the
measurement of syndromes, ancillae are needed to compute the syndromes
coherently:

$\displaystyle\big{[}\sum_{X}\psi(X)\ket{X}\big{]}\otimes\ket{0}_{\mathrm{anc}}\to\sum_{X}\psi(X)\ket{X}\otimes\ket{s(X)}_{\mathrm{anc}},$
(23)

where $\ket{X}$ are base vectors of the physical qubits. In the case of Pauli
stabilizers with eigenvalue $\pm 1$, measuring the ancillary qubits collapses
the state to $\mathcal{H}_{\mathrm{code}}$ when all syndromes return $+1$, or
one of the subspaces orthogonal to $\mathcal{H}_{\mathrm{code}}$ if some
syndromes return $-1$ indicate the errors. One then applies an optimal
recovery operation to the quantum state depending on the syndromes. Clearly,
errors that transform one state to another within
$\mathcal{H}_{\mathrm{code}}$ are not detectable, and those are logical
errors.

The code distance is the minimum number of single physical qubit (qudit)
errors that are part of a logical error. For scalable quantum error correction
codes, which imply that the code distance can be arbitrarily large, there
exists an error threshold for the error rate per physical qudit. If the
physical error rate is below such threshold, we can decrease the logical error
rate by increasing the code distance, despite the increased total errors due
to more physical qudits [94, 96, 95].

###  III.2 The set of correctable errors

For a quantum system represented as a density operator $\rho$, the general
noisy evolution can be written as a completely positive, trace-preserving map
$\mathcal{N}(\rho)$:

$\displaystyle\mathcal{N}(\rho)=\sum_{j}\hat{N}_{j}\rho\hat{N}_{j}^{\dagger}$
(24)

where $\hat{N}_{j}$ are error operators, usually including the identity
operator. The necessary and sufficient condition for correctable errors is the
Knill-Laflamme (KL) condition [108]:

$\displaystyle\hat{P}_{\mathrm{code}}\hat{N}_{i}^{\dagger}\hat{N}_{j}\hat{P}_{\mathrm{code}}=\lambda_{ij}\hat{P}_{\mathrm{code}},\quad\lambda_{ij}^{\ast}=\lambda_{ji}.$
(25)

For errors as operators on a $G$-register, a linearly independent complete
basis can be constructed as $\\{\hat{L}_{g}\hat{\Gamma}_{\sigma}\\}$, where
$\hat{L}_{g}$ is the group left multiplication operator defined in Eq. (5),
and $\hat{\Gamma}_{\sigma}$ is the matrix element operator:
333$\Gamma_{\sigma}$ is short for $\Gamma_{\sigma,m,n}$, where $\sigma$ is the
irrep, and $m,n$ indicated the matrix element in the representation. The
number of different $\Gamma_{\sigma,m,n}$ is therefore
$\sum_{\sigma}{d_{\sigma}}^{2}=|G|$.

$\displaystyle\hat{\Gamma}_{\sigma,m,n}=\sum_{h\in
G}\sqrt{d_{\sigma}}\Gamma^{(\sigma)}_{mn}(h)^{\ast}\ket{h}\bra{h}$ (26)

One can check that the above set of operators are linearly independent by
satisfying:

$\displaystyle\operatorname{Tr}\big{[}(\hat{L}_{g}\hat{\Gamma}_{\sigma})^{\dagger}(\hat{L}_{g^{\prime}}\hat{\Gamma}_{\sigma^{\prime}})]=|G|\delta_{g,g^{\prime}}\delta_{\sigma,\sigma^{\prime}}.$
(27)

The basis is complete as there are only $|G|^{2}$ independent operators in a
Hilbert space of dimension $|G|$.

The gauge-violating effect of $\hat{\Gamma}_{\sigma}$ is clearer in the
electric basis. Using Eq. (82) between Clebsch-Gordan coefficients and the
matrix elements of irreps in [109], one can derive:

$\displaystyle\bra{\sigma^{\prime\prime}_{lr}}\hat{\Gamma}_{\sigma,m,n}\ket{\sigma^{\prime}_{kq}}=$
$\displaystyle\sqrt{\frac{d_{\sigma}d_{\sigma^{\prime}}}{d_{\sigma^{\prime\prime}}}}\sum_{\alpha}\braket{\sigma^{\prime\prime}_{l},\alpha}{\sigma^{\prime}_{k},\sigma_{m}}\braket{\bar{\sigma}^{\prime\prime}_{r},\alpha}{\bar{\sigma}^{\prime}_{q},\bar{\sigma}_{n}},$
(28)

where
$\braket{\sigma^{\prime\prime}_{l},\alpha}{\sigma^{\prime}_{k},\sigma_{m}}$ is
the Clebsch-Gordan coefficient, and the sum of $\alpha$ is from $1$ to the
multiplicity $M(\sigma^{\prime\prime};\sigma^{\prime},\sigma)$, i.e. the
number of times that $\sigma^{\prime\prime}$ appears in the direct sum
decomposition of the tensor product of $\sigma$ and $\sigma^{\prime}$. This
can be interpreted as $\hat{\Gamma}_{\sigma,m,n}$ adding $\sigma_{m}$ to the
left vector and $\bar{\sigma}_{n}$ to the right vector. Thus,
$\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)$ on a gauge-invariant state creates
net flux $\sigma_{m}$ at site $\mathbf{x}$ and $\bar{\sigma}_{n}$ at the site
$(\mathbf{x+i})$. Applying $\hat{\Gamma}_{\sigma,m,n}^{\dagger}$ to the same
link annihilates the flux and restores gauge symmetry. Indeed, we can check in
Appendix B that $\hat{\Gamma}_{\sigma},\hat{\Gamma}_{\sigma^{\prime}}$ on the
same link satisfies the KL condition,

$\displaystyle\hat{P}_{\mathrm{inv}}{\hat{\Gamma}_{\sigma}}^{\dagger}\hat{\Gamma}_{\sigma^{\prime}}\hat{P}_{\mathrm{inv}}=\delta_{\sigma,\sigma^{\prime}}\hat{P}_{\mathrm{inv}},$
(29)

Thus $\hat{\Gamma}_{\sigma}$-type errors are correctable. Another way to
obtain the conclusion is through the code distance $d_{\mathrm{code}}$: for a
QEC with code distance $d_{\mathrm{code}}$, errors involving up to
$[(d_{\mathrm{code}}-1)/2]$ qudits are guaranteed to be correctable [110]. In
our case, to make a logical error with $\hat{\Gamma}_{\sigma}$-type operators,
one needs at least four links of a plaquette to form a Wilson loop, thus the
code distance is 4. This makes any $[(4-1)/2]=1$ $\hat{\Gamma}_{\sigma}$-type
error correctable.

The errors induced by the $\hat{L}_{g}(\mathbf{x},i)$ operator are not
detectable if $g$ is the Abelian center of the group as it commutes with the
$\hat{P}_{\mathrm{inv}}$. For $g$ not in the Abelian center, if
$\hat{L}_{g}(\mathbf{x},i)$ drifts a state to another gauge invariant state,
we can not detect such errors. On the other hand when the error
$\hat{L}_{g}(\mathbf{x},i)$ drifts a state out of the invariant Hilbert space
by generating a local charge at site $\mathbf{x}$, we can measure the local
charge at $\mathbf{x}$ and detect such errors. However, as
$\hat{L}_{g}(\mathbf{x},i)$ does not affect local charges at other sites, it
is not possible to diagnose the link that $\hat{L}_{g}(\mathbf{x},i)$ affects,
and thus the errors are not correctable. The fact that
$\hat{L}_{g}(\mathbf{x},i)$ are not correctable can also be seen by checking
the KL condition:

$\displaystyle\hat{P}_{\mathrm{inv}}\hat{L}_{g^{\prime}}^{\dagger}\hat{L}_{g}\hat{P}_{\mathrm{inv}}=\frac{1}{|G|}\sum_{h\in
G}\hat{L}_{h^{-1}g^{\prime-1}gh}\hat{P}_{\mathrm{inv}}.$ (30)

The right hand side of Eq. (30) differs from Eq. (25) by an operator
$\frac{1}{|G|}\sum_{h\in G}\hat{L}_{h^{-1}g^{\prime-1}gh}$, thus breaking the
KL condition. In the $Z_{2}$ gauge theory, a $Z_{2}$-register is a qubit, and
the complete basis reduces to the familiar Pauli operators
$\\{I,\hat{X},\hat{Z},\hat{X}\hat{Z}\\}$, of which
$\hat{\Gamma}_{\sigma}\in\\{I,\hat{Z}\\}$ are correctable.

The correctable error set can contain multiple-link $\hat{\Gamma}_{\sigma}$
errors, as long as the erroneous links are separated enough such that there is
no ambiguity about which link causes the gauge violation. The easiest errors
to decode are those that show up as pairs of charges in dual representations
$\sigma,\bar{\sigma}$ at the two ends of a link, surrounded by neighboring
sites all with zero charge. This requires the $\hat{\Gamma}_{\sigma}$ errors
to be separated by at least two error-less links (Fig. 3), which we call the
minimal effort decoding condition (MED). The condition can be relaxed if more
complicated classical processing is available. The KL condition requires any
product of two error operators $\hat{N}_{i}$ and $\hat{N}_{j}$ to contain no
non-trivial gauge-invariant operators, i.e. Wilson loops. This condition is
fulfilled when the number of links affected by $\Gamma_{\sigma}$ errors along
any closed loop of perimeter $C$ is at most $[\frac{C-1}{2}]$, thus
eliminating the possibility of error links in $\hat{N}_{i}$ and $\hat{N}_{j}$
forming loops. Considering only the smallest loops, i.e. plaquettes, the local
KL condition allows at most one $\hat{\Gamma}_{\sigma}$ error per plaquette.

Figure 3: Examples of correctable error distributed on the lattice to satisfy
the MED (upper-right) or the local KL condition (lower-left). The orange links
are $\Gamma$-type errors, which must break gauge symmetry at the orange
squares. The conditions require the green links to be error-less. For the MED
condition, the adjacent sites (blue circles) must be charge-neutral. For the
local KL condition, the error links are allowed to extend in a straight line,
which is the shortest path to connect a pair of charges.

###  III.3 The encoding and decoding circuits

Conceptually, the encoding and decoding of gauge symmetry is easier in the
electric basis, where Gauss’s law reads as “zero electric flux at each
vertex”. For non-Abelian groups, the computation of the net flux requires the
group’s Clebsch-Gordan coefficients which are not diagonal in the electric
basis. We bypass some of the difficulties by doing an “effective Clebsch-
Gordan sum” in the group element basis. We derive in Appendix D that the
Clebsch-Gordan sum is equivalent to group multiplications in the group element
basis. With this, we can encode and decode Gauss’s law using the following
primitive gates [111] acting on group registers:

  * •

Inverse gate: $\mathfrak{U}_{-1}|g\rangle=\left|g^{-1}\right\rangle$,

  * •

Left and Right Multiplication gates:
$\mathfrak{U}_{\times}^{L}|g\rangle|U\rangle=|g\rangle|gU\rangle$,
$\mathfrak{U}_{\times}^{R}|g\rangle|U\rangle=|g\rangle|Ug\rangle$,

  * •

Fourier transform gate:

$\mathfrak{U}_{F}=\sum\limits_{g,\sigma_{mn}}\sqrt{\frac{d_{\sigma}}{|G|}}\Gamma^{(\sigma)}_{mn}(g)\ket{\sigma_{mn}}\bra{g}$
(31)

which rotates the magnetic basis to the electric one,

  * •

Group rotation gates in irreps. This uses a group register $\ket{U}$ as the
control to rotate between the vectors in the $d_{\sigma}$-dimensional space:

$\displaystyle\mathfrak{U}_{\sigma}$ $\displaystyle=\sum_{U\in
G}(\ket{U}\bra{U})\otimes(\sum_{m,n=1}^{d_{\sigma}}\Gamma^{(\sigma)}_{mn}(U)\ket{n}\bra{m})$
$\displaystyle=d_{\sigma}^{-1/2}\sum_{m,n=1}^{d_{\sigma}}\hat{\Gamma}_{\sigma,m,n}^{\dagger}\otimes(\ket{n}\bra{m})$
(32)

where the second equality follows from Eq. (26). For Abelian groups,
$\mathfrak{U}_{\sigma}$ is a one-register phase gate on $\ket{U}$.

Fig. 4 shows an example of encoding and decoding for the patch of 7 gauge
links connected to 2 sites in the right corner of Fig. 1. To encode, the links
$U_{3},U_{7}$ in the maximal tree are initialized to the color neutral state
$\ket{\textbf{g}}\equiv|G|^{-\frac{1}{2}}\sum_{g\in G}\ket{g}$, and then,

$\displaystyle\ket{U_{1}}\ket{U_{2}}\ket{\mathbf{g}}\ket{U_{4}}\xrightarrow{\mathfrak{U}_{\mathrm{enc}}}|G|^{-\frac{1}{2}}\sum_{g\in
G}\ket{gU_{1}}\ket{gU_{2}}\ket{g^{-1}}\ket{U_{4}g^{-1}}$ (33)

One can easily check the gauge invariance Eq. (6) for the two sites after the
circuit $\mathcal{U}_{\mathrm{enc}}$ in Fig. 4:

$\displaystyle\hat{T}_{h}\,|G|^{-\frac{1}{2}}\sum_{g\in
G}\ket{gU_{1}}\ket{gU_{2}}\ket{g^{-1}}\ket{U_{4}g^{-1}}$ $\displaystyle=$
$\displaystyle|G|^{-\frac{1}{2}}\sum_{g^{\prime}=hg\in
G}\ket{g^{\prime}U_{1}}\ket{g^{\prime}U_{2}}\ket{g^{\prime-1}}\ket{U_{4}g^{\prime-1}}$
(34)

In the electric basis, the circuit computes the net flux of
$U_{1},U_{2},U_{4}$ and stores it into the tree-link $U_{3}$, thus making the
total net flux at the vertex to be zero. The same process is repeated for
every vertex except $\mathbf{x_{0}}$. Sites in the same branch of the maximal
tree should be processed in sequence, from the top of the branch to the root,
and different branches can be encoded in parallel.

The above procedure initializes the state to the gauge invariant one
$\ket{\Psi_{\mathrm{inv}}}$. During the noisy process in Fig. 2, suppose an
error $\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)$ turns
$\ket{\Psi_{\mathrm{inv}}}$ into
$\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\ket{\Psi_{\mathrm{inv}}}$, creating a
net flux of $\sigma_{m}$ at $\mathbf{x}$ and $\bar{\sigma}_{n}$ at
$\mathbf{x+i}$. We can decode this error pattern with the circuit
$\mathcal{U}_{\mathrm{dec}}$, which adds the electric fluxes coherently to the
ancillary registers originally initialized to color neutral states. Then in
the decoding (derived in Appendix C),

$\displaystyle\hat{\Gamma}$
${}_{\sigma,m,n}\ket{\Psi_{\mathrm{inv}}}\otimes\ket{\textbf{g}}\otimes\ket{\textbf{g}}\xrightarrow{\mathcal{U}_{\mathrm{dec}}}$
$\displaystyle\frac{1}{d_{\sigma}}\sum_{q,r}^{d_{\sigma}}\hat{\Gamma}_{\sigma,q,r}\ket{\Psi_{\mathrm{inv}}}\otimes\ket{\sigma_{mq}(\mathbf{x})}\otimes\ket{\bar{\sigma}_{nr}(\mathbf{x+i})}.$
(35)

For non-Abelian groups, $\mathcal{U}_{\mathrm{dec}}$ preserves the quantum
numbers $\sigma,\bar{\sigma}$, but $m,n$ can change into any integer in
$[1,d_{\sigma}]$, and the corresponding new quantum numbers $q,r$ are
entangled with the ancillae.

To correct gauge-violating errors, the representation of the ancillary
register at every site needs to be measured. This requires the quantum numbers
$\sigma,m,n$ in the Fourier basis to be stored in different qubits, and thus
one can measure $\sigma$ without collapsing $m,n$. Measuring $\ket{\sigma}$ in
the trivial representation confirms the local gauge symmetry. Measuring any
other $\ket{\sigma}$ indicates a gauge-violating error, and projects the gauge
fields to a subspace orthogonal to $\mathcal{H}_{\mathrm{inv}}$ in
$\mathcal{H}_{\mathrm{gauge}}$. In this example, a pair of non-trivial
representations $\ket{\sigma},\ket{\bar{\sigma}}$ on the two ends of a link
are measured, which indicates a $\hat{\Gamma}_{\sigma}$ error on the link, and
the quantum numbers $\ket{m}\ket{q},\ket{n}\ket{r}$ of the ancillae are
entangled with the gauge field state. The recovery can be performed with
$\mathfrak{U}_{\sigma}$ in Eq. (• ‣ III.3):

$\displaystyle\frac{1}{d_{\sigma}}\sum_{q,r}^{d_{\sigma}}\hat{\Gamma}_{\sigma,q,r}\ket{\Psi_{\mathrm{inv}}}\otimes(\ket{m}\ket{q})\otimes(\ket{n}\ket{r})\xrightarrow{\mathcal{U}_{\mathrm{rec}}}$
$\displaystyle\frac{1}{d_{\sigma}^{3/2}}\sum_{q,k,r}^{d_{\sigma}}\hat{\Gamma}_{\sigma,q,k}^{\dagger}\hat{\Gamma}_{\sigma,q,r}\ket{\Psi_{\mathrm{inv}}}\otimes(\ket{m}\ket{k})\otimes(\ket{n}\ket{r})$
$\displaystyle=\ket{\Psi_{\mathrm{inv}}}\otimes\bigg{[}\frac{1}{d_{\sigma}^{1/2}}\sum_{r}^{d_{\sigma}}(\ket{m}\ket{r})\otimes(\ket{n}\ket{r})\bigg{]},$
(36)

where we have used the unitarity of representations,

$d_{\sigma}^{-1}\sum_{q=1}^{d_{\sigma}}\hat{\Gamma}_{\sigma,q,k}^{\dagger}\hat{\Gamma}_{\sigma,q,r}=\delta_{k,r}.$
(37)

Thus $\ket{\Psi_{\mathrm{inv}}}$ is recovered and unentangled with ancillae.
At this point, since the quantum information in the ancillae is irrelevant to
the gauge system, one can recycle the ancillae and re-initialize them to
$\ket{\mathbf{g}}$ for the next round of error detection and correction.

Figure 4: Encoding and decoding circuits for the patch in Fig. 1. (top)
Circuit for preparing gauge-invariant states, and (bottom) Gauss’s law
measurement and recovery circuit, where measuring a pair of charges
$\sigma,\bar{\sigma}$ on the two ancillae indicates a gauge-violating error on
$\ket{U_{2}}$.

##  IV Comparison of quantum fidelities

###  IV.1 Group-agnostic thresholds

LGT states can be stored in a set of $G$-registers in both the gauge-fixed and
gauge-redundant digitization. The number of links needed is $N_{L}-N_{T}$ for
the former and $N_{L}$ for the latter. We further assume that errors on
different registers are independent. Suppose the total rate for any error on a
single register is $\epsilon$. Then the quantum fidelities are lower bounded
by the probability that no errors happen on any register:

$\displaystyle F_{\mathrm{fixed}}$
$\displaystyle\geq(1-\epsilon)^{N_{L}-N_{T}}$ (38) $\displaystyle
F_{\mathrm{red}}$ $\displaystyle\geq(1-\epsilon)^{N_{L}}$ (39)

With the gauge redundancy, certain configuration of $\hat{\Gamma}_{\sigma}$
errors are correctable via gauge symmetry checking and restoration. Suppose
the correctable type error rate on a single register is $\epsilon_{c}$. The
lower bound for the fidelity after gauge-symmetry restoration is the
probability that no error or only correctable errors happen:

$\displaystyle F_{\mathrm{restored}}$
$\displaystyle\geq\sum_{n=0}^{N_{L}}Q_{n}\epsilon_{c}^{n}(1-\epsilon)^{N_{L}-n}=(1-\epsilon)^{N_{L}}\Xi$
(40)

where $Q_{n}$ is the number of ways to arrange $n$ links with correctable
errors in the lattice, such that the correctability condition is still
satisfied, and $\Xi$ is the factor by which the gauge-symmetry restoration
amplifies the fidelity:

$\displaystyle\Xi=\sum_{n=0}^{N_{L}}Q_{n}z^{n},\quad
z=\frac{\epsilon_{c}}{1-\epsilon}$ (41)

Comparing these two bounds Eq. (40) and Eq. (38), the condition for the gauge-
symmetry restoration to give a higher fidelity than gauge fixing is

$\displaystyle\Xi^{1/N_{T}}>(1-\epsilon)^{-1}.$ (42)

This formula can be interpreted as an error threshold: the gauge redundancy
increases the code distance of $\Gamma_{\sigma}$-type errors from 1 to 4. For
the fidelity to increase with the increased code distance due to gauge
redundancy, $\epsilon$ has to be below certain threshold.

The $Q_{n}$’s are related to the independence polynomials of graphs (see
Appendix E for details). We compute $Q_{n}$ for a variety of $L$ using the
Python library `hobj` [112] up to $L=20$ and $L=11$ for 2d lattices with OBC
and PBC, respectively, for both error-correction conditions. For 3d lattices,
we are able to reach $L=4$ for both OBC and PBC with MED condition, while only
$L=3$ for PBC with the KL condition due to limited computing resources. These
$Q_{n}$ are then used to compute the threshold: the $\epsilon$ where the two
sides of Eq. (42) are equal at a given $\epsilon_{c}/\epsilon$. These are
shown in black (blue) lines using OBC (PBC) in Fig. 5 and Fig. 6 for 2d and 3d
lattices, respectively. Eq. (42) is satisfied in the parameter region below
the lines, indicating that the gauge symmetry restoration provides higher
fidelity than the gauge fixed case.

We observe two features from Fig. 5-6. First,the parameter regions to satisfy
Eq. (42) only exist when $\epsilon_{c}/\epsilon\gtrsim 1/d$, which is
consistent with the following analysis. Expanding Eq. (42) for small
$\epsilon$, with $Q_{0}=1,Q_{1}=N_{L}$, we have:

$\displaystyle
1+\frac{N_{L}}{N_{T}}\epsilon_{c}+O(\epsilon_{c}\epsilon)>1+\epsilon+O(\epsilon^{2}).$
(43)

Thus, the correctable fraction of the total error rate for a single link,
$\epsilon_{c}/\epsilon$, must satisfy

$\displaystyle\frac{\epsilon_{c}}{\epsilon}>\frac{N_{T}}{N_{L}}\approx\frac{1}{d},$
(44)

with $\frac{N_{T}}{N_{L}}=\frac{1}{d}$ in the infinite volume limit as seen in
Tab. 1. Second, in all the cases, the threshold $\epsilon$ increases as
$\epsilon_{c}/\epsilon$ increases. This is consistent with the qualitative
reasoning that when a larger portion of errors are correctable, larger values
of $\epsilon$ could be allowed while the redundancy still enables more
correction than the errors it introduces.

Based on the error thresholds obtained at different $L$, we aim to extrapolate
to $L\rightarrow\infty$ limit. We find that near $\epsilon=0$, the threshold
is a monotonic function of $L$ in either boundary condition and approaches the
same limit. In contrast, near $\epsilon_{c}/\epsilon=1$ for 2d lattices, non-
monotonic behavior is observed for small lattices with $L\leq 6$ due to finite
volume effects. By restricting to the results for $L>6$ at 2d lattice, we
perform both quadratic and exponential extrapolations to obtain the threshold
$\epsilon$ in the $L\rightarrow\infty$ limit which can be found in Fig. 5 (red
line with the thickness quantifying error bar on extrapolations).

Figure 5: Error threshold lines in the $\epsilon-\epsilon_{c}/\epsilon$ plane
below which $F_{\mathrm{restored}}>F_{\mathrm{fixed}}$, indicating that using
gauge redundancy to detect and correct the errors is advantageous, for 2d
lattices for (top) MED condition and (bottom) local KL condition. The shaded
region is the infinite volume limit.

For 3d lattice, as computing resources limit the calculations to only $L<5$,
the extrapolation to $L\rightarrow\infty$ cannot be reliably performed. For
MED condition, the threshold curve with OBC near $\epsilon_{c}/\epsilon=1$
exhibits a larger deviation from the PBC results at larger $L$, suggesting
that $L<5$ is far from the infinite limit. For the KL condition, calculations
are limited to only $L=2,3$ with PBC, also precluding an extrapolation to
infinity limit. Despite this, we expect the thresholds for
$L\rightarrow\infty$ to be roughly bounded by the largest $L$ results for OBC
and PBC.

Figure 6: Error threshold lines in the $\epsilon-\epsilon_{c}/\epsilon$ plane
below which $F_{\mathrm{restored}}>F_{\mathrm{fixed}}$, indicating that using
gauge redundancy to detect and correct the errors is advantageous, for 3d
lattices for (top) MED condition and (bottom) local KL condition.

###  IV.2 $\epsilon,\epsilon_{c}$ from error models

$\hat{N}_{j}$ on a $G$-register can always be decomposed as

$\displaystyle\hat{N}_{j}=\sum_{g,\sigma}c_{j,g,\sigma}\hat{L}_{g}\hat{\Gamma}_{\sigma}.$
(45)

The trace-preserving feature
$\sum_{j}\hat{N}_{j}^{\dagger}\hat{N}_{j}=\mathbb{1}$ requires
$\sum_{j,\sigma,g}|c_{j,g,\sigma}|^{2}=1$. When the noise channel is diagonal
in this basis, i.e. for each $\hat{N}_{j}$ there is only one non-zero
$c_{j,g,\sigma}$, such that we can relabel $c_{j,g,\sigma}$ to $c_{g,\sigma}$.
The one-register noise channel can be written as

$\displaystyle\mathcal{N}(\rho)=\sum_{g,\sigma}|c_{g,\sigma}|^{2}\hat{L}_{g}\hat{\Gamma}_{\sigma}\rho(\hat{L}_{g}\hat{\Gamma}_{\sigma})^{\dagger}.$
(46)

The one register total error probability is

$\epsilon=\sum_{g\neq\mathbb{1},\sigma\neq\mathbb{1}}|c_{g,\sigma}|^{2}=1-|c_{\mathbb{1},\mathbb{1}}|^{2}.$
(47)

where $g\neq\mathbb{1}$ and $\sigma\neq\mathbb{1}$ mean, respectively, that
the group element cannot be the identity, and the irreducible representation
cannot be the trivial one. With this, the correctable error probability is

$\epsilon_{c}=\sum_{\sigma\neq\mathbb{1}}|c_{\mathbb{1},\sigma}|^{2}$ (48)

We consider $Z_{N}$ theory, where each $G$-register is a qudit with $N$ states
[76]. We represent the computational basis of the qudit as $\ket{n}$, where
$n$ is an integer in $[0,N-1]$. In the computational basis, define the clock
shift operators

$\hat{\chi}=\sum_{n=0}^{N-1}\ket{n}\bra{{(n+1)\text{ mod }N}}$ (49)

and the phase shift operators

$\hat{\nu}=\sum_{n=0}^{N-1}e^{2\pi in/N}\ket{n}\bra{n}.$ (50)

For the group $Z_{N}$, both group elements $g$ and group representations
$\sigma$ can be mapped to integers $[0,N-1]$. Thus we can choose to have the
computational basis as either the group element or the electric basis. If we
choose the group element basis, $\hat{L}_{g}$ are clock shifts

$\hat{L}_{g}=(\hat{\chi})^{g}=\sum_{n=0}^{N-1}\ket{n}\bra{{(n+g)\text{ mod
}N}},$ (51)

which preserves the gauge symmetry, and thus cannot be diagnosed by Gauss’s
law. The representation $\hat{\Gamma}_{\sigma}$ operators are phase shifts

$\hat{\Gamma}_{\sigma}=(\hat{\nu})^{\sigma}=\sum_{n=0}^{N-1}e^{2\pi
in\sigma/N}\ket{n}\bra{n}.$ (52)

They break gauge symmetry unless they form closed Wilson loops.

If we choose the electric basis as the computational basis instead, as the
phase shift is mapped to the $\hat{L}_{g}$ operator as
$\hat{L}_{g}=(\hat{\nu})^{g}$, thus the phase shift errors would preserve the
symmetry. While the clock shift is mapped to $\hat{\Gamma}_{\sigma}$ as
$\hat{\Gamma}_{\sigma}=(\hat{\chi})^{\sigma}$, making the clock shift errors
correctable.

Consider the error channel where single clock and phase shifts occur
independently with probabilities $p_{\chi},p_{\nu}$ :

$\displaystyle\mathcal{N}(\rho)=$ $\displaystyle(1-p_{\chi})(1-p_{\nu})\rho$
$\displaystyle+\frac{(1-p_{\chi})p_{\nu}}{N-1}\sum_{i=1}^{N-1}(\hat{\nu})^{i}\rho{(\hat{\nu})^{i}}^{\dagger}$
$\displaystyle+\frac{(1-p_{\nu})p_{\chi}}{N-1}\sum_{j=1}^{N-1}(\hat{\chi})^{j}\rho{(\hat{\chi})^{j}}^{\dagger}$
$\displaystyle+\frac{p_{\nu}p_{\chi}}{(N-1)^{2}}\sum_{i,j=1}^{N-1}(\hat{\nu})^{i}(\hat{\chi})^{j}\rho{(\hat{\chi})^{j}}^{\dagger}{(\hat{\nu})^{i}}^{\dagger}$
(53)

The one register total error probability is

$\epsilon=1-(1-p_{\chi})(1-p_{\nu})$ (54)

In the group element basis, $(\hat{\nu})^{\sigma}$ are correctable, and thus

$\epsilon_{c}=(1-p_{\chi})p_{\nu}.$ (55)

In the electric basis, $(\hat{\chi})^{\sigma}$ are correctable,

$\epsilon_{c}=(1-p_{\nu})p_{\chi}.$ (56)

From this, we observe that the relative error probabilities of physical
hardware can prefer different encodings. If the phase errors are more frequent
than the clock errors ($p_{\nu}>p_{\chi}$), encoding in the group element
basis will help to stay below the error thresholds with the total $\epsilon$
reasonably small.

The correctability of phase errors can be generalized to non-Abelian groups,
if one chooses the group element basis encoding. This is because all operators
diagonal in the group element basis can be written as linear combinations of
$\hat{\Gamma}_{\sigma}$. For example, in Tab. 2, we list the correctable
errors for the 3-qubit encoding of the quaternion group
$\mathbb{Q}_{8}=\\{(-1)^{a}\mathbf{i}^{b}\mathbf{j}^{c}\\}$, where $a,b,c=0$
or $1$ [76]. It has four 1d representations and one 2d representation. All the
Pauli-Z operators are correctable, as $\hat{Z}_{b},\hat{Z}_{c}$ correspond to
two 1-d representation operators, and $\hat{Z}_{a}$ is a linear combination of
2-d representation operators:

$\hat{Z}_{a}=\frac{1}{1+i}(\hat{\Gamma}_{2,1,1}+\hat{\Gamma}_{2,1,2}-i\hat{\Gamma}_{2,2,1}+i\hat{\Gamma}_{2,2,2}).$
(57)

1-d representations | 2-d representation
---|---
$\hat{\Gamma}_{\mathrm{triv}}$ | $\hat{I}$ | $\hat{\Gamma}_{2,1,1}$ | $\hat{Z}_{a}\hat{Z_{b}}^{1/2}\frac{1+\hat{Z}_{c}}{2}$
$\hat{\Gamma}_{\mathrm{i-ker}}$ | $\hat{Z}_{c}$ | $\hat{\Gamma}_{2,1,2}$ | $\hat{Z}_{a}\hat{Z_{b}}^{1/2}\frac{1-\hat{Z}_{c}}{2}$
$\hat{\Gamma}_{\mathrm{j-ker}}$ | $\hat{Z}_{b}$ | $\hat{\Gamma}_{2,2,1}$ | $-\hat{Z}_{a}\hat{Z_{b}}^{3/2}\frac{1-\hat{Z}_{c}}{2}$
$\hat{\Gamma}_{\mathrm{k-ker}}$ | $\hat{Z}_{b}\hat{Z}_{c}$ | $\hat{\Gamma}_{2,2,2}$ | $\hat{Z}_{a}\hat{Z_{b}}^{3/2}\frac{1+\hat{Z}_{c}}{2}$
Table 2: Correctable errors $\hat{\Gamma}_{\sigma}$ for the quaternion group
$\mathbb{Q}_{8}$ encoded in 3 qubits via
$(-1)^{a}\mathbf{i}^{b}\mathbf{j}^{c}\to|abc\rangle$.

Thus, for the error model that allows one of the three qubits to have a Pauli
error,

$\displaystyle\mathcal{N}(\rho)=$
$\displaystyle(1-3p_{X}-3p_{Y}-3p_{Z})\rho+p_{X}\sum_{i=a,b,c}\hat{X}_{i}\rho\hat{X}_{i}$
$\displaystyle+p_{Y}\sum_{i=a,b,c}\hat{Y}_{i}\rho\hat{Y}_{i}+p_{Z}\sum_{i=a,b,c}\hat{Z}_{i}\rho\hat{Z}_{i}$
(58)

with the one-register error rate being $3(p_{X}+p_{Y}+p_{Z})$, the correctable
fraction is

$\frac{\epsilon_{c}}{\epsilon}=\frac{p_{Z}}{p_{X}+p_{Y}+p_{Z}}.$ (59)

If the qubits have more phase errors and fewer bit-flip errors, encoding in
the group element basis is preferable.

##  V Conclusions

In this work, we explore how the natural gauge redundancy of lattice gauge
theories can become a tool to create partial error correction codes for
quantum simulations. For generic groups, treating the gauge transformations in
lattice gauge theories as stabilizers and the gauge-invariant subspace as the
code space, we identify the correctable errors in one lattice link, as well as
the MED and KL conditions for multiple link errors to remain correctable. We
construct the quantum circuits to prepare gauge invariant states including
redundant degrees of freedoms, as well as to detect and recover the
correctable errors.

We calculate the error-rate thresholds below which keeping gauge redundancy is
preferable to gauge fixing for error-correcting purposes, under both the MED
and KL conditions. We do this by comparing the quantum fidelities when errors
exist, which is the probability that either no error happens or only
correctable errors happen. The thresholds depend on the correctable fraction
of the error rate in a single link, $\epsilon_{c}/\epsilon$. We find a simple
analytic relation at leading order in $\epsilon$ for when gauge redundancy is
advantageous: $\epsilon_{c}/\epsilon\geq 1/d$ for a $d$ dimensional lattice.
Numerical results demonstrate that this relation is robust for realistic error
rates. Thus for quantum devices where error correction is possible,
$\epsilon\ll 1$, our results can be a guidance to design digitizations. To
provide examples of how one may apply such thresholds, we obtain
$\epsilon_{c}/\epsilon$ explicitly for the discrete Abelian group
$\mathbb{Z}_{N}$ and the non-Abelian group $\mathbb{Q}_{8}$ assuming certain
reasonable error models.

Consideration of similar error thresholds should be generalized to other
digitization schemes and error models. The quantitative values of the
thresholds found in this paper can vary depending on the computational tasks
and the hardware. Future research directions should also take into account
non-diagonal error channels, quantum architectures and inclusion of fermions
on the lattice sites.

###### Acknowledgements.

The authors thank Mario Pernici for his invaluable assistance with `hobj`.
This work is supported by the Department of Energy through the Fermilab
QuantiSED program in the area of “Intersections of QIS and Theoretical
Particle Physics”. Fermilab is operated by Fermi Research Alliance, LLC under
contract number DE-AC02-07CH11359 with the United States Department of Energy.
Y.-Y. L is supported by the NSF of China through Grant No. 12305107, 12247103.

## References

  * Polkovnikov and Gritsev [2008] A. Polkovnikov and V. Gritsev, Breakdown of the adiabatic limit in low-dimensional gapless systems, Nature Physics 4, 477 (2008).
  * Baum  _et al._ [2021] S. Baum, M. Carena, N. R. Shah, C. E. M. Wagner, and Y. Wang, Nucleation is more than critical: A case study of the electroweak phase transition in the NMSSM, JHEP 03, 055, arXiv:2009.10743 [hep-ph] .
  * Riera  _et al._ [2012] A. Riera, C. Gogolin, and J. Eisert, Thermalization in nature and on a quantum computer, Phys. Rev. Lett. 108, 080402 (2012).
  * Czajka  _et al._ [2022] A. M. Czajka, Z.-B. Kang, H. Ma, and F. Zhao, Quantum simulation of chiral phase transitions, JHEP 08, 209, arXiv:2112.03944 [hep-ph] .
  * Cohen  _et al._ [2021] T. D. Cohen, H. Lamm, S. Lawrence, and Y. Yamauchi (NuQS), Quantum algorithms for transport coefficients in gauge theories, Phys. Rev. D 104, 094514 (2021), arXiv:2104.02024 [hep-lat] .
  * Lamm  _et al._ [2020a] H. Lamm, S. Lawrence, and Y. Yamauchi (NuQS), Parton physics on a quantum computer, Phys. Rev. Res. 2, 013272 (2020a), arXiv:1908.10439 [hep-lat] .
  * Kreshchuk  _et al._ [2020a] M. Kreshchuk, W. M. Kirby, G. Goldstein, H. Beauchemin, and P. J. Love, Quantum Simulation of Quantum Field Theory in the Light-Front Formulation (2020a), arXiv:2002.04016 [quant-ph] .
  * Echevarria  _et al._ [2020] M. Echevarria, I. Egusquiza, E. Rico, and G. Schnell, Quantum Simulation of Light-Front Parton Correlators (2020), arXiv:2011.01275 [quant-ph] .
  * Bauer  _et al._ [2021] C. W. Bauer, M. Freytsis, and B. Nachman, Simulating Collider Physics on Quantum Computers Using Effective Field Theories, Phys. Rev. Lett. 127, 212001 (2021), arXiv:2102.05044 [hep-ph] .
  * Li  _et al._ [2022] T. Li, X. Guo, W. K. Lai, X. Liu, E. Wang, H. Xing, D.-B. Zhang, and S.-L. Zhu (QuNu), Partonic collinear structure by quantum computing, Phys. Rev. D 105, L111502 (2022), arXiv:2106.03865 [hep-ph] .
  * Zache  _et al._ [2023a] T. V. Zache, D. González-Cuadra, and P. Zoller, Fermion-qudit quantum processors for simulating lattice gauge theories with matter (2023a), arXiv:2303.08683 [quant-ph] .
  * Feynman [1982] R. P. Feynman, Simulating physics with computers, Int. J. Theor. Phys. 21, 467 (1982).
  * Jordan  _et al._ [2018] S. P. Jordan, H. Krovi, K. S. Lee, and J. Preskill, BQP-completeness of Scattering in Scalar Quantum Field Theory, Quantum 2, 44 (2018), arXiv:1703.00454 [quant-ph] .
  * Bañuls  _et al._ [2020] M. C. Bañuls _et al._ , Simulating Lattice Gauge Theories within Quantum Technologies, Eur. Phys. J. D 74, 165 (2020), arXiv:1911.00003 [quant-ph] .
  * Bauer  _et al._ [2023a] C. W. Bauer _et al._ , Quantum Simulation for High-Energy Physics, PRX Quantum 4, 027001 (2023a), arXiv:2204.03381 [quant-ph] .
  * Shaw  _et al._ [2020] A. F. Shaw, P. Lougovski, J. R. Stryker, and N. Wiebe, Quantum Algorithms for Simulating the Lattice Schwinger Model, Quantum 4, 306 (2020), arXiv:2002.11146 [quant-ph] .
  * Tong  _et al._ [2022] Y. Tong, V. V. Albert, J. R. McClean, J. Preskill, and Y. Su, Provably accurate simulation of gauge theories and bosonic systems, Quantum 6, 816 (2022), arXiv:2110.06942 [quant-ph] .
  * Ji  _et al._ [2020] Y. Ji, H. Lamm, and S. Zhu (NuQS), Gluon Field Digitization via Group Space Decimation for Quantum Computers, Phys. Rev. D 102, 114513 (2020), arXiv:2005.14221 [hep-lat] .
  * Carena  _et al._ [2022a] M. Carena, E. J. Gustafson, H. Lamm, Y.-Y. Li, and W. Liu, Gauge theory couplings on anisotropic lattices, Phys. Rev. D 106, 114504 (2022a).
  * Bauer  _et al._ [2023b] C. W. Bauer, I. D’Andrea, M. Freytsis, and D. M. Grabowska, A new basis for Hamiltonian SU(2) simulations (2023b), arXiv:2307.11829 [hep-ph] .
  * Ciavarella [2023] A. N. Ciavarella, Quantum Simulation of Lattice QCD with Improved Hamiltonians (2023), arXiv:2307.05593 [hep-lat] .
  * Hanada  _et al._ [2022] M. Hanada, J. Liu, E. Rinaldi, and M. Tezuka, Estimating truncation effects of quantum bosonic systems using sampling algorithms (2022), arXiv:2212.08546 [quant-ph] .
  * Zohar and Burrello [2015] E. Zohar and M. Burrello, Formulation of lattice gauge theories for quantum simulations, Phys. Rev. D91, 054506 (2015), arXiv:1409.3085 [quant-ph] .
  * Zohar  _et al._ [2017] E. Zohar, A. Farace, B. Reznik, and J. I. Cirac, Digital lattice gauge theories, Phys. Rev. A95, 023604 (2017), arXiv:1607.08121 [quant-ph] .
  * Bender  _et al._ [2018] J. Bender, E. Zohar, A. Farace, and J. I. Cirac, Digital quantum simulation of lattice gauge theories in three spatial dimensions, New J. Phys. 20, 093001 (2018), arXiv:1804.02082 [quant-ph] .
  * Gustafson  _et al._ [2022] E. J. Gustafson, H. Lamm, F. Lovelace, and D. Musk, Primitive quantum gates for an SU(2) discrete subgroup: Binary tetrahedral, Phys. Rev. D 106, 114501 (2022), arXiv:2208.12309 [quant-ph] .
  * Hackett  _et al._ [2019] D. C. Hackett, K. Howe, C. Hughes, W. Jay, E. T. Neil, and J. N. Simone, Digitizing Gauge Fields: Lattice Monte Carlo Results for Future Quantum Computers, Phys. Rev. A 99, 062341 (2019), arXiv:1811.03629 [quant-ph] .
  * Hartung  _et al._ [2022] T. Hartung, T. Jakobs, K. Jansen, J. Ostmeyer, and C. Urbach, Digitising SU(2) gauge fields and the freezing transition, Eur. Phys. J. C 82, 237 (2022), arXiv:2201.09625 [hep-lat] .
  * Jakobs  _et al._ [2023] T. Jakobs, M. Garofalo, T. Hartung, K. Jansen, J. Ostmeyer, D. Rolfes, S. Romiti, and C. Urbach, Canonical Momenta in Digitized SU(2) Lattice Gauge Theory: Definition and Free Theory (2023), arXiv:2304.02322 [hep-lat] .
  * Charles  _et al._ [2023] C. Charles, E. J. Gustafson, E. Hardt, F. Herren, N. Hogan, H. Lamm, S. Starecheski, R. S. Van de Water, and M. L. Wagman, Simulating $\mathbb{Z}_{2}$ lattice gauge theory on a quantum computer (2023), arXiv:2305.02361 [hep-lat] .
  * Gustafson  _et al._ [2023] E. J. Gustafson, H. Lamm, and F. Lovelace, Primitive Quantum Gates for an $SU(2)$ Discrete Subgroup: Binary Octahedral (2023), arXiv:2312.10285 [hep-lat] .
  * Zohar  _et al._ [2013a] E. Zohar, J. I. Cirac, and B. Reznik, Cold-Atom Quantum Simulator for SU(2) Yang-Mills Lattice Gauge Theory, Phys. Rev. Lett. 110, 125304 (2013a), arXiv:1211.2241 [quant-ph] .
  * Zohar  _et al._ [2012] E. Zohar, J. I. Cirac, and B. Reznik, Simulating Compact Quantum Electrodynamics with ultracold atoms: Probing confinement and nonperturbative effects, Phys. Rev. Lett. 109, 125302 (2012), arXiv:1204.6574 [quant-ph] .
  * Zohar  _et al._ [2016] E. Zohar, J. I. Cirac, and B. Reznik, Quantum Simulations of Lattice Gauge Theories using Ultracold Atoms in Optical Lattices, Rept. Prog. Phys. 79, 014401 (2016), arXiv:1503.02312 [quant-ph] .
  * Singh and Chandrasekharan [2019] H. Singh and S. Chandrasekharan, Qubit regularization of the $O(3)$ sigma model, Phys. Rev. D 100, 054505 (2019), arXiv:1905.13204 [hep-lat] .
  * Singh [2019] H. Singh, Qubit $O(N)$ nonlinear sigma models (2019), arXiv:1911.12353 [hep-lat] .
  * Buser  _et al._ [2020] A. J. Buser, T. Bhattacharya, L. Cincio, and R. Gupta, Quantum simulation of the qubit-regularized O(3)-sigma model (2020), arXiv:2006.15746 [quant-ph] .
  * Haase  _et al._ [2020] J. F. Haase, L. Dellantonio, A. Celi, D. Paulson, A. Kan, K. Jansen, and C. A. Muschik, A resource efficient approach for quantum and classical simulations of gauge theories in particle physics (2020), arXiv:2006.14160 [quant-ph] .
  * Alexandru  _et al._ [2023a] A. Alexandru, P. F. Bedaque, A. Carosso, M. J. Cervia, and A. Sheng, Qubitization strategies for bosonic field theories, Phys. Rev. D 107, 034503 (2023a), arXiv:2209.00098 [hep-lat] .
  * Alexandru  _et al._ [2023b] A. Alexandru, P. F. Bedaque, A. Carosso, M. J. Cervia, E. M. Murairi, and A. Sheng, Fuzzy Gauge Theory for Quantum Computers (2023b), arXiv:2308.05253 [hep-lat] .
  * Wiese [2014] U.-J. Wiese, Towards Quantum Simulating QCD,  _Proceedings, 24th International Conference on Ultra-Relativistic Nucleus-Nucleus Collisions (Quark Matter 2014): Darmstadt, Germany, May 19-24, 2014_ , Nucl. Phys. A931, 246 (2014), arXiv:1409.7414 [hep-th] .
  * Luo  _et al._ [2019] D. Luo, J. Shen, M. Highman, B. K. Clark, B. DeMarco, A. X. El-Khadra, and B. Gadway, A Framework for Simulating Gauge Theories with Dipolar Spin Systems (2019), arXiv:1912.11488 [quant-ph] .
  * Brower  _et al._ [2019] R. C. Brower, D. Berenstein, and H. Kawai, Lattice Gauge Theory for a Quantum Computer, PoS LATTICE2019, 112 (2019), arXiv:2002.10028 [hep-lat] .
  * Mathis  _et al._ [2020] S. V. Mathis, G. Mazzola, and I. Tavernelli, Toward scalable simulations of Lattice Gauge Theories on quantum computers, Phys. Rev. D 102, 094501 (2020), arXiv:2005.10271 [quant-ph] .
  * Zohar  _et al._ [2013b] E. Zohar, J. I. Cirac, and B. Reznik, Quantum simulations of gauge theories with ultracold atoms: local gauge invariance from angular momentum conservation, Phys. Rev. A88, 023617 (2013b), arXiv:1303.5040 [quant-ph] .
  * Kaplan and Stryker [2020] D. B. Kaplan and J. R. Stryker, Gauss’s law, duality, and the hamiltonian formulation of u(1) lattice gauge theory, Phys. Rev. D 102, 094515 (2020).
  * Bender and Zohar [2020] J. Bender and E. Zohar, Gauge redundancy-free formulation of compact qed with dynamical matter for quantum and classical computations, Phys. Rev. D 102, 114517 (2020).
  * Yamamoto [2021] A. Yamamoto, Real-time simulation of (2+1)-dimensional lattice gauge theory on qubits, PTEP 2021, 013B06 (2021), arXiv:2008.11395 [hep-lat] .
  * Bauer and Grabowska [2021] C. W. Bauer and D. M. Grabowska, Efficient Representation for Simulating U(1) Gauge Theories on Digital Quantum Computers at All Values of the Coupling (2021), arXiv:2111.08015 [hep-ph] .
  * Grabowska  _et al._ [2022] D. M. Grabowska, C. Kane, B. Nachman, and C. W. Bauer, Overcoming exponential scaling with system size in Trotter-Suzuki implementations of constrained Hamiltonians: 2+1 U(1) lattice gauge theories (2022), arXiv:2208.03333 [quant-ph] .
  * Kane  _et al._ [2022] C. Kane, D. M. Grabowska, B. Nachman, and C. W. Bauer, Efficient quantum implementation of 2+1 U(1) lattice gauge theories with Gauss law constraints (2022), arXiv:2211.10497 [quant-ph] .
  * Paulson  _et al._ [2021] D. Paulson, L. Dellantonio, J. F. Haase, A. Celi, A. Kan, A. Jena, C. Kokail, R. van Bijnen, K. Jansen, P. Zoller, and C. A. Muschik, Simulating 2d effects in lattice gauge theories on a quantum computer, PRX Quantum 2, 030334 (2021).
  * Kreshchuk  _et al._ [2020b] M. Kreshchuk, S. Jia, W. M. Kirby, G. Goldstein, J. P. Vary, and P. J. Love, Light-Front Field Theory on Current Quantum Computers (2020b), arXiv:2009.07885 [quant-ph] .
  * Klco  _et al._ [2020] N. Klco, J. R. Stryker, and M. J. Savage, SU(2) non-Abelian gauge field theory in one dimension on digital quantum computers, Phys. Rev. D 101, 074512 (2020), arXiv:1908.06935 [quant-ph] .
  * Ciavarella  _et al._ [2021] A. Ciavarella, N. Klco, and M. J. Savage, A Trailhead for Quantum Simulation of SU(3) Yang-Mills Lattice Gauge Theory in the Local Multiplet Basis (2021), arXiv:2101.10227 [quant-ph] .
  * Zache  _et al._ [2023b] T. V. Zache, D. González-Cuadra, and P. Zoller, Quantum and classical spin network algorithms for $q$-deformed Kogut-Susskind gauge theories (2023b), arXiv:2304.02527 [quant-ph] .
  * Hayata and Hidaka [2023] T. Hayata and Y. Hidaka, Breaking new ground for quantum and classical simulations of $\mathrm{SU(3)}$ Yang-Mills theory (2023), arXiv:2306.12324 [hep-lat] .
  * Zohar and Reznik [2011] E. Zohar and B. Reznik, Confinement and lattice QED electric flux-tubes simulated with ultracold atoms, Phys. Rev. Lett. 107, 275301 (2011), arXiv:1108.1562 [quant-ph] .
  * Banerjee  _et al._ [2013] D. Banerjee, M. Bögli, M. Dalmonte, E. Rico, P. Stebler, U. J. Wiese, and P. Zoller, Atomic Quantum Simulation of U(N) and SU(N) Non-Abelian Lattice Gauge Theories, Phys. Rev. Lett. 110, 125303 (2013), arXiv:1211.2242 [cond-mat.quant-gas] .
  * Tagliacozzo  _et al._ [2013] L. Tagliacozzo, A. Celi, P. Orland, and M. Lewenstein, Simulations of non-Abelian gauge theories with optical lattices, Nature Commun. 4, 2615 (2013).
  * Raychowdhury and Stryker [2020] I. Raychowdhury and J. R. Stryker, Solving gauss’s law on digital quantum computers with loop-string-hadron digitization, Phys. Rev. Res. 2, 033039 (2020).
  * Surace  _et al._ [2020] F. M. Surace, P. P. Mazza, G. Giudici, A. Lerose, A. Gambassi, and M. Dalmonte, Lattice gauge theories and string dynamics in Rydberg atom quantum simulators, Phys. Rev. X 10, 021041 (2020).
  * Davoudi  _et al._ [2020] Z. Davoudi, I. Raychowdhury, and A. Shaw, Search for Efficient Formulations for Hamiltonian Simulation of non-Abelian Lattice Gauge Theories (2020), arXiv:2009.11802 [hep-lat] .
  * Bhattacharya  _et al._ [2020] T. Bhattacharya, A. J. Buser, S. Chandrasekharan, R. Gupta, and H. Singh, Qubit regularization of asymptotic freedom (2020), arXiv:2012.02153 [hep-lat] .
  * Zhou  _et al._ [2022] J. Zhou, H. Singh, T. Bhattacharya, S. Chandrasekharan, and R. Gupta, Spacetime symmetric qubit regularization of the asymptotically free two-dimensional O(4) model, Phys. Rev. D 105, 054510 (2022).
  * Caspar and Singh [2022] S. Caspar and H. Singh, From Asymptotic Freedom to $\theta$ Vacua: Qubit Embeddings of the O(3) Nonlinear $\sigma$ Model, Phys. Rev. Lett. 129, 022003 (2022), arXiv:2203.15766 [hep-lat] .
  * Stryker [2019] J. R. Stryker, Oracles for Gauss’s law on digital quantum computers, Phys. Rev. A99, 042301 (2019), arXiv:1812.01617 [quant-ph] .
  * Lamm  _et al._ [2020b] H. Lamm, S. Lawrence, and Y. Yamauchi (NuQS), Suppressing Coherent Gauge Drift in Quantum Simulations (2020b), arXiv:2005.12688 [quant-ph] .
  * Mathew and Raychowdhury [2022] E. Mathew and I. Raychowdhury, Protecting local and global symmetries in simulating (1+1)D non-Abelian gauge theories, Phys. Rev. D 106, 054510 (2022), arXiv:2206.07444 [hep-lat] .
  * Van Damme  _et al._ [2021] M. Van Damme, J. Mildenberger, F. Grusdt, P. Hauke, and J. C. Halimeh, Suppressing nonperturbative gauge errors in the thermodynamic limit using local pseudogenerators (2021), arXiv:2110.08041 [quant-ph] .
  * Halimeh and Hauke [2022] J. C. Halimeh and P. Hauke, Stabilizing Gauge Theories in Quantum Simulators: A Brief Review (2022) arXiv:2204.13709 [cond-mat.quant-gas] .
  * Lieu  _et al._ [2020] S. Lieu, R. Belyansky, J. T. Young, R. Lundgren, V. V. Albert, and A. V. Gorshkov, Symmetry breaking and error correction in open quantum systems, Phys. Rev. Lett. 125, 240405 (2020).
  * Van Damme  _et al._ [2020] M. Van Damme, J. C. Halimeh, and P. Hauke, Gauge-Symmetry Violation Quantum Phase Transition in Lattice Gauge Theories (2020), arXiv:2010.07338 [cond-mat.quant-gas] .
  * Bonati  _et al._ [2021a] C. Bonati, A. Pelissetto, and E. Vicari, Breaking of Gauge Symmetry in Lattice Gauge Theories, Phys. Rev. Lett. 127, 091601 (2021a).
  * Bonati  _et al._ [2021b] C. Bonati, A. Pelissetto, and E. Vicari, Lattice gauge theories in the presence of a linear gauge-symmetry breaking, Phys. Rev. E 104, 014140 (2021b).
  * Gustafson and Lamm [2023] E. J. Gustafson and H. Lamm, Robustness of Gauge Digitization to Quantum Noise (2023), arXiv:2301.10207 [hep-lat] .
  * Stannigel  _et al._ [2014] K. Stannigel, P. Hauke, D. Marcos, M. Hafezi, S. Diehl, M. Dalmonte, and P. Zoller, Constrained dynamics via the Zeno effect in quantum simulation: Implementing non-Abelian lattice gauge theories with cold atoms, Phys. Rev. Lett. 112, 120406 (2014).
  * Halimeh  _et al._ [2020a] J. C. Halimeh, H. Lang, J. Mildenberger, Z. Jiang, and P. Hauke, Gauge-Symmetry Protection Using Single-Body Terms (2020a), arXiv:2007.00668 [quant-ph] .
  * Halimeh  _et al._ [2020b] J. C. Halimeh, R. Ott, I. P. McCulloch, B. Yang, and P. Hauke, Robustness of gauge-invariant dynamics against defects in ultracold-atom gauge theories, Phys. Rev. Res. 2, 033361 (2020b), arXiv:2005.10249 [cond-mat.quant-gas] .
  * Halimeh  _et al._ [2021] J. C. Halimeh, H. Lang, and P. Hauke, Gauge protection in non-Abelian lattice gauge theories (2021), arXiv:2106.09032 [cond-mat.quant-gas] .
  * Tran  _et al._ [2021] M. C. Tran, Y. Su, D. Carney, and J. M. Taylor, Faster digital quantum simulation by symmetry protection, PRX Quantum 2, 010323 (2021).
  * Rajput  _et al._ [2023a] A. Rajput, A. Roggero, and N. Wiebe, Quantum error correction with gauge symmetries, npj Quantum Information 9, 41 (2023a).
  * Terhal [2015] B. M. Terhal, Quantum error correction for quantum memories, Rev. Mod. Phys. 87, 307 (2015).
  * Roffe [2019] J. Roffe, Quantum error correction: an introductory guide, Contemporary Physics 60, 226 (2019).
  * ion [2020] Scaling IonQ’s quantum computers: The roadmap (2020).
  * ibm [2021] The IBM Quantum Development Roadmap (2021).
  * Neven [2020] H. Neven, Day 1 opening keynote by Hartmut Neven (quantum summer symposium 2020) (2020).
  * Cai  _et al._ [2022] Z. Cai, R. Babbush, S. C. Benjamin, S. Endo, W. J. Huggins, Y. Li, J. R. McClean, and T. E. O’Brien, Quantum error mitigation (2022), arXiv:2210.00921 [quant-ph] .
  * Klco and Savage [2021] N. Klco and M. J. Savage, Hierarchical qubit maps and hierarchically implemented quantum error correction, Phys. Rev. A 104, 062425 (2021), arXiv:2109.01953 [quant-ph] .
  * Rajput  _et al._ [2023b] A. Rajput, A. Roggero, and N. Wiebe, Quantum error correction with gauge symmetries, npj Quantum Inf. 9, 41 (2023b), arXiv:2112.05186 [quant-ph] .
  * del Pino and Zilberberg [2023] J. del Pino and O. Zilberberg, Dynamical Gauge Fields with Bosonic Codes, Phys. Rev. Lett. 130, 171901 (2023), arXiv:2211.12119 [quant-ph] .
  * Landahl and Morrison [2021] A. J. Landahl and B. C. A. Morrison, Logical fermions for fault-tolerant quantum simulation (2021), arXiv:2110.10280 [quant-ph] .
  * Chen  _et al._ [2022] Y.-A. Chen, A. V. Gorshkov, and Y. Xu, Error-correcting codes for fermionic quantum simulation (2022), arXiv:2210.08411 [quant-ph] .
  * Shor [1996] P. W. Shor, Fault tolerant quantum computation (1996), arXiv:quant-ph/9605011 .
  * Aharonov and Ben-Or [2008] D. Aharonov and M. Ben-Or, Fault-tolerant quantum computation with constant error rate, SIAM Journal on Computing 38, 1207 (2008).
  * Knill  _et al._ [1998] E. Knill, R. Laflamme, and W. H. Zurek, Resilient quantum computation, Science 279, 342 (1998).
  * Kogut and Susskind [1975] J. Kogut and L. Susskind, Hamiltonian formulation of Wilson’s lattice gauge theories, Phys. Rev. D 11, 395 (1975).
  * Bao  _et al._ [2023] N. Bao, C. Cao, A. Chatwin-Davies, G. Cheng, and G. Zhu, Superselection rules, quantum error correction, and quantum chromodynamics (2023), arXiv:2306.17230 [quant-ph] .
  * Luo  _et al._ [1999] X.-Q. Luo, S.-H. Guo, H. Kroger, and D. Schutte, Improved lattice gauge field Hamiltonian, Phys. Rev. D 59, 034503 (1999), arXiv:hep-lat/9804029 .
  * Carlsson and McKellar [2001a] J. Carlsson and B. H. McKellar, Direct improvement of Hamiltonian lattice gauge theory, Phys. Rev. D 64, 094503 (2001a), arXiv:hep-lat/0105018 .
  * Carlsson and McKellar [2001b] J. Carlsson and B. H. J. McKellar, Direct improvement of hamiltonian lattice gauge theory, Phys. Rev. D 64, 094503 (2001b).
  * Carena  _et al._ [2022b] M. Carena, H. Lamm, Y.-Y. Li, and W. Liu, Improved hamiltonians for quantum simulations of gauge theories, Phys. Rev. Lett. 129, 051601 (2022b).
  * Gattringer and Lang [2010] C. Gattringer and C. B. Lang,  _Quantum chromodynamics on the lattice_, Vol. 788 (Springer, Berlin, 2010).
  * Ligterink  _et al._ [2000] N. Ligterink, N. Walet, and R. Bishop, Toward a many-body treatment of hamiltonian lattice SU(n) gauge theory, Annals of Physics 284, 215 (2000).
  * Müller and Rühl [1984] V. Müller and W. Rühl, The energy gap of su(2) lattice gauge theory in 2+1 dimensions, Nuclear Physics B 230, 49 (1984).
  * Bronzan [1985] J. B. Bronzan, Explicit hamiltonian for su(2) lattice gauge theory, Phys. Rev. D 31, 2020 (1985).
  * Cai  _et al._ [2023] Z. Cai, R. Babbush, S. C. Benjamin, S. Endo, W. J. Huggins, Y. Li, J. R. McClean, and T. E. O’Brien, Quantum error mitigation (2023), arXiv:2210.00921 [quant-ph] .
  * Knill and Laflamme [1997] E. Knill and R. Laflamme, Theory of quantum error-correcting codes, Phys. Rev. A 55, 900 (1997).
  * van Den Broek and Cornwell [1978] P. M. van Den Broek and J. F. Cornwell, Clebsch-gordan coefficients of symmetry groups, physica status solidi (b) 90, 211 (1978).
  * Nielsen and Chuang [2010] M. A. Nielsen and I. L. Chuang,  _Quantum Computation and Quantum Information: 10th Anniversary Edition_ (Cambridge University Press, 2010).
  * Lamm  _et al._ [2019] H. Lamm, S. Lawrence, and Y. Yamauchi (NuQS), General Methods for Digital Quantum Simulation of Gauge Theories, Phys. Rev. D100, 034518 (2019), arXiv:1903.08807 [hep-lat] .
  * Butera and Pernici [2014] P. Butera and M. Pernici, Sums of permanental minors using Grassmann algebra (2014), arXiv:1406.5337 [hep-lat] .

##  Appendix A Counting gauge orbits

Let $\mathcal{U}$ be the set of configurations and $\mathcal{G}$ the group of
gauge transformations on the entire lattice, with $|\mathcal{U}|=|G|^{N_{L}}$
and $|\mathcal{G}|=|G|^{N_{V}}$. In the magnetic basis,
$\hat{P}_{\rm{inv}}\ket{U}$ is the uniform superposition of all gauge
transformations of $\ket{U}$. Thus the number of states in the basis
$\hat{P}_{\rm{inv}}\mathcal{U}$ is the number of configurations in
$\mathcal{U}$ that are not equivalent under gauge transformations:

$\mathrm{dim}\mathcal{H}_{\mathrm{inv}}=|\mathcal{U}/\mathcal{G}|$ (60)

where $|\mathcal{U}/\mathcal{G}|$ is the number of orbits in $\mathcal{U}$
under $\mathcal{G}$. According to Burnside’s counting theorem,

$\displaystyle|\mathcal{U/G}|=\frac{1}{|\mathcal{G}|}\sum_{T\in\mathcal{G}}|\mathcal{U}^{T}|=\frac{1}{|\mathcal{G}|}\sum_{\ket{U}\in\mathcal{U}}|\mathcal{G}_{\ket{U}}|,$
(61)

where $\mathcal{U}^{T}$ is the subset of elements invariant under
$T\in\mathcal{G}$,

$\displaystyle\mathcal{U}^{T}=\\{\ket{U}\in\mathcal{U}:T\ket{U}=\ket{U}\\},$
(62)

and $\mathcal{G}_{\ket{U}}$ is the stabilizer group for the element $\ket{U}$,

$\displaystyle\mathcal{G}_{\ket{U}}=\\{T\in\mathcal{G}:T\ket{U}=\ket{U}\\}.$
(63)

If $T=\prod_{\mathbf{x}}\hat{T}_{h_{\mathbf{x}}}$ then with
$\ket{U}=\prod_{\mathbf{x},i}\ket{g_{\mathbf{x},i}}$, there must be

$\displaystyle
h_{\mathbf{x+i}}=g_{\mathbf{x},i}^{-1}h_{\mathbf{x}}g_{\mathbf{x},i},$ (64)

which means once $h_{\mathbf{x}_{0}}$ at a certain site $\mathbf{x}_{0}$ is
fixed, there is at most one $T\in\mathcal{G}$ to keep $\ket{U}$ invariant. For
$h_{\mathbf{x}_{0}}\in H$ the Abelian center of $G$, this is the global
transformation with $h_{\mathbf{x}_{0}}$. Therefore
$|H|\leq|\mathcal{G}_{\ket{U}}|\leq|G|$ and

$\displaystyle|\mathcal{U}||H|\leq\sum_{\ket{U}\in\mathcal{U}}|\mathcal{G}_{\ket{U}}|\leq|\mathcal{U}||G|.$
(65)

given that $|\mathcal{U}|=|G|^{N_{L}},|\mathcal{G}|=|G|^{N_{V}}$, we find

$\displaystyle|H||G|^{N_{L}-N_{V}}\leq|\mathcal{U/G}|\leq|G|^{N_{L}-N_{V}+1}.$
(66)

For Abelian groups, $H=G$ and
$|\mathcal{U/G}|=|G|^{N_{L}-N_{V}+1}=|G|^{N_{L}-N_{T}}$. For non-Abelian $G$,
the “$\leq$” are both “$<$”.

##  Appendix B Correctability of $\hat{\Gamma}_{\sigma}$

In the rest of the appendices, $g,h$ are group elements, $\sigma,\tau$ are
irreducible representations (irreps), and $k,l,m,n,q,r,s,t,u$ are the matrix
elements of representations.To check Eq. (29), we will compute in the magnetic
basis

$\hat{P}_{0}(\mathbf{x})\hat{\Gamma}_{\sigma^{\prime},s,q}^{\dagger}(\mathbf{x},i)\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x})=\frac{1}{|G|^{2}}\sum_{g,h\in
G}\bigg{(}\vbox{\hbox{ \leavevmode\hbox to115.51pt{\vbox
to67.42pt{\pgfpicture\makeatletter\hbox{\hskip
46.48074pt\lower-33.97003pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}
{}{}{}\pgfsys@moveto{0.0pt}{17.07182pt}\pgfsys@lineto{0.0pt}{-17.07182pt}\pgfsys@stroke\pgfsys@invoke{
} {}{{}}{}
{}{}{}\pgfsys@moveto{-17.07182pt}{0.0pt}\pgfsys@lineto{17.07182pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} \par{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-8.60478pt}{22.89926pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{L}_{g}\hat{L}_{h}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-11.27145pt}{-27.82706pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{R}_{g^{-1}}\hat{R}_{h^{-1}}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{{}{}}}{{}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-43.14774pt}{-2.20613pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{R}_{g^{-1}}\hat{R}_{h^{-1}}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{20.60483pt}{-3.2139pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{L}_{g}\hat{\Gamma}^{\dagger}_{\sigma^{\prime},s,q}\hat{\Gamma}_{\sigma,m,n}\hat{L}_{h}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\par{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{{}{{{}}}{{}}{}{}{}{}{}{}{}{}{}{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{}\pgfsys@moveto{6.21753pt}{0.0pt}\pgfsys@curveto{6.21753pt}{3.43388pt}{3.43388pt}{6.21753pt}{0.0pt}{6.21753pt}\pgfsys@curveto{-3.43388pt}{6.21753pt}{-6.21753pt}{3.43388pt}{-6.21753pt}{0.0pt}\pgfsys@curveto{-6.21753pt}{-3.43388pt}{-3.43388pt}{-6.21753pt}{0.0pt}{-6.21753pt}\pgfsys@curveto{3.43388pt}{-6.21753pt}{6.21753pt}{-3.43388pt}{6.21753pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-2.6389pt}{-2.15277pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\mathbf{x}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}}\bigg{)},$ (67)

For the operators on the link $\mathbf{x},i$,

$\displaystyle\hat{L}_{g}\hat{\Gamma}^{\dagger}_{\sigma^{\prime},s,q}\hat{\Gamma}_{\sigma,m,n}\hat{L}_{h}$
$\displaystyle=\sum_{U}\ket{gU}\bra{U}\sqrt{d_{\sigma}d_{\sigma^{\prime}}}\Gamma^{(\sigma^{\prime})}_{sq}(U)\Gamma^{(\sigma)}_{mn}(U)^{\ast}\hat{L}_{h}$
$\displaystyle=\sqrt{d_{\sigma}}\bigg{[}\sum_{U,l}\Gamma^{(\sigma^{\prime})}_{sl}(g^{-1})\Gamma^{(\sigma^{\prime})}_{lq}(gU)\bigg{]}\bigg{[}\sum_{k}\Gamma^{(\sigma)}_{mk}(g^{-1})\Gamma^{(\sigma)}_{kn}(gU)\bigg{]}^{\ast}\ket{gU}\bra{U}\hat{L}_{h}$
$\displaystyle=\sum_{k,l}\Gamma^{(\sigma^{\prime})}_{sl}(g^{-1})\Gamma^{(\sigma)}_{mk}(g^{-1})^{\ast}\hat{\Gamma}_{\sigma^{\prime},l,q}^{\dagger}\hat{\Gamma}_{\sigma,k,n}\hat{L}_{g}\hat{L}_{h}.$
(68)

Thus, let $h^{\prime}=gh$,

$\hat{P}_{0}(\mathbf{x})\hat{\Gamma}_{\sigma^{\prime},s,q}^{\dagger}(\mathbf{x},i)\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x})=\frac{1}{|G|^{2}}\sum_{h^{\prime}\in
G}\bigg{(}\vbox{\hbox{ \leavevmode\hbox to192.95pt{\vbox
to67.17pt{\pgfpicture\makeatletter\hbox{\hskip
36.26654pt\lower-33.62006pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}
{}{}{}\pgfsys@moveto{0.0pt}{17.07182pt}\pgfsys@lineto{0.0pt}{-17.07182pt}\pgfsys@stroke\pgfsys@invoke{
} {}{{}}{}
{}{}{}\pgfsys@moveto{-17.07182pt}{0.0pt}\pgfsys@lineto{17.07182pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} \par{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-4.83102pt}{22.99371pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{L}_{h^{\prime}}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-6.16435pt}{-27.82706pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{R}_{h^{\prime-1}}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{{}{}}}{{}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-32.93353pt}{-2.38112pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{R}_{h^{\prime-1}}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{20.60483pt}{0.41673pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\sum\limits_{k,l,g}\Gamma^{(\sigma^{\prime})}_{sl}(g^{-1})\Gamma^{(\sigma)}_{mk}(g^{-1})^{\ast}\hat{\Gamma}_{\sigma^{\prime},l,q}^{\dagger}\hat{\Gamma}_{\sigma,k,n}\hat{L}_{h^{\prime}}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\par{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{{}{{{}}}{{}}{}{}{}{}{}{}{}{}{}{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{}\pgfsys@moveto{6.21753pt}{0.0pt}\pgfsys@curveto{6.21753pt}{3.43388pt}{3.43388pt}{6.21753pt}{0.0pt}{6.21753pt}\pgfsys@curveto{-3.43388pt}{6.21753pt}{-6.21753pt}{3.43388pt}{-6.21753pt}{0.0pt}\pgfsys@curveto{-6.21753pt}{-3.43388pt}{-3.43388pt}{-6.21753pt}{0.0pt}{-6.21753pt}\pgfsys@curveto{3.43388pt}{-6.21753pt}{6.21753pt}{-3.43388pt}{6.21753pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-2.6389pt}{-2.15277pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\mathbf{x}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}}\bigg{)}.$ (69)

With the orthogonality of matrix elements

$\sum_{g}\Gamma^{(\sigma^{\prime})}_{sl}(g^{-1})\Gamma^{(\sigma)}_{mk}(g^{-1})^{\ast}=\delta_{\sigma\sigma^{\prime}}\delta_{ms}\delta_{lk}|G|/d_{\sigma},$
(70)

and the unitarity of representations Eq. (37), we get

$\hat{P}_{0}(\mathbf{x})\hat{\Gamma}_{\sigma^{\prime},s,q}^{\dagger}(\mathbf{x},i)\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x})=\delta_{\sigma^{\prime}\sigma}\delta_{sm}\delta_{qn}\hat{P}_{0}(\mathbf{x})$
(71)

##  Appendix C Derivation of Eq. (III.3) in the group element basis

$\mathcal{U}_{\mathrm{dec}}$ performs the following for a gauge field state
$\ket{\Psi}$:

$\displaystyle\ket{\Psi}\otimes(|G|^{-\frac{1}{2}}\sum_{g\in G}\ket{g})$
$\displaystyle\xrightarrow{\mathfrak{U}_{\times}^{L},\mathfrak{U}_{\times}^{L},\mathfrak{U}_{-1},\mathfrak{U}_{\times}^{R},\mathfrak{U}_{\times}^{R}}|G|^{-\frac{1}{2}}\sum_{g\in
G}\hat{T}_{g}(\mathbf{x})\ket{\Psi}\otimes\ket{g^{-1}}$
$\displaystyle\xrightarrow{QFT}\sum_{g\in
G}\hat{T}_{g}(\mathbf{x})\ket{\Psi}\otimes\bigg{(}\sum_{\sigma,m,n}\frac{\sqrt{d_{\sigma}}}{|G|}\Gamma^{(\sigma)}_{mn}(g^{-1})\ket{\sigma}\bigg{)}=\sum_{\sigma,m,n}\hat{P}_{\sigma_{mn}}(\mathbf{x})\ket{\Psi}\otimes\ket{\sigma_{mn}},$
(72)

where

$\hat{P}_{\sigma_{mn}}(\mathbf{x})\equiv\frac{\sqrt{d_{\sigma}}}{|G|}\sum_{g\in
G}\Gamma^{(\sigma)}_{mn}(g^{-1})\hat{T}_{g}(\mathbf{x})$ (73)

For the trivial representation $\sigma=0$, $\hat{P}_{0}(\mathbf{x})$ is the
projection to the subspace invariant under local gauge transformations and
$\hat{P}_{0}(\mathbf{x})\ket{\Psi}_{\mathrm{inv}}=\ket{\Psi}_{\mathrm{inv}}$.
When a correctable error $\hat{\Gamma}_{\sigma}$ occurs on one gauge register,
consider

$\hat{P}_{\sigma^{\prime}_{sq}}(\mathbf{x})\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x})=\frac{\sqrt{d_{\sigma}}}{|G|^{2}}\sum_{g,h\in
G}\Gamma^{(\sigma^{\prime})}_{sq}(g^{-1})\bigg{(}\vbox{\hbox{ \leavevmode\hbox
to107.46pt{\vbox to67.42pt{\pgfpicture\makeatletter\hbox{\hskip
46.48074pt\lower-33.97003pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}
{}{}{}\pgfsys@moveto{0.0pt}{17.07182pt}\pgfsys@lineto{0.0pt}{-17.07182pt}\pgfsys@stroke\pgfsys@invoke{
} {}{{}}{}
{}{}{}\pgfsys@moveto{-17.07182pt}{0.0pt}\pgfsys@lineto{17.07182pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} \par{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-8.60478pt}{22.89926pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{L}_{g}\hat{L}_{h}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-11.27145pt}{-27.82706pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{R}_{g^{-1}}\hat{R}_{h^{-1}}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{{}{}}}{{}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-43.14774pt}{-2.20613pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{R}_{g^{-1}}\hat{R}_{h^{-1}}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{20.60483pt}{-2.4639pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{L}_{g}\hat{\Gamma}_{\sigma,m,n}\hat{L}_{h}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\par{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{{}{{{}}}{{}}{}{}{}{}{}{}{}{}{}{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{}\pgfsys@moveto{6.21753pt}{0.0pt}\pgfsys@curveto{6.21753pt}{3.43388pt}{3.43388pt}{6.21753pt}{0.0pt}{6.21753pt}\pgfsys@curveto{-3.43388pt}{6.21753pt}{-6.21753pt}{3.43388pt}{-6.21753pt}{0.0pt}\pgfsys@curveto{-6.21753pt}{-3.43388pt}{-3.43388pt}{-6.21753pt}{0.0pt}{-6.21753pt}\pgfsys@curveto{3.43388pt}{-6.21753pt}{6.21753pt}{-3.43388pt}{6.21753pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-2.6389pt}{-2.15277pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\mathbf{x}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}}\bigg{)},$ (74)

use the “commutation relation” to replace $\hat{L}_{g}\hat{\Gamma}_{\sigma}$
on the link $(\mathbf{x},i)$ with

$\hat{L}_{g}\hat{\Gamma}_{\sigma,m,n}=\sum_{U}\ket{gU}\bra{U}\sqrt{d_{\sigma}}\Gamma^{(\sigma)}_{mn}(U)^{\ast}=\sum_{U}\ket{gU}\bra{U}\sqrt{d_{\sigma}}[\sum_{k}\Gamma^{(\sigma)}_{mk}(g^{-1})\Gamma^{(\sigma)}_{kn}(gU)]^{\ast}=\sum_{k}\Gamma^{(\sigma)}_{mk}(g^{-1})^{\ast}\hat{\Gamma}_{\sigma,k,n}\hat{L}_{g},$
(75)

and let $h^{\prime}=gh$, Eq. (74) can be simplified as

$\hat{P}_{\sigma^{\prime}_{sq}}(\mathbf{x})\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x})=\frac{\sqrt{d_{\sigma}}}{|G|^{2}}\sum_{g}\Gamma^{(\sigma^{\prime})}_{sq}(g^{-1})\sum_{k}\Gamma^{(\sigma)}_{mk}(g^{-1})^{\ast}\sum_{h^{\prime}}\bigg{(}\vbox{\hbox{
\leavevmode\hbox to87.87pt{\vbox
to67.17pt{\pgfpicture\makeatletter\hbox{\hskip
36.26654pt\lower-33.62006pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{}{{}}{}
{}{}{}\pgfsys@moveto{0.0pt}{17.07182pt}\pgfsys@lineto{0.0pt}{-17.07182pt}\pgfsys@stroke\pgfsys@invoke{
} {}{{}}{}
{}{}{}\pgfsys@moveto{-17.07182pt}{0.0pt}\pgfsys@lineto{17.07182pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} \par{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-4.83102pt}{22.99371pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{L}_{h^{\prime}}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-6.16435pt}{-27.82706pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{R}_{h^{\prime-1}}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{{}{}}}{{}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-32.93353pt}{-2.38112pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{R}_{h^{\prime-1}}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{20.60483pt}{-2.09445pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\hat{\Gamma}_{\sigma,k,n}\hat{L}_{h^{\prime}}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\par{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{{}{{{}}}{{}}{}{}{}{}{}{}{}{}{}{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{}\pgfsys@moveto{6.21753pt}{0.0pt}\pgfsys@curveto{6.21753pt}{3.43388pt}{3.43388pt}{6.21753pt}{0.0pt}{6.21753pt}\pgfsys@curveto{-3.43388pt}{6.21753pt}{-6.21753pt}{3.43388pt}{-6.21753pt}{0.0pt}\pgfsys@curveto{-6.21753pt}{-3.43388pt}{-3.43388pt}{-6.21753pt}{0.0pt}{-6.21753pt}\pgfsys@curveto{3.43388pt}{-6.21753pt}{6.21753pt}{-3.43388pt}{6.21753pt}{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@fillstroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-2.6389pt}{-2.15277pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\mathbf{x}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}}\bigg{)}.$ (76)

Using the orthogonality Eq. (70), we get

$\displaystyle\hat{P}_{\sigma^{\prime}_{sq}}(\mathbf{x})\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x})=\delta_{\sigma^{\prime}\sigma}\delta_{sm}d_{\sigma}^{-1/2}\hat{\Gamma}_{\sigma,q,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x}).$
(77)

Similarly for $(\mathbf{x+i})$ at the other end of the erroneous link,

$\hat{R}_{g^{-1}}\hat{\Gamma}_{\sigma,m,n}=\sum_{k}\Gamma^{(\sigma)}_{kn}(g)^{\ast}\hat{\Gamma}_{\sigma,m,k}\hat{R}_{g^{-1}},$
(78)

and

$\displaystyle\hat{P}_{\sigma^{\prime\prime}_{tr}}(\mathbf{x+i})\hat{\Gamma}_{\sigma,q,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x+i})$
$\displaystyle=\delta_{\sigma^{\prime\prime}\bar{\sigma}}\delta_{tn}d_{\sigma}^{-1/2}\hat{\Gamma}_{\sigma,q,r}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x+i}).$
(79)

Combining Eq. (77) and Eq. (79) gives

$\displaystyle\hat{P}_{\sigma^{\prime\prime}_{tr}}(\mathbf{x+i})\hat{P}_{\sigma^{\prime}_{sq}}(\mathbf{x})\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x})\hat{P}_{0}(\mathbf{x+i})$
$\displaystyle=\delta_{\sigma.\sigma^{\prime}}\delta_{\sigma^{\prime\prime}\bar{\sigma}}\delta_{sm}\delta_{tn}\frac{1}{d_{\sigma}}\hat{\Gamma}_{\sigma,q,r}(\mathbf{x},i)\hat{P}_{0}(\mathbf{x})\hat{P}_{0}(\mathbf{x+i}).$
(80)

Using the fact
$\hat{P}_{0}(\mathbf{x})\hat{P}_{0}(\mathbf{x+i})\ket{\Psi}_{\mathrm{inv}}=\ket{\Psi}_{\mathrm{inv}}$,
the outcome of $\mathcal{U}_{\mathrm{dec}}$ the gauge field state
$\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\ket{\Psi}_{\mathrm{inv}}$ is

$\displaystyle\sum_{\sigma^{\prime}_{sq},\sigma^{\prime\prime}_{tr}}\hat{P}_{\sigma^{\prime\prime}_{tr}}(\mathbf{x+i})\hat{P}_{\sigma^{\prime}_{sq}}(\mathbf{x})\hat{\Gamma}_{\sigma,m,n}(\mathbf{x},i)\ket{\Psi}_{\mathrm{inv}}\otimes\ket{\sigma^{\prime}_{sq}(\mathbf{x})}\otimes\ket{\sigma^{\prime\prime}_{tr}(\mathbf{x+i})}$
$\displaystyle=\sum_{q,r}\frac{1}{d_{\sigma}}\hat{\Gamma}_{\sigma,q,r}(\mathbf{x},i)\ket{\Psi}_{\mathrm{inv}}\otimes\ket{\sigma^{\prime}_{sq}(\mathbf{x})}\otimes\ket{\sigma^{\prime\prime}_{tr}(\mathbf{x+i})}$
(81)

##  Appendix D Clebsch-Gordan sum in the group element basis

Figure 7: Quantum circuits implementing Clebsch-Gordan sums for generic finite
groups. (left) $\mathfrak{U}^{L}_{CG}$ and (right) $\mathfrak{U}^{R}_{CG}$

The relation between Clebsch-Gordan coefficients and matrix elements of the
representations [109] is :

$\displaystyle\frac{d_{\sigma^{\prime\prime}}}{|G|}\sum_{g\in
G}\Gamma^{(\sigma)}_{mn}(g)\Gamma^{(\sigma^{\prime})}_{kq}(g)\Gamma^{(\sigma^{\prime\prime})}_{lr}(g)^{\ast}=\sum_{\alpha}\braket{\sigma^{\prime\prime}_{r},\alpha}{\sigma_{n},\sigma^{\prime}_{q}}\braket{\sigma_{m},\sigma^{\prime}_{k}}{\sigma^{\prime\prime}_{l},\alpha}.$
(82)

The Clebsch-Gordan coefficients satisfy
$\braket{\sigma_{n},\sigma^{\prime}_{q}}{\sigma^{\prime\prime}_{r},\alpha}^{\ast}=\braket{\bar{\sigma}_{n},\bar{\sigma}^{\prime}_{q}}{\bar{\sigma}^{\prime\prime}_{r},\alpha}$.
We can also choose the phases of representation to satisfy
$\braket{\sigma^{\prime\prime}_{r},\alpha}{\sigma_{n},\sigma^{\prime}_{q}}=\braket{\sigma_{n},\sigma^{\prime}_{q}}{\sigma^{\prime\prime}_{r},\alpha}^{\ast}$,
which will be used for later discussions.

With Eq. (82), we show that the group multiplications Fourier transformed to
the representation basis is equivalent to the addition of representations
according to the Clebsch-Gordan coefficients (Fig. 7).

$\displaystyle\mathfrak{U}^{L}_{CG}=$
$\displaystyle\frac{\sqrt{d_{\sigma}d_{\sigma^{\prime}_{1}}d_{\tau}d_{\tau^{\prime}}}}{|G|^{2}}\Gamma^{(\sigma^{\prime})}_{qr}(g_{2}g_{1})\Gamma^{(\tau^{\prime})}_{st}(g_{2})\Gamma^{(\sigma)}_{mn}(g_{1})^{\ast}\Gamma^{(\tau)}_{kl}(g_{2})^{\ast}\big{(}\ket{{\sigma^{\prime}}_{qr}}\otimes\ket{{\tau^{\prime}}_{st}}\bra{{\sigma}_{mn}}\otimes\bra{{\tau}_{kl}}\big{)}$
$\displaystyle=$
$\displaystyle\frac{\sqrt{d_{\sigma}d_{\sigma^{\prime}_{1}}d_{\tau}d_{\tau^{\prime}}}}{|G|^{2}}\Gamma^{(\sigma^{\prime})}_{qu}(g_{2})\Gamma^{(\sigma^{\prime})}_{ur}(g_{1})\Gamma^{(\tau^{\prime})}_{st}(g_{2})\Gamma^{(\sigma)}_{mn}(g_{1})^{\ast}\Gamma^{(\tau)}_{kl}(g_{2})^{\ast}\big{(}\ket{{\sigma^{\prime}}_{qr}}\otimes\ket{{\tau^{\prime}}_{st}}\bra{{\sigma}_{mn}}\otimes\bra{{\tau}_{kl}}\big{)}$
(83)

where all the indices for group elements and group representations are summed
over. Use the orthogonality Eq. (70) to sum $g_{1}$, giving

$\displaystyle\mathfrak{U}^{L}_{CG}$
$\displaystyle=\frac{\sqrt{d_{\tau}d_{\tau^{\prime}}}}{|G|}\Gamma^{(\sigma)}_{qm}(g_{2})\Gamma^{(\tau^{\prime})}_{st}(g_{2})\Gamma^{(\tau)}_{kl}(g_{2})^{\ast}\big{(}\ket{{\sigma}_{qn}}\otimes\ket{{\tau^{\prime}}_{st}}\bra{{\sigma}_{mn}}\otimes\bra{{\tau}_{kl}}\big{)}$
$\displaystyle=\frac{\sqrt{d_{\tau}d_{\tau^{\prime}}}}{|G|}\big{[}\Gamma^{(\bar{\sigma})}_{qm}(g_{2})\Gamma^{(\tau^{\prime})}_{st}(g_{2})^{\ast}\,\Gamma^{(\tau)}_{kl}(g_{2})\big{]}^{\ast}\big{(}\ket{{\sigma}_{qn}}\otimes\ket{{\tau^{\prime}}_{st}}\bra{{\sigma}_{mn}}\otimes\bra{{\tau}_{kl}}\big{)},$
(84)

Finally apply Eq. (82) and convert the product of matrix elements to the
Clebsch-Gordan coefficients,

$\displaystyle\mathfrak{U}^{L}_{CG}$
$\displaystyle=\sqrt{d_{\tau}/d_{\tau^{\prime}}}\big{(}\braket{{\tau^{\prime}}_{t},\alpha}{{\bar{\sigma}}_{m},{\tau}_{l}}\braket{{\bar{\sigma}}_{q},{\tau}_{k}}{{\tau^{\prime}}_{s},\alpha}\big{)}^{\ast}\big{(}\ket{{\sigma}_{qn}}\otimes\ket{{\tau^{\prime}}_{st}}\bra{{\sigma}_{mn}}\otimes\bra{{\tau}_{kl}}\big{)}$
$\displaystyle=\sqrt{d_{\tau}/d_{\tau^{\prime}}}\braket{{\bar{\tau}^{\prime}}_{t},\alpha}{\sigma_{m},\bar{\tau}_{l}}\braket{\sigma_{q},\bar{\tau}_{k}}{{\bar{\tau}^{\prime}}_{s},\alpha}\big{(}\ket{{\sigma}_{qn}}\otimes\ket{{\tau^{\prime}}_{st}}\bra{{\sigma}_{mn}}\otimes\bra{{\tau}_{kl}}\big{)}$
(85)

Thus through $\mathfrak{U}^{L}_{CG}$, $\sigma$ in register 1 stays the same
and $\tau$ in register 2 changes into $\tau^{\prime}$.

Thus, $\mathfrak{U}^{L}_{CG}$ “adds” the left vector in register 1 to register
2 according to the Clebsch-Gordan coefficients. For register 1, the process
preserves quantum numbers $\sigma,n$ but not necessarily $m$ when the
representation $\sigma$ is not one-dimensional. The old flux ${{\sigma}}_{m}$
is added to ${\bar{\tau}}_{l}$ and the new flux ${{\sigma}}_{q}$ to
${\bar{\tau}}_{k}$. Similarly, $\mathfrak{U}^{R}_{CG}$ adds the right-vector
in register 1 to register 2:

$\displaystyle\mathfrak{U}^{R}_{CG}=$
$\displaystyle\frac{\sqrt{d_{\sigma}d_{\sigma^{\prime}_{1}}d_{\tau}d_{\tau^{\prime}}}}{|G|^{2}}\Gamma^{(\sigma^{\prime})}_{qr}(g_{1}g_{2}^{-1})\Gamma^{(\tau^{\prime})}_{st}(g_{2})\Gamma^{(\sigma)}_{mn}(g_{1})^{\ast}\Gamma^{(\tau)}_{kl}(g_{2})^{\ast}\big{(}\ket{{\sigma^{\prime}}_{qr}}\otimes\ket{{\tau^{\prime}}_{st}}\bra{{\sigma}_{mn}}\otimes\bra{{\tau}_{kl}}\big{)}$
$\displaystyle=$
$\displaystyle\sqrt{d_{\tau}/d_{\tau^{\prime}}}\braket{{\sigma}_{n},{\tau}_{l}}{{\tau^{\prime}}_{t},\alpha}\braket{{\tau^{\prime}}_{s},\alpha}{{\sigma}_{r},{\tau}_{k}}\big{(}\ket{{\sigma}_{mr}}\otimes\ket{{\tau^{\prime}}_{st}}\bra{{\sigma}_{mn}}\otimes\bra{{\tau}_{kl}}\big{)}$
(86)

##  Appendix E Correctable errors and independence polynomials

In this appendix, we explain our methods to compute $Q_{n}$ – the number of
possible ways to arrange $n$ links with correctable errors in the lattice,
such that the correctability condition is still satisfied, with tools of graph
theory [112]. The method can be applied to lattices of generic shapes.

A graph consists of vertices and edges. An independent subset of vertices is a
set of vertices in which no two vertices are adjacent to the same edge. The
independence polynomial of a graph is

$\displaystyle I(z)=\sum_{n}a_{n}z^{n},$ (87)

where $a_{n}$ is the number of different independent subsets of $n$ vertices
in the graph.

For a finite lattice $\mathfrak{L}$, we create a corresponding graph
$\mathfrak{L}^{\prime}$ in the following way:

  * •

convert each link of $\mathfrak{L}$ into a vertex of $\mathfrak{L}^{\prime}$;

  * •

for each pair of vertices in $\mathfrak{L}^{\prime}$, create an edge adjacent
to them, if the $\Gamma_{\sigma}$-type errors that occur simultaneously to the
corresponding links in $\mathfrak{L}$ can break the correctability condition.

Thus, each way of arranging $n$ erroneous links to satisfy the correctability
condition corresponds to an independent subset of vertices in the new graph.
This implies that $Q_{n}$ is the number independent subsets of $n$ vertices in
the new graph and $\Xi$ the independence polynomial.

For each lattice considered in Fig. 5 and Fig. 6, we construct the adjacency
matrix of the corresponding graph $\mathfrak{L}^{\prime}$ – an $N_{L}\times
N_{L}$ matrix in which the element in row $i$ and column $j$ is 0 if the
$i,j$-th vertices are independent, and 1 if they are adjacent to the same
edge. We then use the Python library `hobj` [112] to compute the coefficients
of the independence polynomials from the adjacent matrices. The connectivity
for the MED condition would be higher than that for the KL condition.