ResQNets: A Residual Approach for Mitigating Barren Plateaus in Quantum
  Neural Networks
The barren plateau problem in quantum neural networks (QNNs) is a significant
challenge that hinders the practical success of QNNs. In this paper, we
introduce residual quantum neural networks (ResQNets) as a solution to address
this problem. ResQNets are inspired by classical residual neural networks and
involve splitting the conventional QNN architecture into multiple quantum
nodes, each containing its own parameterized quantum circuit, and introducing
residual connections between these nodes. Our study demonstrates the efficacy
of ResQNets by comparing their performance with that of conventional QNNs and
plain quantum neural networks (PlainQNets) through multiple training
experiments and analyzing the cost function landscapes. Our results show that
the incorporation of residual connections results in improved training
performance. Therefore, we conclude that ResQNets offer a promising solution to
overcome the barren plateau problem in QNNs and provide a potential direction
for future research in the field of quantum machine learning.
Muhammad Kashif, Saif Al-kuwari
# ResQNets: A Residual Approach for Mitigating Barren Plateaus in Quantum Neural Networks

###### Abstract

The barren plateau problem in quantum neural networks (QNNs) is a significant challenge that hinders the practical success of QNNs. In this paper, we introduce residual quantum neural networks (ResQNets) as a solution to address this problem. ResQNets are inspired by classical residual neural networks and involve splitting the conventional QNN architecture into multiple quantum nodes, each containing its own parameterized quantum circuit, and introducing residual connections between these nodes. Our study demonstrates the efficacy of ResQNets by comparing their performance with that of conventional QNNs and plain quantum neural networks (PlainQNets) through multiple training experiments and analyzing the cost function landscapes. Our results show that the incorporation of residual connections results in improved training performance. Therefore, we conclude that ResQNets offer a promising solution to overcome the barren plateau problem in QNNs and provide a potential direction for future research in the field of quantum machine learning.

## 1 Introduction

The Noisy Intermediate-Scale Quantum (NISQ) devices are a new generation of quantum computers capable of executing quantum algorithms. However, NISQ devices still suffer from significant errors and limitations in terms of the number of qubits and coherence time [1]. Despite these limitations, NISQ devices are an important stepping stone towards developing fault-tolerant quantum computers, as they provide a platform for exploring and evaluating basic quantum algorithms and applications [2]. Research in the NISQ era is focused on developing algorithms and techniques that are resilient to noise and errors, and can run effectively on NISQ devices [3]. This includes algorithms for quantum error correction [4], quantum optimization [5], and quantum machine learning (QML)[6].

QML is an interdisciplinary field that combines the concepts and techniques from quantum computing and machine learning (ML). It aims to leverage the unique properties of quantum systems, such as superposition, entanglement, and interference, to develop new algorithms and approaches for solving complex machine learning problems [7]. QML is increasingly becoming an exciting application in the NISQ era [2]. The anticipation here is that the quantum models (by exploiting the exponentially large Hilbert space) would achieve a computational advantage over their classical counterparts [8, 9], particularly for quantum datasets [10, 11, 12]. With continued advancements in quantum hardware [13], development of new quantum algorithms [14], quantum error correction and fault tolerance [15], the future of QML is bright, and it is likely to play a significantly important role in the field of machine learning. A wide range of ML algorithms are being explored in the quantum realm, including
quantum neural networks (QNNs) [16], quantum support vector machines [17, 18], quantum principal component analysis [19], and quantum reinforcement learning [20]. These approaches were shown to be effective in various domains, such as image classification [21], natural language processing [22], and recommendation systems [23].

QNNs is a promising area of research that aims to combine the power of quantum computing and neural networks to solve complex computational problems [24, 25]. Unlike classical neural networks, QNNs use quantum-inspired representations and operations for encoding and processing data [26, 27, 28, 29]. This allows for the exploration of exponential solution space and the exploitation of quantum parallelism, potentially leading to faster and more accurate results [7]. QNNs can be considered as a subclass of variational quantum algorithms, which aim to optimize parameters (\(\theta\)) of a parameterized quantum circuit (PQC) 1\(U(\theta)\) to minimize the cost function \(\mathcal{C}\). PQC utilizes tunable parameters to optimize quantum algorithms through classical computation. One example of a QNN architecture is the quantum Boltzmann machine [30, 31], which uses quantum circuits to model complex probability distributions and perform unsupervised learning tasks. In addition to unsupervised learning, QNNs have shown potential in various applications such as quantum feature detection [18], quantum data compression and denoising[32, 33], and quantum reinforcement learning [34]. QNNs can also be used for quantum-enhanced image recognition [6, 35] and quantum molecular simulations [36].

Footnote 1: we will use the terms “PQC” and “quantum layers” interchangeably

However, despite their potential, QNNs are still in the early stages of development and face several technical and practical challenges. In particular, training and optimizing the parameters in QNNs pose significant challenges. To address these challenges, the research community has been developing the quantum landscape theory [37] that explores the properties of cost function landscapes in QML systems. Consequently, interesting results have been obtained in the study of QNN's training landscapes, including the occurrence of barren plateaus (BP) [38], the presence of sub-optimal local minima [39], and the impact of noise on cost function landscapes [40, 41, 42, 43]. These findings provide important insights into the properties of QNNs and their training dynamics, and can inform the development of new algorithms and strategies for training and optimizing QNNs.

In particular, the BP problem refers to a phenomenon in which the circuit's expressiveness, as measured by its ability to approximate a target unitary operation, is severely limited as the number of qubits in the circuit increases [38], which is mainly due to vanishing gradients in the parameter space. The phenomenon of BP in QNNs is a significant challenge that impedes the advancement and widespread implementation of QNNs. To mitigate the BP, various strategies have been proposed, including the use of clever parameter initialization techniques [44], pre-training [45], examination of the dependence on the cost function [46, 47], implementation of layer-wise training of QNNs [48], and initialization parameters drawn from the beta distribution[49]. These solutions aim to overcome the limitations posed by the BP in QNNs and facilitate the full realization of their potential. However, it is important to note that the solution that works best for one QNN architecture may not work for another, as the BP problem can be highly dependent on the specific problem being solved and the quantum architecture being used.

Contribution.In this paper, we propose a novel solution for mitigating the issue of barren plateaus (BP) in quantum neural networks (QNNs). Our approach is based on the concept of residual neural networks, which were previously introduced as a means to overcome the vanishing gradient problem in classical neural networks. For this, we present residual quantum neural networks (ResQNets) by incorporating residual connections between two quantum layers of varying depths. Our findings indicate that ResQNets greatly enhance the training of QNNs compared to plain QNNs (PlainQNets). To validate our proposed ResQNets, we perform comparisons of their cost function landscapes and training performance with that of PlainQNets. Our experimental results demonstrate that the residual connections in ResQNets effectively mitigate the adverse effects of BP and result in improved overall training performance.
Organization.The rest of the paper is organized as follows: Section 2 provides an overview of both classical and quantum residual neural networks and motivates their application. Section 3 discusses parameterized quantum circuits and elaborate on how can multiple PQCs be cascaded. This section also introduces the residual approach in cascaded PQCs. The methodology we adopt in this paper while conducting the various experiments is provided in Section 4. Section 5 presents the results we obtained on both the simulation environment and real quantum devices. Finally, the paper concludes in section 6 with a few concluding remarks and pointers to possible extensions to this work.

