Tensor Ring Optimized Quantum-Enhanced Tensor Neural Networks
Quantum machine learning researchers often rely on incorporating Tensor
Networks (TN) into Deep Neural Networks (DNN) and variational optimization.
However, the standard optimization techniques used for training the contracted
trainable weights of each model layer suffer from the correlations and
entanglement structure between the model parameters on classical
implementations. To address this issue, a multi-layer design of a Tensor Ring
optimized variational Quantum learning classifier (Quan-TR) comprising
cascading entangling gates replacing the fully connected (dense) layers of a TN
is proposed, and it is referred to as Tensor Ring optimized Quantum-enhanced
tensor neural Networks (TR-QNet). TR-QNet parameters are optimized through the
stochastic gradient descent algorithm on qubit measurements. The proposed
TR-QNet is assessed on three distinct datasets, namely Iris, MNIST, and
CIFAR-10, to demonstrate the enhanced precision achieved for binary
classification. On quantum simulations, the proposed TR-QNet achieves promising
accuracy of $94.5\%$, $86.16\%$, and $83.54\%$ on the Iris, MNIST, and CIFAR-10
datasets, respectively. Benchmark studies have been conducted on
state-of-the-art quantum and classical implementations of TN models to show the
efficacy of the proposed TR-QNet. Moreover, the scalability of TR-QNet
highlights its potential for exhibiting in deep learning applications on a
large scale. The PyTorch implementation of TR-QNet is available on
Github:https://github.com/konar1987/TR-QNet/
Debanjan Konar, Dheeraj Peddireddy, Vaneet Aggarwal, Bijaya K. Panigrahi
# Tensor Ring Optimized Quantum-Enhanced Tensor Neural Networks

###### Abstract

Quantum machine learning researchers often rely on incorporating Tensor Networks (TN) into Deep Neural Networks (DNN) and variational optimization. However, the standard optimization techniques used for training the contracted trainable weights of each model layer suffer from the correlations and entanglement structure between the model parameters on classical implementations. To address this issue, a multi-layer design of a Tensor Ring optimized variational Quantum learning classifier (Quan-TR) comprising cascading entangling gates replacing the fully connected (dense) layers of a TN is proposed, and it is referred to as Tensor Ring optimized Quantum-enhanced tensor neural Networks (TR-QNet). TR-QNet parameters are optimized through the stochastic gradient descent algorithm on qubit measurements. The proposed TR-QNet is assessed on three distinct datasets, namely Iris, MNIST, and CIFAR-10, to demonstrate the enhanced precision achieved for binary classification. On quantum simulations, the proposed TR-QNet achieves promising accuracy of \(94.5\%\), \(86.16\%\), and \(83.54\%\) on the Iris, MNIST, and CIFAR-10 datasets, respectively. Benchmark studies have been conducted on state-of-the-art quantum and classical implementations of TN models to show the efficacy of the proposed TR-QNet. Moreover, the scalability of TR-QNet highlights its potential for exhibiting in deep learning applications on a large scale. The PyTorch implementation of TR-QNet is available on Github: [https://github.com/konar1987/TR-QNet/](https://github.com/konar1987/TR-QNet/).

Quantum Computing, Tensor Networks, IBM quantum computer, qubit

## 1 Introduction

Deep learning is a very effective and extensively used machine learning method, which has shown great performance in various tasks, including recognition, classification, regression, and clustering [1, 2, 3, 4]. Recent years have witnessed the surge of quantum machine learning [5], a new computational paradigm that blends quantum computing and machine learning. It employs quantum parallelism and non-classical connections, such as quantum entanglement, to possibly speed up or revolutionize existing classical algorithms [6]. Importantly, the convergence of these disciplines can result in synergistic improvements and new views on a wide range of difficult challenges [7]. Concurrently, combining physics principles and classical machine learning approaches has shown significant promise in tackling quantum computing issues [8]. Researchers demonstrated that the trainable weights of neural networks have a strong correlation with many-body wave functions [9, 10]. Furthermore, ideas for identifying phase transitions in quantum many-body systems using fully connected artificial neural networks (ANNs) and convolutional neural networks (CNNs) have been examined, with encouraging results [11, 12, 13].

Deep Neural Networks (DNN) have extremely high spatial and temporal complexity levels owing to densely stacked
layers containing large-scale matrix multiplications. Hence, DNNs often need several days of training while requiring a considerable amount of memory for inference. Furthermore, substantial weight redundancy in DNNs has been demonstrated [14], demonstrating the possibility of condensing DNNs while preserving performance. As a result, a variety of compression approaches, including pruning [15], quantization [16], and low-rank decomposition [17], have been devised. Applying TNs to DNNs to generate TNNs is one of them since TNNs have outstanding potential to approximate the original weights with fewer parameters [18], particularly involving the reconstruction of convolutional and fully connected layers using a range of TD formats [19]. However, the scalability of DNN is hindered when a substantial number of neurons are taken into account, thereby restricting the feasible number of layers. This is primarily due to the time-consuming training process and the need for a lot of memory to store the large weight matrices. The accuracy and effectiveness of the DNN model will suffer with an increase in the hidden layers if the parameters for such large-weight matrices are not optimized. Therefore, decreasing the number of model parameters is imperative to maintain accuracy. Nevertheless, the present hardware used to train neural networks significantly restricts their scale and usefulness. These concerns have gained significance due to the imminent approach of physical limitations to impede the progress of performance enhancements in deep classical neural networks.

In contemporary times, a correlation has been established between tensor networks (TN) and neural networks, whereby the former serves as an effective ansatz for representing quantum many-body wave functions [20; 21]. As a result, it is possible to substitute tensor networks (TN) for these weights and rely on variational optimization techniques to train them [22]. A plethora of TN-based efficient algorithms for classification [23], anomaly detection [24; 25], segmentation [26], and clustering [27] have been proposed in recent times. In addition to their capacity for effective expression, TN offers streamlined methodologies for compressing data through tensor factorization techniques [28; 29]. For instance, it is possible to significantly reduce the number of parameters in neural network models by retaining only the most significant degrees of freedom and discarding those that exhibit lower correlations. Tensor Neural Networks (TNN) [26] and Variational Tensor Deep Neural Networks [19; 30] are instances of neural networks that rely on tensor network structures to replace the weight tensors of the hidden layers. This is achieved by applying Singular Value Decomposition (SVD) methods. Recent research studies have validated that, despite having a limited parameter space, TNN exhibits superior performance and accuracy compared to conventional ANNs [28; 31]. Deep neural network low-rank tensor approximation has been extensively studied in the literature for effective model reduction, low generative error, and high prediction speed [32].

Recently Quantum Neural Networks (QNN) have emerged as a potential contender to circumvent the problems and to facilitate the training of DNN [33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44]. Quantum states are mathematical entities of quantum systems compatible with higher-order tensors [45]. TNNs may thus be utilized as simulators in traditional computers to emulate genuine quantum circuits [46; 47]. Some particular TNNs can be realized on compact, near-term quantum devices using quantum computing's ultrahigh parallelism [48]. Rather than the more broad TN-based quantum circuit modeling paradigm, quantum circuit simulation on TNNs focuses on the functions of TNs as bridges between traditional ANNs and QNNs.

### Motivation

Most contemporary TNN advancements involve tensorization solely at the level of hidden layers pertaining to trainable weights [49; 19; 30; 50; 51]. Training a model typically involves optimizing each layer's contracted trainable weights using established optimization techniques like gradient descent [26; 52]. The outcome of this is an adaptable architecture for TNN that can be effectively trained for a substantial quantity of neurons and layers. The variational algorithm employs a method of local gradient-descent, incorporating tensor gradients. This motivates us to propose hybrid TNN models incorporating both tensor and quantum layers. The training algorithm used in our study offers valuable insights into the entanglement structure of trainable weights for fully connected layers of TNN. Nevertheless, it helps to clarify the expressive power of a quantum neural state.

### Primary Contributions and Novelty

Considering the neural network's entanglement structure, a novel multi-layer design of a Tensor Ring optimized variational Quantum learning classifier (Quan-TR) with cascading entanglement gates is introduced in the proposed hybrid quantum-enhanced TNN model (TR-QNet). Furthermore, our TR-QNet model's accuracy and efficiency are evaluated on numerical data and image classification on various datasets. The present study exhibits a tripartite novelty, which can be summarized as follows:

1. Our study presents for the first time a novel quantum-enhanced hybrid tensor neural network (TR-QNet) comprising classical tensor layers followed by quantum layers for data and image classification. The proposed TR-QNet incorporates the novel multi-layer design of Quan-TR, replacing the fully connected softmax layers in TNN, distinguishing it from the state-of-the-art TN models [19; 30; 50; 51].
2. In addition, the quantum layers (Quan-TR) of the proposed TR-QNet model incorporate a cascading of quantum entangling gates, leading to the elimination of local minima. This is demonstrated by the convergence of the training loss of the proposed TR-QNet model.
3. Compared with the classical TN model, the binary-class classification accuracy of TR-QNet is improved by \(10.53\%\), \(7.28\%\) and \(12\%\) on the Iris [53], MNIST [54] and CIFAR-10 [55] datasets, respectively. This approach presents a distinctive and innovative effort towards expediting advancements in resolving computer vision issues through deep quantum learning.

The subsequent sections of this manuscript are organized in the following manner. Section 2 explains the proposed Quantum-Enhanced Tensor Neural Network architecture, which includes an overview of classical Tensor Neural Networks (TNN) and Tensor Ring optimized variational Quantum circuit (Quan-TR). Section 3 contains the datasets, experimental settings, and experimental results. Section 4 elucidates the efficacy of the TR-QNet model and underscores its constraints. Finally, the concluding remarks and future research directions are discussed in Section 5. _Appendix_ section provides the convergence of the proposed TR-QNet.

## 2 Quantum-Enhanced Tensor Neural Network Architecture

The TR-QNet model is a novel proposed framework that combines classical TN and quantum layers (Quan-TR) with tensor ring parameterized inputs and cascading of entangling gates. Recently, the authors _et al._[56] also proposed a similar type of Tensor Ring parameterized Variational Quantum Circuit (TR-VQC). However, the TR-VQC suffers from directly reduced input features due to a few available qubits and the limited entanglement between the parameters, resulting in Barren plateaus [57]. In contrast, our hybrid TR-QNet model exhibits a relationship between tensor neural networks and variational Quantum learning classifiers optimized by a tensor ring structure, as shown in Figure 1, enabling feeding the full input features through TNN layers with minimal loss of information. The TR-QNet model architecture incorporates a tensor neural network (TNN) with multiple hidden layers. It introduces a multi-layer tensor-ring optimized variational Quantum learning classifier with cascading entangling gates to address quantum entanglement among model parameters efficiently. This approach replaces the conventional soft-max layer typically employed at the end of TN models. A classical pooling layer is incorporated in integrating the TNN model and Quan-TR of the proposed TR-QNet architecture to match the dimension of the input of TNN and the input of Quan-TR.

The VQC-based training algorithm resembling DMRG [58] enables a straightforward entanglement of the entanglement spectrum of the Matrix Product Operators' (MPO's) [28] trainable weights, thereby facilitating a lucid comprehension of the correlations within the parameters of our TR-QNet model. One can evaluate the MPO's entanglement structure and capacity as a quantum neural state through standard quantum information measures.

