Table of Contents
Fetching ...

Density Matrix Emulation of Quantum Recurrent Neural Networks for Multivariate Time Series Prediction

José Daniel Viqueira, Daniel Faílde, Mariamo M. Juane, Andrés Gómez, David Mera

TL;DR

This paper tackles training and simulating Quantum Recurrent Neural Networks (QRNNs) for multivariate time series by introducing a density-matrix emulation framework that handles mid-circuit measurements via an operator-sum representation. It derives exact analytical first- and second-order derivatives with respect to trainable parameters using the Parameter Shift Rule, enabling gradient-based optimization even when outputs are noisy. The authors implement a hardware-efficient QRNN ansatz, test on four diverse datasets, and compare against classical RNNs and a Quantum Reservoir Computing (QRC) baseline, showing competitive predictive performance and feasible training with small qubit counts (around 5 qubits). The work provides a principled, scalable pathway to evaluate QRNNs in the near term, offering explicit tools for emulation, gradient computation, and performance benchmarking relevant to quantum hardware development and time-series prediction tasks.

Abstract

Quantum Recurrent Neural Networks (QRNNs) are robust candidates for modelling and predicting future values in multivariate time series. However, the effective implementation of some QRNN models is limited by the need for mid-circuit measurements. Those increase the requirements for quantum hardware, which in the current NISQ era does not allow reliable computations. Emulation arises as the main near-term alternative to explore the potential of QRNNs, but existing quantum emulators are not dedicated to circuits with multiple intermediate measurements. In this context, we design a specific emulation method that relies on density matrix formalism. Using a compact tensor notation, we provide the mathematical formulation of the operator-sum representation involved. This allows us to show how the present and past information from a time series is transmitted through the circuit, and how to reduce the computational cost in every time step of the emulated network. In addition, we derive the analytical gradient and the Hessian of the network outputs with respect to its trainable parameters, which are needed when the outputs have stochastic noise due to hardware errors and a finite number of circuit shots (sampling). We finally test the presented methods using a hardware-efficient ansatz and four diverse datasets that include univariate and multivariate time series, with and without sampling noise. In addition, we compare the model with other existing quantum and classical approaches. Our results show how QRNNs can be trained with numerical and analytical gradients to make accurate predictions of future values by capturing non-trivial patterns of input series with different complexities.

Density Matrix Emulation of Quantum Recurrent Neural Networks for Multivariate Time Series Prediction

TL;DR

This paper tackles training and simulating Quantum Recurrent Neural Networks (QRNNs) for multivariate time series by introducing a density-matrix emulation framework that handles mid-circuit measurements via an operator-sum representation. It derives exact analytical first- and second-order derivatives with respect to trainable parameters using the Parameter Shift Rule, enabling gradient-based optimization even when outputs are noisy. The authors implement a hardware-efficient QRNN ansatz, test on four diverse datasets, and compare against classical RNNs and a Quantum Reservoir Computing (QRC) baseline, showing competitive predictive performance and feasible training with small qubit counts (around 5 qubits). The work provides a principled, scalable pathway to evaluate QRNNs in the near term, offering explicit tools for emulation, gradient computation, and performance benchmarking relevant to quantum hardware development and time-series prediction tasks.

Abstract

Quantum Recurrent Neural Networks (QRNNs) are robust candidates for modelling and predicting future values in multivariate time series. However, the effective implementation of some QRNN models is limited by the need for mid-circuit measurements. Those increase the requirements for quantum hardware, which in the current NISQ era does not allow reliable computations. Emulation arises as the main near-term alternative to explore the potential of QRNNs, but existing quantum emulators are not dedicated to circuits with multiple intermediate measurements. In this context, we design a specific emulation method that relies on density matrix formalism. Using a compact tensor notation, we provide the mathematical formulation of the operator-sum representation involved. This allows us to show how the present and past information from a time series is transmitted through the circuit, and how to reduce the computational cost in every time step of the emulated network. In addition, we derive the analytical gradient and the Hessian of the network outputs with respect to its trainable parameters, which are needed when the outputs have stochastic noise due to hardware errors and a finite number of circuit shots (sampling). We finally test the presented methods using a hardware-efficient ansatz and four diverse datasets that include univariate and multivariate time series, with and without sampling noise. In addition, we compare the model with other existing quantum and classical approaches. Our results show how QRNNs can be trained with numerical and analytical gradients to make accurate predictions of future values by capturing non-trivial patterns of input series with different complexities.
Paper Structure (16 sections, 44 equations, 8 figures, 2 tables)

This paper contains 16 sections, 44 equations, 8 figures, 2 tables.

Figures (8)

  • Figure 1: Classical Recurrent Neural Network representations. (a) Basic RNN scheme. (b) Basic RNN unrolled through time.
  • Figure 2: General form of the QRNN circuit. Arrows show the information flux.
  • Figure 3: Decomposition of $U$ operator into encoding ($V$) and evolution part ($W$). The latter is the same for all the circuit blocks since $\bm{\theta}$ does not change during a circuit evaluation.
  • Figure 4: QRNN ansatz, $U (\bm{x}_{(t)}, \bm{\theta})$, consisting of two parts. The first one is the data encoding, and gates inside the orange box are repeated with different parameters, that are a subset of trainable parameters, $\bm{\alpha}_i^r \in \{\bm{\theta}\}$. We use one qubit per input variable. The second one is the evolution and entanglement part, where the blue box is repeated $L$ times (layers). Each layer is a column of $R_z R_x$ rotations parameterised by a pair of parameters, $\bm{\beta}_i^l \in \{ \bm{\theta} \}$, and a ladder of CZ gates. A final column of $R_x$ gates is applied over register E before measurement, because the $R_z$ does not affect the $Z$-expectation value.
  • Figure 5: Results of the learning task with the QRNN model. Numerical gradients were used for the training, without sampling noise. Each time series was divided into windows of 20 points, each one being a sample. The neural network must predict the value of the last 5 outputs for each window, by reducing the RMSE with respect to the last 5 points of the target. Dashed lines are the inputs $\bm{x}_{(t)}$, from which we make the prediction. Solid lines represent the targets. Points are the predictions. Windows are represented in orange (red), blue (dark blue) or green (gold, dark gold) depending on whether the window is used for training (tra), validation (val) or testing (tes), respectively. In the test region, we add a window to make the prediction for the full test sequence (fte). For the Santa Fe series, a representative portion of the test region is displayed.
  • ...and 3 more figures