## 2 Residual Neural Networks

Residual Neural Networks (ResNets) are a type of deep neural network architecture that aims to improve the training process by addressing the vanishing gradient problem. The basic idea behind ResNets is to introduce residual connections between layers in the network, allowing for easier optimization as the network gets deeper. The residual connections allow the network to learn residual mapping rather than trying to fit the target function directly. This helps prevent the vanishing gradient problem, where the gradients in the backpropagation process become very small, making it difficult to update the parameters effectively. ResNets were first introduced in [50], where the authors showed that ResNets outperformed traditional deep neural networks on benchmark image recognition tasks and demonstrated that ResNets could accommodate significantly deeper architectures than previous networks without sacrificing accuracy.

The residual connections in ResNets have been shown to be effective for training very deep neural networks, with hundreds or even thousands of layers. This has drastically improved the performance in several computer vision and natural language processing tasks. A typical structure of a residual block in ResNets is depicted in Figure 0(a).

Given an input feature map \(x\), the basic building block of a ResNet can be defined as:

\[H(x)=F(x,W_{i})+x\]

where \(H(x)\) is the output of the block, \(F\) is a non-linear function represented by a series of neuron and activation layers with parameters \(W_{i}\), and \(x\) is the input feature map that is added back to the output (the residual connection). The model is trained to learn the function \(F\) such that it approximates the residual mapping \(y-x\), where \(y\) is the desired output. By introducing residual connections, ResNets can address the vanishing gradient problem in deep neural networks, allowing for deeper architectures to be trained effectively.

In this paper, we introduce the quantum counterpart of ResQNet, namely residual quantum neural network (ResQNet), a QNN architecture combining the principles of classical ResNets with QNNs. The basic idea is to add a residual connection between the output of one layer of quantum operations and the input of the next layer. This helps to mitigate the vanishing gradient problem, a.k.a BP, which is a major challenge in QNNs and arises as the number of qubits in the systems increases. Figure 0(b) directs how ResQNets works compared to ResNets.

In ResQNets, the residual connection is represented mathematically as:

Figure 1: Residual block structure
\[\psi_{\rm out}(\theta)=\psi(\theta)+U(\theta)\psi(\theta)\]

where \(\psi(\theta)\) is the input to the quantum circuit, \(U(\theta)\) is the unitary operation defined by the PQC, and \(\psi_{\rm out}(\theta)\) is the output.

## 3 Parameterized Quantum Circuits

QNN is a type of Parameterized Quantum Circuit (PQC), which is a quantum circuit that has tunable parameters that can be optimized to perform specific tasks. In a QNN, the parameters are typically optimized using classical optimization algorithms to learn a target function or perform a specific task. The PQC architecture of a QNN allows for the representation and manipulation of quantum data in a manner that can be used for various applications, such as QML and quantum control. The mathematical derivation of PQC involves the representation of quantum states and gates as matrices and the composition of these matrices to form the overall unitary operator for the circuit.

A quantum state can be represented by a column vector in a Hilbert space, where the elements of the vector are complex numbers that satisfy the normalization constraint:

\[\left|\psi\right\rangle=\left[\alpha\ \beta\right],\quad\left|\alpha\right|^{2 }+\left|\beta\right|^{2}=1\]

A quantum gate is represented by a unitary matrix, which preserves the norm of the vector, i.e., the inner product of the transformed vector with itself is equal to the inner product of the original vector with itself:

\[U^{\dagger}U=UU^{\dagger}=I\]

where \(U^{\dagger}\) is the conjugate transpose of \(U\) and \(I\) is the identity matrix. A PQC can be modeled as a sequence of gates, each represented by a unitary matrix based on classical parameters. The overall unitary operator of the circuit can be obtained by composing the matrices of the individual gates in the correct order:

\[U_{\rm circuit}=U_{n}(\theta_{n})\cdots U_{2}(\theta_{2})U_{1}(\theta_{1})\]

where \(U_{i}(\theta_{i})\) is the unitary matrix representing the \(i\)-th gate and \(\theta_{i}\) is a classical parameter.

The final quantum state after applying the PQC to an initial state can be obtained by matrix-vector multiplication:

\[\left|\psi_{\rm final}\right\rangle=U_{\rm circuit}\left|\psi_{\rm initial}\right\rangle\]

The parameters \(\theta_{1},\ldots,\theta_{n}\) can be optimized using classical optimization algorithms to achieve a desired quantum state or to maximize an objective function such as the expected value of a measurement outcome. The optimization problem can be written as:

\[\theta^{*}=\arg\max_{\theta}\left|\left\langle\psi_{\rm desired}\right|U_{ \rm circuit}(\theta)\left|\psi_{\rm initial}\right\rangle\right|^{2}\]

Solving this optimization problem provides the optimal set of parameters \(\theta^{*}\) that produce the desired outcome.

### Cascading PQCs

In the proposed ResQNets, we encapsulate PQC/QNNs into a quantum node (QN), and arrange multiple QNs in a series, such that the output from one QN serves as the input for the next. This structure enables us to introduce the residual learning approach in a manner that allows the PQCs to work together to achieve the desired outcome. The process of cascading PQCs involves feeding the
output of each PQC into the input of the next, creating a layered structure where each layer represents a single PQC. In this case, each PQC can build upon the outputs of the previous ones, leading to a more complex and sophisticated computation. To ensure that the overall computation remains stable, the residual learning approach is employed, where the output of each PQC is combined with the input of the next in a specified manner.

We now present the mathematical formulation for connecting multiple PQCs in sequence. We will refer to each PQC as \(U_{i}\) where \(i\) denotes the QN it is encapsulated in.

#### 3.1.1 2-Cascaded PQC

Consider two PQCs denoted as \(U_{1}(\theta_{1})\) and \(U_{2}(\theta_{2})\), where \(\theta_{1}\) and \(\theta_{2}\) are classical parameters. The first PQC \(U_{1}(\theta_{1})\) is applied to an initial quantum state \(\ket{\psi_{\text{initial}}}\) to obtain an intermediate quantum state \(\ket{\psi_{\text{intermediate}}}\):

\[\ket{\psi_{\text{intermediate}}}=U_{1}(\theta_{1})\ket{\psi_{\text{initial}}}\]