### Tensor Neural Networks

A Tensor Network Network (TNN) is obtained after the tensorization of an ANN, enabling it to align with the MPO weights' size and dimensions [20, 21]. The hidden layers of the proposed TR-QNet model can reshape into a rank-\(d_{T}\) tensor, possessing a dimension size of \(\mathcal{N}_{T}\), which can subsequently be contracted to form a TN layer. This TN layer comprises six Matrix Product Operators (MPO) [28] weights, each having an input size of \(m\). Features that cannot be factorized to align with the MPOs in the TN layers are transformed during the preprocessing stage of the training TR-QNet to conform to the input size of the TN layer. A dense trainable layer of size \(\mathcal{N}_{s}\times\mathcal{N}_{q}\) is added as a connecting layer preceding the Tensor Ring optimized variational Quantum learning classifier (Quan-TR) layer to address the issue of reduction in the size of input data in classical TNN model. The length of the input feature vector of Quan-TR is denoted by \(\mathcal{N}_{s}\), while the output size of the contracted TNN layer is represented by \(\mathcal{N}_{q}\). The contraction of two rank-2 tensors, \(\mathcal{S}_{xy}\) and \(\mathcal{V}_{yz}\), can be represented diagrammatically by connecting the two tensors along their shared index \(y\). Mathematically, the contraction operation is described as follows:

\[\mathcal{T}_{xz}=Tr(\mathcal{S}_{xy}\mathcal{V}_{yz})=\sum_{y}\mathcal{S}_{xy} \mathcal{V}_{yz} \tag{1}\]

Here, \(Tr\) designates the trace over shared indices \(y\).

A viable approach to intelligent data compression techniques that rely on TN and MPO decomposition to enhance the representation of weight matrices involves substituting weights with MPOs. The MPO form of the weight matrix of a hidden layer can be derived from the \(\mathcal{W}\) matrix by consecutively applying SVD, as demonstrated in Figure 1. The TN layers comprise a set of trainable weights denoted as \(\omega_{i}\) represented by MPO. A Bond tensor \(B_{j,j+1}\) is obtained by contracting a pair of neighboring MPO tensors, \(\omega_{j}\), and \(\omega_{j+1}\), along their shared virtual dimension. Adjusting the input feature vector \(\alpha\) to align with the MPO dimensions allows the network's output \(\mathcal{O}_{TN}\) to be derived through the
contraction of the resulting tensor network. The activation function \(\sigma_{TN}\) is applied to the result of a tensor contraction operation [51] as follows.

\[\mathcal{O}_{TN}=\sigma_{TN}(Tr(\alpha_{i},\alpha_{j},\alpha_{k},\cdots\omega_{ i},\omega_{j},\omega_{k},\cdots)+\omega_{0}) \tag{2}\]

Here, the tensor contraction operation between the input tensor \(\alpha\) and the weight tensor \(\omega\) and \(i,j,k\), etc. represent the tensor indices. It may be noted that the activation function \(\sigma_{TN}\) is applied element-wise to the matrix obtained from the tensor contraction, and it cannot be directly applied to individual MPO tensors separately due to the non-linearity introduced by the activation function. In the proposed TR-QNet, one approach involves contracting the features and tensor network layers (MPOs) before applying the activation function and reshaping the resulting tensor to match the inputs of the next layer. This process is repeated until the entire TNN network is contracted.

### Tensor Ring Optimized Variational Quantum Learning Classifier

The proposed Tensor Ring optimized variational Quantum learning classifier (Quan-TR) with Tensor Neural Networks is a hybrid classical-quantum algorithm combining tensor network elements and variational quantum circuits for data and image classification. The proposed Quan-TR introduces a multi-layer Tensor Ring optimized variational Quantum learning classifier with cascading entangling gates to address quantum entanglement among model parameters efficiently, which is the major distinction with our Tensor Ring Parameterized Variational Quantum Circuit (TR-VQC) [56]. The proposed Quan-TR framework consists of three main components: tensor ring encoding, variational learning parameters, and measurement. tensor ring encoding represents the quantum states in a compressed format. It leverages the tensor ring structure, a tensor network with a specific hierarchical ring-like connectivity pattern. The tensor ring approximation uses SVD to compress the quantum states while preserving important features. This ap

Figure 1: A Tensor Ring optimized Quantum-enhanced tensor neural Network (TR-QNet) architecture with 4-qubits Quan-TR for tensorizing an (a) ANN with 2 hidden layers and 2 fully connected dense layers. The network prediction, \(y_{f}\), is derived by feeding the model the input feature vector \(\alpha\) as \(y_{f}=\sigma(\mathcal{W}\alpha+w_{0})\), where \(w_{0}\) is bias vector, and \(\sigma\) is the ReLu activation function; (b) the ANN’s TN representation using Matrix Product States (MPS) and Matrix Product Operators (MPO); (c) MPO decomposition of the weight matrix \(\mathcal{W}\) performing singular value decomposition (SVD) and truncating the inconsequential singular values includes MPO factorization for a matrix \(\mathcal{W}_{m^{3}\times m^{3}}\) followed by reshaping \(\mathcal{W}\) into a rank-6 tensor and using a suitable SVD, matrix \(\mathcal{W}\) may be represented as a 3-site MPO; (d) the resulting TNN with MPO trainable weights; (e) 2-layer Tensor Neural Networks (TNN) tensorizing the ANN using part (b), (c) and (d); and (f) Low-rank Quan-TR component employed in this proposed TR-QNet has three parts: tensor ring encoding (\(\tau\)), variational learning parameters, and quantum measurement. The cascading CNOT gates are preserved through tensor ring approximation relying on SVD. \(\mathcal{R}_{y}(\theta)\) and \(\mathcal{R}_{z}(\theta)\) are used for data encoding and measurements.
proximation allows for efficient representation and manipulation of quantum states within Quan-TR. In the proposed Quan-TR, single-qubit rotation gates \(\mathcal{R}_{y}(\theta)\), and \(\mathcal{R}_{z}(\theta)\) are used to represent rotations along the Y and Z axes, respectively. These rotation angles (\(\theta\)) are learned during training to find the optimal values that minimize the objective function. By combining tensor ring encoding with variational learning parameters and measurement, the proposed TR-QNet architecture enables the training of quantum circuits for data and image classification. In our Quan-TR framework, the tensor ring parametrization represents a quantum state \(|\psi\rangle\) using \(V\) tensors, each with bond dimension \(\mathcal{B}\), denoted by \(\tau(\upsilon)\) as follows [52]:

\[|\psi\rangle=\sum_{x_{i}}^{x_{V}}\sum_{y_{i}}^{y_{V}}\tau(1)^{y_{1}}_{x_{V}x_{1 }}\tau(2)^{y_{2}}_{x_{1}x_{2}}\cdots\tau(V)^{y_{V}}_{x_{V-1}x_{V}}|x_{i},x_{2}, \cdots x_{V}\rangle \tag{3}\]

The physical indices \(x_{v}\in\{0,1\}\) span the \(2^{V}\)-dimensional Hilbert space, while the bond indices \(y_{v}\in\{1,\cdots N_{v}\}\), control the maximum amount of entanglement captured by the tensor ring, also known as tensor rank. A tensor ring parametrization of a 4-qubit state is illustrated in Figure 1. In Quan-TR, each \(\tau(\upsilon)\) in the ring represents a tensor of dimension \(\mathcal{B}\times\mathcal{B}\times\mathcal{X}\), signifying the connections between the tensors in the tensor ring. The tensor, \(\tau(\upsilon)\), has three indices, two of which have a bond dimension \(\mathcal{B}\), and the third index has a dimension \(\mathcal{X}\). Subsequently, the input characteristics are encoded through the utilization of single qubit rotation gates (\(\mathcal{R}_{y}(\theta)\)), which preserves the tensor ring configuration. The fundamental element of the parametrized circuit in every layer of the proposed Quan-TR model is the cascading entanglement of qubits, which is subsequently followed by parametrized single qubit rotations. The two-qubit gates, such as the CNOT gate, do not preserve the tensor ring representation. An approximation technique based on singular value thresholding is employed for this gate to address this issue. The tensor ring structure facilitates the computation of 2-qubit gates for adjacent qubits. By employing a cascading configuration of the tensor ring, executing a CNOT operation from the ultimate qubit to the initial qubit becomes feasible. It is worth noting that using the tensor ring format allows for the utilization of the same rank \(d_{q}\) in each decomposition, which may not be feasible with the conventional Matrix Product State (MPS) format. By employing this approximation, all calculations for the forward pass exhibit linearity concerning the number of gates.

We develop a universal TR-QNet model that uses the intrinsic probabilistic behavior of qubit measurements to classify images using a hybrid classical-quantum framework. The aspects of variational quantum learning classifier concerning encoding, variational, and measurement are all accomplished within the implementation of Quan-TR. Single-qubit rotation gate, \(\mathcal{R}_{y}(\theta)\), is employed to encode rotations along the \(Y\)-axes in the encoding section. Quantum bits (qubits) represent the input state of VQC in the proposed TR-QNet as

\[|\psi(\theta)\rangle=(\cos\theta|0\rangle+\sin\theta|1\rangle)|\mathcal{O}_{ TN}\rangle. \tag{4}\]

In the VQC of the TR-QNet model, the quantum states \(|\psi(\theta)\rangle\) correspond to the quantum encoding of the classical inputs \(\mathcal{O}_{TN}\) from the classical layer of TNN. The Tensor Ring parameterized quantum circuit (Quan-TR) is dense and constitutes parametrized single qubit gates with CNOT gates to entangle quantum states from each qubit. To encode phase information, the dressed quantum layer of TR-QNet uses the rotation gates \(\mathcal{R}_{y}\) and \(\mathcal{R}_{z}\). Complementary quantum states are created with the help of the CNOT gate. In the Bloch sphere projection, the \(\mathcal{R}_{y}(\theta)\) and \(\mathcal{R}_{z}(\theta)\) gates represent the following single-qubit rotations about the \(Y\) and \(Z\)-axes, respectively, as follows:

\[\mathcal{R}_{y}(\theta)=\exp{(-jY\theta/2)}=\left[\begin{array}{cc}\cos \theta/2&-\sin\theta/2\\ \sin\theta/2&\cos\theta/2\end{array}\right] \tag{5}\]

and

\[\mathcal{R}_{z}(\theta)=\exp{(-jZ\theta/2)}=\left[\begin{array}{cc}\exp{(-j \theta/2)}&0\\ 0&\exp{(j\theta/2)}\end{array}\right]. \tag{6}\]

To perform the one-qubit rotation, we contract the \(2\times 2\) unitary rotation matrix \(\mathcal{R}\) with the original tensor \(\tau(\upsilon)\), and the resulting tensor \(\tau^{\prime}(\upsilon)\) represents the rotated state of the \(\upsilon^{th}\) qubit as follows:

\[\tau^{\prime}(\upsilon)^{y^{\prime}_{\upsilon}}_{x_{\upsilon-1}x_{\upsilon}}= \sum_{y_{\upsilon}}\mathcal{R}_{y^{\prime}_{\upsilon}y_{\upsilon}}\tau( \upsilon)^{y_{\upsilon}}_{x_{\upsilon-1}x_{\upsilon}} \tag{7}\]

To perform a two-qubit gate transformation on qubits \(\upsilon\) and \((\upsilon+1)\) in the proposed Quan-TR, the tensor network needs to be transformed into an orthogonal form centred around the qubits of interest \(\upsilon\) and \((\upsilon+1)\) before applying the gate operation. The shared bond index is contracted between the tensors \(\tau(\upsilon)\) and \(\tau(\upsilon+1)\) to create a new tensor as follows:

\[\mathcal{M}^{y_{\upsilon}y_{\upsilon+1}}_{x_{\upsilon-1}x_{\upsilon+1}}=\sum_ {x_{\upsilon}}\tau(\upsilon)^{y_{\upsilon}}_{x_{\upsilon-1}x_{\upsilon}}\tau( \upsilon+1)^{y_{\upsilon+1}}_{x_{\upsilon}x_{\upsilon+1}} \tag{8}\]
To apply the two-qubit gate \(\mathcal{U}\) on the two-qubit tensor computed from Equation 8, we reshape the gate \(\mathcal{U}\) into an operator acting on the joint state of qubits \(\upsilon\) and \((\upsilon+1)\).

\[(\mathcal{M}^{\prime})^{y_{v}y_{v+1}}_{x_{v-1}x_{v+1}}=\sum_{y_{v}y_{v+1}} \mathcal{U}_{y^{\prime}_{v}y^{\prime}_{v+1}y_{v}y_{v+1}}\mathcal{M}^{y_{v}y_{ v+1}}_{x_{v-1}x_{v+1}} \tag{9}\]

We perform SVD on the resultant tensor \(\mathcal{M}^{\prime}\) on reshaping it as \((y^{\prime}_{v}+x_{v-1})\times(y^{\prime}_{v+1}+x_{v+1})\) as follows:

\[(\mathcal{M}^{\prime})^{y_{v}y_{v+1}}_{x_{v-1}x_{v+1}}=\sum_{x_{v}}\mathcal{P} ^{y^{\prime}_{v}}_{x_{v-1}x_{v}}\mathcal{S}_{x_{v}}\mathcal{Q}^{y^{\prime}_{v+ 1}}_{x_{v}x_{v+1}} \tag{10}\]

Here, \(\mathcal{P}\) and \(\mathcal{Q}\) comprise orthogonal vectors, \(\mathcal{S}_{x_{v}}\) is composed of singular values of matrix \(\mathcal{M}^{\prime}\). The matrix has \(2N\) singular values irrespective of the two-qubit gate structure, where \(N\) denotes the bond dimension of the tensor ring. We then truncate the \(\mathcal{S}_{x_{v}}\) matrix to keep only the \(N\) largest singular values, and the resulting matrix is denoted by \(\mathcal{S}^{i}{}_{x_{v}}\). \(\mathcal{P}\) and \(\mathcal{Q}\) are truncated only to keep the orthogonal vectors corresponding to the \(N\) largest singular values.

