기본 정보
- 저자
- DOI
- 10.22331/q-2020-08-24-310
- 저널
- Quantum
- 발행년도
- 2020
- 발행기관
- Verein zur Förderung des Open Access Publizierens in den Quantenwissenschaften
- 피인용수
- 33
- 라이선스
- cc-by
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.22331/q-2020-08-24-310
- 토픽
- Graphene research and applications
- OpenAlex ID
- W2890073778
평가 내용
- 관련도
- 사업분야
- 필름·전자재료 · (16) CPI(투명 폴리이미드)
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '필름·전자재료 > CPI(투명 폴리이미드)' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
We still do not have perfect decoders for topological codes that can satisfy all needs of different experimental setups. Recently, a few neural network based decoders have been studied, with the motivation that they can adapt to a wide range of noise models, and can easily run on dedicated chips without a full-fledged computer. The later feature might lead to fast speed and the ability to operate at low temperatures. However, a question which has not been addressed in previous works is whether neural network decoders can handle 2D topological codes with large distances. In this work, we provide a positive answer for the toric code \cite{Kitaev2003Faulttolerantanyon}. The structure of our neural network decoder is inspired by the renormalization group decoder \cite{duclos2010fast, duclos2013fault}. With a fairly strict policy on training time, when the bit-flip error rate is lower than<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mn>9</mml:mn><mml:mi mathvariant="normal">%</mml:mi></mml:math>and syndrome extraction is perfect, the neural network decoder performs better when code distance increases. With a less strict policy, we find it is not hard for the neural decoder to achieve a performance close to the minimum-weight perfect matching algorithm. The numerical simulation is done up to code distance<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>d</mml:mi><mml:mo>=</mml:mo><mml:mn>64</mml:mn></mml:math>. Last but not least, we describe and analyze a few failed approaches. They guide us to the final design of our neural decoder, but also serve as a caution when we gauge the versatility of stock deep neural networks. The source code of our neural decoder can be found at \cite{sourcecodegithub}.
본문 55,411자
본문 펼치기
# Neural Network Decoders for Large-Distance 2D Toric Codes
Xiaotong Ni
QuTech, Delft University of Technology, P.O.Box 5046, 2600 GA Delft, The Netherlands.
2020 April 8
We still do not have perfect decoders for topological codes that can satisfy all needs of different experimental setups. Recently, a few neural network
based decoders have been studied, with the motivation that they can adapt to a wide range of noise models, and can easily run on dedicated chips without a
full-fledged computer. The later feature might lead
to fast speed and the ability to operate at low temperatures. However, a question which has not been
addressed in previous works is whether neural network decoders can handle 2D topological codes with
large distances. In this work, we provide a positive
answer for the toric code [1]. The structure of our
neural network decoder is inspired by the renormalization group decoder [2, 3]. With a fairly strict policy
on training time, when the bit-flip error rate is lower
than 9% and syndrome extraction is perfect, the neural network decoder performs better when code distance increases. With a less strict policy, we find it is
not hard for the neural decoder to achieve a performance close to the minimum-weight perfect matching
algorithm. The numerical simulation is done up to
code distance _d_ = 64. Last but not least, we describe
and analyze a few failed approaches. They guide us to
the final design of our neural decoder, but also serve
as a caution when we gauge the versatility of stock
deep neural networks. The source code of our neural
decoder can be found at [4].
### 1 Introduction
Before we can make the components of quantum computers as reliable as those of classical computers, we
will need quantum error correction so that we can
scale up the computation. The surface code and
other topological codes are popular choices for several qubit architectures because of their high thresholds and low requirement on connectivity between
qubits. However, several good performing decoders
have trouble to do real-time decoding for qubits with
fast error-correction cycles, such as superconducting
qubits. Moreover, as we are getting closer to the point
where small size surface code can be implemented in
the lab, it is desirable that the decoders can adapt to
the noise models from the experimental setups. These
considerations motivate the study of decoders based
on neural networks, which we will refer to as neu
Xiaotong Ni: [xiaotong.ni@gmail.com](mailto:xiaotong.ni@gmail.com)
ral decoders, for surface code and other topological
codes [5–12]. One question that has not been addressed so far is whether neural networks can also be
used for decoding 2D topological codes on a large lattice with good performance. In this work, we will
focus on answering this question for the toric code.
While it is the simplest topological code, it shares
many common features with others, which makes it a
good test platform.
To design a neural decoder for large toric codes, a
natural first step is to use convolutional neural networks (CNNs) [13, 14], as the toric code and CNNs
are both translational-invariant on a 2D-lattice. Compared to normal neural networks, the number of parameters in CNNs only scale with the depth of networks. This gives an intuition that the training of
the CNNs should remain feasible for the lattice size
of concern in the near future. We want the decoder
to be able to adapt to experimental noise, which we
should assume to be constantly changing, and thus
the data for calibration is limited. The structure of
CNNs allows us to have a great control of how many
parameters to be re-trained during calibration so that
we can avoid over-fitting (see Appendix E for an example).
Interestingly, the renormalization group (RG) decoder [2, 3] for toric code already has a structure very
similar to the CNNs used in image classification. Both
of them try to keep the information needed for the
output intact while reducing the size of the lattice,
by alternating between local computation and coarsegrain steps. This similarity means that we should aim
to achieve better or similar performance with the neural decoder compared to the RG one. And in case of
bad performance, we can “teach” the neural decoder
to use a similar strategy as the RG decoder. This is
indeed how we get good performance in the end. Conceptually, this is similar to imitation learning (see [15]
for an overview). Even though we initialize the neural decoder by mimicking the RG one, it can have the
following advantages:
- It can achieve a better performance than the RG
decoder, as the latter one contains some heuristic
steps. On the other hand, the neural decoder can
be optimized to be a local minimum with respect
to the parameters of the neural network (strictly
speaking, at least the gradient is very small). The
idea of improving belief propagation with neural
networks is also used for decoding classical linear
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 1
of operator _As_ and _Bp_
_Z_ <sup>⊗4</sup>
_coarse-grained_
_<u>edge</u>_
_e_
_q∈n_ ( _p_ )
_As_ =
- _Xq,_ _Bp_ =
_q∈n_ ( _s_ )
_Zq,_ (1)
where _s_ and _p_ is any site and plaquette respectively,
and _n_ ( _·_ ) consists of the 4 qubits neighboring _s_ or _p_ .
The logical- _Z_ operators have the form
_Z_ ¯ _i_ =
_q∈li_
_Zq,_ (2)
Figure 1: An illustration of the lattice and a _Bp_ stabilizer
check. The 2 _×_ 2 unit cells are marked by the red color. We
also give an example of a coarse-grained edge, which locates
at the top-right and contains two edges of the original lattice.
codes [16].
- It offers an additional way to adapt to experimental noise models, which is simply training on
experimental data.
It is tricky to evaluate the performance of neural
decoders. As it stands, we need to train the neural nets for different lattice sizes separately, and the
training process is not deterministic. Thus, we cannot
define a threshold for the decoder. This is fine if our
main goal is to have an adaptable decoder for nearfuture quantum devices. However, in order to know
how optimal the neural decoders are, we still make
a “threshold plot” under a well-studied noise model
in Figure 4. Roughly speaking, the threshold benchmark is a good indicator of how good the decoder can
process syndrome information. At the same time, we
compare our neural decoder to the minimum-weight
perfect matching algorithm in Figure 5, and show in
Appendix E that our neural decoder can improve itself when trained on different error model. We hope
these pieces of information together can give us a first
impression of neural decoders on toric code.
The focus of this paper is not on how to obtain
an optimal neural decoder. Indeed, a lot of hyperparameter optimizations can be done to further improve the performance or reduce the amount of data
needed for training. Instead, we describe the key ideas
that allow us to reliably obtain decent neural decoders
for the toric code. The knowledge we gained can help
us design neural decoders for other large codes.
### 2 Introduction to Toric code and the Renormalization Group Decoder
2.1 Toric Code
First, we give a brief introduction of toric code. Consider a _L × L_ square lattice with periodic boundary
condition, where a qubit lives on each edge. The stabilizer group of toric code is generated by two types
where _l_ 1 _,_ 2 are two shortest inequivalent noncontractible loops. The toric code has a distance
_d_ = _L_ .
In this paper, we will focus on the bit-flip noise
model, i.e. only _X_ errors can happen. We will also
assume perfect measurements. Under this restriction,
the quantum states will stay in the +1 eigenspace of
_As_ . Therefore, we only need to consider the expectation values of _Bp_ and _Z_ <sup>¯</sup> _i_ . For simplicity, let us suppose in the beginning _⟨Z_ <sup>¯</sup> _i⟩_ = +1. And then a set
of _X_ errors happened, which leads to the syndrome
_s_ = _{⟨Bp⟩}_ . The goal of a decoder is to apply _X_
to the qubits, such that _⟨Bp⟩_ and _⟨Z_ <sup>¯</sup> _i⟩_ return to +1.
Without going to detail, we claim it is enough to know
the parity of the number of _X_ errors that happened
on the loops _l_ 1 _,_ 2. These two parities will be the final
training target for our neural decoder. We will refer
to the two parities as logical corrections.
2.2 Renormalization Group Decoder
Let us first set up some notation. We will use _e_ to denote an edge of the original lattice or a coarse-grained
edge. When we say _e_ is a coarse-grained edge, we
mean _e_ is an edge of a unit cell which consists of
two (or more) edges of the original lattice. We use
_x_ ( _e_ ) = 1 to denote an _X_ error happened on edge _e_,
and otherwise _x_ ( _e_ ) = 0. When _e_ is a coarse-grained
edge consists of edges _{ei}_, we set _x_ ( _e_ ) to be
Lastly, the conditional marginal probability distribution _pe_ ( _x_ ( _e_ ) _|_ syndrome) of error on a coarse-grained
edge _e_ is denoted by _pe_ . Theoretically, _pe_ can be computed by enumerating all error configurations that
have the given syndrome. However, with renormalization group decoders and our neural decoders, we will
only be able to compute approximate distributions
_p_ <sup>_′_</sup> _e_ <sup>_≈_</sup> <sup>_pe_</sup> <sup>.</sup> <sup>Therefore,</sup> <sup>with</sup> <sup>a</sup> <sup>slight</sup> <sup>abuse</sup> <sup>of</sup> <sup>notation,</sup>
we will use _p_ <sup>_′_</sup> _e_ <sup>and</sup> <sup>_pe_</sup> <sup>interchangeably.</sup> <sup>We</sup> <sup>will</sup> <sup>also</sup>
use _pe_ to denote the physical error rate of an original
edge _e_ .
One renormalization stage consists of the following
(see Figure 2 for an example):
1. Divide the lattice into _m × m_ <sup>_′_</sup> unit cells, where
in this work _m_ = _m_ <sup>_′_</sup> = 2.
_x_ ( _e_ ) =
- _x_ ( _ei_ ) mod 2 _._ (3)
_i_
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 2
<u>0.08</u>
Belief
propagation
network
Postprocessing
input
RN block
0.08
0.08
coarse
graining
belief
propagation
<u>0.9</u>
0.1
0.99
pre-trained
2
0
~~0.01~~
~~0.99~~
Figure 2: An illustration of the first renormalization stage.
The numbers in the figure are made up by the author and
are likely not accurate. The left side is the physical lattice,
where the qubits have the same error rate. The dots represent the locations of violated parity checks. The right side is
the coarse-grained lattice. The dots indicate that the corresponding coarse-grained plaquettes contain an odd number
of violated parity checks. The numbers on coarse-grained
edges are _{p_ <sup>_′_</sup> _e_ <sup>(1)</sup> <sup>_}_</sup> <sup>,</sup> <sup>which</sup> <sup>are</sup> <sup>computed</sup> <sup>by</sup> <sup>belief</sup> <sup>propaga-</sup>
tion. With the help of _{p_ <sup>_′_</sup> _e_ <sup>(1)</sup> <sup>_}_</sup> <sup>,</sup> <sup>we</sup> <sup>can</sup> <sup>more</sup> <sup>reliably</sup> <sup>figure</sup>
out how the coarse-grained syndrome should be matched.
1
RN block
Dense Layers
output
2. The ideal outputs of the renormalization step are
_{pe}_ for each coarse-grained edge _e_ that is a border of a unit cell. However, we can only compute _{pe}_ approximately by using belief propagation, which is a heuristic procedure for computing marginal probabilities (see Appendix A).
These approximate _{p_ <sup>_′_</sup> _e_ <sup>_}_</sup> <sup>are</sup> <sup>treated</sup> <sup>as</sup> <sup>the</sup> <sup>er-</sup>
ror rate of the coarse-grained edge _e_ for the next
renormalization stage.
Figure 3: Structure of the entire network, and the training
order labeled by the blue circles. After loading the pre-trained
belief propagation network into RN block, the first step is to
train the dense layers, and the second step is to train all the
layers together. We will call the second step global training.
training process is to train the BP network with the
data generated by a handcrafted BP algorithm. This
means initially the inputs to the BP network are syndromes and error rates on each edge, and the outputs are supposed to approximate the error rates on
coarse-grained edges. However, later in the training
process (i.e. global training mentioned in section 3.2),
the BP network can deviate from this initial behavior.
The post-processing has two steps. The first step is
to remove the superficial complexity from the coarsegrained lattice. Whenever for a coarse-grained edge
_e_ has _pe_ (1) _>_ 0 _._ 5, we apply an _X_ on _e_ and switch
_pe_ (1) _↔_ _pe_ (0). If _e_ is on either of the two noncontractible loops _l_ 1 _,_ 2, then the desired logical correction will be updated accordingly. Although this step
only changes the representation of the data, and in
principle, neural nets can learn to do the same thing,
it is a quite costly step for neural nets as it can call
the parity function multiple times. The second step
is coarse-graining. We need to reduce the lattice size
by half, and for convenience, this is done by the first
layer of every belief propagation network. We also
compute the parity of four _⟨Bp⟩_ in each unit cell and
feed these parities to the next BP network as the effective syndrome of the coarse-grained lattice.
In more detail, the input to the BP network can
be packed in a tensor _I_ with shape ( _l, l,_ 3), where _l_ is
the initial lattice size or the output size of the precedent BP network. For example, we can set _I_ ( _i, j,_ 0)
to be _⟨Bp⟩_ on plaquette ( _i, j_ ), and _I_ ( _i, j,_ 1) _, I_ ( _i, j,_ 2)
to be the error rates corresponding to the top and left
qubits of the plaquette. Each BP network consists
of 13 convolution and 3 batch normalization layers.
The definition of convolution layers can be found in
Appendix B, and batch normalization is introduced
in [17]. The first layer reduces the lattice size _L_ by
half. The reasoning is that the belief propagation is
done based on 2 _×_ 2 unit cells. The remaining layers keep the lattice size unchanged. Among them,
At the end of the renormalization process, we obtain _pe_ for _e_ being either of the two non-contractible
loops. For simplicity, we assume the two noncontractible loops are _l_ 1 _,_ 2. Thus, we get an approximation of the marginal probability distribution for
logical correction.
### 3 Design and Training of the Neural nets
At a first glance, to build a neural decoder, we can
simply train a convolutional neural net with inputoutput pairs (syndrome, logical correction). However,
in practice, this does not allow us to get a good enough
performance. A detailed description of some simpler
approaches and discussion will be presented in Appendix C. Those failures eventually motivate us to
design and train the neural decoder in the following
way.
3.1 Design of the network
The network follows the same structure as the renormalization decoder. Most of the network is repetitively applying the renormalization block, which is
depicted in Figure 3. The belief propagation (BP)
network, as its name suggested, is intended to approximate the BP process (see Appendix A for an
introduction). More concretely, the first step of the
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 3
only four involve communication between unit cells,
i.e. the kernels of these four convolution layers have
size 3 _×_ 3. They spread evenly in the 13-layer network. Other layers only have kernels of size 1 _×_ 1,
which can then be viewed as computation inside unit
cells. The rationale behind this is that the messages
likely need to be processed before the next round of
communication. The batch normalization layers also
spread evenly, with the hope that they can make the
training more stable.
After the renormalization process reduces the lattice to a size of 2 _×_ 2, we apply 4 dense layers (a.k.a
fully-connected layers). Note that the dense layers
conveniently break the translational symmetry imposed by the convolution layers. In the end, we have a
neural network with input shape ( _L, L,_ 3) and output
shape (2) <sup>_1_</sup> . The input shape is ( _L, L,_ 3) because this is
the input shape of BP networks. For _L_ = 64, the total
number of trainable layers in the network is around
60, which is very large compared to early deep neural networks [14]. However, most of the computation
cost and the trainable parameters are concentrated
in the 16 convolution layers with kernel size 3 _×_ 3.
Combining this and the careful training strategy we
describe below, we find that the training can be done
very efficiently.
3.2 Training
In general, training neural networks becomes harder
when the number of layers increases. This is often
attributed to the instability of gradient backpropagation. Considering we have a very deep neural network,
we should find a way to train parts of the network
first. The training is divided into two stages. First,
we train the belief propagation network to indeed do
belief propagation (BP). This corresponding to the
blue circle with 0 in Figure 3. To do this, we implement a BP algorithm and use it to generate training data for the network. More concretely, we first
assign a random error rate _e_ <sup>_−k_</sup> to each edge, where
_k_ _∈_ [0 _._ 7 _,_ 7] from a uniform distribution. The choice
of the distribution is quite arbitrary. Then we sample error on each edge according to its error rate and
compute the syndrome. After that, we feed both the
error rates and syndrome into our handcrafted BP algorithm, which will output an estimation of the error
rates _pe_ corresponding to the coarse-grained edges.
We can subsequently train the BP network with the
same input-output relation. An important detail is
that we transform the error rates _pe_ (1) in both input and output to _re_ = log ( _pe_ (1) _/pe_ (0)). The reason
behind this is described in Appendix C.
Next, we load the pre-trained belief propagation
network into the decoder network described in the
previous subsection. To ensure _re_ stay bounded, we
_1_ For efficient training, an additional dimension called batch
size will be added.
Figure 4: Logical accuracy versus physical error rate. The
neural decoders are trained at physical error rate 9%. For
the three solid lines, the decoder has been trained globally,
while the dashed lines it has not. The colors of the dashed
lines indicate the code distance they are evaluated on. The
vertical grid indicates the physical error rates for which we
evaluate the logical accuracy.
perform a rescale _re_ _→_ 7 _re/_ max _e |re|_ before feed it
into next RN block (the choice of 7 here is arbitrary).
We can then train the dense layers and afterward the
whole network with input-output pairs (syndrome,
logical correction). These two trainings correspond to
the blue circle 1 and 2 in Figure 3, respectively. The
training data is measurable in experiments in these
two training.
We train the decoders for different lattice sizes
_L_ separately. Although this makes the concept of
threshold pointless, it is still useful to estimate the
“threshold” so that we can have a rough comparison
of the neural decoder with the existing ones. For this,
we train the decoder for different _L_ with the same
amount of stochastic gradient steps, which also implies the optimizer sees the same amount of training
data for each _L_ . In addition, the training for each _L_
is done under 1 hour (on the year 2016 personal computer with 1 GPU). We consider this to be a fairly
strict policy. The result is plotted in Figure 4. We
can also forgo this strict policy and spend more time
in training the neural decoder for _d_ = 64 toric code,
which gives rise to Figure 5. The training time is still
under 2 hours. More details about the design and
training can be found in Appendix D and the source
code [4], and more discussion about the numerical results can be found in the following section.
### 4 Numerical results
For the strict training policy, we plot the logical accuracies versus the physical error rates in Figure 4.
Logical accuracy is simply (1 _−_ logical error rate) and
is averaged over the two logical qubits. For the solid
lines, the decoders have been trained globally, i.e.
have done both steps 1 and 2 in Figure 3. For the
1.0
0.9
0.8
0.7
0.6
0.5
0.080 0.085 0.090 0.095 0.100 0.105 0.110
physical error rate
d = 16
d = 32
d = 64
No global training
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 4
1.00
0.95
0.90
0.85
0.80
0.75
0.70
0.65
d = 16 MWPM
d = 64 MWPM
d = 16 NN strict policy
d = 64 NN more training
d = 64 NN strict policy
0.080 0.085 0.090 0.095 0.100 0.105 0.110
physical error rate
Figure 5: In this figure, we compare the performance of our
neural decoders to the MWPM algorithm. The solid line for
_d_ = 16 and the dashed line for _d_ = 64 decoder are using
the strict training policy, while more training has been done
on the _d_ = 64 decoder corresponding to the solid line. The
“star” points are the performance of the minimum-weight
perfect matching algorithm. The colors of stars indicate the
code distance they are evaluated on. The vertical grid indicates the physical error rates for which we evaluate the logical
accuracy for the lines. We see the performance of neural decoders can be almost as good as MWPM for a decent range
of physical error rates.
dashed lines, the decoders only did step 1, i.e. only
the dense layers are trained. The colors of the dashed
lines indicate the code distance they are evaluated on.
The vertical grid indicates the physical error rates for
which we evaluate the logical accuracy, where for each
point we sample 10 <sup>4</sup> (syndrome, logical correction)
pairs. We can see that the solid lines cross around
_p_ physical = 0 _._ 095; therefore we might say our neural
decoder has an effective threshold around 9 _._ 5%. It can
be seen that the global training is crucial for getting
a decent performance because without it the effective
threshold will be below 8%.
We can also spend more time to train the _d_ = 64 decoder, and then compare the performance of the neural decoders to the minimum-weight perfect matching
algorithm (MWPM) in Figure 5. The “star” points
are the logical accuracies of MWPM, where each one
is evaluated by 3000 trials. The _d_ = 16 decoder corresponding to the solid line and the _d_ = 64 decoder
corresponding to the dashed line are from the strict
training policy. The _d_ = 64 decoder corresponding to
the solid line is obtained by doing more training while
having the same network architecture. We see that
without the strict training policy, the performance of
the neural decoder is almost identical to MWPM for
a decent range of physical error rates. We can also
compare to the renormalization group (RG) decoder
in [2], where the authors have shown a threshold of
8 _._ 2% when using 2 _×_ 1 unit cell, and claim a threshold
around 9 _._ 0% if using 2 _×_ 2 unit cell. With the strict
training policy, our neural decoder is slightly better
or at least comparable to the RG decoder, while with
out the policy our neural decoder is clearly better for
_d ≤_ 64.
### 5 Discussion
One obvious question is whether we can get a good
neural decoder for surface code or other topological
codes on large lattices. In the case of surface code,
the major difference compared to the toric code is the
existence of boundaries. This means we have to inject
some non-translational invariant components into the
network. For example, we can have a constant tensor _B_ with shape ( _L, L,_ 2) marks the boundary, e.g.
_B_ ( _x, y, i_ ) = 1 if ( _x, y_ ) is at the smooth boundary and
_i_ = 0, or if ( _x, y_ ) is at the rough boundary and _i_ = 1;
otherwise _B_ ( _x, y, i_ ) = 0. We then stack _B_ with the
old input tensor before feed into the neural decoder.
More generally, if a renormalization group decoder exists for a topological code, we anticipate that a neural
decoder can be trained to have similar or better performance. For example, neural decoders for surface
code with measurement errors, for topological codes
with abelian anyons can be trained following the same
procedure described in this paper.
Another question we want to discuss is the viability of our neural decoder at low physical error rates.
On the one hand, we can train our neural decoders to
approximate the RG decoder, and therefore they can
have similar performance at low error rates. On the
other hand, it will be much harder to improve neural
decoders just by training on experimental data, because it will take a long time to encounter syndromes
that are decoded incorrectly. Therefore, we should
expect neural decoders to gradually lose the ability
to adapt to experimental noise models as the physical
error rates decrease.
We want to discuss a bit more about running neural networks on specialized chips. It is straightforward to run our neural decoder on GPU or TPU [18]
as they are supported by Tensorflow [19], the neural network library used in this work. There is software (e.g. OpenVINO) to compile common neural networks to run on commercially available fieldprogrammable gate arrays (FPGAs), but we do not
know how easy it is for our neural decoder <sup>_2_</sup> . Apart
from power efficiency, there is a study about operating FPGAs at 4K temperature [20]. Overall, there is
a possibility to run neural decoders at low temperature. Note that for running on FPGAs or benchmarking the speed, it is likely a good idea to first compress
the neural networks, see [21].
_2_ The only uncommon component of our neural decoder is
element-wise parity function.
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 5
### 6 Acknowledgement
The author wants to thank Ben Criger, Barbara Terhal, Thomas O’Brien for useful discussion. The implementation of minimum-weight perfect matching algorithm, including the one used in Appendix E, is provided by Christophe Vuillot, which uses the backend
from either Blossom V [22] or NetworkX [23]. The
author acknowledge support through the ERC Consolidator Grant No. 682726.
### References
[1] A.Yu. Kitaev. Fault-tolerant quantum computa
tion by anyons. _Annals_ _of_ _Physics_, 303(1):2–30,
jan 2003. DOI: [10.1016/s0003-4916(02)00018-0.](https://doi.org/10.1016/s0003-4916%0x2802%0x2900018-0)
[2] Guillaume Duclos-Cianci and David Poulin. Fast
decoders for topological quantum codes. _Phys-_
_ical_ _review_ _letters_, 104(5):050504, 2010. [DOI:](https://doi.org/10.1103/PhysRevLett.104.050504)
[10.1103/PhysRevLett.104.050504.](https://doi.org/10.1103/PhysRevLett.104.050504)
[3] Guillaume Duclos-Cianci and David Poulin.
Fault-tolerant renormalization group decoder for
abelian topological codes. _Quantum_ _Information_
_&_ _Computation_, 14(9-10):721–740, 2014.
[4] `[https://github.com/XiaotongNi/](https://github.com/XiaotongNi/toric-code-neural-decoder)`
`[toric-code-neural-decoder](https://github.com/XiaotongNi/toric-code-neural-decoder)` .
[5] Paul Baireuther, Thomas E. O'Brien, Brian
Tarasinski, and Carlo W. J. Beenakker. Machinelearning-assisted correction of correlated qubit
errors in a topological code. _Quantum_, 2:48, jan
2018. DOI: [10.22331/q-2018-01-29-48.](https://doi.org/10.22331/q-2018-01-29-48)
[6] Savvas Varsamopoulos, Ben Criger, and Koen
Bertels. Decoding small surface codes with
feedforward neural networks. _Quantum_ _Science_
_and_ _Technology_, 3(1):015004, nov 2017. [DOI:](https://doi.org/10.1088/2058-9565/aa955a)
[10.1088/2058-9565/aa955a.](https://doi.org/10.1088/2058-9565/aa955a)
[7] Giacomo Torlai and Roger G Melko. A neural de
coder for topological codes. _Physical_ _Review_ _Let-_
_ters_, 119(3):030501, 2017. DOI: [10.1103/Phys-](https://doi.org/10.1103/PhysRevLett.119.030501)
[RevLett.119.030501.](https://doi.org/10.1103/PhysRevLett.119.030501)
[8] Nikolas P. Breuckmann and Xiaotong Ni. Scal
able neural network decoders for higher dimensional quantum codes. _Quantum_, 2:68, may 2018.
DOI: [10.22331/q-2018-05-24-68.](https://doi.org/10.22331/q-2018-05-24-68)
[9] Paul Baireuther, MD Caio, B Criger, Carlo WJ
Beenakker, and Thomas E O’Brien. Neural network decoder for topological color codes with circuit level noise. _New_ _Journal_ _of_ _Physics_, 21(1):
013003, 2019. DOI: [10.1088/1367-2630/aaf29e.](https://doi.org/10.1088/1367-2630/aaf29e)
[10] Stefan Krastanov and Liang Jiang. Deep neural network probabilistic decoder for stabilizer
codes. _Scientific_ _Reports_, 7(1), sep 2017. [DOI:](https://doi.org/10.1038/s41598-017-11266-1)
[10.1038/s41598-017-11266-1.](https://doi.org/10.1038/s41598-017-11266-1)
[11] Nishad Maskara, Aleksander Kubica, and Tomas
Jochym-O’Connor. Advantages of versatile
neural-network decoding for topological codes.
_Physical_ _Review_ _A_, 99(5):052351, 2019. [DOI:](https://doi.org/10.1103/PhysRevA.99.052351)
[10.1103/PhysRevA.99.052351.](https://doi.org/10.1103/PhysRevA.99.052351)
[12] Christopher Chamberland and Pooya Ronagh.
Deep neural decoders for near term fault-tolerant
experiments. _Quantum_ _Science_ _and_ _Technol-_
_ogy_, 3(4):044002, jul 2018. DOI: [10.1088/2058-](https://doi.org/10.1088/2058-9565/aad1f7)
[9565/aad1f7.](https://doi.org/10.1088/2058-9565/aad1f7)
[13] Yann LeCun et al. Generalization and network
design strategies. _Connectionism_ _in_ _perspective_,
pages 143–155, 1989.
[14] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E
Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C.
Burges, L. Bottou, and K. Q. Weinberger, editors, _Advances_ _in_ _Neural_ _Information_ _Processing_
_Systems 25_, pages 1097–1105. Curran Associates,
Inc., 2012.
[15] Alexandre Attia and Sharone Dayan. Global
overview of imitation learning. 2018.
[16] Eliya Nachmani, Yair Be'ery, and David Bur
shtein. Learning to decode linear codes using deep learning. In _2016_ _54th_ _Annual_ _Aller-_
_ton Conference on Communication,_ _Control,_ _and_
_Computing_ _(Allerton)_ . IEEE, sep 2016. [DOI:](https://doi.org/10.1109/allerton.2016.7852251)
[10.1109/allerton.2016.7852251.](https://doi.org/10.1109/allerton.2016.7852251)
[17] Sergey Ioffe and Christian Szegedy. Batch nor
malization: Accelerating deep network training
by reducing internal covariate shift. 2015.
[18] Norman P. Jouppi, Al Borchers, Rick Boyle,
Pierre luc Cantin, Clifford Chao, Chris Clark,
Jeremy Coriell, Mike Daley, Matt Dau, Jeffrey
Dean, Ben Gelb, Cliff Young, Tara Vazir Ghaemmaghami, Rajendra Gottipati, William Gulland,
Robert Hagmann, C. Richard Ho, Doug Hogberg, John Hu, Robert Hundt, Dan Hurt, Julian Ibarz, Nishant Patil, Aaron Jaffey, Alek
Jaworski, Alexander Kaplan, Harshit Khaitan,
Daniel Killebrew, Andy Koch, Naveen Kumar,
Steve Lacy, James Laudon, James Law, David
Patterson, Diemthu Le, Chris Leary, Zhuyuan
Liu, Kyle Lucke, Alan Lundin, Gordon MacKean, Adriana Maggiore, Maire Mahony, Kieran
Miller, Rahul Nagarajan, Gaurav Agrawal, Ravi
Narayanaswami, Ray Ni, Kathy Nix, Thomas
Norrie, Mark Omernick, Narayana Penukonda,
Andy Phelps, Jonathan Ross, Matt Ross, Amir
Salek, Raminder Bajwa, Emad Samadiani, Chris
Severn, Gregory Sizikov, Matthew Snelham, Jed
Souter, Dan Steinberg, Andy Swing, Mercedes
Tan, Gregory Thorson, Bo Tian, Sarah Bates,
Horia Toma, Erick Tuttle, Vijay Vasudevan,
Richard Walter, Walter Wang, Eric Wilcox,
Doe Hyun Yoon, Suresh Bhatia, and Nan Boden.
In-datacenter performance analysis of a tensor
processing unit. In _Proceedings_ _of_ _the_ _44th_ _An-_
_nual_ _International_ _Symposium_ _on_ _Computer_ _Ar-_
_chitecture_ _-_ _ISCA_ _'17_ . ACM Press, 2017. [DOI:](https://doi.org/10.1145/3079856.3080246)
[10.1145/3079856.3080246.](https://doi.org/10.1145/3079856.3080246)
[19] Martín Abadi, Ashish Agarwal, Paul Barham,
Eugene Brevdo, Zhifeng Chen, Craig Citro,
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 6
Greg S. Corrado, Andy Davis, Jeffrey Dean,
Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael
Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz
Kaiser, Manjunath Kudlur, Josh Levenberg,
Dandelion Mané, Rajat Monga, Sherry Moore,
Derek Murray, Chris Olah, Mike Schuster,
Jonathon Shlens, Benoit Steiner, Ilya Sutskever,
Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol
Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL `[https://www.](https://www.tensorflow.org/)`
`[tensorflow.org/](https://www.tensorflow.org/)` . Software available from tensorflow.org.
[20] I. D. Conway Lamb, J. I. Colless, J. M. Horni
brook, S. J. Pauka, S. J. Waddy, M. K.
Frechtling, and D. J. Reilly. An FPGA-based instrumentation platform for use at deep cryogenic
temperatures. _Review_ _of_ _Scientific_ _Instruments_,
87(1):014701, jan 2016. [DOI: 10.1063/1.4939094.](https://doi.org/10.1063/1.4939094)
[21] Yu Cheng, Duo Wang, Pan Zhou, and Tao
Zhang. Model compression and acceleration
for deep neural networks: The principles,
progress, and challenges. _IEEE_ _Signal_ _Process-_
_ing_ _Magazine_, 35(1):126–136, jan 2018. [DOI:](https://doi.org/10.1109/msp.2017.2765695)
[10.1109/msp.2017.2765695.](https://doi.org/10.1109/msp.2017.2765695)
[22] Vladimir Kolmogorov. Blossom v: a new
implementation of a minimum cost perfect
matching algorithm. _Mathematical_ _Program-_
_ming_ _Computation_, 1(1):43–67, apr 2009. [DOI:](https://doi.org/10.1007/s12532-009-0002-8)
[10.1007/s12532-009-0002-8.](https://doi.org/10.1007/s12532-009-0002-8)
[23] Aric Hagberg, Dan Schult, Pieter Swart, et al.
Networkx, 2004–. URL `[https://networkx.](https://networkx.github.io/)`
`[github.io/](https://networkx.github.io/)` .
[24] Gabriel Goh. Why momentum really works. _Dis-_
_till_, 2017. DOI: [10.23915/distill.00006.](https://doi.org/10.23915/distill.00006)
[25] Yoshua Bengio and Yann LeCun. Scaling learn
ing algorithms towards ai. _Large-scale kernel ma-_
_chines_, 34(5):1–41, 2007.
[26] Dumitru Erhan, Yoshua Bengio, Aaron
Courville, Pierre-Antoine Manzagol, Pascal
Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? _Journal_
_of_ _Machine_ _Learning_ _Research_, 11(Feb):625–660,
2010.
[27] Andrew L Maas, Awni Y Hannun, and Andrew Y
Ng. Rectifier nonlinearities improve neural network acoustic models. In _Proceedings_ _of_ _the_ _30th_
_International_ _Conference_ _on_ _Machine_ _Learning_,
volume 28 of _JMLR_ _Workshop_ _and_ _Conference_
_Proceedings_, Atlanta, Georgia, USA, 2013.
[28] Diederik Kingma and Jimmy Ba. Adam: A
method for stochastic optimization. _3rd_ _Interna-_
_tional_ _Conference_ _for_ _Learning_ _Representations,_
_San_ _Diego_, 2015. URL `[https://arxiv.org/](https://arxiv.org/abs/1412.6980)`
`[abs/1412.6980](https://arxiv.org/abs/1412.6980)` .
### A Implementation of Belief Propaga- tion Algorithm
Belief propagation is a heuristic procedure for computing marginal probabilities of graphical models. We
choose to use a slightly different belief propagation
implementation compared to [2], as ours seems to be
more natural for the bit-flip noise model. We divide
the lattice into 2 _×_ 2 unit cells. Let _G_ be a bipartite graph, where one part corresponds to unit cells,
and another part to coarse-grained edges. Two vertices in _G_ is connected when the coarse-grained edge
is adjacent to the unit cell. This later decides how the
messages flow in the graph. However, we assign two
variables _{x_ ( _ei_ ) _, x_ ( _ej_ ) _}_ to each vertex corresponding
a coarse-grained edge which _ei_ and _ej_ form. In this
section, the symbol _e_ or _ei_ will denote original edges
of the lattice (i.e. not coarse-grained). We define _E_
to be the set of all edges _e_, _Ecg_ _⊂_ _E_ to be the set of
_e_ which are components of coarse-grained edges (i.e.
red edges in Figure 1), and _E_ <sup>¯</sup> _cg_ = _E_ _\ Ecg_ . Given a
syndrome _S_, the unnormalized probability of an error
configuration _⃗x ≡{x_ ( _e_ ) _}e∈E_ can be written as
where the product is taken over all unit cells _c_, and
_{x_ ( _e_ ) _}c_ are the set of _x_ ( _e_ ) such that _e_ _∈_ _Ecg_ is adjacent to _c_ . We can then apply the standard belief
propagation to the graph _G_ . Without further explanation, we choose to use the following rule. A unit
cell _ck_ sends to each of its adjacent cell _cn_ a message
containing 4 real numbers
_{mck,cn_ ( _x_ ( _ei_ ) _, x_ ( _ej_ )) _}_ for _x_ ( _ei_ ) _, x_ ( _ej_ ) = 0 _,_ 1 _,_ (6)
where _ei_ and _ej_ form the coarse-grained edge between
_ck_ and _cn_ . When we already fix an error configuration
_x_, we may use the simplified notations
_pe_ _≡_ _pe_ ( _x_ ( _e_ )) _,_ _mck,cn_ _≡_ _mck,cn_ ( _x_ ( _ei_ ) _, x_ ( _ej_ )) _._
(7)
To compute an out-going message from cell _c_, we take
messages from the other three directions, and consider
them to be the probability of error configuration on
respective edges. We then sum over all error configurations in the cell, which give the correct syndrome
of the 4 plaquette stabilizer checks. More concretely,
we define _⃗xc_ to be _⃗x_ restricted to edges in _c_ (i.e. all
edges in Figure 6), and _g_ <sup>_′_</sup> ( _S,⃗xc_ ) checks whether _⃗xc_ is
compatible with _S_ similar to _g_ . We assume we want
_p_ ( _⃗x_ ) = _g_ ( _S,⃗x_ )
_e∈E_
_pe_ ( _x_ ( _e_ )) _,_ (4)
where _g_ ( _S,⃗x_ ) = 1 if _⃗x_ has syndrome _S_, and otherwise
_g_ ( _S,⃗x_ ) = 0. It is obvious _g_ ( _S,⃗x_ ) can be factorized
to local terms. Thus, the marginal distribution for
_e ∈_ _Ecg_ can then be factorized according to _G_ as
_{x_ ( _e_ ) _,e∈E_ <sup>¯</sup> _cg}_
_p_ ( _⃗x_ ) =
_c_
_fc_ ( _{x_ ( _e_ ) _}c_ ) _,_ (5)
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 7
Figure 6: An illustration of message passing for a unit cell.
to send the messages from _c_ to _cn_, while the incoming
messages are from cells _I_ = _{ck}_ . Then we have
One important requirement is that _f_ is (almosteverywhere) differentiable with respect to _⃗w_ . This
allows us to train the network with gradient descent,
for which a good introduction can be found in [24].
In general, we can expect gradient descent will take
us to a local minimum or some region with very small
gradients. This is the advantage of “end-to-end” training compared to human-written heuristic algorithms,
as the latter are unlikely to be a local optimum (assuming we can add real number parameters to those
heuristic algorithms). A common loss function for
classification problems is cross-entropy. Assume we
have a dataset _D_ = _{_ ( _xi, yi_ ) _}_ where _yi_ _∈{_ 0 _,_ 1 _}_, and
the neural network output _yi_ <sup>_′_</sup> <sup>which</sup> <sup>tries</sup> <sup>to</sup> <sup>approxi-</sup>
mate Prob( _yi_ = 1), the cross-entropy loss function is
then calculated as following:
_−_
_ck∈I_
- _pei._ (8)
_mc,cn_ =
- _g_ <sup>_′_</sup> ( _S,⃗xc_ )
_xc_
_mck,c_
_i_ <sup>_′_</sup> <sup>))</sup> <sup>_._</sup> (11)
_i_
( _yi_ log _yi_ <sup>_′_</sup>
_i_ <sup>_′_</sup> <sup>+ (1</sup> <sup>_−_</sup> <sup>_yi_</sup> <sup>) log (1</sup> <sup>_−_</sup> <sup>_y_</sup> _i_ <sup>_′_</sup>
For the last term <sup>�</sup> _pei_, the product is taken over the
blue edges in Figure 6, assuming _cn_ is on the right of
_c_ .
In the end of the message passing, we can compute
the marginal probability by
- _,_ (9)
Note that when we use the notation Prob( _yi_ = 1), we
implicitly assume _D_ is obtained by sampling from an
underlying probability distribution.
More concretely, most neural networks consist of
many layers. In this paper, the two relevant types
of layers are the dense and convolution layer. Dense
layers (a.k.a fully-connected layers) have the form
_g_ ( _A⃗x_ + _⃗b_ ), where _g_ is some non-linear function applied
entrywise, and the matrix _A_, vector _⃗b_ are the trainable
parameters. Assuming _A_ has a shape of _n × m_, we
will say the output dimension of the dense layer is _n_ .
One convolution layer, as the name suggests, contains
a collection of discrete convolutions. For this paper,
the input to the layer resides on a 2-dimensional lattice of size _l_ <sup>2</sup> with periodic boundary condition. On
each lattice site, there is a _d_ -dimensional input vector
_x⃗u_ _∈_ R <sup>_d_</sup>, where the subscript _⃗u_ _∈_ Z <sup>2</sup> _l_ <sup>(we</sup> <sup>use</sup> <sup>Z</sup> <sup>_l_</sup> <sup>to</sup>
_P_ ( _x_ ( _ei_ ) _, x_ ( _ej_ )) = _mck,cnmcn,ck_ _/_
- _peipej_
where _ei_ and _ej_ are the edges between _cn_ and _ck_ . From
the joint distribution _P_ ( _x_ ( _ei_ ) _, x_ ( _ej_ )) we can compute
the distribution _P_ ( _x_ ( _ei_ ) + _x_ ( _ej_ ) mod 2). It is not
hard to see that the above message passing rules will
lead to the correct marginal probability when the underlying graph is a tree (note this is not the case for
the square lattices we are considering). To generate
training data for neural networks, we do 7 rounds of
message passing defined above.
The key differences between our implementation
and the one in [3] is
- Ours utilizes all four stabilizer checks in each unit
cell while in [3] only three are used.
- Each message contains 4 real numbers in our implementation while only 1 in [3].
### B Introduction to Neural Networks
A neural network, at the highest abstraction, can
just be viewed as a black-box function _f_ nn( _x,⃗w_ ) with
many parameters _⃗w_ to be tuned. We want _f_ to describe the input-output relation presented in a dataset
_D_ = _{_ ( _xi, yi_ ) _}_ . To do this <sup>_3_</sup>, we choose a (smooth) loss
function _L_, and then we do the minimization
_x⃗u_ _∈_ R <sup>_d_</sup>, where the subscript _⃗u_ _∈_ Z <sup>2</sup> _l_ <sup>(we</sup> <sup>use</sup> <sup>Z</sup> <sup>_l_</sup> <sup>to</sup>
denote integer in range [0 _, l−_ 1]). We define the kernel
to be a tensor _K⃗u,i_, where _⃗u_ _∈_ Z <sup>2</sup> _n_ <sup>and</sup> <sup>_i_</sup> <sup>_∈_</sup> <sup>Z</sup> <sup>_d_</sup> <sup>.</sup> <sup>With</sup>
to be a tensor _K⃗u,i_, where _⃗u_ _∈_ Z <sup>2</sup> _n_ <sup>and</sup> <sup>_i_</sup> <sup>_∈_</sup> <sup>Z</sup> <sup>_d_</sup> <sup>.</sup> <sup>With</sup>
a slight abuse of notation, we will say such a kernel
has size _n_ <sup>2</sup> . The convolution is then
_i∈_ Z _d_
_y⃗v_ =
_u∈_ Z <sup>2</sup> _n_
_x⃗v−⃗u,iK⃗u,i,_ (12)
_i_
where _x⃗v−⃗u,i_ is the _i_ th element of _x⃗v−⃗u_, and _⃗v_ _−⃗u_
is calculated module _l_ because of the periodic boundary condition. We will have a collection of kernels
_{K⃗u,i,j}j_ for one convolution layer, which means we
also have a collection of outputs _{y⃗v,j}j_ . The cardinality of _{K⃗u,i,j}j_ is conventionally called the number
of filters. After Equation 12, we can also apply a nonlinear function _g_ entrywise if needed.
Before concluding this section, let us make one clarification. In this paper, sometimes we only train part
of the network, e.g. for blue circle 1 in Figure 3 we
only train the dense layers. Assuming _⃗w_ 1 are the parameters in the part of the network we want to train
and _⃗w_ 2 are the rest, then we are doing the optimiza
min
_w_
min
_L_ ( _f_ ( _xi,⃗w_ ) _, yi_ ) _._ (10)
_3_ In this work, we choose to not study the effect of overfitting,
as we have the ability to generate infinite data.
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 8
tion
Block RN1 RN2 RN3 RN4 Dense
Cross-entropy 0.16 0.22 0.28 0.4 0.5
Accuracy 0.93 0.90 0.86 0.79 0.58
Table 1: Cross-entropy and accuracy after each renormalization block when we do the training block by block. It is done
with a bit-flip error rate 0 _._ 08. Although the accuracy after
the first RN block is comparable to the input error rate, it
gradually decreases until barely above 0 _._ 5
and coming from a single training instance. However,
the author has observed the same trend many times
that the loss and accuracy slowly degrade in the process of renormalization, even though the error rate
is way below the theoretical threshold. To diagnose
the reason, we first notice that the first RN block actually performs reasonably well. This suggests that
the optimizer is capable of training each RN block
alone. Assume this is indeed the case, the degrading
of performance is likely caused by the following two
reasons.
First, later in the renormalization process, if we
look at the coarse-grained syndrome or _pe_ alone, they
behave more and more like white noise. While it
is possible for the neural nets to do the same postprocessing described in section 3.1, a few layers of
the network will be occupied by this. Therefore, the
natural solution is to implement the post-processing
ourselves. By doing this, we suspect it is possible to
reach a threshold of 8%, but apparently 8% is still not
good enough.
The second reason is related to the convergence of
_pe_ . When below the threshold, we will encounter very
often that _pe_ is very close to 0 or 1. For example, if
_x_ ( _e_ ) = 1 vs _x_ ( _e_ ) = 0 corresponding to a weight 4 vs
weight 1 local configuration, then we will have _pe_ _≈_
_p_ <sup>3</sup> 0 <sup>, where</sup> <sup>_p_</sup> <sup>0</sup> <sup>is the initial error rate.</sup> <sup>This will become</sup>
more prominent later in the renormalization process,
as _pe_ from the previous renormalization stage become
the error rate in the next stage. It is important to
know how close to 0 (or 1) _pe_ is on the logarithmic
scale. Otherwise, in the later stage, the information
will not be accurate enough to deduce configuration
close to the minimum weight of errors. This poses the
following requirements:
- When we pass _pe_ to some intermediate layer of
a neural net, it should be able to distinguish between small _pe_ . However, recall that each layer
does the computation _f_ ( _Ax_ + _b_ ), where _f_ has a
bounded derivative. Thus, to distinguish a set of
small _{pe}_, we need _∥A∥∼_ 1 _/_ min _{pe}_ . This will
either not be achieved by training or cause instability of the network. Another issue related to
the minuscule nature of _pe_ is the cross-entropy
loss function does not provide enough motivation for _pe_ to converge to the target value _q_ in
log-scale. More accurately, the derivative of the
cross-entropy scales like _O_ ( _|pe −_ _q|_ ) when _pe_ _≈_ _q_,
min
_w_ 1
_i_
_L_ ( _f_ ( _xi,⃗w_ 1 _,⃗w_ 2) _, yi_ ) (13)
by using some gradient descent optimizer.
### C Comparison to Simpler Approachers
In this section, we will show the performance of the
neural net decoders when trained with simpler approaches (more precisely, approaches with less human
involvement and prior knowledge of toric code decoding), and provide some reasoning if possible. The neural nets will be the same as the ones we used in the
main text, except that they do not contain the “removing complexity” step in the post-processing. We
will see in general the performance gets much worse,
especially when the lattice size grows large. However,
this does not mean these simpler approaches will always fail. It just implies that a large amount of training time / human involvement is needed, which could
make them impossible in practice.
The simplest approach is to train the whole network with input-output pairs (syndrome, logical correction). During limited attempts, this approach does
not produce decoders much better than random guess
for large toric codes. A hand-waving explanation is
the following. It is fair to assume a lot of parity functions need to be evaluated during the decoding process. It is known that the parity is not an easy function for neural nets to compute [25], and one good
way to approximate it is to increase the depth of the
network. So let us assume each renormalization stage
needs 5 layers. This means to decode _L_ = 32 toric
code, the network will have 25 layers, which exceeds
the range where neural nets can be reliably trained.
The problem of too many layers can be alleviated
if we can pre-train the earlier layers of the network.
A similar strategy was used in training neural nets
for computer vision problems [26]. For the bit-flip
noise model, we can pre-train the earlier layers to
mimic the renormalization group decoder. Recall in
section 2, we mentioned that for the renormalization
group decoder, the output corresponding to a coarsegrained edge _e_ is _pe_ . Since we generate syndromes by
first sampling _x_ ( _e_ ) for all (not coarse-grained) edges _e_,
we also have the ability to generate pairs (syndrome,
_{x_ ( _e_ ) _}_ for coarse-grained edges _e_ ) for training. Although _{x_ ( _e_ ) _}_ in the above pairs are binary numbers,
with the cross-entropy as the cost function, in theory
the output will converge to _pe_ (1). The pre-training
is done one renormalization block at a time. More
concretely, with the network we are using in the main
text, we will train the output of the 12th layer with
the training target of first renormalization block, and
the output of the 24th layer with the second block, etc.
We can try this method on _L_ = 32 toric code and bitflip error rate 0 _._ 08. It does not work well, as we can
see in Table 1. These numbers are not very accurate
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 9
which will be too small before the convergence
in log-scale. A natural solution is we replace the
appearance of _pe_ with log _pe −_ log(1 _−_ _pe_ ).
- Even with a good representation of _pe_, we shall
still be very cautious about the training, as we
are trying to estimate very small _pe_ from sampling. In the end, we decide to implement a belief propagation routine and use the input-output
pair from the routine to train the network. The
advantage is that belief propagation directly outputs the probability, which should be reasonably
accurate in the logarithmic scale. Therefore, we
can get a much stable training process.
### D Technical Details
The objective of this section is to describe some technical details for people who do not plan to read the
source code.
For the majority of network, we use leaky ReLUs [27] as the activation function, which has the
form
_y_ = _x_ if _x >_ 0; _y_ = 0 _._ 2 _x_ if _x ≤_ 0 (14)
Apart from the last layer of each renormalization
block and the last dense layer, the number of filters in
each convolution layer is 200, and the output dimension of each dense layer is 50.
For training a belief propagation network, we generate a dataset of size 80000. The dataset consists of the
input and output of the belief propagation algorithm
described in Appendix A when applied to _d_ = 16
toric code. The optimizer we use is the ADAM [28].
The learning rate parameter of the optimizer is set to
7 _×_ 10 <sup>_−_</sup> <sup>4</sup> for training belief propagation network, 10 <sup>_−_</sup> <sup>3</sup>
for training dense layers, 7 _×_ 10 <sup>_−_</sup> <sup>5</sup> for global training
of _L_ = 16 _,_ 32 lattice, and 7 _×_ 10 <sup>_−_</sup> <sup>6</sup> for _L_ = 64. The
batch size for training is 50. The training of the dense
layers uses around 1000 batches. For the strong policy, the global training uses 3000 batches regardless of
the code distance. To see the potential of our neural
decoder at _d_ = 64, we also did a longer training and
compared it to MWPM in Figure 5. In total, it is
trained using 18000 batches. The first 12000 batches
are trained on physical error rate _p_ = 0 _._ 09, and the
last 6000 batches are on _p_ = 0 _._ 095. The reason of
switching to a higher error rate for late-stage training
is that the accuracy at _p_ = 0 _._ 09 is too close to 1 for
effective training.
### E Spatially Varying Error Rates
A natural use of the neural decoder is to train it with
experimental data. Naturally, the noise models in the
experiments will not be translational invariant. There
are two simple ways to reconcile this fact with the
translational-invariance of convolutional neural nets:
1. Allow the first few layers of the network to be
non-translational invariant.
2. Introduce site-dependent trainable variables to
the networks.
In this section, we will consider the error model that
has varying bit-flip error rates across the lattice. For
this, we can use the second approach, where the sitedependent variables can in principle represents the
varying error rates. In fact, recall that the neural
decoder has an input shape ( _L, L,_ 3), which contains
2 _L_ <sup>2</sup> numbers that are originally error rates feeding
into belief propagation. Thus we can simply feed the
site-dependent variables into the neural decoder and
then train them.
However, there is still a complication regarding the
starting point of this training. A natural choice is
to start with the trained neural decoder for uniform
error rate and only train the site-dependent variables.
With this route, there is a risk that if previously we
trained the neural decoder under uniform error rate
for long enough, the neural decoder could learn to
ignore the error rate inputs as they are constant. In
this case, only training the site-dependent variables
can fail.
Another route we can take is that we also reinitialize the first renormalization block. More accurately,
we do the following:
1. We start with the trained neural decoder for uniform error rate.
2. We reverse the belief propagation network in
the first renormalization block to the pre-trained
weights. In other words, it now again approximates belief propagation.
3. We then train the site-dependent variables and
the first renormalization block together.
We test this scheme with a distance 16 toric code. For
each qubit, there is a 50% chance it has bit-flip rate
0 _._ 16, and a 50% chance of rate 0. In other words, only
around half of the qubits are noisy. With this new error model, we train the site-dependent variables and
the first renormalization block for 4500 batches, where
each batch contains 50 training data. The learning
rate of the ADAM optimizer is set to 2 _×_ 10 <sup>_−_</sup> <sup>4</sup> . By performing this training, we increase the logical accuracy
from 0 _._ 967 to 0 _._ 993, where 0 _._ 967 corresponds to the
decoder trained on uniform bit-flip error model. The
accuracy is each evaluated by using 10 <sup>5</sup> (syndrome,
logical correction) pair. To provide some comparison, we run the minimum-weight perfect matching
(MWPM) algorithm for the same error model. Without providing error rate information, the MWPM algorithm assigns an equal weight to each qubit, and
have a logical accuracy of 0 _._ 975. If we provide the
perfect information about the error rates, we can assign weight 1 to noisy qubits, and weight 100 to the
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 10
noiseless ones. For each pair of violated parity checks,
we can select the path with the minimum total weight
between them, and use this weight for the MWPM algorithm. With this choice, the logical accuracy rises
to 1, e.g. 100% success. These accuracies are each
evaluated by 10 <sup>4</sup> (syndrome, logical correction) pair.
Based on the thoughts above, it is likely better to
not start with the neural decoder trained on uniform
error rate. Instead, we can train a neural decoder
with training data that has varying error rates, but
otherwise the same procedure as depicted in Figure 3.
This way, the first renormalization block will not learn
to ignore the error rate inputs.
Accepted in 2020-12-31, click title to verify. Published under CC-BY 4.0. 11
섹션 본문
섹션 본문이 없습니다.
참고문헌 22건
- Fault-tolerant quantum computation by anyons Annals of Physics · Elsevier BV · 2003 10.1016/s0003-4916(02)00018-0
- Fast Decoders for Topological Quantum Codes Physical Review Letters · American Physical Society · 2010 10.1103/physrevlett.104.050504
- Fault-tolerant renormalization group decoder for abelian topological codes Quantum Information and Computation · Rinton Press · 2014 10.26421/qic14.9-10-1
- Machine-learning-assisted correction of correlated qubit errors in a topological code Quantum · Verein zur Förderung des Open Access Publizierens in den Quantenwissenschaften · 2018 10.22331/q-2018-01-29-48
- Decoding small surface codes with feedforward neural networks Quantum Science and Technology · IOP Publishing · 2017 10.1088/2058-9565/aa955a
- Neural Decoder for Topological Codes Physical Review Letters · American Physical Society · 2017 10.1103/physrevlett.119.030501
- Scalable Neural Network Decoders for Higher Dimensional Quantum Codes Quantum · Verein zur Förderung des Open Access Publizierens in den Quantenwissenschaften · 2018 10.22331/q-2018-05-24-68
- Neural network decoder for topological color codes with circuit level noise New Journal of Physics · IOP Publishing · 2019 10.1088/1367-2630/aaf29e
- Deep Neural Network Probabilistic Decoder for Stabilizer Codes Scientific Reports · Nature Portfolio · 2017 10.1038/s41598-017-11266-1
- Advantages of versatile neural-network decoding for topological codes Physical review. A/Physical review, A · American Physical Society · 2019 10.1103/physreva.99.052351
- Deep neural decoders for near term fault-tolerant experiments Quantum Science and Technology · IOP Publishing · 2018 10.1088/2058-9565/aad1f7
- ImageNet Classification with Deep Convolutional Neural Networks Neural Information Processing Systems · 2012
- Global overview of Imitation Learning arXiv (Cornell University) · Cornell University · 2018
- Learning to decode linear codes using deep learning 2016 10.1109/allerton.2016.7852251
- Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift arXiv (Cornell University) · Cornell University · 2015 10.48550/arxiv.1502.03167
- In-Datacenter Performance Analysis of a Tensor Processing Unit 2017 10.1145/3079856.3080246
- An FPGA-based instrumentation platform for use at deep cryogenic temperatures Review of Scientific Instruments · American Institute of Physics · 2016 10.1063/1.4939094
- Model Compression and Acceleration for Deep Neural Networks: The Principles, Progress, and Challenges IEEE Signal Processing Magazine · Institute of Electrical and Electronics Engineers · 2018 10.1109/msp.2017.2765695
- Blossom V: a new implementation of a minimum cost perfect matching algorithm Mathematical Programming Computation · Springer Science+Business Media · 2009 10.1007/s12532-009-0002-8
- Why Momentum Really Works. Distill · Distill Working Group · 2017 10.23915/distill.00006
- Scaling Learning Algorithms toward AI The MIT Press eBooks · The MIT Press · 2007 10.7551/mitpress/7496.003.0016
- Adam: A Method for Stochastic Optimization 2014