The second PQC \(U_{2}(\theta_{2})\) is then applied to the intermediate state \(\ket{\psi_{\text{intermediate}}}\) to obtain the final quantum state \(\ket{\psi_{\text{final}}}\):

\[\ket{\psi_{\text{final}}}=U_{2}(\theta_{2})\ket{\psi_{\text{intermediate}}}\]

The overall unitary operator of the two cascaded PQCs can be obtained by composing the matrices of the individual PQCs in the correct order:

\[U_{\text{circuit}}=U_{2}(\theta_{2})U_{1}(\theta_{1})\]

The final quantum state after applying the two cascaded PQCs to an initial state can be obtained by matrix-vector multiplication:

\[\ket{\psi_{\text{final}}}=U_{\text{circuit}}\ket{\psi_{\text{initial}}}\]

The parameters \(\theta_{1}\) and \(\theta_{2}\) can be optimized using classical optimization algorithms to achieve a desired quantum state or to maximize an objective function such as the expected value of a measurement outcome. The optimization problem can be written as:

\[\theta_{1},\theta_{2}^{=}\arg\max_{\theta_{1},\theta_{2}}\abs{\bra{\psi_{ \text{desired}}}U_{\text{circuit}}(\theta_{1},\theta_{2})\ket{\psi_{\text{ initial}}}}^{2}=\arg\max_{\theta_{1},\theta_{2}}\abs{\bra{\psi_{\text{desired}}}U_{2}( \theta_{2})U_{1}(\theta_{1})\ket{\psi_{\text{initial}}}}^{2}\]

Solving this optimization problem returns the optimal set of parameters \((\theta_{1},\theta_{2})\) that produce the desired outcome.

#### 3.1.2 \(n\)-Cascaded PQCs

Similarly, for \(n\) cascaded PQCs, where each PQC takes the output of the previous one as its input, the intermediate states can be described as follows:

\[\ket{\psi_{\text{intermediate},i}}=U_{i}(\theta_{i})\ket{\psi_{\text{intermediate },i-1}}\]

where \(i=1,2,\cdots,n\) and \(\ket{\psi_{\text{intermediate},0}}=\ket{\psi_{\text{initial}}}\). The overall unitary operator of the \(n\) cascaded PQCs can be obtained by composing the matrices of the individual PQCs in the correct order:

\[U_{\text{circuit}}=U_{n}(\theta_{n})\cdots U_{2}(\theta_{2})U_{1}(\theta_{1})\]

The final quantum state after applying the \(n\) cascaded PQCs to an initial state can be obtained by matrix-vector multiplication:
\[\left|\psi_{\text{final}}\right\rangle=U_{\text{circuit}}\left|\psi_{\text{ initial}}\right\rangle\]

The parameters \(\theta_{1},\theta_{2},\cdots,\theta_{n}\) can be optimized using classical optimization algorithms to achieve a desired quantum state or to maximize an objective function such as the expected value of a measurement outcome. The optimization problem can be written as:

\[\theta_{1},\theta_{2},\cdots,\theta_{n} =\arg\max_{\theta_{1},\theta_{2},\cdots,\theta_{n}}\left|\left\langle \psi_{\text{desired}}\right|U_{\text{circuit}}(\theta_{1},\theta_{2},\cdots, \theta_{n})\left|\psi_{\text{initial}}\right\rangle\right|^{2}\] \[=\arg\max_{\theta_{1},\theta_{2},\cdots,\theta_{n}}\left|\left\langle \psi_{\text{desired}}\right|U_{n}(\theta_{n})\cdots U_{2}(\theta_{2})U_{1}( \theta_{1})\left|\psi_{\text{initial}}\right\rangle\right|^{2}\]

Solving this optimization problem returns the optimal set of parameters \((\theta_{1},\theta_{2},\cdots,\theta_{n})\) that produce the desired outcome.

### Residual PQCs

We now introduce residual blocks in the cascaded PQCs encapsulated in QNs which we call ResQNets. In ResQNets, the output of the previous PQC is added to its input and fed as an input to the next PQC. The residual block is inserted to facilitate efficient information flow and improved performance. The primary objective of incorporating residual blocks in QNNs here is to overcome the difficulties associated with BP and thereby improve the learning process. Furthermore, the proposed method aims to harness the strengths of both residual learning and quantum computing to tackle complex problems more effectively.

To mathematically formulate our proposed ResQNets, we start by considering the case of two PQCs, and extend the approach to the general case of cascading \(n\) PQCs with \(n\) residual blocks. We will refer to each PQC as \(U_{i}\) where \(i\) denotes the QN it is encapsulated in.

#### 3.2.1 1-Residual Block

ResQNet with a single residual block contains a maximum of two PQCs of arbitrary depth enclosed in two separate QNs. The first QN serves as a residual block whose input is added to its output before passing it as input to the PQC in the next QN. For the mathematical formulation of such a setting, consider two PQCs, denoted as \(U_{1}(\theta_{1})\) and \(U_{2}(\theta_{2})\), where \(\theta_{1}\) and \(\theta_{2}\) are classical parameters. The first PQC \(U_{1}(\theta_{1})\) is applied to an initial quantum state \(\left|\psi_{\text{initial}}\right\rangle\) to obtain an intermediate quantum state \(\left|\psi_{\text{intermediate}}\right\rangle\):

\[\left|\psi_{\text{intermediate}}\right\rangle=U_{1}(\theta_{1})\left|\psi_{ \text{initial}}\right\rangle\]

In this case, the input of the second PQC \(U_{2}(\theta_{2})\) is not just the intermediate state \(\left|\psi_{\text{intermediate}}\right\rangle\), but the sum of the initial state \(\left|\psi_{\text{initial}}\right\rangle\) and the intermediate state \(\left|\psi_{\text{intermediate}}\right\rangle\):

\[\left|\psi_{\text{input}}\right\rangle=\left|\psi_{\text{initial}}\right\rangle +\left|\psi_{\text{intermediate}}\right\rangle\]

The second PQC \(U_{2}(\theta_{2})\) is then applied to the input state \(\left|\psi_{\text{input}}\right\rangle\) to obtain the final quantum state \(\left|\psi_{\text{final}}\right\rangle\):

\[\left|\psi_{\text{final}}\right\rangle=U_{2}(\theta_{2})\left|\psi_{\text{ input}}\right\rangle\]

The overall unitary operator of the two cascaded PQCs can be obtained by composing the matrices of the individual PQCs in the correct order:

\[U_{\text{circuit}}=U_{2}(\theta_{2})U_{1}(\theta_{1})\]
The final quantum state, after applying the two cascaded PQCs to an initial state, can be obtained by matrix-vector multiplication:

\[\left|\psi_{\text{final}}\right\rangle=U_{\text{circuit}}\left|\psi_{\text{ initial}}\right\rangle\]