\[\tau^{\prime}(\upsilon)^{y_{v}}_{x_{v-1}x_{v}}=\mathcal{P}^{y_{v}}_{x_{v-1}x_{ v}}\mathcal{S}^{i}{}_{x_{v}} \tag{11}\]

and

\[\tau^{\prime}(\upsilon+1)^{y_{v+1}}_{x_{v+1}x_{v}}=\mathcal{Q}^{y_{v+1}}_{x_{v }x_{v}x_{v+1}} \tag{12}\]

The preprocessed data from the TNN layer, denoted as \(\mathcal{O}^{i}_{TN}\), is transformed into a quantum state represented by \(|\psi(\mathcal{O}^{i}_{TN})\rangle\). Subsequently, the quantum state undergoes processing through Quan-TR with parameters \(\mathcal{U}(\theta_{1},\theta_{2},\cdots,\theta_{n})\). Finally, by performing measurements on particular qubits through the use of the Pauli-Z basis, we obtain a collection of outputs denoted as \(\lambda_{j}\) along with their corresponding probabilities as follows:

\[\mathcal{Z}_{ij}=\langle\psi(\mathcal{O}^{i}_{TN})|\mathcal{U}^{\dagger}( \theta)|\lambda_{j}\rangle\langle\lambda_{j}|\mathcal{U}(\theta)|\psi( \mathcal{O}^{i}_{TN})\rangle \tag{13}\]

where, complete operation is \(\mathcal{U}(\theta)\) is defined as

\[\mathcal{U}(\theta)=\mathcal{U}_{n}(\theta_{n})\mathcal{U}_{n-1}(\theta_{n-1}) \cdots\mathcal{U}_{1}(\theta_{1}). \tag{14}\]

The loss function, \(\mathcal{L}(\theta)\), can be defined as follows considering the input quantum state as \(|0\rangle^{\mathcal{N}}_{q}\).

\[\mathcal{L}(\theta)=f(y_{j}(\theta),t_{j})=\mathcal{Z}(y_{j}( \theta)\neq t_{j})= \tag{15}\] \[\sum_{j}^{\mathcal{N}_{q}}f((\langle 0|\psi^{\dagger}(\mathcal{O}^{j}_ {TN})\mathcal{U}^{\dagger}(\theta)y_{j}\mathcal{U}(\theta)\psi(\mathcal{O}^ {j}_{TN})|0\rangle),t_{j})\]

where, \(y_{j}(\theta)\in\{\overline{\lambda_{j}}\}\) and \(t_{j}\) corresponds to a target output. In order to train the proposed Quan-TR model, the gradient of the loss function is evaluated as follows:

\[\frac{\delta\mathcal{L}(\theta)}{\delta\theta_{j}}=\langle 0|\psi^{ \dagger}(\mathcal{O}^{j}_{TN})\frac{\delta\mathcal{U}^{\dagger}(\theta)}{ \delta\theta_{j}}y_{j}\mathcal{U}(\theta)\psi(\mathcal{O}^{j}_{TN})|0\rangle +\langle 0|\psi^{\dagger}(\mathcal{O}^{j}_{TN})\mathcal{U}^{\dagger}( \theta)y_{j}\frac{\delta\mathcal{U}(\theta)}{\delta\theta_{j}}\psi(\mathcal{ O}^{j}_{TN})|0\rangle= \tag{16}\] \[\langle 0|\psi^{\dagger}(\mathcal{O}^{j}_{TN})\mathcal{U}^{\dagger} _{1}(\theta_{1})\cdot\frac{\delta\mathcal{U}^{\dagger}_{j}(\theta_{j})}{ \delta\theta_{j}}\cdot\mathcal{U}^{\dagger}{}_{n}(\theta_{n})y_{j}\mathcal{U }(\theta)\psi(\mathcal{O}^{j}_{TN})|0\rangle+\] \[\langle 0|\psi^{\dagger}(\mathcal{O}^{j}_{TN})\mathcal{U}^{\dagger} (\theta)y_{j}\mathcal{U}_{n}(\theta_{n})\cdot\frac{\delta\mathcal{U}_{j}( \theta_{j})}{\delta\theta_{j}}\cdot\mathcal{U}_{1}(\theta_{1})\psi(\mathcal{ O}^{j}_{TN})|0\rangle\] \[=\langle 0|\psi^{\dagger}(\mathcal{O}^{j}_{TN})\mathcal{U}^{\dagger} _{-}[i\psi_{j}]\mathcal{U}^{\dagger}_{+}y_{j}\mathcal{U}(\theta)\psi( \mathcal{O}^{j}_{TN})|0\rangle+\langle 0|\psi^{\dagger}(\mathcal{O}^{j}_{TN}) \mathcal{U}^{\dagger}(\theta)y_{j}\mathcal{U}_{+}[-i\psi_{j}]\mathcal{U}_{-} \psi(\mathcal{O}^{j}_{TN})|0\rangle\]

where, \(\mathcal{U}_{j}(\theta_{j})=e^{-i\theta_{j}\psi(\theta^{j})}\).

However, due to NISQ's limitations, classical simulators are now being utilized to optimize and update parameters and feed them back to TNN and Quan-TR separately until convergence conditions are reached. Hence, we have used cross-entropy loss to update the parameters. The loss function (\(\mathcal{L}_{\theta}\)) is derived with the hyper-parameters \(\theta\) of the proposed TR-QNet model as

\[\operatorname*{argmin}_{\theta}\mathcal{L}_{(\theta)}=\sum_{j}^{\mathcal{N}_{q} }[t_{j}\log\overline{f}(\mathcal{O}^{j}_{TN})+(1-t_{j})\log\{1-\overline{f}( \mathcal{O}^{j}_{TN})\}]\;. \tag{17}\]

where, \(\overline{f}(\mathcal{O}^{j}_{TN},\theta)\) can defined for binary optimization problem as follows.

\[\overline{f}(\mathcal{O}^{j}_{TN},\theta)=\begin{cases}1,&\text{if }f(\mathcal{O}^{j}_{TN}, \theta)>0\\ -1,&\text{otherwise}\end{cases} \tag{18}\]
The DMRG-like sweeping technique [58] for training the TNN uses a stochastic gradient-based optimization strategy in which a gradient descent step with a learning rate updates the local bond tensors \(Bj,j+1\) towards a global minimum of the loss function. In order to update the weights in TNN, a gradient of the bond tensors with respect to the loss, \(Bj,j+1\), is obtained by defining \(\overline{f}(\mathcal{O}^{j}_{TN})=TB\), where \(T\) represents the contraction of every tensor in the TNN other than the bond tensor \(B\).

## 3 Results

### Data Sets

The Iris dataset [53] is often used as a benchmark to evaluate the performance of different machine learning algorithms. The Iris dataset contains a total of \(150\) samples, and each sample has four features: sepal length, sepal width, petal length, and petal width. We extracted three distinct binary data sets from the original Iris dataset. We added \(80\%\) samples to each training subset and the remaining \(20\%\) samples for each class as a test data set.

Researchers studying computer vision often rely on the MNIST dataset [54] as a benchmark for Artificial Neural Networks. The MNIST dataset has \(70,000\)\(28\times 28\) grayscale images (\(60,000\) for training and \(10,000\) for testing), divided into \(10\) classes and each containing \(7,000\) images.

The CIFAR-10 [55] dataset comprises a total of \(60,000\) images in \(10\) categories (\(6000\) for each class), with \(32\times 32\) colour images including \(50,000\) training images and \(10000\) test images. The tests, however, resize and transform CIFAR-10 images into \(28\times 28\) times their original size grey-scale images.

However, owing to the limited qubit available at the NISQ processor, we perform binary classification jobs using this batch of images with values \(0\) or \(9\), \(1\) or \(8\), \(2\) or \(7\), \(3\) or \(6\), and \(4\) or \(5\) and multi-class classification with values \(0\), \(1\) or \(9\), \(2\), \(4\) or \(5\) and \(3\), \(6\) or \(7\). We had to restrict our datasets to two randomly selected classes in our investigations since the Qiskit Quantum Simulator only has access to a few qubits.

### Experimental Settings

