# Error mitigation of entangled states using brainbox quantum autoencoders

Joséphine Pazem  Peter Grünberg Institute, Forschungszentrum Jülich, Jülich
52428, Germany  Institute for Quantum Information, RWTH Aachen University,
D-52056 Aachen, Germany  Mohammad H. Ansari  Peter Grünberg Institute,
Forschungszentrum Jülich, Jülich 52428, Germany

###### Abstract

Current quantum hardware is subject to various sources of noise that limits
the access to multi-qubit entangled states. Quantum autoencoder circuits with
a single qubit bottleneck have shown capability to correct error in noisy
entangled state. By introducing slightly more complex structures in the
bottleneck, the so-called brainboxes, the denoising process can take place
faster and for stronger noise channels. Choosing the most suitable brainbox
for the bottleneck is the result of a trade-off between noise intensity on the
hardware, and the training impedance. Finally, by studying Rényi entropy flow
throughout the networks we demonstrate that the localization of entanglement
plays a central role in denoising through learning.

##  I Introduction

Classical machine learning methods (ML) can identify features in statistics of
data and reproduce them [1, 2]. Measuring entangled states on quantum systems
can sample classical data out of complex probability distributions [3].
Recognition of statistical patterns in such data is challenging for classical
methods. Therefore, quantum machine learning techniques (QML) may accelerate
or enable the processing of these distributions to recognize such statistical
patterns [4, 5, 6, 7]. The quantum speedups, however, can only be
characterized in perfect gates, perfect states and measurements; none of which
are so perfect in state-of-the-art devices [8, 9, 10, 11].

The Noisy Intermediate Scale Quantum (NISQ) processors [12] due to their
fragility can be reasonably controlled only in the scale of a few tens of
qubits [13, 14]. In the absence of fault-tolerant processors, error mitigation
requires in-depth characterization of the device and post-processing [10, 15].
Such improvements takes place in the classical simulations of quantum
circuits.

Error mitigation of multi-qubit states is an active research topic and can be
approached by increasing coherence time of qubits [16] or making their net
interaction free from unwanted crosstalks [17, 18]. These attempts will be
useful when multi-qubit states are achieved with high fidelity. A crucial task
towards this goal is to show the availability of quantum resources such as
entanglement on a device [19, 20, 21, 22]. The power of QML can be leveraged
to address the noise impinging on quantum processors. Quantum Neural Networks
can contribute to perfecting qubit states on NISQ processors. For this
purpose, training tailors the network map to withstand noise and recover the
desired quantum features. They are thereby candidates to prove a quantum
advantage on near-term devices [23, 24, 25, 26, 27, 28].

Autoencoders are a type of neural network that enable the compression of
information in smaller layer, the latent space, between input and output
layers and are often used to denoise information [29, 30, 31, 32, 33]. Quantum
autoencoders (QAEs) can tackle the problem of producing ideal states using
real-device noisy quantum gates [34, 35, 36, 37, 38]. Noisy devices are unable
to prepare ideal entanglement. QAEs, however, can be trained on noisy data in
an unsupervised fashion so that they produce ideal states as outputs. To
verify this concept, an autoencoder with a single-qubit latent space is
trained to reconstruct a perfect Greenberger-Horne-Zeilinger (GHZ) state [39],
i.e. $(|0\rangle^{\otimes m}+|1\rangle^{\otimes m})/\sqrt{2}$ in the presence
of random bit and phase flip as well as small unitary noise [38].

Figure 1: Architecture of the brainbox quantum autoencoder with symmetric
four-qubit inputs/output layers. The left (red) partition of the network is
the encoder, where information of the input is compressed until the brainbox
bottleneck by reducing the number of qubits. The right (blue) partition is a
decoder that reconstitutes the inputs on the output layer. The brainbox is
represented by the set of qubit numbers in a row from left to right, i.e.
$(n_{1},\cdots,n_{K})$. For example, we denote (1,1,1) the -QAE,(2) the -QAE
and (1,2) the -QAE.

In this paper, we use brainbox QAE (BB-QAE) as a generalized QAE in which a
small network replaces a single-qubit latent space. These brainbox circuits
differ by the number of qubits and their layouts. They can be composed of one
or many layers. The morphology of the BB-QAE and brainbox are shown in Figure
1. We aim at denoising GHZ states using different brainboxes and we make a
close comparison between them. We show that a strong bit-flip noise beyond the
tolerance of single-qubit QAE can be well-tolerated by a rather different
brainbox. For example, the noise intensities observed on some qubits of the
IBM Eagle chip can be counter-acted. Moreover, we study entropy evolution in
the neural network and show that entanglement can be rearranged in the network
during the training and this is key to the network’s success in tolerating
strong noisy flips.

##  II Training of the quantum autoencoder

Quantum autoencoder (QAE) network consists of a set of interconnected qubits
in layers with a bottleneck in the middle (see Fig.1). The first (last) layer
of the network represents the input (output) register. The edges connecting
qubits in adjacent layers represent a quantum map from one layer to the next.
There is no connection between qubits of the same layer, meaning that they may
be independent on the hardware too. The network’s bottleneck is a layer with
fewer qubits compared to input and output layers. From the input layer to the
bottleneck, the encoder selectively retains information from the input layer
to build a good encoding in the bottleneck. Initialized in the computational
ground state, the decoder recovers the inputs from the state encoded in the
bottleneck. Optimization of the encoder’s and decoder’s maps relies on the
comparison between input and evolved states.

Our QAE is a dissipative quantum neural networks (DQNN) organized in $L$
layers. Each layer $l$ contains $N_{l}$ qubits, and each qubit in layer $l$ is
coupled to all qubits in layer $l+1$. Thus, we univocally denote the network’s
topology as $(N_{1},\cdots,N_{L})$. In the middle of the symmetric structure
of the QAE, we use a small sub-network instead of single-qubit layer and call
it brainbox bottleneck (BB). It can be either mirror symmetric as the QAE, or
asymmetric, as depicted in Figure (1). Varying the morphology of BBs helps to
understand how the bottleneck’s structure impacts outcome results on the
output layer.

The quantum map on the QAE is constructed starting from the input layer and
propagates the state forwards, layer by layer, towards the output layer. The
unitary $U^{l}_{j}$ acts on all qubits in layer $l-1$ and $j$-th qubit in
layer $l$. It changes the state of the $j$-th qubit in layer $l$. Therefore
the quantum map that updates qubits in layer $l$ looks like
$\mathcal{U}^{l}\equiv\prod_{j=1}^{N_{l}}U^{l}_{j}$. For example consider
there are $N_{5}$ qubits in layer $5$ and $N_{6}$ on layer $6$. The density
matrix of layer 6 is initialized in the computational ground state $|0\rangle$
and its transformation depends on the state on layer 5, i.e.
$\rho_{(6)}=\rm{Tr}_{(5)}\\{\mathcal{U}^{(6)}\left(\rho^{(5)}\otimes|0\rangle\langle
0|^{\otimes N_{6}}\right){\mathcal{U}^{(6)}}^{\dagger}\\}$. The trace isolates
the state on layer $l$ and dissipation equips the network with forgetfulness,
a necessary condition to learning [40]. Therefore one can easily conclude that
the output density matrix can be generated as follows:

$\rho^{out}=\prod_{l=2}^{L}\operatorname*{Tr}_{(l-1)}\left\\{\mathcal{U}^{l}\left(\rho^{l-1}\otimes|0\rangle\langle
0|^{\otimes N_{l}}\right){\mathcal{U}^{l}}^{\dagger}\right\\}$ (1)

with $\rho^{l-1}$ denoting the density matrix of the layer $l-1$ and all
qubits in layer $l$ are in the ground state.

The QAE has been trained with a (1)-BB structure to enable the reconstruction
of a noise-free multiqubit entangled states [38]. The study attempts to
prepare ideal GHZ-states $|\Psi_{\rm{in}}\rangle=(|00\cdots 0\rangle+|11\cdots
1\rangle)/\sqrt{2}$. But noisy hardware is simulated by statistically exposing
each qubit to the bit-flip noise channel $\mathcal{N}(\rho_{\rm{in}})$ with
flip probability $p$:

$\displaystyle\mathcal{N}(\rho_{\rm{in}})$
$\displaystyle=\mathcal{E}_{N_{\rm{in}}}(\cdots(\mathcal{E}_{1}(\rho_{\rm{in}},p),p)\cdots)$
(2)

with
$\mathcal{E}_{i}(\rho_{\rm{in}},p)=(1-p)\,\rho_{\rm{in}}\,+\,p\,X_{i}\rho_{\rm{in}}X_{i}$
being the bit-flip channel for the qubit $i$ and $X_{i}$ being the flip Pauli
operator. For single-qubit bottlenecks, Ref[38] and Ref[41] show that the
noise tolerance of the (1)-QAE is low ($p<0.3$). We continue the analysis on
BB-QAEs with larger brainbox bottlenecks.

The quantum map of the BB-QAE is divided in two parts: the encoder and the
decoder. In the left wing of the network, the map $\mathcal{E}(\rho^{in})$ of
the encoder is applied on the noisy inputs and hidden layers, and compresses
states in the latent space, in the brainbox [34, 35, 36, 37]. For a brainbox
bottleneck with $K$ layers, we note different configurations by
$(n_{1},\cdots,n_{K})$. For example (1,1) is a linear chain of two qubits .

