The cross-sectional stock return predictions via quantum neural network
  and tensor network
In this paper, we investigate the application of quantum and quantum-inspired
machine learning algorithms to stock return predictions. Specifically, we
evaluate the performance of quantum neural network, an algorithm suited for
noisy intermediate-scale quantum computers, and tensor network, a
quantum-inspired machine learning algorithm, against classical models such as
linear regression and neural networks. To evaluate their abilities, we
construct portfolios based on their predictions and measure investment
performances. The empirical study on the Japanese stock market shows the tensor
network model achieves superior performance compared to classical benchmark
models, including linear and neural network models. Though the quantum neural
network model attains a lowered risk-adjusted excess return than the classical
neural network models over the whole period, both the quantum neural network
and tensor network models have superior performances in the latest market
environment, which suggests the capability of the model's capturing
non-linearity between input features.
Nozomu Kobayashi, Yoshiyuki Suimon, Koichi Miyamoto, Kosuke Mitarai
# The cross-sectional stock return predictions via quantum neural network and tensor network

###### Abstract

In this paper we investigate the application of quantum and quantum-inspired machine learning algorithms to stock return predictions. Specifically, we evaluate performance of quantum neural network, an algorithm suited for noisy intermediate-scale quantum computers, and tensor network, a quantum-inspired machine learning algorithm, against classical models such as linear regression and neural networks. To evaluate their abilities, we construct portfolios based on their predictions and measure investment performances. The empirical study on the Japanese stock market shows the tensor network model achieves superior performance compared to classical benchmark models, including linear and neural network models. Though the quantum neural network model attains the lowered risk-adjusted excess return than the classical neural network models over the whole period, both the quantum neural network and tensor network models have superior performances in the latest market environment, which suggests capability of model's capturing non-linearity between input features.

## 1 Introduction

The arrival of real quantum computers and experiments that show the quantum supremacy [1, 2] make it more realistic that the new computational paradigm will come by virtue of quantum computing. It is true that we are currently at the era of NISQ (noisy intermediate-scale quantum computer) [3] and must implement the quantum error correction for full picture of such a new paradigm, but rapid progress of quantum technologies already open a new window to the research in various fields, such as quantum chemistry, optimization, machine learning, and finance. It is therefore worth looking for a practical application of quantum computers even in the NISQ era. The framework of variational quantum algorithms (VQAs) [4] are thought to be an effective approach towards the goal. It has been applied, for instance, to solve machine learning problems [5, 6].

Machine learning techniques developed within the framework of VQAs are essentially equivalent to the ones using tensor networks [7, 8, 9], which is originally invented as a
tool to simulate quantum physics in classical computers [10, 11]. Its ability to utilize an exponentially large tensor into a factorized series of smaller tensors has also allowed the machine learning community to successfully solve various machine learning problems [12, 8, 9]. It can consequently be considered as a quantum-inspired machine learning algorithm.

Given these growing interests of quantum and quantum-inspired machine learning algorithms, it is important to study their applicability on the real-world problems, which are, however, less known so far partly due to the current limitation of computational resource for quantum computers and their simulators. In this work, to address above issue, we consider a real-world financial problem, namely prediction of stock returns, employing quantum and quantum-inspired machine learning algorithms.

Stock return prediction has been a principal problem in finance. Ever since the work by Fama and French [13], who have provided the empirical evidence that the notion of so-called factors is effective in return explainability, significant efforts has been made to find unseen factors that have predicable powers for stock returns. Among practical investors, multi-factor models, which is a linear regression of stock returns by a set of factors, are commonly used thanks to their simplicity and interpretability, though they lack expressibility due to absence of interaction terms between factors. As it is, machine learning has been becoming an alternative to them. Various studies, [14, 15, 16, 17, 18] to name but a few, are conducted on stock return predictions with machine learning methods, which can capture non-linearity in contrast to multi-factor models.