\[\left|\psi_{\text{final}}\right\rangle=U_{\text{circuit}}\left(\left|\psi_{ \text{initial}}\right\rangle+\left|\psi_{\text{intermediate}}\right\rangle\right)\]

\[\left|\psi_{\text{final}}\right\rangle=U_{2}(\theta_{2})\left(\left|\psi_{ \text{initial}}\right\rangle+U_{1}(\theta_{1})\left|\psi_{\text{initial}}\right\rangle)\]

The parameters \(\theta_{1}\) and \(\theta_{2}\) can be optimized using classical optimization algorithms to achieve a desired quantum state or to maximize an objective function such as the expected value of a measurement outcome.

#### 3.2.2 2-Residual blocks

In ResQNets with two residual blocks, up to three PQCs can be incorporated within three QNs. There are three potential configurations for the residual blocks in this setup:

1. utilizing only the first QN as a residual block,
2. combining the first two QNs to form a single residual block,
3. utilizing both the first and second QNs individually as separate residual blocks.

For our mathematical formulation, only the third configuration will be considered since it is the general setting for the case of two residual blocks; other configurations effectively contain a single residual block, which has already been mathematically derived in section 3.2.1. However, we will conduct experiments examining all three configurations to determine which configuration performs the best.

Let \(U_{1}(\theta_{1})\), \(U_{2}(\theta_{2})\), and \(U_{3}(\theta_{3})\) be PQCs enclosed in three QNs, where \(\theta_{1}\), \(\theta_{2}\), and \(\theta_{3}\) are classical parameters. The first PQC \(U_{1}(\theta_{1})\) takes an initial quantum state \(\left|\psi_{\text{initial}}\right\rangle\) as its input and produces an intermediate quantum state \(\left|\psi_{\text{intermediate}}\right\rangle\):

\[\left|\psi_{\text{intermediate}}\right\rangle=U_{1}(\theta_{1})\left|\psi_{ \text{initial}}\right\rangle\]

The second PQC \(U_{2}(\theta_{2})\) takes the sum of the initial state \(\left|\psi_{\text{initial}}\right\rangle\) and the intermediate state \(\left|\psi_{\text{intermediate}}\right\rangle\) as its input and produces another intermediate quantum state \(\left|\psi_{\text{intermediate}}^{\prime}\right\rangle\):

\[\left|\psi_{\text{input}}\right\rangle=\left|\psi_{\text{initial}}\right\rangle +\left|\psi_{\text{intermediate}}\right\rangle\]

\[\left|\psi_{\text{intermediate}}^{\prime}\right\rangle=U_{2}(\theta_{2}) \left|\psi_{\text{input}}\right\rangle\]

Finally, the third PQC \(U_{3}(\theta_{3})\) takes the sum of the input \(\left|\psi_{\text{input}}\right\rangle\) and the intermediate state \(\left|\psi_{\text{intermediate}}^{\prime}\right\rangle\) as its input and produces the final quantum state \(\left|\psi_{\text{final}}\right\rangle\):

\[\left|\psi_{\text{input}}^{\prime}\right\rangle=\left|\psi_{\text{input}} \right\rangle+\left|\psi_{\text{intermediate}}^{\prime}\right\rangle\]

\[\left|\psi_{\text{final}}\right\rangle=U_{3}(\theta_{3})\left|\psi_{\text{ input}}^{\prime}\right\rangle\]

The overall unitary operator of the three cascaded PQCs can be obtained by composing the matrices of the individual PQCs in the correct order:

\[U_{\text{circuit}}=U_{3}(\theta_{3})U_{2}(\theta_{2})U_{1}(\theta_{1})\]
The final quantum state after applying the three cascaded PQCs to an initial state can be obtained by matrix-vector multiplication:

\[\left|\psi_{\text{final}}\right\rangle=U_{\text{circuit}}\left|\psi_{\text{ initial}}\right\rangle=U_{3}(\theta_{3})U_{2}(\theta_{2})U_{1}(\theta_{1})\left|\psi_{ \text{initial}}\right\rangle\]

#### 3.2.3 \(n\) Residual Blocks

In the case of \(n\) PQCs enclosed within \(n\) QNs, there are multiple potential configurations for the residual blocks. The mathematical formulation considered here assumes that each of the \(n\) QNs is used as a separate residual block. However, the formulation can be adapted to account for alternative configurations of residual blocks, as needed. For \(n\) PQCs, the ResQNet can be represented as:

\[\left|\psi_{\text{intermediate}}^{(1)}\right\rangle=U_{1}(\theta_{1}) \left|\psi_{\text{initial}}\right\rangle\] \[\left|\psi_{\text{input}}^{(1)}\right\rangle=\left|\psi_{\text{ initial}}\right\rangle+\left|\psi_{\text{intermediate}}^{(1)}\right\rangle\] \[\left|\psi_{\text{intermediate}}^{(2)}\right\rangle=U_{2}(\theta_ {2})\left|\psi_{\text{input}}^{(1)}\right\rangle\] \[\left|\psi_{\text{input}}^{(2)}\right\rangle=\left|\psi_{\text{ input}}^{(1)}\right\rangle+\left|\psi_{\text{intermediate}}^{(2)}\right\rangle\] \[\vdots\]

\[\left|\psi_{\text{intermediate}}^{(n-1)}\right\rangle=U_{n-1}(\theta_{n-1}) \left|\psi_{\text{input}}^{(n-2)}\right\rangle\] \[\left|\psi_{\text{input}}^{(n-1)}\right\rangle=\left|\psi_{\text {input}}^{(n-2)}\right\rangle+\left|\psi_{\text{intermediate}}^{(n-1)}\right\rangle\] \[\left|\psi_{\text{final}}\right\rangle=U_{n}(\theta_{n})\left| \psi_{\text{input}}^{(n-1)}\right\rangle\]

And the overall unitary operator of the \(n\) cascaded PQCs is:

\[U_{\text{circuit}}=U_{n}(\theta_{n})U_{n-1}(\theta_{n-1})\cdots U_{2}(\theta _{2})U_{1}(\theta_{1})\]

The equation can be written in a summation form as follows:

\[\left|\psi_{\text{final}}\right\rangle=U_{n}(\theta_{n})\left(\left|\psi_{ \text{initial}}\right\rangle+\sum_{k=1}^{n-1}U_{k}(\theta_{k})\left|\psi_{ \text{input}}^{(k-1)}\right\rangle\right)\]

where \(\left|\psi_{\text{input}}^{(k-1)}\right\rangle=\left|\psi_{\text{input}}^{( k-2)}\right\rangle+\left|\psi_{\text{intermediate}}^{(k-1)}\right\rangle\) and \(\left|\psi_{\text{intermediate}}^{(k)}\right\rangle=U_{k}(\theta_{k})\left| \psi_{\text{input}}^{(k-1)}\right\rangle\).