We compute the original input data sets' mean and variance. The data sets are then normalized using the zero-mean normalization procedure to have a zero mean and unit variance before feeding into the TNN. The proposed TR-QNet comprises TN layers with several trainable MPO tensors, and a stochastic gradient-based algorithm has been employed to train the MPOs [28], relying on a DMRG-like technique. The prior tensor gradient technique is appropriate for TNN models fully composed of TN layers. However, it is neither effective nor adaptable in models with hybrid architectures that combine TN layers and VQC.

We employed automated differentiation techniques [59] and a classical back-propagation algorithm to determine the gradient of the TNN trainable weights as our TR-QNet is a feed-forward hybrid neural network combining TN and quantum layers. We have used _TensorLy-Torch_ library to compute the automatic differentiation of TN layers in PyTorch settings. However, being a hybrid classical-quantum framework, the classical TNN model is simulated on classical hardware and Quan-TR on the Qiskit simulator. The weights of the TN layers are updated using a layer-by-layer approach. The intermediate dense layer has merely been included to make up for the size mismatch between the features in the last TN layer and Quan-TR, and it is not trainable. Each \(6\) MPO trainable weight on the TN layers has virtual dimension \(V\) and a _ReLu_ activation function. The last layer of Quan-TR in the output chain is a dense layer with softmax activation, which outputs vectors that are one-hot encoded (OHE) and contain the predicted probabilities for the desired number of labels. We set up the initial \(V\) qubit state as \(|00\cdots 0\rangle\), which is afterward transformed into a Tensor Ring (TR) representation since \(\tau(\epsilon)\) is a \(\mathcal{B}\times\mathcal{B}\times 2\) tensor with only (\(0,0,0\))\({}^{th}\) element as \(1\) and rest as \(0^{\prime}s\). Our Quan-TR is repeated \(r\) times to illustrate the depth of Quan-TR. The tensor ring rank in Quan-TR is set to \(d_{q}=4\) for all tests.

Experiments have been carried out using the varying numbers of qubits (\(4,6,8,10,12\)) and number of TN and Quan-TR layers on an Nvidia Tesla \(V100-SXM2\) GPU Cluster with \(32\) GB of memory and \(640\) Tensor cores with \(8\) cores of Intel(R) Xeon(R) CPU E5-2683 v4@2.1GHz. In the case of image classification, \(784\) input features (\(28\times 28\)) from the input images are received at the input layer of the proposed TR-QNet. With a maximum of \(25\) epochs, Quan-TR layers of the proposed TR-QNet model are rigorously trained using the Adam optimizer with an initial learning rate of \(0.01\) and weight decay (\(\delta\)) of \(0\). Figure 2 shows the convergence of loss during training of the proposed TR-QNet model varying number of qubits and TN and Quan-TR layers with \(5\)-fold cross-validation. In the Iris data classification experiments, the proposed Quan-TR is provided with the four feature vectors (\(\mathcal{N}_{q}=4\)) for training from the previous TNN layer through the dense layer with batch size \(4\). We chose three measures random to represent the three classes of the dataset out of the \(2^{4}\) available measurements acquired from Quan-TR. To further transform selected measurements into class probabilities, we employ the sigmoid activation function (Softmax) and the cross-entropy loss function as given in Equation 19. However, in the case of MNIST and CIFAR-10 datasets, for binary
classification, we choose the final measurements \(|00\cdots 0\rangle\) and \(|11\cdots 1\rangle\) as the output values and batch size \(32\), where multiple readouts need to feed the results to TR-QNet.

### Experimental Results

Extensive experiments have been conducted using large sets of Iris [53], MNIST [54], and CIFAR-10 [55] datasets with varying numbers of qubit count \(4\), \(6\), \(8\), \(10\), and \(12\) and tensor ring ranks (\(d_{q}\)) of \(2\), \(3\), and \(4\) as provided in Table 1. However, it has been found from the experimental data for the Iris dataset that the optimal result is found for \(4\) qubits Quan-TR model with tensor ring rank of \(4\) as reported in Table 1. It is noteworthy that the proposed TR-QNet, and its quantum counterparts, namely, Variational Quantum Tensor Networks classifier (VQTN) [50], Quantum Convolutional Neural Networks (QCNN) [60], Tensor Ring parametrized Variational Quantum Circuit (TR-VQC) [56], and fully classically simulated Variational Tensor Neural Network (VTNN) [51] are trained on the binary and ternary pair of classes from the datasets.

In order to illustrate the resilience of the proposed model over the quantum counterpart and classical tensor neural network-based models, unforeseen test images on the Iris [53], MNIST [54], and CIFAR-10 [55] datasets are used for evaluation. The training loss curves for the proposed TR-QNet model are demonstrated on the Iris [53] in Figure 2. The convergence analysis of the proposed TR-QNet is also provided in the _Appendix_.

Table 2 summarizes the numerical results obtained using our TR-QNet using \(4\), \(6\) and \(8\) number of qubits, VQTN [50], and QCNN [60] and TR-VQC [56] using \(4\) (Iris dataset) and \(8\) qubits (MNSIT and CIFAR-10 datasets) and fully classically simulated VTNN [51] on Iris, MNSIT and CIFAR-10 datasets. It has been observed from the experimental results reported in Table 2 that optimal accuracy has been achieved for class \(2\) or \(3\) in most cases of the Iris dataset. On the contrary, in the case of MNIST and CIFAR-10 datasets, class \(3\) or \(6\) reports optimal accuracy for most of the models discussed in the manuscript. Our TR-QNet achieves promising accuracy of \(94.5\%\), \(86.16\%\), and \(83.54\%\) with \(4\) qubits on the Iris and with \(6\) qubits on the MNIST and CIFAR-10 datasets, respectively. However, in the case of multi-class classification, despite TR-QNet's low accuracy, as provided in Table 3, it outperforms VQTN and VTNN. It may be noted that TR-VQC and QCNN are not feasible for multi-class classification owing to the limitations of their framework. In addition, we use a \(\gamma=0.05\) significant threshold for a two-sided paired Wilcoxon signed-rank test [61] to demonstrate the effectiveness of the proposed TR-QNet model over other methods. It is evident from the two-sided paired Wilcoxon signed-rank