Our interest here is to test whether the quantum or quantum-inspired techniques can be applied to predict stock returns, and also have competitive advantage over classical machine learning algorithms in that task. To this end, using a set of stocks in the Japanese stock market, we conduct portfolio backtesting over 10 years based on stock return predictions by quantum neural network, tensor network, standard linear regression, and neural network and compare their performances. As a result, we find that the tensor network model outperforms the other models, while the quantum neural network model are inferior to the neural network model in the whole backtesting period. We also observe that in the latest market environment the quantum neural network model has the better performance than the neural network model, which might be related to the overfitting problem. This experiment provides the implication that quantum neural network and tensor network may be able to learn non-linear and interaction effects among features, and they have potential to use in return predictions beyond the conventional models.

This paper is organized as follows. In Section 2, we explain the definition of our problem, the stock return predictions, then describe both classical and quantum machine learning algorithms we use in our analysis. Section 3 presents the methodology to conduct our backtesting experiment and then shows its results, using quantitative metrics that are often used to evaluate an investment performance. Finally, in Section 4 we conclude our analysis and discuss some future directions for further research.

## 2 Methodology

This section collects all the ingredients we use in our analysis. First we set up the definition of our objective as stock return prediction by cross-sectional analysis, which is based on comparing each stock to others at a point in time, and describe general methodology to tackle the problem. Then we explain classical models for return predictions, namely the linear regression and the neural network models. Both models are used as benchmark models against quantum ones in our experiment, according to the following reasons. The
linear regression model is one of the most traditional models as well as widely employed both by academicians and practitioners in finance. The neural network model serves as a classical counterpart of quantum models, not to mention that it shows superior investing performance over the linear model thanks to its flexibility and expressibility. After that we introduce quantum circuit learning, which is one realization of quantum neural network, and tensor network algorithms in our framework. Finally, we describe the optimization procedure for these machine learning models.

### Problem Definition

The objective of this work is to predict stock returns over cross-section. Before formulating our problem, let us clarify some notations.

Suppose there are trading dates indexed as \(0\leq t\leq T\) and at each trading date \(t\) we have \(N_{t}\) stocks available to invest. We call such a whole set of stocks as stock universe and denote \(U_{t}\). Remark that frequency of trading periods depends on our purpose and data availability, by which we adjust the frequency for monthly, weekly, daily, and so on. We describe most generic situation that stock universe varies over time. Stocks are indexed as \(i=1,\cdots,N_{t}\), and price of \(i\)-th stock at time \(t\) is denoted as \(p_{i,t}\). The return of \(i\)-th stock from \(t\) to \(t+1\) is then calculated as

\[r_{i,t+1}=\frac{p_{i,t+1}-p_{i,t}}{p_{i,t}}\,, \tag{1}\]

which is what we wish to predict. For financial practitioners, it is essential to predict stock returns, since they usually build trading strategies based on predicted future returns. In academic literature, it has been a central problem to investigate the predictability of stock returns and to construct prediction models which satisfies empirical characteristics, with the hope to reveal market structures.

There are mainly two distinct approaches to predict stock returns: one is that by focusing on a specific stock we use time series analysis to predict its return, the other is that we predict cross-sectional relative stock performance for whole stock universe at each time, employing each firm's features.

In this work we adopt the latter cross-sectional approach, in which we leverage information of firms. Suppose we have \(n\) features for \(i\)-th stock at time \(t\). Such features are compiled to \(n\)-dimensional vector \(X_{i,t}\), by means of which we describe the general formula of our prediction model as follows:

\[r_{i,t+1}=F(X_{i,t})+\epsilon_{i,t}\,, \tag{2}\]

where the form of \(F\) is not specified here and will be determined by our choice of models. \(\epsilon_{i,t}\) represents an error term.

