Using matrix-product states for time-series machine learning

Joshua B. Moore,Hugo P. Stackhouse,Ben D. Fulcher,Sahand Mahmoodian
2024-12-20
Abstract:Matrix-product states (MPS) have proven to be a versatile ansatz for modeling quantum many-body physics. For many applications, and particularly in one-dimension, they capture relevant quantum correlations in many-body wavefunctions while remaining tractable to store and manipulate on a classical computer. This has motivated researchers to also apply the MPS ansatz to machine learning (ML) problems where capturing complex correlations in datasets is also a key requirement. Here, we develop and apply an MPS-based algorithm, MPSTime, for learning a joint probability distribution underlying an observed time-series dataset, and show how it can be used to tackle important time-series ML problems, including classification and imputation. MPSTime can efficiently learn complicated time-series probability distributions directly from data, requires only moderate maximum MPS bond dimension $\chi_{\rm max}$, with values for our applications ranging between $\chi_{\rm max} = 20-150$, and can be trained for both classification and imputation tasks under a single logarithmic loss function. Using synthetic and publicly available real-world datasets, spanning applications in medicine, energy, and astronomy, we demonstrate performance competitive with state-of-the-art ML approaches, but with the key advantage of encoding the full joint probability distribution learned from the data. By sampling from the joint probability distribution and calculating its conditional entanglement entropy, we show how its underlying structure can be uncovered and interpreted. This manuscript is supplemented with the release of a publicly available code package MPSTime that implements our approach. The efficiency of the MPS-based ansatz for learning complex correlation structures from time-series data is likely to underpin interpretable advances to challenging time-series ML problems across science, industry, and medicine.
Machine Learning,Quantum Physics
What problem does this paper attempt to address?
The problem that this paper attempts to solve is how to use Matrix - Product States (MPS) to learn and model the complex joint probability distributions in time - series data. Specifically, the author has developed an MPS - based time - series machine - learning algorithm MPSTime for handling classification and missing - value imputation problems in time - series. ### Core problems of the paper 1. **Learning the joint probability distribution of time - series**: - Traditional time - series analysis methods have limitations when dealing with complex temporal structures, especially when it is necessary to capture long - term dependencies. This paper proposes using MPS to efficiently represent and learn the complex correlations in time - series. 2. **Time - series classification and missing - value imputation**: - Classification task: Inferring class labels from time - series. - Missing - value imputation task: Inferring missing data points from known observations. ### Main contributions 1. **Proposing a new MPS algorithm MPSTime**: - This algorithm can directly learn the probability distribution of time - series from data and only requires a moderate maximum MPS bond dimension \(\chi_{\text{max}}\), ranging from 20 to 150. 2. **A unified loss function**: - Using a single log - loss function to train both the classification and the generative models simultaneously, which makes this method flexibly applicable to different time - series tasks. 3. **Efficient computation and interpretability**: - The structure of MPS enables it to efficiently encode the complex correlations in time - series, and by calculating metrics such as conditional entanglement entropy, meaningful interpretations can be extracted from the model. 4. **Verification in practical applications**: - Verification was carried out using synthetic data and publicly available real - world datasets from fields such as medicine, energy, and astronomy, demonstrating that its performance is comparable to that of the existing state - of - the - art machine - learning methods but with better interpretability. ### Formula summary - **Wave function and joint probability distribution**: \[ p(x)=|\Psi(x)|^{2} \] Here, \(p(x)\) is the probability density of observing a time - series instance \(x\), which is given by the squared modulus of the wave function \(\Psi(x)\). - **MPS approximate representation**: \[ W_{s_{1},\ldots,s_{T}}=\sum_{\alpha}A^{s_{1}}_{\alpha_{1}}A^{s_{2}}_{\alpha_{1},\alpha_{2}}\cdots A^{s_{T - 1}}_{\alpha_{T - 2},\alpha_{T - 1}}A^{s_{T}}_{\alpha_{T - 1}} \] where \(W\) is the low - rank MPS approximation of the original wave function. - **Loss function**: \[ L_{G}=-\frac{1}{N}\sum_{n = 1}^{N}\log p(x_{n}) \] The negative log - likelihood loss function for generative model training. Through these methods, this paper provides a powerful and interpretable new tool for time - series analysis, especially having significant advantages in application scenarios where understanding and interpreting model behavior are required.