Given a set of \(n\) PQCs, \(U_{1}(\theta_{1}),U_{2}(\theta_{2}),\ldots,U_{n}(\theta_{n})\) and an initial quantum state \(\left|\psi_{\text{initial}}\right\rangle\), the objective is to find the set of classical parameters \(\boldsymbol{\theta}=\theta_{1},\theta_{2},\ldots,\theta_{n}\) that maximizes (or minimizes) some cost function \(C(\boldsymbol{\theta})\) associated with the final quantum state \(\left|\psi_{\text{final}}\right\rangle\) produced by the cascaded PQCs. The optimization problem can be formulated as:

\[\boldsymbol{\theta}^{\star}=\arg\max_{\boldsymbol{\theta}}C(\boldsymbol{ \theta})\]

or

\[\boldsymbol{\theta}^{\star}=\arg\min_{\boldsymbol{\theta}}C(\boldsymbol{ \theta})\]

where \(\boldsymbol{\theta}^{\star}\) represents the optimal set of classical parameters that maximizes (or minimizes) the cost function. Note that the cost function \(C(\boldsymbol{\theta})\) can be defined based on the desired behavior of the quantum circuit and can be calculated from the final quantum state \(\left|\psi_{\text{final}}\right\rangle\).
Methodology

In classical NNs, residual neural networks (ResNets) were proposed to overcome the problem of vanishing gradients and were very useful for enabling deep learning in classical machine learning. In this paper, we propose a Residual Quantum Neural Networks (ResQNets), to enable deep learning in QNNs by mitigating the effect of BP as a function of the number of layers.

The conventional approach to constructing QNNs contains an arbitrarily deep PQC, which takes some input and yields some output. Such an architecture typically has a single QN, as depicted in Figure 1(a). In this paper, we refer to this traditional QNN architecture as "Simple PlainQNet".

To construct our proposed ResQNets, we need to further split the traditional QNN architecture into two QNs, where every QN contains arbitrary deep quantum layers. Since our proposed ResQNets contain at least two QNs and the traditional way of constructing QNNs contains a single QN, we construct a slightly modified version of simple PlainQNet, which we call "PlainQNet" and includes two or more QNs, with each QN containing PQCs of arbitrary depth, as shown in Figure 1(b). In PlainQNets, the output of the previous QN is fed to the next QN. The purpose of constructing PlainQNet is to have a fair comparison with our proposed ResQNets because ResQNets need two or more QNs to work. An example of ResQNet architecture with two QNs is shown in Figure 1(c). The PlainQNet architecture is similar to general QNN split into two QNs, whereas in the case of ResQNet, the first QN serves as the residual block, i.e., the input of the first QN is added to its output and then passed as input to the second QN.

It should be noted that ResQNets can comprise multiple QNs with various arrangements of residual blocks. For instance, the ResNet from Figure 1(c) can be extended to have three QNs, in which case three potential configurations can be employed. These include having the first and second QNs acting as individual residual blocks, combining the first and second QNs to serve as a single residual block, and only the first QN functioning as the residual block. The possibility of these three configurations has been taken into consideration. We also consider the case of three QNs with these configurations.

Figure 2: QNN architecture used in this paper (a) Simple PlainQNet (b) PlainQNet and (c) ResQNet
### Quantum Layers Design

For the design of quantum layers, we use a periodic structure containing two single-qubit unitaries (\(RX\) and \(RY\)) per qubit. These unitaries are randomly initialized in the range \([0,\pi]\). Furthermore, a two-qubit gate, i.e., \(CNOT\)-gate is used to entangle qubits, and every qubit is entangled with its neighboring qubit. Figure 3 shows the example design of the quantum layers we used (5 qubits). All the QNs in our experiments have the same quantum layers design.

### Depth of Quantum Layers

The impact of the quantum layer depth in examining the existence of BP in the cost function landscape of a QNN is significant. Effective depth (the longest path within the quantum circuit until the measurement) is crucial in this regard. For convenience, We introduce two depth parameters: layer depth (\(D_{L}\)) and effective depth (\(D_{E}\)). The layer depth \(D_{L}\) refers to the combined number of repetitions of the quantum layer illustrated in Figure 3 in both QNs, while the effective depth \(D_{E}\) represents the overall depth. For our quantum layers design, the following equation can be used to calculate the effective depth.

\[\textit{Total Effective Depth}=D_{E}=4\times D_{L}+k \tag{1}\]

where \(k=2,3,4,5\ldots\) for \(5,6,7,8\ldots\) qubits, respectively. Since the quantum layers are split into two separate QNs, and the depth per QN can be crucial to achieving better performance, it is important to calculate \(D_{E}\) of each QN individually and then add them to obtain the final \(D_{E}\). Failure to calculate the depth in each QN separately could result in an effective depth different from the sum of the effective depths of each QN, i.e., \(D_{L}/QN1+D_{L}/QN2\neq D_{E}\). For example, with \(D_{L}=2\), the total effective depth would be 10 without considering the splitting into two QNs. However, if \(D_{L}\) is split into two QNs with \(D_{L}/QN=1\), the effective depth would be 12. A modified version of Equation 1 should be used to calculate the \(D_{E}\) per QN, as described below.

\[\textit{Effective Depth per QN}=D_{E}/QN=4\times D_{L}/QN+k \tag{2}\]

### Depth Distribution per QN

As previously discussed, ResQNets and PlainQNets consist of multiple QNs, which results in different depth splits for a given depth of quantum layers. According to the definition of BP, the gradient vanishes as a function of the number of qubits; hence, we fix the depth of quantum layers to \(D_{L}=6\), and only vary the number of qubits. Table 1 summarizes the different depth per QN combinations

Figure 3: Quantum Layers Design
for \(D_{L}=6\), and all these depth combinations are tested for different numbers of qubits. Column 3 of Table 1 represents the depth split in the form of ordered pairs (we refer to this form in the rest of the paper whenever we discuss depth split per QN). For instance, \((1,5)\) denotes \(D_{L}=1\) in the first QN and \(D_{L}=5\) in the second QN. The depth per QN combination can be extended to more than two QNs in a similar manner.

### Cost Function Definition

For training our proposed ResQNet, we consider a simple example of learning the identity gate. In such a scenario a natural cost function would be the difference of 1 minus the probability of measuring an all-zero state, which can be described by the following equation.

\[C=\left\langle\psi(\theta)\right|(I-\left|0\right\rangle\left\langle 0\right|) \left|\psi(\theta)\right\rangle=1-p_{\left|0\right\rangle}\]

We consider the global cost function setting, i.e., we measure all the qubits in the network. Therefore, the above cost function definition will be applied across all the qubits according to the following equation.

\[C=\left\langle\psi(\theta)\right|(I-\left|00\ldots 0\right\rangle\left\langle 0 0\ldots 0\right|)\left|\psi(\theta)\right\rangle=1-p_{\left|00\ldots 0\right\rangle} \tag{3}\]