As for a choice of features, what should explain stock returns is a long-standing subject to study in financial literature, and has industriously been investigated. The celebrated work by Fama and French [13] proposes and empirically shows that returns of individual firms can be explained by the following three factors: market (how the whole market move), size (how large the market capitalization of stocks is), and value (how the stock price is overvalued or undervalued). Ever since their publication, successive studies has followed in order to find other unknown factor to explain returns, with the result that the number of proposed factors has surpassed a hundred. Other than famous three factors mentioned above, typical factors considered so far includes momentum (how big the past return of stocks is) and quality (how stable earnings stocks have).
Regarding the prediction model \(F\), linear regression has been traditionally used both for academicians and practitioners, because of its simplicity and interpretability. In this case, (2) becomes

\[r_{i,t+1}=\sum_{k=1}^{n}X_{i,t,k}\cdot\theta_{k}+\epsilon_{i,t}\,, \tag{3}\]

where \(\theta\) is an \(n\)-dimensional vector of model parameters. Note that the index \(k\) represents \(k\)-th element of a \(n\)-dimensional vector. In our analysis, we employ this linear regression model as a benchmark. The parameters \(\theta\) is determined by the usual ordinary least square regression.

Traditional linear regression models neglect interaction terms between features and nonlinear terms. Machine learning models shed light on these issues, as is widely reported in e.g. [14, 15, 16, 17, 18]. In our analysis, we use the neural network models as classical machine learning ones. As quantum and quantum-inspired machine learning models, we propose to employ quantum circuit learning and tensor network in return predictions. The following subsections are devoted to describing these methods and how they can be applied for stock return predictions.

### Neural network

We consider a feed-forward neural network, which consists of \(L\) layers of affine maps and activation functions. It is formally written as

\[F^{\text{NN}}=\mathsf{W_{L}}\circ\sigma_{L-1}\circ\cdots\sigma_{1}\circ \mathsf{W_{1}}\,, \tag{4}\]

The affine map \(W_{l}\) acts on \(n_{l}\)-dimensional input vector \(Z_{l}\) as follows:

\[\mathsf{W_{l}}(Z_{l})=W_{l}Z_{l}+b_{l}\,, \tag{5}\]

where \(W_{l}\in\mathbb{R}^{n_{l+1}\times n_{l}}\) denotes a weight matrix and \(b_{l}\in\mathbb{R}^{n_{l}}\) a bias vector. The activation function \(\sigma_{l}\) is a key to generate non-linear effect on the model. Though there are a plenty of possibilities what activation function to use, in our analysis we use the same function \(\mathsf{ReLU}\) for all \(l=1,\cdots L\) defined as:

\[\sigma_{l}(x)=\mathsf{ReLU}(x)\equiv\max\{x,0\}\,. \tag{6}\]

Having these in our hands, we construct return prediction such that

\[r_{i,t+1}=F^{\text{NN}}(X_{i,t})+\epsilon_{i,t}\,. \tag{7}\]

### Quantum circuit learning

Among various quantum machine learning algorithms that have been developed recently [4], we employ the framework called quantum circuit learning [5] in this work. It is one of the variational quantum algorithms, aiming at application for supervised machine learning problems. Quantum circuit learning can be regarded as a quantum counterpart of the neural network, since both algorithm try to optimize parameters variationally so that an objective function is minimized. For this reason, quantum circuit leaning and similar approaches are also sometimes referred to as quantum neural network [4].