In the right wing of the network, the decoder map $\mathcal{D}$ reconstructs
states in their original dimension, thanks to the information encoded in the
last layer of the brainbox. The output state is then
$\rho^{\rm{out}}_{x}=\mathcal{D}(\rho^{\rm{latent}}_{x})=\mathcal{D}(\mathcal{E}(\mathcal{N}_{x}(\rho_{\rm{GHZ}},p))$,
where $\mathcal{N}_{x}(\rho)$ denotes a discrete noise realization $x$ of the
bit-flip channel, that is a combination of flipped/not flipped on all qubits
of the input layer.

The aim of the quantum map is to make the output quantum state as similar as
possible to the ideal target state. In other words, a successful denoising
strategy on a QAE should wash out the statistical noise encoded on the input
layer from the output state. This can be measured by evaluating the fidelity
of the output state $\rho^{\rm{out}}$ with the ideal state $\rho_{\rm{GHZ}}$:

$\displaystyle F_{x}(\rho^{\rm{out}}_{x},\rho_{\rm{GHZ}})=$
$\displaystyle\langle\Psi_{\rm{GHZ}}|\,\rho^{\rm{out}}_{x}|\Psi_{\rm{GHZ}}\rangle$
$\displaystyle=$
$\displaystyle\operatorname*{Tr}\left\\{\rho_{\rm{GHZ}}\,\rho^{\rm{out}}_{x}\right\\}.$
(3)

At each training step $n$, the average fidelity over all $N_{data}$ states
$\\{\mathcal{N}_{x}(\rho_{\rm{GHZ}},p)\\}_{x=1}^{N_{\rm{data}}}$ defines the
objective function for the network:

$F(n)=\frac{1}{N_{\rm{data}}}\sum_{x=1}^{N_{\rm{data}}}F_{x}\left(\rho^{\rm{out}}_{x}(n),\rho_{\rm{GHZ}}\right).$
(4)

The maximization of this function instructs the network how to perform its
task. First initialized at random, the interlayer unitaries $\\{U^{l}_{j}\\}$
are updated layerwise and iteratively with the parameter matrix multiplication
method [27, 28]:

$U^{l}_{j}(n+\varepsilon)\leftarrow e^{i\varepsilon
K^{l}_{j}(n)}U^{l}_{j}(n),$ (5)

where $K^{l}_{j}(n)$ is the parameter matrix derived from $F$ [38]. This
update rule is inspired by the gradient descent algorithms [42] and
understands gradients as the derivative of $F$ with respect to each unitary.
After $N_{\rm{it}}$ updates of the quantum map, the objective function
converges to 1 if the training is successful or takes smaller positive values
otherwise.

##  III Results

Denoising a four-qubit GHZ state has been previously performed in [41, 38] on
some symmetric input/output QAE network examples, such as a simple single-
qubit bottleneck with additional hidden layers (4,2,1,2,4) and without them
(4,1,4), and (4,1,4,1,4) network which is twice (4,1,4). Each training employs
200 GHZ states exposed to noise of certain bit-flip probability $p$. For each
$p$ the performance assessment is evaluated by comparing mean fidelity
function before and after applying denoising quantum map. These QAEs can
ideally denoise GHZ state up to the tolerance noise $p^{*}=0.3$, see Fig. (2)
in Ref.[38]. We use the same scheme on different network topologies, and our
aim is to understand under what topology or connectivity conditions noise
tolerance $p^{*}$ can be improved beyond the weak limit of 0.3. This enable
QAEs to denoise entangled states under harsh noise exposure. In addition, it
gives better prospects to scale up the inputs.

###  III.1 Tolerance threshold

Our QAEs contains two symmetric hidden layers each with 2 qubits next to the
input and the output, so that the topology is (4,2,BB,2,4) and (6,2,BB,2,6).
We consider the brainbox bottlenecks listed in Fig.2. The BB examples are the
symmetric sub-networks (3), (2), (1), (1,1) (1,1,1) and the asymmetric BB sub-
networks (1,2) and (2,1). In order to make a clear comparison between how fast
each brainbox makes its way to an optimized quantum map, we start all these
networks at the same initial map and we update the map 200 times. Among these
examples, the (1)-QAE represents the original QAE from Ref. [38].

(a)

(b)

Figure 2: (a) Testing fidelity: Average output state fidelity over a range of
noisy test states with noise probability $p$. The error bars indicates the
absolute value of standard deviation in the data about average fidelity. When
it is large, it indicates that some noise realizations do not reach high
fidelity states after denoising while some do. (b) Tolerance thresholds: The
noise probability that returns output states with at least 99% fidelity with
the ideal GHZ state. Various networks with 4- and 6-qubit input/output layers
and different BBs have been tested. Some brainboxes make up to 10%
improvements in the network tolerance threshold.

After training the above-mentioned BB-QAEs with training sets of 200 noisy GHZ
states and different bit-flip probabilities $p$, testing checks whether the
network denoises states it was not trained with. The optimized quantum map is
applied to some new noisy GHZ-states. Though the noise realizations differ,
the noise channel is the same as during the training. The output states are
compared with an ideal GHZ state using the fidelity function 4.

The result is shown in Fig.2(a). We call tolerance threshold the largest
probability the network can recover from, ie the fidelity at the end of the
training is close to 1. One can see that the simple brainbox (1) used in Ref.
[38] can tolerate only noise probability up to 0.3, while the (1,1)-QAE can
increase the threshold slightly to 0.35. The other brainbox bottlenecks push
the tolerance threshold up to 0.4 and perform equally well with respect to
fidelity.

A low tolerance threshold is an issue in two ways. To make the QAE useful on
the current NISQ devices, it must operate well at intermediate noise scales,
close to the tolerance thresholds. In addition, errors are more likely to
occur on larger states. Therefore, noise resilience must be improved. For this
aim, we compared the results of (4,2,BB,2,4) and (6,2,BB,2,6) networks. We
plot the respective thresholds in Fig.2(b). By increasing the number of input
qubits from 4 to 6 while aiming at GHZ-states, the noise tolerance on a simple
single-qubit bottleneck shows a large drop off by 0.1 from $p^{*}=0.3$ to 0.2.
This raises concerns about the scalability of denoising: by adding more qubits
to the inputs, the noise tolerance shrinks, in other words the QAE becomes
more fragile and unable to recover the ideal target state.

For a given probability $p$, the number of combinations of flipped/intact
qubits in the input states grows exponentially with their size. With a small
training data set, this suppresses the tolerance threshold. In the limit of
infinite size data set, the distribution of GHZ and non-GHZ states is such
that the amount of GHZ states is always larger than that of non-GHZ except at
$p=0.5$. With a simple majority rule, the network can identify the GHZ state
as the target state. As the size of the training set becomes finite,
deviations from the ideal distribution alter the training. Dashed and solid
lines in Fig. (3) compare distributions for ideal states and the next most
probable noisy state for training sets with infinitely many and 200 states
respectively. In limited data set, the ideal GHZ state occurs less often in
the finite data set than the next most probable noisy state in the vicinity of
$p\sim 0.4$. Thus for such data set, the QAE training can only help to boost
tolerance threshold up to where GHZ state constitute a majority of the
training data. While the training data ultimately imposes an upper bound on
the tolerance that can possibly be achieved, the (1)-QAE performs sub-
optimally and its tolerance does not depend on the training data. For the
multi-qubit BB, he scaling of the generalization error with the size of the
training data set is consistent with the results in [43].

Figure 3: Training data set: The distribution of 4-qubit GHZ and non-GHZ
states in infinitely many samples (dashed line) versus finite 200 samples
(solid lines). In the infinite sample case the distribution of GHZ for all
noise probabilities $p$ dominates, while artefacts in the finite data set
prevents the dominance of GHZ for strongly noisy channels.

For this study, a size-200 training set already shows disparities in
improvements in tolerance due to the network topology. Fig.2(b) shows that in
a network of 4-qubit inputs all brainbox beyond (1) and (1,1) equivalently
perform with higher tolerance. Adding two qubits to the input results in the
reduction of noise tolerance by 0.1 unit, however in this case still all BBs
except the single-qubit bottleneck (1) reveal higher tolerance. Another
important lesson from the study is that qubit configurations in BBs contribute
to the tolerance. For example in the case of 4-qubit input, a brainbox with
two qubits in separate layers (1,1) yields a sub-optimal tolerance at 0.35,
while stacking them in a single layer (2) saturates the data limit at 0.4.

###  III.2 Training impedance

In section III.1, we found that most of multi-qubit brainboxes we used in the
(4,2,BB,2,4) and (6,2,BB,2,6) network maximize the achievable bit-flip noise
tolerance $p^{*}$. However some BB topologies make the training less costly.

Figure 4: Training impedance for the optimization of (4,2,BB,2,4) networks. As
the noise intensities grow, the optimization is more demanding. Some BBs show
to be less efficient to rapidly gain high fidelity in the output state.

Let us mark the step $n(F)$ at which the training achieves a fidelity above
$F$ in the output. Consider that each BB-QAE is trained for $N_{\rm{it}}$
iterations. We define the _training impedance_ $Z(F)=n(F)/N_{\rm{it}}$. In
Fig. 4 we evaluate $Z(0.99)$ for several networks at different noise
probabilities $p$. The result indicates that training impedance depends on the
fidelity limit, training noise probability, brainbox, and input qubits, i.e.
$Z=Z(F,p,\rm{BB},N_{\rm{in}})$.

(a)

(b)

Figure 5: Cross-tests results for two networks: (4,2,1,2,4) and (4,2,2,1,2,4)
associated to (1) and (2,1) brainbox subnetworks. Three noise channels were
implemented with noise intensities $p_{test}$: the bit-flip channel (full
lines), the depolarizing channel (dashed lines) and the erasure channel
(dotted lines). The (1)-QAE shows more sensitivity noise in the test states:
for the same training probability $p_{train}$, the reconstruction error
fluctuates and larger errors occur on unfamiliar noise channels. In contrast,
the map optimized by the (2,1)-QAE treats all noise channels and intensities
equally. The outputs of the BB-QAE lose dependency on the noise it was trained
with. In addition, the reconstruction error over the weak noise regime is
lower compared to the (1)-QAE.

Results for (4,2,BB,2,4) networks are summarized in Fig. 4. For noise
probabilities $p\leq 0.3$ the impedance factor $Z(0.99)$ in all BB networks
remains relatively small nearly between 0.23 to 0.30; meaning that all
networks at these noise probabilities can easily find their way to fidelity
above 0.99 within the first third of the training. Some BBs such as (2), (3),
(1,2), (1,1,2), (1,2,1) are slightly slower in gaining high fidelity. However
the very same network under harder noise of $p\geq 0.35$ have an advantage
during the training and optimization is almost 5% faster than in other
networks.

The selection of a suitable brainbox is based on the trade-off between the
gain in fidelity and the loss in computational speed. At low noise intensities
such as $p=0.1$, linear brainboxes (1,1),(1,1,1) and (2,1) accelerate the
training compared to the single qubit box (1). Longer brainboxes also protect
the network against overfitting (see section III.3). Between p=0.2 and 0.3,
multi-qubit brainboxes cause a small computational overhead that is minimized
by the linear architectures. Above the (1)-QAE’s tolerance threshold, wide
brainbox structures such as (2), (3), and (1,2) improve the training
efficiency compared to the linear ones. Thanks to a larger amount of
parameters, they efficiently capture subtle patterns in the training states,
as in the over-parametrized regime [44, 45].

Similar graphs for (6,2,BB,2,6) networks are shown in Appendix A.

###  III.3 Cross-testing

In previous sections, the testing data set was generated under the same noise
channel as during the training of the quantum map. A generalization of this
approach has been described in Ref. [41], in which the QAE is trained using a
noise channel with parameter $p$ and is tested with the same channel with
different parameter $p^{\prime}$. In this section, we evaluate the BB-QAEs
with a generalized cross-test: the testing data originates either either from
the same noise channel with different intensity, or from a different noise
channel.

We consider two BB-QAEs with brainboxes (1) and (2,1). Though these two
brainboxes have similar impedance factors (see Fig.4), they differ by their
tolerance threshold (Fig.4). We train them both with bit-flip noise at
intensities $p_{\rm{train}}=0.05$ and 0.3. After the training is completed, we
use the final map to test noisy input GHZ states generated by one of the
following three noise channels with independent noise intensities
$p_{\rm{test}}$: (1) bit-flip channel defined in Eq.2, (2) depolarizing
channel
$\mathcal{E}_{i}^{dep}(\rho,p_{\rm{test}})=(1-3p_{\rm{test}}/4)\rho+p_{\rm{test}}/4(X_{i}\rho
X_{i}+Y_{i}\rho Y_{i}+Z_{i}\rho Z_{i})$, which can add a relative phase
between $|00\cdots 0\rangle$ and $|11\cdots 1\rangle$ of GHZ-states and can
rotate each qubit around an arbitrary axis, and (3) erasure channel that by
probability $p_{\rm{test}}$ replaces the state of a single qubit in the GHZ
state with a random state $\alpha|0\rangle+\beta|1\rangle$, otherwise it
remains unchanged, [46, 47]. In the latter, since all $\alpha$’s and $\beta$’s
are different for each noise realization, the map is challenged to reconstruct
GHZ-states starting from any possible pure quantum state. In Fig.5, we
evaluate the generalization error with the reconstruction error
$R(\\{\rho_{x}^{\rm{out}}\\},\rho_{\rm{GHZ}})=1-1/N_{\rm{test}}\sum_{x=1}^{N_{\rm{test}}}F_{x}(\rho_{x}^{\rm{out}},\rho_{\rm{GHZ}})$
where $N_{test}=200$ is the number of states in the testing data set.

For both network morphologies, training with weak noise yields almost perfect
generalization to all three noise channels over a large range of
probabilities. In figure 5(a,b), reconstruction error is kept in the
negligible range.

We repeat the same cross-testing procedure at the tolerance threshold of the
(1)-QAE. In figure 5(a), this network recovers from the bit-flip channel with
reconstruction error close to 0.001. In contrast, states affected by the
erasure and depolarizing channels cannot land on ideal GHZ state with high
fidelity ( higher than 99.9%). This is a sign of overfitting, since the
discrete states in the former case are already represented in the training
data set. The two remaining noise channels add states that are new to the
network. In this respect, the noise tolerance measure in Fig.2 is deceitful to
the extend that the last optimized map works solely on the training states.

Training the (2,1)-QAE with $p_{\rm{train}}=0.3$, ie below its tolerance
threshold, enables the full recovery of erroneous states irrespective of the
noise channel tested, at all $p_{\rm{test}}$. This is possible due to the fact
that the extended network has access to the dominating fraction of ideal GHZ
states, which brings advantages in the cross-tests as well. One can think of
the BB structure as a magnifying glass that makes it possible to distinguish
targets from noise even when they are close to one another, by creating a
better encoding of inputs in its last layer.

###  III.4 Rényi entropy flow

A key property to measure in engineered quantum systems is entanglement: in
contrast to their classical counterparts, quantum algorithms can generate
large amounts of entanglement between parts of the system [48, 49].
Entanglement during the learning phase in a QAE changes internally across
layers. It allows delocalizes information in the network and steers the
training towards the optimal condition of having a separable output. In order
to observe its contribution to the training, some measures of entanglement
have been tested, such as entanglement witnesses [50] and von Neumann entropy
[51]. Similar to any many-body quantum system, measuring the entropy of
different partitions provides a way to probe its entanglement structure.

Here, we evaluate the second-order Rényi entropy since it can capture long-
range entanglement [52, 53, 54] as well as dissipation mechanisms [55, 56].
Rényi entropy can serve as a measure for probing and characterizing brainbox
bottlenecks. A slow entropy growth in a layer or in a part of the network can
be used to identify localization in a subset of the network [57].

(a)

(b)

Figure 6: Layerwise Rényi entropy evaluated after applying the last step of
the denoising map. Darker colors indicates larger entropy of noisy mixed
states. We study a single-qubit brainbox in (a) and a double-qubit layer
brainbox in (b). Entropy at low noise strength of $p=0.1$ decreases toward the
output layer so that one can expect noise is localized in the encoder and is
blocked away from the brainbox. However in the case of $p=0.45$ which is much
stronger than the networks’ tolerance threshold, input noise from the input
layer leaks out at the bottleneck and noise accumulates in the decoder and
output layer.

For a bipartite system $\mathcal{S}$ with subsystems A and B and total density
matrix $\rho$, second order Rényi entropy is
$S^{(2)}(\rho)=-\log{(\operatorname*{Tr}\\{\rho^{2}\\})}$. When equal to zero,
it indicates that $\mathcal{S}$ is pure and independent from any environment.
Typically, entropy of the whole BB-QAE is zero at all iterations because the
system is isolated from the environment and therefore in a pure state.
Moreover, second order Rényi entropy can be evaluated for any subsystem in
$\mathcal{S}$, eg. A, based on the associated partial density matrix
$\rho_{A}=\operatorname*{Tr}_{B}(\rho)$:
$S_{A}^{(2)}(\rho_{A})=-\log{(\operatorname*{Tr}_{A}\\{(\rho_{A})^{2}\\})}$.
Consequently, at each training step, in a BB-QAE with $L$ layers, the entropy
of layer $l$ reflects the presence of entanglement between the layer $l$ and
the remaining $L-1$ layers in the network. The second order Rényi entropy in
layer $l$ is defined as

$S_{l}^{(2)}=-\log{(\operatorname*{Tr}_{l}\\{(\rho_{l})^{2}\\})},$ (6)

with the partial density matrix of layer $l$ being
$\rho_{l}=\operatorname*{Tr}_{k\neq l}\\{\rho\\}$ for $k=1,\cdots L$ and
$\rho$ is the state of the whole BB-QAE.

In particular, at each iteration, the entropy of layer $l$ can be evaluated
using Eq.(6) after applying the respective unitary $\mathcal{U}^{l}$. During
the training, we compare the evolution of layer-wise entropy in a (1)-QAE for
both weak ($p=0.1$) and strong ($p=0.4$) noise in the input GHZ states (see
Fig.10 in Appendix B). During the learning phase, entropy is redistributed
within the network. In the first steps, it undergoes steep growth, especially
in the last layer. In the subsequent iterations, entanglement vanishes
exponentially in the decoder’s layers, while it is only slightly suppressed in
the encoder, resulting in entropy inversion.

Entropy after optimization is compared for (1)- and (2)-QAEs below and above
the tolerance threshold, at $p=0.1$ and $p=0.45$ respectively (Fig.6). In a
BB-QAE with bit-flipped GHZ state on the initial layer, successful denoising
not only raises fidelity of the output states, but also improves its
separability. Therefore, training inverts entropy in the network and shifts
noise from the decoder to the encoder. The bottleneck seals it away from the
output layer.

In contrast, failure to denoise the inputs can take two forms. In Fig.6(a),
instead of concentrating noise in the encoder, the training yields high
entanglement in the last two layers, while the encoder remains almost
independent. As in Fig.6(b), the inversion of entropy can be favorized by
using larger BB structures. In this case, the training improves noise
concentration, but the bottleneck seal seems too porous to lock noise out of
the decoder, resulting in poor denoising.

##  IV Conclusion

We have presented an in-depth study of various brainbox structures for the
bottleneck in a quantum autoencoder used to denoise entangled quantum states.
Training a QAE single-qubit bottleneck has been studied in Ref. [38]. This
bottleneck can come with only limited tolerance against bit-flip,
depolarizing, and random unitary noise channels. Scaling the inputs size from
4 to 6 qubits makes the training more greedy in data, and deteriorates the
denoising performance rapidly.

We identified two mechanisms behind the limitation of noise tolerance. (1) The
finite size of the training data set causes statistical deviations from the
ideal noisy state distribution expected from the bit-flip channel. It imposes
an upper bound on the maximum tolerance the BB-QAE can achieve. This upper
bound depends on each training data set. (2) The study of Rényi entropy shows
that the single-qubit bottleneck is unable to seal noise away from the output
state, and therefore to carry out its denoising task.

We compared the simple QAE with multi-qubit brainbox bottlenecks, most of
which brought significant elevation of tolerance. When qubits are added to the
input and output layers, the relative improvements are maintained. If a
brainbox bottleneck can endure stronger noise compared to another brainbox,
adding more qubits to input state maintains the superiority of the former one.

Some bottlenecks show similar tolerance threshold against noise. This raises
an important question: What other features can make a brainbox more suitable
than the other ones? To address this question, we compare training impedance
between brainboxes. For this purpose, we evaluate the training impedance
$Z(0.99)$, which indicates what minimum percentage of the training process is
required to achieve a fidelity above 99% in the output. The result has been
summarized in Fig. (4) and show that the training impedance depends not only
on the bottleneck, but also on the training noise probability $p$. Below bit-
flip probabilities $p=0.3$, linear brainboxes such as (1,1) are favorable to a
more efficient training. In contrast, between $p=0.3$ and $p=0.4$, non-linear
brainboxes such as (2) or (2,1) are most economical to train.

We evaluate the Rényi entropy of network layers at each optimization step to
show how nonlocal entanglement between layers evolves and impacts the outputs
fidelity. Results show that in networks below their tolerance threshold,
entropy becomes localized in the encoder of the BB-QAE, so that much less
noise passes through the bottleneck to the decoder. This usually leads to
outputs states that have high fidelity with the target and that are separable
from the network. Some examples were given in Fig.6: in successful training,
noise is blocked off from the bottleneck, while in unsuccessful training noise
penetrates through the bottleneck. The absence of separability of the output
indicates the presence of layer-to-layer stray coupling between hidden and
output layers, which eventually does not allow its fidelity to rise higher.

In connection to NISQ devices, QAEs are resilient to input layer noise and
therefore they provide the potential to generate ideal entanglement on noisy
gates and qubits. A QAE with complex bottleneck and more qubits and parameters
in general seem advantageous for denoising, because such a complex structure
provides the possibility to separate encoder and decoder. However detailed
analysis shows that less resourceful brainboxes can be found with the same
performance as a complex one. Testing the network with the depolarizing and
erasure channel proves that some bottlenecks can keep their superiority over
the whole trainable range. We expect that these differences will remain when
selecting different quantum target states.

One of the main obstacles against implementing QAEs in scaled up input states
is the required high connectivity in the network that is inaccessible on the
current processors. An alternative is to train a map with missing connections
[38].

## Acknowledgement

The authors thank Maria Schuld and Pia Döring for fruitful discussions. MA
acknowledges that a part of this manuscript was motivated during the support
from Intelligence Advanced Research Projects Activity (IARPA) under contract
W911NF-16-0114.

## References

  * Bishop [2006] C. M. Bishop,  _Pattern Recognition and Machine learning_ (Springer, New York, NY, 2006).
  * Goodfellow  _et al._ [2016] I. Goodfellow, Y. Bengio, and A. Courville,  _Deep Learning_ (MIT Press, 2016) http://www.deeplearningbook.org.
  * Arute  _et al._ [2019] F. Arute, K. Arya, R. Babbush, D. Bacon, J. C. Bardin, R. Barends, R. Biswas, S. Boixo, F. G. Brandao, D. A. Buell, B. Burkett, Y. Chen, Z. Chen, B. Chiaro, R. Collins, W. Courtney, A. Dunsworth, E. Farhi, B. Foxen, A. Fowler, C. Gidney, M. Giustina, R. Graff, K. Guerin, S. Habegger, M. P. Harrigan, M. J. Hartmann, A. Ho, M. Hoffmann, T. Huang, T. S. Humble, S. V. Isakov, E. Jeffrey, Z. Jiang, D. Kafri, K. Kechedzhi, J. Kelly, P. V. Klimov, S. Knysh, A. Korotkov, F. Kostritsa, D. Landhuis, M. Lindmark, E. Lucero, D. Lyakh, S. Mandrà, J. R. McClean, M. McEwen, A. Megrant, X. Mi, K. Michielsen, M. Mohseni, J. Mutus, O. Naaman, M. Neeley, C. Neill, M. Y. Niu, E. Ostby, A. Petukhov, J. C. Platt, C. Quintana, E. G. Rieffel, P. Roushan, N. C. Rubin, D. Sank, K. J. Satzinger, V. Smelyanskiy, K. J. Sung, M. D. Trevithick, A. Vainsencher, B. Villalonga, T. White, Z. J. Yao, P. Yeh, A. Zalcman, H. Neven, and J. M. Martinis, Quantum supremacy using a programmable superconducting processor, Nature 574, 505 (2019).
  * Schuld  _et al._ [2015] M. Schuld, I. Sinayskiy, and F. Petruccione, An introduction to quantum machine learning, Contemp. Phys. 56, 172 (2015).
  * Schuld and Petruccione [2019] M. Schuld and F. Petruccione,  _Quantum science and technology_ (2019) p. 287.
  * Biamonte  _et al._ [2017] J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost, N. Wiebe, and S. Lloyd, Quantum machine learning, Nature 549, 195 (2017).
  * Marquardt [2021] F. Marquardt, Machine learning and quantum devices, SciPost Phys. Lect. Notes (2021).
  * Kim  _et al._ [2022] Y. Kim, A. Morvan, L. B. Nguyen, R. K. Naik, C. Jünger, L. Chen, J. M. Kreikebaum, D. I. Santiago, and I. Siddiqi, High-fidelity three-qubit iToffoli gate for fixed-frequency superconducting qubits, Nature Physics 18, 783 (2022).
  * Huang  _et al._ [2020a] W. Huang, W. Chien, C. Cho, C. Huang, T. Huang, and C. Chang, Mermin’s inequalities of multiple qubits with orthogonal measurements on IBM Q 53-qubit system , Quantum Engineering 2, 1 (2020a).
  * Kim  _et al._ [2021a] J. S. Kim, L. S. Bishop, A. D. Córcoles, S. Merkel, J. A. Smolin, and S. Sheldon, Hardware-efficient random circuits to classify noise in a multiqubit system, Physical Review A 104, 10.1103/PhysRevA.104.022609 (2021a), arXiv:2104.10221 .
  * Kim  _et al._ [2021b] Y. Kim, C. J. Wood, T. J. Yoder, S. T. Merkel, J. M. Gambetta, K. Temme, and A. Kandala, Scalable error mitigation for noisy quantum circuits produces competitive expectation values, arXiv 2108.09197 (2021b).
  * Preskill [2018] J. Preskill, Quantum Computing in the NISQ era and beyond, Quantum 2, 79 (2018).
  * Acharya  _et al._ [2023] R. Acharya, I. Aleiner, R. Allen, T. I. Andersen, M. Ansmann, F. Arute, K. Arya, A. Asfaw, J. Atalaya, R. Babbush, D. Bacon, J. C. Bardin, J. Basso, A. Bengtsson, S. Boixo, G. Bortoli, A. Bourassa, J. Bovaird, L. Brill, M. Broughton, B. B. Buckley, D. A. Buell, T. Burger, B. Burkett, N. Bushnell, Y. Chen, Z. Chen, B. Chiaro, J. Cogan, R. Collins, P. Conner, W. Courtney, A. L. Crook, B. Curtin, D. M. Debroy, A. Del Toro Barba, S. Demura, A. Dunsworth, D. Eppens, C. Erickson, L. Faoro, E. Farhi, R. Fatemi, L. Flores Burgos, E. Forati, A. G. Fowler, B. Foxen, W. Giang, C. Gidney, D. Gilboa, M. Giustina, A. Grajales Dau, J. A. Gross, S. Habegger, M. C. Hamilton, M. P. Harrigan, S. D. Harrington, O. Higgott, J. Hilton, M. Hoffmann, S. Hong, T. Huang, A. Huff, W. J. Huggins, L. B. Ioffe, S. V. Isakov, J. Iveland, E. Jeffrey, Z. Jiang, C. Jones, P. Juhas, D. Kafri, K. Kechedzhi, J. Kelly, T. Khattar, M. Khezri, M. Kieferová, S. Kim, A. Kitaev, P. V. Klimov, A. R. Klots, A. N. Korotkov, F. Kostritsa, J. M. Kreikebaum, D. Landhuis, P. Laptev, K.-M. Lau, L. Laws, J. Lee, K. Lee, B. J. Lester, A. Lill, W. Liu, A. Locharla, E. Lucero, F. D. Malone, J. Marshall, O. Martin, J. R. McClean, T. McCourt, M. McEwen, A. Megrant, B. Meurer Costa, X. Mi, K. C. Miao, M. Mohseni, S. Montazeri, A. Morvan, E. Mount, W. Mruczkiewicz, O. Naaman, M. Neeley, C. Neill, A. Nersisyan, H. Neven, M. Newman, J. H. Ng, A. Nguyen, M. Nguyen, M. Y. Niu, T. E. O’Brien, A. Opremcak, J. Platt, A. Petukhov, R. Potter, L. P. Pryadko, C. Quintana, P. Roushan, N. C. Rubin, N. Saei, D. Sank, K. Sankaragomathi, K. J. Satzinger, H. F. Schurkus, C. Schuster, M. J. Shearn, A. Shorter, V. Shvarts, J. Skruzny, V. Smelyanskiy, W. C. Smith, G. Sterling, D. Strain, M. Szalay, A. Torres, G. Vidal, B. Villalonga, C. Vollgraff Heidweiller, T. White, C. Xing, Z. J. Yao, P. Yeh, J. Yoo, G. Young, A. Zalcman, Y. Zhang, N. Zhu, and G. Q. AI, Suppressing quantum errors by scaling a surface code logical qubit, Nature 614, 676 (2023).
  * Jurcevic  _et al._ [2020] P. Jurcevic, A. Javadi-Abhari, L. S. Bishop, I. Lauer, D. F. Bogorin, M. Brink, L. Capelluto, O. Günlük, T. Itoko, N. Kanazawa, A. Kandala, G. A. Keefe, K. Krsulich, W. Landers, E. P. Lewandowski, D. T. McClure, G. Nannicini, A. Narasgond, H. M. Nayfeh, E. Pritchett, M. B. Rothwell, S. Srinivasan, N. Sundaresan, C. Wang, K. X. Wei, C. J. Wood, J.-B. Yau, E. J. Zhang, O. E. Dial, J. M. Chow, and J. M. Gambetta, Demonstration of quantum volume 64 on a superconducting quantum computing system (2020).
  * Kim  _et al._ [2021c] J.-S. Kim, L. S. Bishop, A. D. Corcoles, S. Merkel, J. A. Smolin, and S. Sheldon, Hardware-efficient random circuits to classify noise in a multi-qubit system, Phys. Rev. A 104, 022609 (2021c), 2104.10221 .
  * Siddiqi [2021] I. Siddiqi, Engineering high-coherence superconducting qubits, Nature Reviews Materials 6, 875 (2021).
  * Xu and Ansari [2021] X. Xu and M. Ansari, $zz$ freedom in two-qubit gates, Phys. Rev. Appl. 15, 064074 (2021).
  * Ku  _et al._ [2020] J. Ku, X. Xu, M. Brink, D. C. McKay, J. B. Hertzberg, M. H. Ansari, and B. L. Plourde, Suppression of Unwanted ZZ Interactions in a Hybrid Two-Qubit System, Physical review letters 125, 200504 (2020), arXiv:2003.02775 .
  * Mermin [1990a] N. D. Mermin, Extreme quantum entanglement in a superposition of macroscopically distinct states, Physical Review Letters 65, 1838 (1990a).
  * Mermin [1990b] N. D. Mermin, Quantum mysteries revisited, American journal of physics 58, 731 (1990b).
  * Alsina and Latorre [2016] D. Alsina and J. I. Latorre, Experimental test of Mermin inequalities on a five-qubit quantum computer, Physical Review. A 94, 10.1103/physreva.94.012314 (2016).
  * Huang  _et al._ [2020b] W.-J. Huang, W.-C. Chien, C.-H. Cho, C.-C. Huang, T.-W. Huang, and C.-R. Chang, Mermin’s inequalities of multiple qubits with orthogonal measurements on ibm q 53-qubit system, Quantum Engineering 2, e45 (2020b).
  * Wan  _et al._ [2017] K. H. Wan, O. Dahlsten, H. Kristjánsson, R. Gardner, and M. S. Kim, Quantum generalisation of feedforward neural networks, npj Quantum Information 3, 10.1038/s41534-017-0032-4 (2017).
  * Farhi and Neven [2018] E. Farhi and H. Neven, Classification with quantum neural networks on near term processors (2018), arXiv 1802.06002.
  * Cerezo  _et al._ [2021] M. Cerezo, A. Arrasmith, R. Babbush, S. C. Benjamin, S. Endo, K. Fujii, J. R. McClean, K. Mitarai, X. Yuan, L. Cincio, and P. J. Coles, Variational quantum algorithms, Nature Reviews Physics 3, 625 (2021), 2012.09265 .
  * Schuld and Petruccione [2021] M. Schuld and F. Petruccione,  _Machine learning with quantum computers_ , 2nd ed. (Springer Nature, 2021).
  * Beer  _et al._ [2020] K. Beer, D. Bondarenko, T. Farrelly, T. J. Osborne, R. Salzmann, D. Scheiermann, and R. Wolf, Training deep quantum neural networks, Nat. Commun. 11 (2020).
  * Sharma  _et al._ [2020] K. Sharma, M. Cerezo, L. Cincio, and P. J. Coles, Trainability of dissipative perceptron-based quantum neural networks (2020), arXiv 2005.12458.
  * Gehring  _et al._ [2013] J. Gehring, Y. Miao, F. Metze, and A. Waibel, Extracting deep bottleneck features using stacked auto-encoders, in  _2013 IEEE International Conference on Acoustics, Speech and Signal Processing_ (IEEE, 2013).
  * Vincent  _et al._ [2008] P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol, Extracting and composing robust features with denoising autoencoders, in  _Proceedings of the 25th international conference on Machine learning - ICML ’08_ (ACM Press, New York, New York, USA, 2008).
  * Vincent  _et al._ [2010] P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, and P.-A. Manzagol, Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion, Journal of Machine Learning Research 11, 3371 (2010).
  * Hinton and Salakhutdinov [2006] G. E. Hinton and R. R. Salakhutdinov, Reducing the dimensionality of data with neural networks, Science (New York, N.Y.) 313, 504 (2006).
  * Sinha and Rajan [2018] R. Sinha and P. Rajan, A deep autoencoder approach to bird call enhancement, in  _2018 IEEE 13th International Conference on Industrial and Information Systems (ICIIS)_ (2018) pp. 22–26.
  * Cao and Wang [2020] C. Cao and X. Wang, Noise-assisted quantum autoencoder, Phys. Rev. Applied 15, 054012 (2020), 2012.08331 .
  * Romero  _et al._ [2017] J. Romero, J. P. Olson, and A. Aspuru-Guzik, Quantum autoencoders for efficient compression of quantum data, Quantum Sci. Technol. 2, 045001 (2017).
  * Bravo-Prieto [2021] C. Bravo-Prieto, Quantum autoencoders with enhanced data encoding, Machine Learning: Science and Technology 2, 035028 (2021).
  * Du and Tao [2021] Y. Du and D. Tao, On exploring practical potentials of quantum auto-encoder with advantages (2021).
  * Bondarenko and Feldmann [2020] D. Bondarenko and P. Feldmann, Quantum autoencoders to denoise quantum data, Phys. Rev. Lett. 124, 130502 (2020).
  * Greenberger  _et al._ [1989] D. M. Greenberger, M. A. Horne, and A. Zeilinger, Going beyond bell’s theorem, in  _Bell’s Theorem, Quantum Theory and Conceptions of the Universe_ (Springer Netherlands, 1989) pp. 69–72.
  * Bondarenko  _et al._ [2023] D. Bondarenko, R. Salzmann, and V.-S. Schmiesing, Learning quantum processes with memory – quantum recurrent neural networks (2023).
  * Achache  _et al._ [2020] T. Achache, L. Horesh, and J. Smolin, Denoising quantum states with quantum autoencoders – theory and applications, arXiv 2012.14714 (2020), 2012.14714 .
  * Ruder [2016] S. Ruder, An overview of gradient descent optimization algorithms (2016).
  * Caro  _et al._ [2021] M. C. Caro, H.-Y. Huang, M. Cerezo, K. Sharma, A. Sornborger, L. Cincio, and P. J. Coles, Generalization in quantum machine learning from few training data, arXiv 2111.05292 (2021).
  * Larocca  _et al._ [2021] M. Larocca, N. Ju, D. García-Martín, P. J. Coles, and M. Cerezo, Theory of overparametrization in quantum neural networks, arXiv 2109.11676 (2021), 2109.11676 .
  * Rocks and Mehta [2022] J. W. Rocks and P. Mehta, Bias-variance decomposition of overparameterized regression with random linear features (2022), arXiv 2203.05443.
  * Bennett  _et al._ [1997] C. H. Bennett, D. P. DiVincenzo, and J. A. Smolin, Capacities of quantum erasure channels, Phys. Rev. Lett. 78, 3217 (1997).
  * Grassl  _et al._ [1997] M. Grassl, T. Beth, and T. Pellizzari, Codes for the quantum erasure channel, Physical Review. A 56, 33 (1997).
  * Vidal [2003] G. Vidal, Efficient classical simulation of slightly entangled quantum computations, Phys. Rev. Lett. 91, 147902 (2003).
  * Eisert  _et al._ [2010] J. Eisert, M. Cramer, and M. B. Plenio, Colloquium: Area laws for the entanglement entropy, Rev. Mod. Phys. 82, 277 (2010).
  * Jonathon Brown [2022] A. F. Jonathon Brown, Mauro Paternostro, Optimal quantum contral via genetic algorithm for quantum state engineering (2022), arXiv 2206.1468v2.
  * Ballarin  _et al._ [2022] M. Ballarin, S. Mangini, S. Montangero, C. Macchiavello, and R. Mengioni, Entanglement entropy production in quantum neural networks (2022), arXiv:2206.02474v1.
  * Ansari  _et al._ [2019] M. H. Ansari, A. van Steensel, and Y. V. Nazarov, Entropy production in quantum is different, Entropy 21, 854 (2019).
  * Ansari and Nazarov [2015a] M. H. Ansari and Y. V. Nazarov, Exact correspondence between Renyi entropy flows and physical flows, Phys. Rev. B 91, 174307 (2015a).
  * Ansari and Nazarov [2015b] M. H. Ansari and Y. V. Nazarov, Rényi entropy flows from quantum heat engines, Phys. Rev. B 91, 104303 (2015b).
  * Uzdin [2021] R. Uzdin, Methods for measuring noise, purity changes, and entanglement entropy in quantum devices and systems, arXiv 2112.00546 (2021), 2112.00546 .
  * Ansari and Nazarov [2016] M. Ansari and Y. V. Nazarov, Keldysh formalism for multiple parallel worlds, Journal of Experimental and Theoretical Physics 122, 389 (2016).
  * Abanin  _et al._ [2019] D. A. Abanin, E. Altman, I. Bloch, and M. Serbyn, Colloquium: Many-body localization, thermalization, and entanglement, Rev. Mod. Phys. 91, 021001 (2019).

##  Appendix A Denoising a 6-qubit input GHZ states on (6,2,BB,2,6) networks

In this section we present results related to denoising 6-qubit input GHZ
states.

###  A.1 Training procedure

The input layer is initialized with 6-qubit inputs, while the rest of the
network is initialized in the ground state. The network is trained with a set
of 200 noisy GHZ states and bit-flip probabilities $p$. After the training is
over, the optimized quantum map is used to test the performance on some new
noisy GHZ states the network was not trained with. The result is repeated for
200 test states at different $p$ values between 0 and 0.5. For every choice of
brainbox, we evaluate the output state fidelity. Results are plotted in Fig.7.

Figure 7: (a) Testing fidelty: Average output state fidelity over a range of
noisy input test states with noise probability $p$. The error bars indicates
the absolute value of standard deviation in the data about average fidelity.
(b) Training data set: The distribution of 6-qubit GHZ and non-GHZ states in
infinitely many samples (dashed line) versus finite 200 samples (solid lines).
In the infinite sample case the distribution of GHZ for all noise
probabilities $p$ dominates, while artefacts in the finite data set prevents
the dominance at strongly noisy channels.

As discussed in the main text, in the limit of infinite size data set, the
distribution of GHZ and non-GHZ states is such that the amount of GHZ states
is always larger than that of non-GHZ except at $p=0.5$. This distribution in
Fig.7(b) is shown in dashed line. Reducing the size of our training data to a
finite value makes zigzag deviations about the ideal distribution. Around
$p=0.35$, the finiteness disorder reverts the superiority of GHZ state which
deceives the network into recovering an undesired target state. Solid lines in
Fig.7(b) shows the training data we used to denoise a 6-qubit QAE.

###  A.2 Training impedance

Results for (6,2,BB,2,6) networks listed in Fig.7(a) show the tolerance
threshold for denoising outputs. However, some complex BBs such as (1,2), (3)
reach the same tolerance than simpler BBs, such as (1,1), (2). In order to
understand which BB is more efficient, we evaluate training impedance in the
networks. Results can be found in Fig. (8). For all $p$ values within the
range indicated in the plots, the network (1,1) and (1,1,1) have less
resistivity against training compared to the network (2) and (3), and even
(1,2).

Figure 8: Training impedance for the optimization of (6,2,BB,2,6) networks. In
contrast to the 4-qubit inputs, linear BBs perform best at all noise
intensities, except for the (2,1)-configuration.

###  A.3 Cross testing

In the section the result of cross testing of the (6,2,1,2,6) network with
brainbox (1) is discussed. As mentioned in the previous appendix sections, the
(1)-QAE network can tolerate noise in the domain of $p\leq 0.2$. In this range
of noise strengths, the network carries an intermediate impedance to training,
which makes it efficient for training. Training the network with bit-flip
noise channel of $p_{\rm{train}}=0.05$ trains the network based on a dominant
subset of GHZ states in the training data set.

Figure 9: Cross-tests results for two networks: (6,2,1,2,6) associated to the
brainbox subnetwork (1). Three noise channels were implemented with noise
intensities $p_{\rm{test}}$: the bit-flip channel (full lines), the
depolarizing channel (dashed lines) and the erasure channel (dotted lines).

This training makes the network resilient to (1) bit-flip, (2) depolarizing,
(3) erasure channels in a large domain of noise strength $p_{\rm{test}}<0.5$.
However training the network with input noise probability beyond the network
tolerance makes the network confused about the identity of the dominant subset
in the training data set. This suppresses the fidelity of output state to
$<90\%$.

##  Appendix B Entropy evolution

In this appendix we list some result on the time evolution of entropy during
training steps. We consider the network (4,2,1,2,4) with (1)- bottleneck. On
this network we start the input layer (layer 1) with a set of noisy GHZ states
with noise strength $p$. All other qubits in other layers are in the ground
state. We initialize a quantum map at random and optimize it iteratively to
create ideal GHZ states on the output layer (layer 5). At each step we
evaluate total network density matrix and by tracing out the irrelevant
layers, we evaluate the second order Rényi entropy for each layer. The result
for $p=0.1$ can be seen in Fig. (10 a) and for $p=0.45$ in Fig. (10 b).

(a)
(b)

Figure 10: Rényi entropy flow in individual layers of (4,2,1,2,4) network
during its evolution during the training (x-axis). The bit-flip probability
$p$ of the noisy input GHZ states is $0.1$ in (a) and 0.4 in (b).

As expected, all layers start from zero entropy and quickly raise their
entropy as they capture mixed state from the noisy input. Even as one can see
the output layer (layer 5) shows a large entropy after a few steps of
optimization.

Continuing optimization lowers the entropy of the decoder (layers 4 and 5)
much faster than in the encoder (layers 1 and 2). The end of the denoising
processes have been magnified in the two insets in (a) and (b). One can see
that in the weak noise regime of (a) with $p=0.1$ layer 5 carries zero
entropy, which makes it a separable state from other layers. In the strong
noise regime (b) with $p=0.45$, entropy of the output layer is finite and
larger than that of the bottleneck (layer 3), which makes the state entangled
to other layers and therefore being affected by input noise. This prevents
this network to land on stable high fidelity GHZ state due to stray couplings.