For cost function optimization, we use Adam optimizer (with a stepsize of 0.1), which is a gradient-based optimization method for optimization problems. The Adam optimizer updates the parameters of a model iteratively based on the gradient of the loss function with respect to the parameters. The Adam optimizer uses an exponentially decaying average of the first and second moments of the gradients to adapt the learning rate for each parameter. Let \(g_{t}\) be the gradient of the loss function with respect to the parameters at iteration \(t\). The first moment, \(m_{t}\), and the second moment, \(v_{t}\), are computed as follows:

\[m_{t} =\beta_{1}m_{t-1}+(1-\beta_{1})g_{t}\] \[v_{t} =\beta_{2}v_{t-1}+(1-\beta_{2})g_{t}^{2}\]

where \(\beta_{1}\) and \(\beta_{2}\) are the decay rates for the first and second moments, respectively. The bias-corrected first moment and second moment are then computed as:

\[\hat{m}_{t} =\frac{m_{t}}{1-\beta_{1}^{t}}\] \[\hat{v}_{t} =\frac{v_{t}}{1-\beta_{2}^{t}}\]

Finally, the parameters are updated using the following equation:

\[\theta_{t+1}=\theta_{t}-\frac{\alpha}{\sqrt{\hat{v}_{t}}+\epsilon}\hat{m}_{t}\]

where \(\alpha\) is the learning rate and \(\epsilon\) is a small constant to prevent division by zero.

\begin{table}
\begin{tabular}{|c|c|c|} \hline \(D_{L}\) in QN-1 & \(D_{L}\) in QN-2 & in-text representation \\ \hline
1 & 5 & (1,5) \\ \hline
5 & 1 & (5,1) \\ \hline
2 & 4 & (2,4) \\ \hline
4 & 2 & (4,2) \\ \hline
3 & 3 & (3,3) \\ \hline \end{tabular}
\end{table}
Table 1: Depth combinations per QN
Results and Discussion

In order to investigate the issue of BP in both PlainQNets and ResQNets, we maintain a constant depth of quantum layers, \(D_{L}=6\), which comprises \(100\) quantum gates and \(60\) parameters. The quantum layer depth distribution is varied among different combinations, as discussed in table 1. The \(D_{E}\) per QN can then be calculated using Equation 2. The performance of both networks is evaluated by comparing their cost function landscapes and training results for the problem specified in Equation 3.

### PlainQNet and Simple PlainQNet

In this paper, we use a minimum of two QNs in constructing ResQNets, while the traditional approach in developing QNNs utilizes a single QN (referred to as "simple PlainQNets" in this paper). To ensure a fair comparison between the performance of QNNs with no residual and ResQNets, we also modify simple PlainQNets with two QNs (referred to as "PlainQNets" in this paper). A preliminary comparison between the performance of these two types of PlainQNets is conducted to verify that the use of two QNs in PlainQNets leads to better or equivalent performance compared to the use of a single QN in simple PlainQNets.

The simple PlainQNets and PlainQNets are compared for \(6\)-qubit and \(7\)-qubit quantum layers with a constant depth of \(D_{L}=6\). In the case of PlainQNets, the depth distribution per QN can vary, but we use the depth combinations of \((5,1)\) and \((4,2)\), where the first entry represents the depth of the first QN and the second entry represents the depth of the second QN, as shown in Table 1. We choose deeper quantum layers on the first QN and relatively shallow depth on the second QN primarily because such a configuration of depths per QN leads to a better performance, which will be discussed in more detail in the subsequent sections. For \(6\)-qubit quantum layers, the effective depth (\(D_{E}\)) for PlainQNets for both depth combinations mentioned above is \(30\) (as defined in Equation 2). The closest possible \(D_{E}\) for simple PlainQNets using the quantum layers considered in this paper (shown in Figure 3) is \(31\) with an overall \(D_{L}\) of \(7\) (as defined in Equation 1), which was used in the comparison. Similarly, for \(7\)-qubit quantum layers, the \(D_{E}\) for PlainQNets is \(32\) for both depth combinations per QN. The closest \(D_{E}\) in the case of simple PlainQNets is obtained for \(D_{L}=7\).

Both PlainQNets and simple PlainQNets are then trained for the prob

Figure 4: Cost vs. iterations of PlainQNets and simple PlainQNets (a) for \(6\) qubits (b) for \(7\) qubits. The parentheses denote the \(D_{L}\) per QN.
3. The training results are displayed in Figure 4. It can be observed that for 6-qubit layers, both PlainQNets and simple PlainQNets exhibit comparable performance. However, when the number of qubits increases to 7, the performance of simple PlainQNets decreases significantly due to BP, while PlainQNets improves. Based on these observations, we can infer that it is appropriate to compare the performance of PlainQNets with that of our proposed ResQNets. Hence, for the remainder of the paper, we will compare the performance of PlainQNets, which are QNNs containing two (or more) QNs, with that of ResQNets.

### ResQNet with shallow width quantum layers

In this section, we perform a comparative analysis of the incidence of BP in both PlainQNets and ResQNets. Both PlainQNets and ResQNets consist of two QNs, with a maximum of one residual block in the case of ResQNets. To facilitate a fair comparison, we consider shallow depth quantum layers with \(D_{L}=6\) and incrementally vary the number of qubits from 6 to 10.

#### 5.2.1 6-Qubit Circuit

In this setting, we experiment with a total of 6 qubits. The cost function landscapes for both PlainQNet and ResQNet were analyzed and compared, as shown in Figure 5. The results demonstrate that a significant portion of the cost function landscapes of the PlainQNet for almost all the depth combinations are flat and have a narrow region containing the global minimum. On the other hand, the cost function landscapes of ResQNets are less flat and have a wider region containing the global minimum, which makes ResQNet more suitable for optimization.

The training of PlainQNets and ResQNets was performed for the problem defined in Equation 3. The results of the training are depicted in Figure 6. When the depth of the second QN is equal to or greater than the depth of the first QN, it was observed that the PlainQNets do not undergo successful training. This can be attributed to the flat cost function landscape, i.e., the BP, as depicted in Figure

Figure 5: Cost function landscapes of PlainQNet (upper panel) and ResQNet (lower panel) for 6 Qubits. The parentheses denotes the \(D_{L}\) per QN.
5. For the similar depth distribution per QN (depth in second QN \(\geq\) depth in first QN), the ResQNets were observed to effectively undergo training. However, they struggled to reach an optimal solution due to the presence of multiple local minima in their cost function landscape. In instances where the depth of the first QN is greater than the second QN, both PlainQNets and ResQNets underwent successful training, but ResQNets outperformed PlainQNets.

#### 5.2.2 8-Qubit Cirucit