Quantum circuit learning consists of the following procedures. Suppose we have a dataset consisting of input data \(\{x_{i}\}_{i=1}^{N}\), and corresponding teacher data \(\{y_{i}\}_{i=1}^{N}\). First we
construct a quantum circuit \(V(x)\) from \(x\). We apply it to some initial state \(\left|\psi_{0}\right\rangle\) in order to encode the information of input variables into the quantum state: \(\left|\psi_{in}\right\rangle=V(x)\left|\psi_{0}\right\rangle\). Then we prepare a parameterized quantum circuit \(U(\theta)\) and apply it to the above state: \(\left|\psi_{out}\right\rangle=U(\theta)\left|\psi_{in}\right\rangle\). Finally, we measure the expectation value \(\left\langle\psi_{out}\right|O\left|\psi_{out}\right\rangle\) of some observable \(O\). In this work, we take Pauli \(Z\) operator acting on the first qubit, \(Z_{1}\), as the observable \(O\). It is taken as an output of the algorithm \(F^{\mathrm{QCL}}(x,\theta)\). The objective function built from \(y_{i}\) and \(F^{\mathrm{QCL}}(x,\theta)=\left\langle\psi_{out}\right|Z_{1}\left|\psi_{out}\right\rangle\) is minimized by varying the parameter \(\theta\). With the optimized parameter \(\theta=\theta^{*}\), the trained model is given as \(F^{\mathrm{QCL}}(x,\theta^{*})\). Figure 1 shows the general circuit of the quantum circuit learning algorithm.

We next explain the construction of quantum circuits for our analysis. It follows [5]. The initial state \(\left|\psi_{in}\right\rangle\) is prepared as \(\left|0\right\rangle^{\otimes n}\), where we assume the dimension of vectors \(x_{i}\) of input data is \(n\). The encoding circuit \(V(x_{i})\) is given by

\[V(x_{i})=\prod_{j=1}^{n}R_{j}^{Z}(\cos^{-1}x_{i,j}^{2})R_{j}^{Y}(\sin^{-1}x_{i,j})\,, \tag{8}\]

where \(R_{j}^{Z}\), \(R_{j}^{Y}\) represent rotation gates acting on \(j\)-th qubit:

\[R_{j}^{Z}(\phi)=e^{i\phi Z_{j}/2}\,,\quad R_{j}^{Y}(\phi)=e^{i\phi Y_{j}/2}\,. \tag{9}\]

Note that the input vector \(x_{i}\) must be normalized in the range of \([-1,1]\).

Then our parameterized quantum circuit is constructed as follows

\[U(\theta)=\prod_{i=1}^{d}\left(\prod_{j=1}^{n}U(\theta_{j}^{(i)})U_{\mathrm{ rand}}\right)\,, \tag{10}\]

which is illustrated in Figure 2. Here, \(U_{\mathrm{rand}}\) denotes a time evolution gate for the following Hamiltonian,

\[U_{\mathrm{rand}}=e^{-iH\tau},\quad H=\sum_{j=1}^{n}a_{j}X_{j}+\sum_{j=1}^{n} \sum_{k=1}^{j-1}J_{jk}Z_{j}Z_{k}\,, \tag{11}\]

where \(a_{j}\), \(J_{j,k}\) are randomly taken from a uniform distribution on \([-1,1]\) and \(\tau\) represents a time length of the evolution. Both of these parameters are fixed during the algorithm. \(U(\theta_{j}^{(i)})\) denotes a sequence of rotation gates on \(j\)-th qubit:

\[U(\theta_{j}^{(i)})=R_{j}^{X}\left(\theta_{j1}^{(i)}\right)R_{j}^{Z}\left( \theta_{j2}^{(i)}\right)R_{j}^{X}\left(\theta_{j3}^{(i)}\right)\,. \tag{12}\]

Figure 1: The general structure of quantum circuit learning, where we have two quantum circuit architectures: Data encoding circuit \(V(x)\) and parameterized quantum circuit \(U(\theta)\)
where \(R^{X}_{j}(\phi)=e^{i\phi X_{j}/2}\). \(U_{\rm rand}\) and \(U(\theta^{(i)}_{j})\) are repeatedly applied to the state for \(d\) times, resulting in the whole gate \(U(\theta)\) in Eq. (10).

Equipped with these gates, quantum circuit learning can be used in return prediction such that