Figure 2: TR-QNet training loss is reported on a \(4\) qubits systems with varying layers of TNN and Quan-TR layers for randomly selected binary classes (a) 1 or 2, (b) 2 or 3 and (c) 1 or 3, (d) varying with qubits (\(4,6,8,10\), and \(12\) on Iris dataset [53].
test that the proposed TR-QNet model yields statistically significant results using \(4\) and \(6\) qubits Quan-TR for Iris data and image (MNIST and CIFAR-10) classification, respectively. This is primarily owing to the limited Iris data feature demanding fewer qubits, whereas the larger image size requires more qubits. Further increasing to \(8,10\), and \(12\) qubits resulted in a substantial decrease in accuracy for the proposed TR-QNet and the other methods, probably as a result of over-parametrization [62] and barren plateaus [57].

## 4 Discussions

The experimental results reported in the manuscript show that the proposed TR-QNet model outperforms its quantum and classical counterparts for binary classification and multi-class (ternary) classification in test datasets in the given experimental settings. This is due to the fact that the proposed TR-QNet is capable of modulating classification tasks by substituting the trainable weight matrices of the fully connected dense layers of standard TNN with Quan-TR, and hence, TNN acts as an efficient encoding tool, especially for large image features with minimal loss of information from the input images. The VQC-based training algorithm resembling DMRG [58] enables a straightforward entanglement of the entanglement spectrum of the MPO's [28] trainable weights, thereby facilitating a lucid comprehension of the correlations within the parameters of TN layers. For efficient training of the proposed Quan-TR model, we have presented a novel entanglement-aware training technique relying on hybrid classical-quantum algorithms and

\begin{table}
\begin{tabular}{l c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Qubit**} & \multicolumn{3}{c}{\(d_{q}\)**=2**} & \multicolumn{3}{c}{\(d_{q}\)**=4**} & \multicolumn{3}{c}{\(d_{q}\)**=6**} \\ \cline{2-11}  & **1 or 2** & **2 or 3** & **1 or 3** & **1 or 2** & **2 or 3** & **1 or 3** & **1 or 2** & **2 or 3** & **1 or 3** & **1 or 2** & **2 or 3** & **1 or 3** \\ \hline
4 & 0.919 & 0.875 & 0.891 & 0.941 & 0.939 & 0.955 & 0.939 & 0.911 & 0.924 \\
6 & 0.801 & 0.794 & 0.789 & 0.882 & 0.865 & 0.880 & 0.829 & 0.817 & 0.829 \\
8 & 0.782 & 0.765 & 0.770 & 0.787 & 0.780 & 0.788 & 0.782 & 0.757 & 0.772 \\
10 & 0.728 & 0.765 & 0.760 & 0.773 & 0.743 & 0.760 & 0.769 & 0.750 & 0.763 \\
12 & 0.628 & 0.605 & 0.616 & 0.673 & 0.643 & 0.690 & 0.629 & 0.617 & 0.609 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparative analysis of the proposed 2-2 layers TR-QNet with varying number of qubits and tensor ranks (\(d_{q}\)) on Iris dataset

\begin{table}
\begin{tabular}{l c c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Qubits**} & \multicolumn{3}{c}{**Iris**} & \multicolumn{3}{c}{**MNIST**} & \multicolumn{3}{c}{**CIFAR-10**} \\ \cline{2-11}  & & **1 or 2** & **2 or 3** & **1 or 3** & **0 or 9** & **1 or 8** & **2 or 7** & **3 or 6** & **4 or 5** & **0 or 9** & **1 or 8** & **2 or 7** & **3 or 6** & **4 or 5** \\ \hline \multirow{3}{*}{**TR-QNet**} & 4 & **0.941** & **0.939** & **0.955** & 0.817 & **0.828** & 0.869 & 0.850 & 0.809 & 0.758 & 0.803 & 0.747 & 0.798 & 0.771 \\  & 0.882 & 0.865 & 0.880 & **0.828** & **0.836** & **0.891** & **0.863** & **0.870** & **0.819** & **0.849** & **0.833** & **0.857** & **0.809** \\  & 0.787 & 0.780 & 0.788 & 0.667 & 0.684 & 0.669 & 0.650 & 0.671 & 0.658 & 0.603 & 0.647 & 0.618 & 0.624 \\ \hline
**VQTN** & 4/6 & **0.924** & 0.905 & 0.911 & 0.813 & 0.806 & 0.829 & 0.811 & 0.823 & 0.788 & 0.794 & 0.776 & 0.745 & 0.763 \\ \hline
**QCNN** & 4/6 & 0.871 & 0.852 & 0.861 & 0.772 & 0.736 & 0.740 & 0.742 & 0.755 & 0.721 & 0.714 & 0.717 & 0.732 & 0.746 \\ \hline
**TR-VQC** & 4/6 & 0.853 & 0.849 & 0.829 & 0.803 & 0.799 & 0.802 & 0.789 & 0.790 & 0.767 & 0.759 & 0.761 & 0.753 & 0.747 \\ \hline
**YTNN** & N/A & 0.838 & 0.839 & 0.842 & 0.797 & 0.788 & 0.798 & 0.778 & 0.780 & 0.701 & 0.698 & 0.734 & 0.727 & 0.715 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Mean accuracy of the proposed TR-QNet with VQTN [50], TR-VQC [56], QCNN [60], and fully classically simulated VTNN [51] on the test Iris [53], MNIST [54] and CIFAR-10 [55] datasets [The bold values sheds light to the two-sided paired Wilcoxon signed-rank test data [61]]

\begin{table}
\begin{tabular}{l c c c c c c c c c} \hline \hline  & & \multicolumn{3}{c}{**Iris**} & \multicolumn{3}{c}{**MNIST**} & \multicolumn{3}{c}{**CIFAR-10**} \\ \cline{2-11}
**Model** & **Qubit** & **1, 2 or 3** & **0, 1 or 9** & **2, 4 or 5** & **3, 6 or 7** & **0, 1, 9** & **2, 4 or 5** & **3, 6 or 7** \\ \hline
4 & **0.815** & **0.738** & 0.723 & **0.746** & 0.707 & 0.712 & 0.723 \\
**TR-QNet** & 6 & 0.802 & **0.741** & **0.736** & **0.739** & **0.719** & **0.725** & **0.731** \\  & 8 & \(0.785\) & 0.709 & 0.717 & 0.716 & **0.718** & 0.707 & 0.713 \\ \hline VQTN & 6 & **0.811** & \(0.714\) & 0.701 & 0.698 & 0.688 & 0.682 & 0.694 \\ \hline VTNN & N/A & \(0.774\) & \(0.689\) & 0.684 & 0.679 & 0.613 & 0.639 & 0.657 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Mean accuracy of the proposed TR-QNet with tensor ranks (\(d_{q}=4\)), VQTN [50] and VTNN [51] for multi-class (3-class) classification [The bold numbers provide information about the two-sided paired Wilcoxon signed-rank test data]
stochastic gradient-descent updates. This approach operates on a condensed parameter subspace obtained from the tensorization of trainable weights, leading to faster convergence and promising results.

Moreover, our implementation enables the creation of hybrid architectures that combine TN layers, dense layers, and Quan-TR to create true instances of deep learning models. Moreover, it is worth noting that the multi-layer design of Quan-TR within our proposed TR-QNet has the potential to produce the cascading effect of entanglement between the neuronal inputs and their outputs. Our results indicate that the classical TNNs with DMRG-like training and Quan-TR methods work accurately and efficiently for data and image classification tasks. The direct access to the singular values throughout the virtual dimensions of the trainable MPOs of TN layers provided by the DMRG-like training method and tensor ring optimized variational learning algorithm is crucial as it enables the computation of a measure of entanglement (correlation) between the features and model parameters. Since more qubits signify a bigger Hilbert space to parametrize the input data [5], we see a general pattern of increasing classification accuracy with qubit count from \(4\) to \(6\). However, Further increasing to \(8,10\) and \(12\) qubits resulted in a substantial decrease in accuracy for the proposed TR-QNet, probably as a result of over-parametrization [62] and barren plateaus [57]. Due to the additional non-linearity caused by the truncated singular value decomposition over the MPOs and two-qubit gate transformations, we also notice that in the case of the Iris dataset, TR-QNet significantly outperforms the VQTN, QCNN, and TR-VQC with full quantum state information and classically simulated VTNN. Eight-qubit circuit topologies are used in a series of studies utilizing different rankings to examine the impact of tensor ring rank on the performance of TR-QNet as it yields optimal results regarding input qubit counts.

However, the proposed TR-QNet model for multi-class image classification has achieved a comparable level of precision, primarily due to the inherent challenges faced by the slow convergence of Quan-TR. Hence, even though its promising performance is exhibited on relatively smaller datasets, the proposed TR-QNet is restricted due to the inherent difficulties in scaling and time-intensive training of Quan-TR. Nevertheless, TR-QNet has achieved higher accuracy in binary classification tasks when compared with its quantum and classical counterparts. Our method paves the way for developing novel deep neural network representations of a quantum state. It serves as a useful tool for investigating the expressive potential of quantum neural states. We aim to develop an efficient TR-QNet model comprising an optimized Quan-TR with fewer hyper-parameters. The total number of parameters in TNN is estimated as \(O(\mathcal{N}_{T}d_{T}n+(n-2)d_{T}^{3})\)[63]. In the case of Quan-TR, the computational complexity is \(O(\mathcal{N}_{q}d_{q})\) as each calculation of a single or two-qubit gate in the proposed Quan-TR is \(O(1)\)[56].

## 5 Conclusion

In line with the impressive advances in quantum machine learning, the proposed TR-QNet framework offers an improvement over fully classical TNN and has been developed as a proof of concept using hybrid classical-quantum algorithms for better training strategies for TNN. In this paper, we have investigated the benefits of a Tensor Ring optimized variational Quantum learning classifier (Quan-TR) to find a better optimization strategy for TR-QNet, which exploits the entanglement inherent between qubits. The experimental results on the test datasets using the proposed TR-QNet model show its efficiency over the quantum and classical counterparts in binary and multi-class classification. Moreover, the experimental results demonstrate the efficacy of the proposed TR-QNet in various settings, which is crucial for data classification and image recognition in noisy intermediate-scale quantum (NISQ) devices. Consequently, our TR-QNet model is a strong contender for deep learning and can revolutionize the studies in quantum machine learning.

However, it remains to investigate the current TR-QNet architecture for deep convolutional neural networks and their training algorithms for regression and classification, which can be deployed immediately in near-term quantum devices. Authors are engaged in this direction.

## Appendix

### Convergence Analysis of TR-QNet

Due to NISQ's limitations, classical simulators are now being utilized to optimize and update parameters and feed them back to Tensor Neural Network (TNN) and Quan-TR separately until convergence conditions are reached. Hence, we have used cross-entropy loss to update the parameters. The loss function (\(\mathcal{L}_{\theta}\)) is derived with the hyper-parameters \(\theta\) of the proposed TR-QNet model as

\[\operatorname*{argmin}_{\theta}\mathcal{L}_{\theta}=\sum_{j}^{\mathcal{N}_{q }}[t^{j}\log\overline{f}(\mathcal{O}_{TN}^{j})+(1-t^{j})\log\{1-\overline{f} (\mathcal{O}_{TN}^{j})\}] \tag{19}\]
\(t^{j}\) corresponds to a target output, \(\mathcal{N}_{q}\) is the number of qubits in Quan-TR and \(\overline{f}(\mathcal{O}_{TN}^{j})\) is the average outcome on quantum measurement of a qubit \(j\) concerning the network hyper-parameter set \(\theta\) as evaluated in the following subsection as follows.

\[f(y_{j}(\theta),t^{j})=\sum_{j}^{\mathcal{N}_{q}}f((\langle 0|\psi^{\dagger}( \mathcal{O}_{TN}^{j})\mathcal{U}^{\dagger}(\theta)y_{j}\mathcal{U}(\theta) \psi(\mathcal{O}_{TN}^{j})|0\rangle),t^{j}) \tag{20}\]

where, \(y_{j}(\theta)\in\{\overline{\lambda_{j}}\}\) and \(t^{j}\) corresponds to a target output and the preprocessed data from the TNN layer, denoted as \(\mathcal{O}_{TN}^{j}\), is transformed into a quantum state represented by \(|\psi(\mathcal{O}_{TN}^{j})\rangle\).

In order to train the proposed Quan-TR model, the gradient of the loss function is evaluated as follows:

\[\frac{\delta\overline{f}^{\prime}(\mathcal{O}_{TN}^{j})}{\theta^{j}}=\langle 0 |\psi^{\dagger}(\mathcal{O}_{TN}^{j})\frac{\delta\mathcal{U}^{\dagger}( \theta)}{\delta\theta_{j}}y_{j}\mathcal{U}(\theta)\psi(\mathcal{O}_{TN}^{j} )|0\rangle+\langle 0|\psi^{\dagger}(\mathcal{O}_{TN}^{j})\mathcal{U}^{ \dagger}(\theta)y_{j}\frac{\delta\mathcal{U}(\theta)}{\delta\theta_{j}}\psi( \mathcal{O}_{TN}^{j})|0\rangle\]

\[=\langle 0|\psi^{\dagger}(\mathcal{O}_{TN}^{j})\mathcal{U}_{1}^{\dagger}( \theta_{1})\cdot\frac{\delta\mathcal{U}_{j}^{\dagger}(\theta_{j})}{\delta \theta_{j}}\cdot\mathcal{U}^{\dagger}{}_{n}(\theta_{n})y_{j}\mathcal{U}(\theta )\psi(\mathcal{O}_{TN}^{j})|0\rangle+ \tag{21}\]

\[\langle 0|\psi^{\dagger}(\mathcal{O}_{TN}^{j})\mathcal{U}^{\dagger}(\theta )y_{j}\mathcal{U}_{n}(\theta_{n})\cdot\frac{\delta\mathcal{U}_{j}(\theta_{j}) }{\delta\theta_{j}}\cdot\mathcal{U}_{1}(\theta_{1})\psi(\mathcal{O}_{TN}^{j} )|0\rangle\]

where, \(\mathcal{U}_{j}(\theta_{j})=e^{-i\theta_{j}\psi(\theta^{j})}\). The global phase has no direct bearing on the results of the measurement, and hence, we disregard the global phase. Now, rotation gates can be written as follows.

\[\frac{\delta\psi(\theta,\mathcal{O}_{TN})}{\delta\theta^{j}}=\frac{1}{2}\psi (\theta+\frac{\pi}{2},\mathcal{O}_{TN})\frac{\delta\psi^{\dagger}(\theta, \mathcal{O}_{TN})}{\delta\theta^{j}}=\frac{1}{2}\psi(\theta-\frac{\pi}{2}, \mathcal{O}_{TN}) \tag{22}\]

Substituting Equation 21 by Equation 22, we obtain as follows.

\[\frac{\delta\overline{f}^{\prime}(\mathcal{O}_{TN}^{j})}{\theta^{j}}=\langle 0 |\psi^{\dagger}(\mathcal{O}_{TN}^{j})\mathcal{U}_{1}^{\dagger}(\theta_{1}) \cdot\frac{\delta\mathcal{U}_{j}^{\dagger}(\theta_{j})}{\delta\theta_{j}} \cdot\mathcal{U}^{\dagger}{}_{n}(\theta_{n})y_{j}\mathcal{U}(\theta)\psi( \mathcal{O}_{TN}^{j})|0\rangle+\]

\[\langle 0|\psi^{\dagger}(\mathcal{O}_{TN}^{j})\mathcal{U}^{\dagger}(\theta )y_{j}\mathcal{U}_{n}(\theta_{n})\cdot\frac{\delta\mathcal{U}_{j}(\theta_{j}) }{\delta\theta_{j}}\cdot\mathcal{U}_{1}(\theta_{1})\psi(\mathcal{O}_{TN}^{j} )|0\rangle\]

\[=\frac{1}{2}\{-\langle 0|\psi^{\dagger}(\mathcal{O}_{TN}^{j})\mathcal{U}_{1}^{ \dagger}(\theta_{1})\cdot\frac{\delta\mathcal{U}_{j}^{\dagger}(\theta_{j}- \frac{\pi}{2})}{\delta\theta_{j}}\cdot\mathcal{U}^{\dagger}{}_{n}(\theta_{n} )y_{j}\mathcal{U}(\theta)\psi(\mathcal{O}_{TN}^{j})|0\rangle+\]

\[\langle 0|\psi^{\dagger}(\mathcal{O}_{TN}^{j})\mathcal{U}^{\dagger}(\theta )y_{j}\mathcal{U}_{n}(\theta_{n})\cdot\frac{\delta\mathcal{U}_{j}(\theta_{j}+ \frac{\pi}{2})}{\delta\theta_{j}}\cdot\mathcal{U}_{1}(\theta_{1})\psi(\mathcal{ O}_{TN}^{j})|0\rangle\}\]

\[=\frac{1}{2}\{\langle 0|\psi^{\dagger}(\mathcal{O}_{TN}^{j})\mathcal{U}_{-}^{ \dagger}[i\psi_{j}]\mathcal{U}_{+}^{\dagger}y_{j}\mathcal{U}(\theta)\psi( \mathcal{O}_{TN}^{j})|0\rangle-\langle 0|\psi^{\dagger}(\mathcal{O}_{TN}^{j}) \mathcal{U}^{\dagger}(\theta)y_{j}\mathcal{U}_{+}[-i\psi_{j}]\mathcal{U}_{-} \psi(\mathcal{O}_{TN}^{j})|0\rangle\}\]

\[=\frac{1}{2}\Psi_{\theta_{+}}(\psi(\mathcal{O}_{TN}^{j}))-\frac{1}{2}\Psi_{ \theta_{-}}(\psi(\mathcal{O}_{TN}^{j}))\]

For the rotation gates \(\mathcal{R}_{y}(\omega_{y})\) and \(\mathcal{R}_{z}(\omega_{z})\) of Quan-TR in TR-QNet, the angle of rotation [variational parameter (\(\theta\))] is \(\omega_{y}\) and \(\omega_{z}\), respectively. The rotation gates \(\mathcal{R}_{y}(\omega_{y})\) and \(\mathcal{R}_{z}(\omega_{z})\) of Quan-TR operate the qubits \(|\psi_{y}\rangle\) and \(|\psi_{z}\rangle\) as follows.

\[|\psi_{y}(t+1)\rangle=\left(\begin{array}{cc}\cos\triangle\omega_{y}(t)&- \sin\triangle\omega_{y}(t)\\ \sin\triangle\omega_{y}(t)&\cos\triangle\omega_{y}(t)\end{array}\right)|\psi_{y }(t)\rangle \tag{24}\]

\[|\psi_{z}(t+1)\rangle=\left(\begin{array}{cc}\exp(-j\triangle\omega_{z}(t))&0 \\ 0&(-j\triangle\omega_{z}(t))\end{array}\right)|\psi_{z}(t)\rangle \tag{25}\]

where,

\[\omega_{y}(\iota+1)=\omega_{y}(t)+\triangle\omega_{y}(t) \tag{26}\]

and

\[\omega_{z}(\iota+1)=\omega_{z}(\iota)+\triangle\omega_{z}(\iota) \tag{27}\]

For the quantum layers in Quan-TR at epoch, \(\iota\), Equations 26 and 27 measure the change in the phase or angles \(\triangle\omega_{y}(\iota)\) and \(\triangle\omega_{z}(\iota)\), respectively. Let us Consider

\[\mathcal{C}(\iota)=\omega_{y}(\iota)-\overline{\omega_{y}(\iota)} \tag{28}\]

\[\mathcal{D}(\iota)=\omega_{z}(\iota)-\overline{\omega_{z}(\iota)} \tag{29}\]
\[\mathcal{R}(\iota)=\omega_{y}(\iota+1)-\omega_{y}(\iota)=\mathcal{C}( \iota+1)-\mathcal{C}(\iota) \tag{30}\] \[\mathcal{S}(\iota)=\omega_{z}(\iota+1)-\omega_{z}(\iota)=\mathcal{D} (\iota+1)-\mathcal{D}(\iota) \tag{31}\]

The optimal phases or angles are therefore \(\overline{\omega}_{y}(\iota)\) and \(\overline{\omega}_{z}(\iota)\) for the rotation gates \(\mathcal{R}_{y}(\omega_{y})\) and \(\mathcal{R}_{z}(\omega_{z})\), respectively.

In order to update the weights in TNN, a gradient of the bond tensors with respect to the loss (\(\mathcal{L}_{\theta}\)), \(\mathcal{B}^{j,j+1}\), is obtained by defining \(\overline{f}(\mathcal{O}_{TN}^{j})=\mathcal{T}\mathcal{B}\), where \(T\) represents the contraction of every tensor in the TNN other than the bond tensor \(\mathcal{B}\).

When considering \(\mathcal{B}^{j}(\iota)\), \(\omega_{y}^{j}(\iota)\) and \(\omega_{z}^{j}(\iota)\), the loss function \(\mathcal{L}_{\theta}(\mathcal{B},\omega_{y},\omega_{z})\) is differentiated as follows:

\[\begin{split}\frac{\partial\mathcal{L}_{\theta}(\mathcal{B}, \omega_{y},\omega_{z})}{\partial\mathcal{B}^{j}(\iota)}=\sum_{j=1}^{\mathcal{ N}_{q}}\frac{\partial\overline{f}^{i}(\mathcal{O}_{TN}^{j})}{\mathcal{B}^{j}( \iota)}\left[\frac{t^{j}}{\overline{f}\left(\mathcal{O}_{TN}^{j}\right)}- \frac{t^{j}-1}{1-\overline{f}^{i}(\mathcal{O}_{TN}^{j})}\right]\\ =\sum_{j=1}^{\mathcal{N}_{q}}\mathcal{T}^{j}(\iota)\left[\frac{t^ {j}}{\overline{f}\left(\mathcal{O}_{TN}^{j}\right)}-\frac{t^{j}-1}{1- \overline{f}^{i}(\mathcal{O}_{TN}^{j})}\right]\end{split} \tag{32}\]

Hence, the change in the bond tensor designated as \(\triangle\mathcal{B}^{j}(\iota)\) is evaluated as follows.

\[\triangle\mathcal{B}^{j}(\iota)=-\gamma(\iota)\frac{\partial\mathcal{L}_{ \theta}(\mathcal{B},\omega_{y},\omega_{z})}{\partial\mathcal{B}^{j}(\iota)} \tag{33}\]

Here, \(\gamma(\iota)\) is a learning rate in the gradient descent procedure for updating the bond tensors in TN layers.

\[\frac{\partial\mathcal{L}_{\theta}(\mathcal{B},\omega_{y},\omega_{z})}{ \partial\omega_{y}^{j}(\iota)}=\sum_{j=1}^{\mathcal{N}_{q}}\frac{\partial \overline{f}^{i}(\mathcal{O}_{TN}^{j})}{\omega_{y}^{j}(\iota)}\left[\frac{t^{j }}{\overline{f}\left(\mathcal{O}_{TN}^{j}\right)}-\frac{t^{j}-1}{1-\overline{ f}^{i}(\mathcal{O}_{TN}^{j})}\right] \tag{34}\]

\[\frac{\partial\mathcal{L}_{\theta}(\mathcal{B},\omega_{y},\omega_{z})}{ \partial\omega_{y}^{j}(\iota)}=\sum_{j=1}^{\mathcal{N}_{q}}\frac{\partial \overline{f}^{i}(\mathcal{O}_{TN}^{j})}{\omega_{y}^{j}(\iota)}\left[\frac{t^{ j}}{\overline{f}\left(\mathcal{O}_{TN}^{j}\right)}-\frac{t^{j}-1}{1-\overline{f}^{i}( \mathcal{O}_{TN}^{j})}\right] \tag{35}\]

Here, parameter shift techniques are used to evaluate the gradient of the Quan-TR parameters \(\omega_{y}\) and \(\omega_{z}\)[64, 65, 50] as follows.

\[\frac{\partial\overline{f}^{i}(\mathcal{O}_{TN}^{j})}{\omega_{y}^{j}(\iota)} =\frac{1}{2}\left[\Psi_{\omega_{y}+\frac{\pi}{2}}^{\iota+1}(\psi( \mathcal{O}_{TN}^{j}))-\Psi_{\omega_{y}-\frac{\pi}{2}}^{\iota}(\psi( \mathcal{O}_{TN}^{j}))\right] \tag{36}\]

and

\[\frac{\partial\overline{f}^{i}(\mathcal{O}_{TN}^{j})}{\omega_{z}^{j}(\iota)} =\frac{1}{2}\left[\Psi_{\omega_{z}+\frac{\pi}{2}}^{\iota+1}(\psi( \mathcal{O}_{TN}^{j}))-\Psi_{\omega_{z}-\frac{\pi}{2}}^{\iota}(\psi( \mathcal{O}_{TN}^{j}))\right] \tag{37}\]

where, with rotation angles \(\omega_{y}^{j}(\iota)\) and \(\omega_{z}^{j}(\iota)\), respectively, \(\Psi(\iota)_{\omega_{y}\pm\frac{\pi}{2}}(\psi(\mathcal{O}_{TN}^{j}))\) and \(\Psi(\iota)_{\omega_{z}\pm\frac{\pi}{2}}(\psi(\mathcal{O}_{TN}^{j}))\) are the measured qubit \(\psi(\mathcal{O}_{TN}^{j})\). The changes in phase or angles are designated as \(\triangle\omega_{y}^{j}(\iota)\) and \(\triangle\omega_{z}^{j}(\iota)\), respectively, for the rotation gate used to update the qubits. The rotation angles are then modified using the formula below.

\[\triangle\omega_{y}^{j}(\iota)=-\nu(\iota)\{\frac{\partial\overline{f}^{i}( \mathcal{O}_{TN}^{j})}{\omega_{y}^{j}(\iota)}\} \tag{38}\]

\[\triangle\omega_{z}^{j}(\iota)=-\mu(\iota)\{\frac{\partial\overline{f}^{i}( \mathcal{O}_{TN}^{j})}{\omega_{z}^{j}(\iota)}\} \tag{39}\]

Here, \(\nu(\iota)\) and \(\mu(\iota)\) are the learning rates in the gradient descent procedure for updating the rotation angles.

## 6 Data availability

The Iris dataset [53], MNIST[54], and CIFAR-10 [55] datasets can be found in the following links:[https://archive.ics.uci.edu/dataset/53/iris](https://archive.ics.uci.edu/dataset/53/iris), [http://yann.lecun.com/exdb/mnist/](http://yann.lecun.com/exdb/mnist/), and [https://www.cs.toronto.edu/~kriz/cifar.html](https://www.cs.toronto.edu/~kriz/cifar.html), respectively.

## 7 Code Availability & Description

The PyTorch implementation of TR-QNet is available on Github: [https://github.com/konar1987/TR-QNet/](https://github.com/konar1987/TR-QNet/).
## 8 Acknowledgements

This work was partially supported by the Fulbright-Nehru Visiting Researcher Grant \(\#2858FNPDR/2022\).
