Quantum Recurrent Neural Networks (QRNNs) are robust candidates to model and predict future values in multivariate time series. However, the effective implementation of some QRNN models is limited by the need of 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. The mathematical development is explicitly provided as a compact formulation by using tensor notation. It 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, with an eye on gradient-based training and noisy outputs that would appear when using real quantum processors. We finally test the presented methods using a novel hardware-efficient ansatz and three diverse datasets that include univariate and multivariate time series. Our results show how QRNNs can make accurate predictions of future values by capturing non-trivial patterns of input series with different complexities.
翻译:量子循环神经网络是建模和预测多变量时间序列未来值的稳健候选方法。然而,一些量子循环神经网络模型的有效实现受到中间电路测量需求的限制。这增加了对当前含噪声中等规模量子时代量子硬件的要求,而该时代的硬件尚无法进行可靠计算。仿真成为探索量子循环神经网络潜力的主要近期替代方案,但现有量子仿真器并不适用于包含多次中间测量的电路。在此背景下,我们设计了一种基于密度矩阵形式的专用仿真方法。通过使用张量表示法,以紧凑公式形式明确给出了数学推导过程。这使我们能够展示时间序列的当前与过去信息如何通过电路传输,以及如何在仿真网络的每一步中降低计算成本。此外,我们推导了网络输出相对于可训练参数的解析梯度和海森矩阵,以服务于基于梯度的训练以及使用实际量子处理器时可能出现的含噪声输出。最后,我们采用一种新颖的硬件高效拟设以及三个包含单变量与多变量时间序列的多样性数据集测试了所提出的方法。结果表明,量子循环神经网络能够通过捕获输入序列中非平凡模式,准确预测不同复杂度的未来值。