\[r_{i,t+1}=F^{\rm QCL}(X_{i,t},\theta)+\epsilon_{i,t}\,. \tag{13}\]

### Tensor Network

Tensor network enables us to obtain effective representations of quantum wavefunctions that live on exponentially large dimensional Hilbert space. This is beneficial not only for quantum physics but also for machine learning problems, as tensor network enables us to manipulate a high dimensional feature space.

The matrix product state (MPS), one of the best studied and understood tensor networks among all types of ones, is employed in our analysis. MPS is defined as follows. Suppose we have an \(n\)-th order tensor \(T\), whose component is given by \(T_{i_{1}\cdots i_{n}}\). The MPS is a representation of such a tensor \(T\) by a product of smaller tensors:

\[T_{i_{1}\cdots i_{n}}=\sum_{\alpha_{1}\cdots\alpha_{n}}A^{(1)}_{i_{1}\alpha_{ 1}}A^{(2)}_{i_{2}\alpha_{1}\alpha_{2}}\cdots A^{(n)}_{i_{n},\alpha_{n}}\,, \tag{14}\]

where the range of indices \(\alpha_{i}\) is called the bond dimension \(m\).

We follow the approach taken in [12, 19, 9] to apply the MPS to our purposes. Consider input vector \(x\) and a feature map \(\Phi(x)\) which maps \(x\) to an \(n\)-th order tensor defined as

\[\Phi_{i_{1}\cdots i_{n}}(x)=\phi_{i_{1}}(x_{1})\phi_{i_{2}}(x_{2})\cdots\phi_ {i_{n}}(x_{n})\,, \tag{15}\]

where

\[\phi(x_{j})=\left(\begin{array}{c}1\\ x_{j}\end{array}\right)\,. \tag{16}\]

We construct a model regression function with an MPS \(W^{\rm MPS}\) which acts as variational parameters to be trained as,

\[y=F^{\rm MPS}(x,W)=\sum_{i_{1}\cdots i_{n}}W^{\rm MPS}_{i_{1}\cdots i_{n}}\Phi _{i_{1}\cdots i_{n}}(x)\,. \tag{17}\]

We use this function \(F^{\rm MPS}(W,x)\) in return prediction:

\[r_{i,t+1}=F^{\rm MPS}(X_{i,t},W)+\epsilon_{i,t}\,. \tag{18}\]

Figure 2: Our choice of a parameterized quantum circuit in the quantum circuit learning algorithm
### Optimization procedure

Now that we have introduced both classical and quantum machine learning models we test in our analysis, let us briefly describe how the training of models is performed. In this subsection, we denote all the prediction models as \(F(X_{i,t},\theta)\) where \(\theta\) represent parameters for corresponding model, unless otherwise noted. Given true return data \(r_{i,t}\) and predicted one \(\tilde{r}_{i,t}=F(X_{i,t})\), our objective function \(E\) to be minimized is the mean squared error,

\[E=\frac{1}{NT}\sum_{t=1}^{T}\sum_{i=1}^{N}(\tilde{r}_{i,t}-r_{i,t})^{2}\,. \tag{19}\]

To archive the minimum, we utilize stochastic gradient descent technique for all models, which is common prescription in learning of neural networks. In this framework, parameters are subsequently updated such as

\[\theta\leftarrow\theta-\eta\nabla_{\theta}E\,, \tag{20}\]

where \(\eta\) represents a hyperparameter and the explicit formula for updating parameters depends on the type of optimizers. As for the quantum circuit learning model \(F=F^{\text{QCL}}\), the gradient is calculated by the so-called parameter-shift rule [5, 6].

It is worth mentioning that, in tensor network, gradient descent technique is not a standard way to optimize parameters, since a more physics-oriented optimization algorithm called density matrix renormalization group (DMRG) [11] prevails in many physics applications and is also used in machine learning one [8]. We, however, work with gradient descent in our analysis, as it is simple to implement on high-level API such as TensorFlow [20] and allows us to compare with other models on equal footing. Note that DMRG approach is thought to be more sophisticated in updating parameters than gradient descent, therefore it would be interesting to investigate the difference of performances in optimizing tensor network models. See [19] for more details.

