reported in [14] which uses a renormalization ap-
proach. When the syndrome measurements are
noisy, our decoder still performs better for larger
lattice when error probability is low, see Fig-
ure 10 for the plot. More numerical simulation
needs to be done to determine the threshold.
This paper is structured as follows. In sec-
tion 2 we discuss previous work in which ma-
chine learning was applied to decode quantum
codes. In section 3 we give a review of the 4D
toric code and its properties. In section 4, we
provide a general introduction to machine learn-
ing. In section 5 we describe the application of
convolutional neural networks as a subroutine in
our decoding algorithm. In section 6 we discuss
the results of Monte-Carlo simulations. In Ap-
pendix A, we give a short introduction to the
backpropagation algorithm which we use to train
the neural network. In Appendix D, we give a
toy example which shows how a baseline machine
learning model can fail at a task similar to de-
coding when the system size becomes large. This
highlights the importance of choosing a transla-
tional invariant model as we do. In Appendix E,
we observed and analyzed one property of multi-
layer convolutional neural networks, and show it
fits nicely to the task of assigning likelihood of
qubit errors for high dimensional toric code.
2 Previous Work
It is known for a while in the classical error cor-
rection community that the errors and syndromes
of a parity checking code can be put together into
a probabilistic graphical model, which is a major
tool for machine learning. Probabilistic graphical
models include for example Bayesian networks
and the Ising model (see [39] for an introduction
to probabilistic graphical model and connection
to error correcting codes). In [15] (and references
therein), it is shown that by using belief propa-
gation, the decoder can achieve very good perfor-
mance for LDPC and turbo code that are close to
the Shannon limit. We want to note that while
there is no formal connection (to our knowledge)
between neural networks and graphical models, a
graphical model of a problem is often helpful for
designing the architecture of the neural network.
For example, in [25] the structure of the Tanner
graph is used to construct a neural network, in
order to improve belief propagation for (classical)
codes that have high density checks.
In [29], the authors discussed applying be-
lief propagation to decoding of quantum stabi-
lizer codes. While stabilizer codes and classi-
cal parity checking codes share many similarities,
the authors highlighted several issues that might
cause belief propagation to work much worse for
stabilizer codes (even with low density checks).
In [12, 13], the authors used belief propagation as
a subroutine in the renormalization decoder for
topological codes, with the purpose of synchro-
nizing marginal probabilities across neighbouring
cells.
Neural network decoder for quantum stabilizer
codes has been studied in [3, 21, 36, 37] (more
precisely in [36] hidden Boltzmann machines are
used instead of neural networks). Our work will
use a similar scheme as [21, 36], where the neural
networks predict which qubits have undergone an
error. In [3, 37], the neural networks output 1 or
2 bits which will correct the final measurement of
the logical operators. The main difference of our
work is that our machine learning decoder is nat-
urally scalable through the use of convolutional
neural networks.
3 The 4D Toric Code
3.1 Definition
The 4D toric code is a stabilizer quantum code
defined on a four-dimensional (4D) hypercubic
lattice which was first considered in [11]. We will
consider periodic boundary conditions so that
topologically the lattice is a 4D torus. The faces
of the lattice are squares and they are identi-
fied with the qubits. From now on we will use
the words face and qubit interchangeably. The
number of faces in a lattice of side-length L is
4
2
L
4
= 6L
4
. This follows from the fact that
every face is uniquely determined by a vertex v
and two coordinates i, j ∈ {x, y, z, w}, so that the
face with base-point v lies in the i-j-plane. More
generally, the number of k-dimensional objects
in the lattice (1-dimensional objects would be
edges or 3-dimensional objects would be cubes)
is given by
4
k
L
4
. There are stabilizer checks for
every edge and cube in the lattice. A stabilizer
check associated with a particular edge acts as
Pauli-X on all faces which are incident to it (see
Figure 1 (left)), whereas a stabilizer check associ-
ated with a particular cube acts as Pauli-Z on all
Accepted in Quantum 2018-05-04, click title to verify 2