We now conduct experiments on both PlainQNets and ResQNets with 8-qubit layers, and examine the cost function landscapes of both PlainQNets and our proposed ResQNets. The overall layer depth is set to 6, and all depth combinations are analyzed. The results presented in Figure 7, reveal that approximately 90% of the cost function landscape for PlainQNets remains flat irrespective of the depth distribution per QN, making them unsuitable for optimization. In contrast, the cost function landscapes of ResQNets are still not flat for all the depth combinations, and thus are more favorable for optimization.

We conduct training experiments for both PlainQNets and ResQNets with 8 qubit quantum layers to solve the problem defined in Equation 3. The training results are presented in Figure 8, which show that as we increase the number of qubits from 6 to 8, the PlainQNets get trapped in the flat cost function landscape (i.e., BP), for all the depth combinations per QN and fail to train effectively for the specified problem.

On the other hand, the ResQNets demonstrate successful training across all the depth combinations, surpassing the performance of PlainQNets. Notice that ResQNets exhibit superior learning outcomes when the depth of the first QN is much greater than that of the second QN (\(D_{EinQN1>>>D_{EinQN2}}\)), such as in the case of \((5,1)\). This is because in such scenarios the cost function landscape has fewer and wider regions leading to the global minimum. Conversely, when the depth of the second QN is equal to or greater than that of the first QN, the cost function landscape is characterized by multiple local minima, making it less suitable for optimization as the optimizer becomes trapped in local minima. This phenomenon can be attributed to the presence of residual blocks in ResQNets. In the case of two QNs, a residual connection is introduced only after the first block. This helps in mitigating the issue of BP. However, if the second QN is deep enough, it can still result in BP. In such scenarios, the cost function landscape still contains multiple local minima and fewer paths to reach the global minimum, which makes the optimization process more prone to becoming stuck in a

Figure 6: Cost vs. iterations of (a) PlainQNets (b) and ResQNets for 6 qubits. The parentheses denote the \(D_{L}\) per QN.
local minimum. Despite this, ResQNets still demonstrate superior training performance compared to PlainQNets.

#### 5.2.3 10-Qubit Circuit

To further expand our study, we increased the number of qubits to 10 and performed the same experiments as with quantum layers of 6 and 8 qubits. The cost function landscapes were then analyzed

Figure 8: Cost vs. iterations of (a) PlainQNets and (b) ResQNets for 8 qubits. The parentheses denote the \(D_{L}\) per QN.

Figure 7: Cost function landscapes of PlainQNet (upper panel) and ResQNet (lower panel) for 8 Qubits. The parentheses denote the \(D_{L}\) per QN.
for both PlainQNets and ResQNets, as shown in Figure 9. Similar to the case of 8 qubit layers, a substantial portion of the cost function landscape of PlainQNets was found to be flat, indicating the presence of BP and making it unsuitable for optimization. Conversely, the cost function landscape of ResQNets remained more favorable for optimization as it was characterized by multiple paths leading to the global minimum, thus avoiding the occurrence of BP.

We subsequently trained the 10 qubit quantum layers to address the problem defined in Equation 3. The results of these experiments are depicted in Figure 10. Our analysis indicates that PlainQNets did not exhibit successful training outcomes for nearly all depth combinations, with the exception of \((4,2)\), which showed considerable performance improvement. When we examined its cost function landscape in Figure 9, we observe that there are one or two narrow regions that contain the solution and may be found by the optimizer. However, these narrow regions are unlikely to be encountered and thus the performance, despite being optimal, is not considered suitable for general optimization problems. Therefore, it can still be concluded that the PlainQNets are severely affected by the problem of BP. On the other hand, ResQNets effectively overcame the issue of BP and exhibited successful training outcomes for all depth combinations. Our observations for 10 qubit quantum layers align with our previous findings for 6 and 8 qubit layers in that ResQNets are more effective when the depth after the residual connection is less. This suggests that a shallower depth of quantum layers after the residual connection in ResQNets is more favorable for optimization and mitig

Figure 9: Cost function landscapes of PlainQNet (upper panel) and ResQNet (lower panel) for 10 Qubits. The parentheses denotes the \(D_{L}\) per QN.
Our results conclusively demonstrate that PlainQNets are heavily impacted by the issue of BP as the number of qubits increases, which significantly hinders their performance and ability to optimize the cost function. The previous results have demonstrated the advantage of our proposed ResQNets over PlainQNets in mitigating the phenomenon of BP. Therefore, in the next section, we will conduct experiments solely with ResQNets.

### ResQNets with wider quantum layers

To analyze the scalability of ResQNets for larger quantum circuits, we consider quantum layers with larger number of qubits, i.e., 15 and 20. The depth of the quantum layers, \(D_{L}\), is kept constant at 6. As the cost function landscapes are known to have a direct impact on the training results, as shown in Section 5.2. Consequently, we only present the training results for the 15 and 20-qubit quantum layers.

#### 5.3.1 15-Qubit Circuit

We train the 15 qubit quantum layers to optimize the problem defined in Equation 3. The training results are shown in Figure 10(a). it can be observed that the ResQNets are effectively trained. Additionally, analogous to the case of shallow width quantum layers, the performance is substantially better when the depth in the first QN (before the residual point) is bigger than the second QN.

#### 5.3.2 20-Qubit Circuit

We now train the ResQNets for 20-qubit layers for the problem defined in Equation 3, with a total layer depth of \(D_{L}=6\). It can be observed that even with 20 qubit layers, the ResQNets are effectively trained, as shown in Figure 10(b). Furthermore, similar to the previously shown results, the ResQNets for 20-qubit layers also perform significantly better when the depth after the residual point (second QN) is lesser than the depth before the residual point (first QN).

Figure 10: Cost vs. iterations of (a) PlainQNets (b) and ResQNets for 10 qubits. The parantheses denotes the \(D_{L}\) per QN.
From the results in Figure 11, it is evident that the ResQNets are capable of working with wider quantum layers. The results demonstrate that analogous to the case of shallow-width quantum layers, the training performance is better with the optimal results being achieved for a larger depth in the first QN and a smaller depth in the second QN.

It should be noted that our experiments are limited by the memory constraints of our local computer and we cannot go beyond 20 qubits. However, based on our findings, we believe that the proposed ResQNets would still train effectively even beyond 20 qubits.

### ResQNets with 3-QN

From the analysis presented in previous sections, it can be observed that the ResQNets consisting of two QNs with a maximum of one residual block can effectively address the problem of BP and significantly improve the training performance of QNNs. In this section, we show that increasing the number of QNs in ResQNets can enhance the performance of ResQNets even further. As discussed in Section 4, for three QNs we can have multiple configurations of residual blocks. We consider all of these configurations for our experiments with 20-qubit quantum layers and a fixed quantum layer depth of \(D_{L}=6\).

The results of the experiments conducted in this section will provide valuable insights into the optimal configuration of residual blocks for ResQNets with three or more QNs.