## 3 Experiment

In this section, we show our empirical study to evaluate how our proposed models perform in return prediction. Our criteria for the evaluation is how profitable our models are, which can be measured by applying models in investment strategies. For this purpose, we adopt an investment strategy based on models' predictions and conduct the backtesting experiment on past historical data. In the following we explain our dataset and methodology of the investment strategy, then discuss results of backtesting.

### Dataset

Our dataset, or investment universe \(U_{t}\), is a set of the Japanese stocks that are constituent of TOPIX500 index. TOPIX500 is a Japanese stock market index, consisting of the 500 most liquid stocks with the largest values of market capitalization among members of stocks listed on Tokyo Stock Exchange.

Input features we use are summarized in Table 1. We consider 10 features, which is rather a small number compared to general machine learning models for stock return predictions, where we typically employ as many as tens to hundreds features to gain expressibility and accuracy. This is due to the fact that our quantum circuit learning architecture requires one qubit for each feature; the more qubits we use, the more computationally intense the simulation of quantum circuits becomes. We therefore limit the
number of features to \(n=10\) so that our backtesting experiment can be conducted within reasonable computational time.

As a preprocessing, all features and returns are cross-sectionally ranked at each time step [17, 21]: the \(i\)th feature of the \(l\)th stock at time \(t\), \(x_{i,t,l}\), is converted to \((\rho_{i,t,l})/(N_{t}-1)\), where \(\rho_{i,t,l}\) is the rank of \(x_{i,t,l}\) among \(\{x_{i,t,l}\}_{i=1,\ldots,N_{t}}\) in the ascending order.

### Investment strategy

The investment strategy that we take in this work is as follows. Our backtesting period goes from June 2008 to May 2021, during which we make investment decisions on monthly basis and let \(t\) denote the end of each month. Subsequently, our subject to predict is then one-month future return.

At the beginning of backtesting, we take three-year samples (June 2008 - May 2011) as training dataset to train the model, and the following one-year ones (June 2011 - May 2012) as test dataset to predict returns. We then roll this procedure forward until the end of the backtesting period. See Figure 3 for its design. In short, we repeatedly make prediction for forthcoming year from most recent three-year samples, but only re-estimate models once a year, not every month, in order to avoid computationally intensive estimation, which is the severe problem for quantum circuit learning runnning on a simulator.

At each time step \(t\) we sort stocks in descending order based on predicted returns \(\tilde{r}_{i,t+1}\) and define a set of stocks belonging to the top quintile as \(H_{t}\). Assuming our models correctly predict stock returns, \(H_{t}\) should represent most profitable stocks among the whole universe \(U_{t}\). On that account, we go long, or buy, these stocks with equal weight. The portfolio return between \(t\) and \(t+1\) is then given by

\[r_{\text{port},t+1}=\frac{1}{|H_{t}|}\sum_{i\in H_{t}}r_{i,t+1}\,, \tag{21}\]

where \(|H_{t}|\) denote the number of stocks in \(H_{t}\). We repeat this process and measure the portfolio performance over the backtesting period.

To test the performance of our investment strategy, the common approach is to set up a benchmark portfolio and evaluate excess return between our portfolio and the benchmark. In this work, we use the TOPIX500 index as a benchmark, therefore the excess return is defined as

\[\alpha_{t}=r_{\text{port},t}-r_{\text{TOPIX500},t}\,, \tag{22}\]

\begin{table}
\begin{tabular}{|l|l|l|} \hline Factor & Feature & Description \\ \hline \hline \multirow{4}{*}{Value} & Book-Value to Price Ratio & Net Asset / Market Value \\ \cline{2-3}  & Earning to Price Ratio & Net Profit / Market Value \\ \cline{2-3}  & Sales to Price Ratio & Sales / Market Value \\ \hline Quality & Return on Equity & Net Profit / Net Asset \\ \hline \multirow{4}{*}{Momentum} & Momentum (1-month) & Stock Returns in the last month \\ \cline{2-3}  & Momentum (3-month) & Stock Returns in the past 3 months \\ \cline{2-3}  & Momentum (6-month) & Stock Returns in the past 6months \\ \cline{2-3}  & Momentum (12-month) & Stock Returns in the past 12 months \\ \hline Size & Market Capitalization & log(Market Value) \\ \hline \multirow{2}{*}{Market} & \multirow{2}{*}{Beta} & Regression coefficient of stock returns \\  & & and market return (TOPIX) over 60 months \\ \hline \end{tabular}
\end{table}
Table 1: The list of features and their descriptions
where \(r_{\text{TOPIX500},t}\) denotes the return of the TOPIX500 index at time \(t\). The metrics of the portfolio performance we employ are following three quantities, all of which are constructed from the time series of \(\alpha_{t}\):

\[\text{ER} =\prod_{t=1}^{T}(1+\alpha_{t})^{12/T}-1\,, \tag{23}\] \[\text{TE} =\sqrt{\frac{12}{T-1}\sum_{t}^{T}(\alpha_{t}-\bar{\alpha}_{t})^{2 })}\,,\] (24) \[\text{IR} =\text{ER/TE}\,, \tag{25}\]

with \(\bar{\alpha}_{t}=1/T\sum_{t=1}^{T}\alpha_{t}\). Here ER represents an annualized excess return, TE (tracking error) denotes corresponding standard deviation, and IR is so called the information ratio, which expresses the risk-adjusted excess return of the portfolio.

### Model architectures

We summarize the detailed setting of our models. As a traditional model, we use the linear regression which we denote Linear. In all models we consider except for the linear regression, the number of parameters is set to be in the same order for fair comparison. We use Adam optimizer in the training, where the number of epochs is also fixed to 20 in all machine learning models.

Neural NetworkWe prepare two distinct neural network models, which differs in the number of hidden layers.

* NN1 denotes the neural network model with \(L=3\) layers whose nodes are given by \((10,7,1)\). This model has 92 parameters to be trained.
* NN2 denotes the neural network model with \(L=4\) layers whose nodes are given by \((10,5,4,1)\). This model has 93 parameters to be trained.

Figure 3: The concept of our backtesting experiment, showing that we take three years as a training period and subsequent one year as a test period, rolling this process until the end of the backtesting period
As mentioned earlier, we stick to use ReLU function as the activation function. TensorFlow [20] is used to implement the model.

Quantum Circuit LearningWe denote our quantum circuit learning model by \(\mathsf{QCL}\). The number of qubit is 10, which is same as the number of input features. The depth of parameterized gates is set to \(d=3\). The number of parameters is consequently 90. We use Qulacs [22] to implement.

Tensor NetworkWe denote our tensor network model by \(\mathsf{TN}\). We set the bond dimension to \(m=2\). The number of parameters is then 76 in this setting. We use TensorNetwork [23] as well as TensorFlow for its implementation.

### Backtesting result

Table 2 summarizes the results of our empirical backtesting. See also Figure 4 for cumulative returns of portfolios and Figure 5 for cumulative excess returns. We observe that the tensor network model \(\mathsf{TN}\) has the best performance in regard to both the excess return and the information ratio. On the other hand, the quantum circuit learning model \(\mathsf{QCL}\) has competitive performance with the neural network model with respect to the excess return, however, it has larger value of TE, which in turn results in inferior risk-adjusted return IR.