The cost function landscapes of various residual block configurations in ResQNets with three QNs were analyzed, as presented in Figure 12. The results indicate that the optimal placement of residual blocks has a significant impact on the performance of ResQNets. When the residual block is added after every QN, the cost function landscape quickly flattens irrespective of the depth per QN, suggesting that this configuration leads to equivalent or suboptimal performance compared to PlainQNets, which is not at all suitable for optimization.

On the other hand, when the residual block is added after two QNs, the cost function landscape shows multiple and wider regions containing the global minimum, which makes this configuration more suitable for optimization. Moreover, this configuration exhibits a consistent cost function landscape regardless of the depth per QN combination, implying that this particular residual block arrangement is more robust to BP and supports a wide range of depths and QN combinations.

For the case of adding the residual only after the first QN, with two QNs after the residual block, the results show that the cost function landscape is better than the case of adding the residual block

Figure 11: Cost vs. iterations of ResQNets for (a) 15 qubits and (b) 20 qubits. The parentheses denote the \(D_{L}\) per QN.
Figure 12: Cost function landscapes of ResQNets for 20 Qubits and 3-QNs. Residual after every QN (Top panel), Residual after two QNs (middle panel) and residual only after the first QN (bottom panel). The parentheses denote the \(D_{L}\) per QN and the comma denotes the residual point.
after every QN, but not as good as the case where there is a gap of two QNs while adding the residual.

We then trained ResQNets with three QNs for all the configurations while varying the depth for each QN combination on the problem defined in Equation 3. The training results are shown in Figure 13. These results align with the behavior of the cost function landscape, where the residual block configuration skipping two QNs outperforms other configurations. It can be observed that the residual block configuration after every QN does not train at all, while the residual block configuration after the first QN does converge for all the depth per QN combinations, but with significantly slower convergence compared to the residual block configuration after two QNs.

### 3-QN vs. 2-QN ResQNet

In this section, we compare the performance of ResQNets with 2 and 3-QNs to demonstrate the impact of increasing the number of QNs. The analysis was conducted for 20 qubit layers considering the best-performing depth combinations for both 2 and 3-QNs.

For 2-QNs, the results from Figure 10(b) indicate that the depth combinations of (5,1) and (4,2) performed better than other depth combinations. On the other hand, for three QNs, the results from Figure 12(b) and 12(c) show that the depth combinations of \((4\:1,1)\) and \((4,\:1\:1)\) outperformed other depth combinations. A closer examination of the best-performing depth combinations reveals that the \(D_{L}\) before and after the residual block for the depth per QN combination of \((5,1)\) in 2-QN ResQNet is equivalent to depth per QN combination of \((4\:1,1)\) for 3-QN ResQNet. Similarly, the combination \((4,2)\) in the 2-QN ResQNet is equivalent to \((4,\:1\:1)\) in the 3-QN ResQNet. Despite these similarities, as demonstrated in Figure 14, the ResQNets with 3-QNs exhibit superior performance, as they converge to the optimal solution more efficiently compared to the ResQNets with 2-QNs.

Figure 13: Training results of ResQNets with three QNs with 20 qubit layers. (a) Residual after every QN (b) Residual after two QNs and (c) Residual after the first QN. The parentheses denote the \(D_{L}\) per QN and the comma denotes the residual point.
### Real Quantum Device

The results presented so far were obtained by running ResQNets and PlainQNets on a simulation platform. In this section, we carry out some experiments on real quantum devices. In particular, we trained both ResQNets and PlainQNets with 2-QNs on a 5-qubit quantum layer with 20 epochs using an IBM's quantum device, namely \(ibmq\_lima\). The quantum layers depth was fixed to \(D_{L}=6\) with \(D_{L}=5\) in the first QN, and \(D_{L}=1\) in the second QN. This depth combination was chosen considering all the results discussed previously. We note that due to the limited number of publicly available quantum devices, the queue times for executing the jobs are considerably long. Therefore, to minimize the training time, we chose to reduce the number of epochs for real-device training. We trained both PlainQNets and ResQNets for only 20 epochs on real devices instead of 100 epochs as in the case of simulation. The training results are illustrated in Figure 15.

Figure 14: Training comparison of 2-QN and 3-QN ResQNets for 20 qubit layers. The parentheses denote the \(D_{L}\) per QN and the comma denotes the residual point.

Figure 15: Training comparison ResQNets and PlainQNets on (a) real quantum device and (b) simulator. The values in parentheses denote the depth per QN.
The results presented in Figure 14(a) reveal that ResQNets have been trained successfully on a real device, whereas PlainQNets have not been trained on a real device. The same trend is observed when both networks are executed on the simulator, as depicted in Figure 14(b). However, when both PlainQNets and ResQNets are trained on a real device, a slight fluctuation is observed while approaching the optimal solution due to hardware noise, as compared to the simulation results. Despite the presence of noise, the rate of decrease in the loss value for ResQNets is almost identical for both simulation and real experiments. According to [40], hardware noise can potentially cause BP. However, our results demonstrate that our proposed ResQNets are somewhat resilient against hardware noise, as they achieve similar performance to that of the simulator (though with some fluctuations).

## 6 Conclusion

The problem of barren plateaus (BP) in quantum neural networks (QNNs) is a critical hurdle on the road to the practical realization of QNNs. There have been several attempts to resolve this issue, but the impact of BP can still vary greatly depending on the application and the architecture of quantum layers. Thus, it is essential to have multiple solutions for BP to cover a wide range of problems.

In this paper, we propose residual quantum neural networks (ResQNets) to address the issue of BP in QNNs. Our approach is inspired by classical residual neural networks (ResNets), which were introduced to overcome the vanishing gradients problem in classical neural networks.

In traditional QNNs, a single parameterized quantum circuit (PQC) with arbitrary depth is included within a single quantum node (QN). To create ResQNets, we split the conventional QNN architecture into multiple QNs, each containing its own PQC with varying depths. Splitting the QNNs allows us to introduce the residual connections between the QNs, forming our proposed ResQNets. In simple QNNs without residual connections (referred to as PlainQNets), the output from the previous QN serves as the input to the next. On the other hand, in ResQNets, one or multiple QNs can serve as residual blocks, with the output from a previous residual block being added to its input before it is passed on to the next QN.

In our study, we first demonstrate the efficacy of the proposed splitting of the conventional QNN architecture into multiple QNs (PlainQNets) by comparing their performance to that of conventional QNNs (simple PlainQNets). The comparison results indicated that the PlainQNets have better or equivalent performance to that of conventional QNNs. Subsequently, we compare the performance of PlainQNets with that of our proposed ResQNets through several training experiments. Our analysis of the cost function landscapes for quantum layers of increasing qubits shows that incorporating residual connections results in improved training performance.

Based on our findings, we conclude that the proposed ResQNets provide a promising solution for overcoming the problem of BP in QNNs and offer a potential direction for further research in the field of quantum machine learning.