From Figure 5, before 2016 \(\mathsf{QCL}\) has the approximately same performance as \(\mathsf{Linear}\). This implies that \(\mathsf{QCL}\) at least learns the linear relationship between input features as is expected. After 2016, on the other hand, \(\mathsf{QCL}\) continues to outperform \(\mathsf{Linear}\), which might be because \(\mathsf{QCL}\) are able to learn non-linear relationships as well. What is more, in these recent market environments, \(\mathsf{QCL}\) can successfully predict stock returns and gain the excess returns, beating classical models. See Appendix A for numerics and graphs. We also find that during last three years in the backtesting period neural network models perform poorly. It suggests that neural networks used in this analysis tend to overfit to the previous market environment and fail in adapting to the latest one.

The tensor network model \(\mathsf{TN}\) has the best performance over other models in spite of the lowest number of parameters. It illustrates that \(\mathsf{TN}\) can possibly have effective architectures to learn financial data, to say nothing of possibility to capture non-linearity among features. It should be further investigated in the future whether this superiority holds when we increase the number of features and parameters in models.

\begin{table}
\begin{tabular}{|l|l|l|l|l|l|} \hline  & Linear & NN1 & NN2 & \(\mathsf{QCL}\) & \(\mathsf{TN}\) \\ \hline ER (\%) & -0.28 & 1.27 & 1.76 & 1.35 & **3.71** \\ \hline TE (\%) & 6.64 & **3.79** & 4.28 & 6.18 & 5.41 \\ \hline IR & -0.04 & 0.34 & 0.41 & 0.22 & **0.69** \\ \hline \end{tabular}
\end{table}
Table 2: The empirical result of backtesting in TOPIX500 universe (Bold characters show the best numbers in each metrics)
## 4 Conclusion and discussion

In this paper we propose to use quantum and its inspired algorithms to predict stock returns. We especially test quantum circuit learning and tensor network as the proposed model against the classical models, namely linear regression and neural network. In order to evaluate their capabilities, we consider the investment strategy based on predicted returns by classical and quantum models. We then conduct backtesting over 10 years in the Japanese stock market.

Our finding is that the tensor network model outperforms classical models, while the quantum circuit learning model archives comparable performance with the neural network models but with higher risk. As is expected, both proposed models seem to learn non-linear relationships between input features, implied by their superior performance against linear

Figure 4: The cumulative returns of portfolios constructed by various methods and that of TOPIX500

Figure 5: The cumulative excess returns of portfolio constructed by various methods over TOPIX500
regression. Although the performance of the neural network models is deteriorated in the latest years, our proposed models successfully continue to gain the excess return. These difference in the performance can be related to the overfitting problem in machine learning and market instability in these periods. We therefore speculate that quantum techniques can have a good control of the overfitting problem, which is originally suggested in [5]. It is, however, unclear whether the hypothesis is true, further examination on this issue should be conducted.

Lastly, we comment on several open problems for future exploration.

* In this work we evaluate models' capabilities in the Japanese stock market. It should be examined if quantum models work in other countries, e.g. the United States, or in the global market. [21] studies the transfer learning of neural network in the investment problem between various markets. Whether transfer learning in the quantum model is also effective or not is another interesting research direction.
* While we study the predictability of stocks, it would be interesting whether quantum machine learning is applicable for other assets, such as bonds or currencies. See [24, 25] for machine learning approach in these assets.
* As is explained in Section 2, there are two approaches towards the return prediction, one of which is the cross-section prediction we employ. The other way, namely the time-series approach can be applied in quantum machine learning. In classical neural networks, recurrent neural network and its variants are developed and widely investigated in financial literature [26, 27, 28, 29]. It would be interesting to apply the quantum counterpart of such recurrent networks in financial analysis. See [30, 31] for the existing literature of quantum recurrent neural networks.

## Acknowledgement

This work was partially supported by KAKENHI Grant Number JP22K11924 from JSPS, MEXT Q-LEAP Grant No. JPMXS0120319794, and JST COI-NEXT No. JPMJPF2014.
