Manuscript Offprint
arXiv:2610.10697On linearity or non-linearity in machine learning for quantum chaotic dynamics
Abstract
Accurately simulating chaotic quantum many-body dynamics remains a major computational challenge for classical methods, due to the rapid buildup and spatial spreading of entanglement during the evolution. This raises the question of whether machine learning can provide an effective alternative for predicting quantum dynamics. We address this question by formulating quantum dynamics as a time-series forecasting problem, using a few-qubit PXP chain, realizable with Rydberg-atom arrays, as a benchmark. By varying the initial state, the system spans dynamical regimes ranging from ergodic behavior to quantum many-body scarring, providing a controlled setting for testing forecasting models across qualitatively different dynamics. We compare two contrasting architectures: an expressive nonlinear Transformer and DLinear, a simple linear forecasting model. The Transformer accurately predicts dynamics in the more ergodic regime, but its performance progressively deteriorates as the initial state approaches the scarred limit. In contrast, DLinear remains accurate across the entire family of initial states, with its main deviations consisting of small high-frequency oscillations that have little effect on the overall prediction error. Remarkably, these results show that observables generated by complex quantum many-body dynamics can be forecast with high accuracy through a simple linear mapping from past to future observations. This reveals that the complexity of the underlying quantum evolution need not translate into an equally complex forecasting problem.
Keywords: Quantum many-body dynamics, quantum chaos, machine learning, transformer, DLinear, deep learning, artificial intelligence
1 Introduction
Simulating the dynamics of quantum many-body systems remains a fundamental computational challenge because the dimension of the Hilbert space grows exponentially with the size of the system [1, 2, 3, 4]. Exact numerical methods therefore become rapidly intractable, motivating approximate approaches that exploit the structure of physically relevant quantum states. Among these, matrix product states (MPS) provide an efficient representation of states with limited entanglement and form the basis for powerful tensor-network methods for many-body simulations [5, 6, 7, 8]. However, as nonequilibrium dynamics generates entanglement that progressively spreads across the system, an accurate MPS representation requires increasingly large computational resources. This limitation is particularly severe in quantum chaotic many-body systems, where entanglement typically grows rapidly after a generic quench and eventually approaches volume-law scaling [9, 10, 11]. Exact diagonalization is thus limited by system size, whereas tensor-network methods are ultimately limited by the accessible evolution time.
The computational limitations of conventional simulation methods have stimulated a growing interest in data-driven approaches to quantum dynamics. In particular, machine-learning (ML) methods provide a complementary route to extracting and predicting dynamical behavior directly from generated or experimentally accessible data. Here, we consider precisely this forecasting setting, where the problem can be formulated in terms of observable time series: given a finite history of observations, the goal is to predict their subsequent evolution without explicitly propagating the full many-body quantum state. In this context, a variety of ML architectures
(a)
Initial states
Data preparation
Time – evolved states
Each time – evolved states is represented by a feature vector


For each
(b)
(c)
Prediction

Both on trajectories
Fig. 1 Schematic illustration of the forecasting protocol, consisting of three stages: data preparation [panel (a)], training [panel (b)], and prediction [panel (c)]. Data preparation (a): A set of initial quantum states, , of an -qubit system is prepared. Each state is evolved under the Hamiltonian , generating quantum trajectories, . At each time , each trajectory is represented by a feature vector comprising local magnetizations and connected two-point correlations, for a total of features. For each trajectory, the first time steps define the input sequence, while the subsequent time steps constitute the target sequence. Training (b): DLinear and the Transformer are trained on a subset of trajectories. Prediction (c): The trained models are evaluated on the remaining unseen trajectories to assess their forecasting performance.
have been explored, including long short-term memory (LSTM) networks, multilayer perceptrons (MLPs) and convolutional neural networks (CNNs) [12, 13, 14, 15], as well as data-driven methods based on dynamical mode decomposition [16].
A complementary perspective arises when the roles of quantum dynamics and machine learning are reversed: rather than using ML to predict quantum time evolution, quantum systems can themselves be exploited as computational resources for learning and predicting classical nonlinear and chaotic dynamics. As an example, in quantum reservoir computing the intrinsic dynamical complexity of quantum systems is harnessed for information processing and temporal prediction [17, 18, 19, 20, 21, 22]. Thus, quantum dynamics can be viewed both as a target of ML and as a resource for learning complex dynamical patterns.
This dual perspective raises a natural question: when quantum dynamics are themselves the object to be learned, how much model complexity is actually required to predict them? More specifically, to what extent does the complexity of the underlying quantum evolution translate into the complexity required to forecast its observable dynamics?
In this work, we address this question by comparing two forecasting architectures with markedly different structures: a nonlinear Transformer model [23, 24, 25], which uses self-attention to capture dependencies in sequential data, and a DLinear architecture [23, 24, 25], a simple linear model originally developed for long-horizon time-series forecasting. This comparison allows us to directly investigate whether forecasting complex quantum dynamics requires an expressive nonlinear architecture, or whether a simple linear mapping from past to future observations is sufficient to accurately predict the evolution of a quantum many-body system.
The quantum many-body system considered in this work is the paradigmatic PXP model [26, 27, 28, 29, 30, 31, 32], an effective model describing interacting Rydberg atoms in the blockade regime. Its dynamics depend strongly on the choice of initial state, allowing qualitatively different dynamical regimes to be explored within the same Hamiltonian. In particular, the model exhibits both ergodic dynamics and non-ergodic evolution associated with quantum many-body scars (QMBS), characterized by long-lived coherent revivals [29, 28, 33, 34]. By considering a family of initial states interpolating between these regimes, we can therefore assess the forecasting performance of linear and nonlinear models across different types of quantum dynamics while keeping the underlying Hamiltonian fixed.
Our results reveal a clear difference between the two forecasting approaches for this problem. DLinear provides accurate and stable predictions across the entire family of initial states considered, whereas the performance of the Transformer depends strongly on the dynamical regime, progressively deteriorating as the dynamics approach the quantum-scarred limit. The robust performance of DLinear is particularly notable given its simple linear structure, showing that, for the observable dynamics considered here, accurate forecasting can be achieved without an expressive nonlinear architecture. This finding is consistent with recent observations in classical time-series forecasting [35], where simple linear models have been shown to compete with, and in some cases outperform, more sophisticated nonlinear architectures.
Operationally, we train both predictive architectures on a family of initial states spanning dynamical regimes from chaotic thermalizing behavior to non-ergodic evolution associated with quantum many-body scars. The forecasting task is to predict the future evolution of a set of physical observables, namely local magnetizations and connected two-point correlation functions, given an initial segment of their time series. The performance of the two models is subsequently evaluated on unseen initial conditions and future time windows. We benchmark this framework on a few-qubit PXP chain, for which numerically exact time evolution can be efficiently computed to generate training and test data, enabling a controlled comparison between the two forecasting architectures. Although demonstrated here for the PXP model, the framework is not tied to a specific Hamiltonian and can be extended to other quantum many-body systems, as well as to digital quantum circuits, whenever representative time-series data are available.
where is the z-Pauli matrix, is the x-Pauli matrix, is the projector onto the state , while . We set , so that all physical times discussed in this work are expressed in units of .
The PXP model naturally arises in systems of interacting Rydberg atoms operating in the blockade regime [29, 26, 36, 28, 30]. Its spectrum is predominantly chaotic, with level statistics and eigenstate properties consistent with the eigenstate thermalization hypothesis (ETH) [9, 37, 38, 39], although it hosts a small set of nonthermal eigenstates forming the quantum many-body scar (QMBS) subspace embedded within an otherwise thermal spectrum [29]. This coexistence of quantum chaos and atypical eigenstates is reflected in the dynamics. The fully polarized state rapidly explores the accessible Hilbert space and exhibits ergodic behavior consistent with ETH, while the Néel state shows long-lived revivals due to its overlap with the QMBS subspace [29]. Interestingly, a richer variety of dynamical behaviors emerges for initial states interpolating between these two limits, including local reminiscent states [40].
The coexistence of distinct dynamical regimes depending on the initial state makes the PXP model both particularly rich and challenging to study, analytically and numerically. In the ergodic regime, the system rapidly generates large amounts of entanglement with a volume-law scaling, which severely limits the efficiency of tensor-network approaches and makes long-time simulations with Matrix Product States (MPS) generally intractable [5]. By contrast, non-ergodic initial states can exhibit much slower entanglement growth, allowing for longer accessible simulation times and highlighting the strong dependence of the dynamics on the chosen initial condition.
This work is motivated by these challenges and aims to establish a data-driven framework for learning the dynamics of a class of quantum states from a finite training set, where the class encompasses a variety of dynamical behaviors ranging from chaotic to quantum scarred regimes, thereby enabling prediction of previously unseen dynamical trajectories using ML methods. The general protocol is illustrated in Fig. 1 and is described in the following.
The class of states on which we train the ML models is given by
where and are staggered product states, with , and . Here, denotes a normalization factor. This construction defines a family of states that smoothly interpolates between several physically relevant limits, including Néel and fully polarized configurations, which are recovered for specific parameter choices. In particular, the Néel states and are obtained for with and , respectively, while the fully polarized state is recovered for , independently of . Moreover, allowing intermediate values of introduces entangled initial states, thereby increasing the diversity and complexity of the training set used for the ML models.
Each parameter pair defines an initial state . We consider a set of initial (input) states, , as illustrated in Fig. 1(a), generated by random sampling in the parameter space. For each input state, the corresponding time-evolution trajectory is obtained by evolving the state under the
Schrödinger equation, , where we set . To characterize the dynamics, we associate with each trajectory a time-dependent feature vector , constructed from physical observables, specifically local magnetizations and connected two-point correlations.
Time is discretized into equally spaced steps with spacing , such that the physical times are for . At each time , we define the feature vector , which encodes the state of the system at that time via the chosen set of observables:
namely as the concatenation of all single-site magnetizations and connected pairwise correlators. Here, and . The total number of features is , comprising local magnetizations and connected two-body correlators. In this work, we consider a system composed if qubits which corresponds to a number of features .
3 Methods
3.1 Formal Definitions
Each trajectory is represented by a sequence of feature vectors . We divide each trajectory into an input sequence containing the first time steps,
and a target sequence containing the subsequent time steps,
The forecasting dataset is therefore defined as
The objective is to learn a mapping
such that
approximates the future trajectory [Fig. 1(b),(c)].
In practice, trajectories are used for training, while the remaining trajectories are reserved for evaluation. We consider a DLinear model [35] and a Transformer architecture [23] for learning this mapping.
3.2 Models
We consider two complementary neural architectures for time-series forecasting: DLinear [35, 41] and the Transformer [23, 42]. The two models differ primarily in how they generate future predictions. DLinear is a direct multi-step forecasting architecture that predicts the entire future horizon in a single forward pass, whereas the Transformer is employed in an autoregressive framework, generating future states sequentially. This distinction allows us to compare direct and autoregressive forecasting strategies under a common training objective.
Both models are trained using the same informed composite loss, which incorporates domain-relevant information beyond pointwise prediction accuracy. In addition to penalizing errors in the predicted states, the loss promotes temporal consistency by penalizing discrepancies in the evolution of the predicted trajectory, including differences in temporal increments and inconsistencies in their direction. Consequently, the training objective encourages both architectures not only to reconstruct the target states accurately, but also to preserve relevant dynamical characteristics of the underlying system.
3.2.1 DLinear
DLinear is a simple yet effective linear architecture for time-series forecasting, introduced by Zeng et al. [35]. Unlike autoregressive models, DLinear performs direct multi-step forecasting by predicting the entire future horizon in a single forward pass. This design avoids the recursive generation of future states and, consequently, does not suffer from error accumulation associated with autoregressive prediction or the exposure bias arising from the discrepancy between training and inference inputs.
The model first decomposes the input sequence into trend and seasonal components through a moving-average operation. The trend component captures the slowly varying, long-term behavior of the signal, while the seasonal component represents recurring variations around this trend. Two independent linear layers are then applied to the decomposed components, and their outputs are combined to produce the final prediction. Despite its simplicity, DLinear has been shown to achieve competitive or superior performance compared to more complex Transformer-based architectures in several long-term forecasting benchmarks [35].
3.2.2 Transformer
Transformers are DL architectures originally introduced for sequence modeling in natural language processing. Unlike recurrent neural networks, they process the entire input sequence simultaneously and capture long-range dependencies through the self-attention mechanism, which enables the model to dynamically weigh the relevance of different elements of the input sequence when generating predictions. Since their introduction, Transformers have become widely used for sequential learning tasks, including time-series forecasting and scientific ML. The Transformer architecture was first proposed by Vaswani et al. [23].
In this work, we employ the Transformer in an autoregressive forecasting framework. During training, the model receives as input a sequence of consecutive time steps and is trained to predict only the subsequent step. During inference, the predicted state is appended to the input sequence, replacing the oldest time step through a sliding-window mechanism, and the updated sequence is fed back to the model to predict the next state. This iterative procedure is repeated until the desired prediction horizon is reached.
More formally, the Transformer models the probability of the future sequence as
(9)
Despite its ability to capture long-range dependencies, autoregressive forecasting suffers from two well-known limitations. First, prediction errors can accumulate over time, since each predicted state is recursively used to generate subsequent predictions, potentially leading to progressively larger deviations over long horizons. Second, training is typically performed using teacher forcing, where the model conditions on ground-truth states, whereas during inference it relies on its own predictions. This discrepancy between the training and inference conditions is known as exposure bias. In contrast to DLinear, which predicts the entire horizon directly, the autoregressive Transformer is therefore subject to these recursive effects.
3.3 Numerical Experiments
We benchmark the Transformer and DLinear on a dataset comprising trajectories generated from initial states sampled in the parameter space. Each trajectory contains uniformly spaced time steps, with , and is represented by physical observables corresponding to the local magnetizations and the connected two-point correlators. Consequently, the complete dataset can be represented as a tensor .
The dataset is split at the trajectory level before preprocessing. The first trajectories are held out for testing, while the remaining trajectories are used for training and validation. This ensures that different time steps belonging to the same physical trajectory never appear in both the training and test sets. A feature-wise Min-Max transformation to the interval is fitted exclusively on the training trajectories and subsequently applied, without refitting, to the test set. Predictions are transformed back to the original physical scale before the evaluation metrics are computed.
For every trajectory, the models receive the first time steps as input and predict the subsequent steps. Since , the input window covers the physical-time interval , whereas the forecasting horizon covers . Both architectures therefore address the same forecasting problem,
where denotes, respectively, the Transformer and DLinear. The two models differ only in how this mapping is implemented. DLinear predicts the complete future trajectory in a single forward pass, whereas the Transformer is trained using teacher forcing and generates the forecast autoregressively at inference time.
3.3.1 Training & Instantiations
To provide a controlled comparison, both models are trained using the same temporally informed objective. For a mini-batch containing trajectories, let and denote the true and predicted values of feature at forecasting step , respectively. The pointwise reconstruction term is
To promote agreement between the local temporal variations of the predicted and exact trajectories, we define
for . The derivative-consistency term is then
while directional disagreements are penalized through
The complete training objective is
This loss does not explicitly impose the equations of motion. Instead, it introduces a soft temporal inductive bias that encourages the models to reproduce the values, local increments, and directions of variation of the physical observables.
The Transformer is instantiated with model dimension , seven encoder-decoder layers, two attention heads, and a feed-forward dimension . These architectural hyperparameters were selected through Hyperband search on the training set using validation loss as the selection criterion. The model is optimized with AdamW using a learning rate of , weight decay , gradient clipping with norm 1.0, and a batch size of 4. Training is performed for at most 100 epochs, with a 30% validation split, a ReduceLROnPlateau scheduler, and early stopping with patience 8.
During training, the Transformer decoder receives the shifted ground-truth target sequence,
and a causal mask prevents access to subsequent target steps. At inference time, ground-truth future values are unavailable; therefore, the decoder is initialized with a zero vector and filled recursively with its own previous predictions. The resulting model is referred to as the Transformer because it is trained with the temporally informed composite loss defined above.
For DLinear, the moving-average window is set to , corresponding to physical-time units, and the selected regularization coefficient is . These values were obtained through a Bayesian hyperparameter search on the training set. DLinear is optimized with AdamW using a learning rate of , weight decay , and a batch size of 64. Training is performed for at most 250 epochs with a 30% validation split, a ReduceLROnPlateau scheduler, and early stopping with patience 10. Unlike the Transformer, DLinear directly produces all future steps in a single forward pass and therefore does not use teacher forcing or autoregressive feedback.
The preprocessing procedure, trajectory-level split, input window, forecasting horizon, loss weights, and evaluation protocol are identical for the two architectures. Model-specific optimization settings are selected independently to account for their substantially different computational and memory requirements.
3.3.2 Evaluation Metrics
The forecasting performance of the models is evaluated on the trajectories that are not used during training. We consider two complementary metrics: the mean absolute error (MAE), which quantifies the magnitude of the prediction error, and the directional accuracy (DA), which measures the ability of the model to reproduce the direction of the temporal evolution of each observable.
Let and denote, respectively, the true and predicted values of feature f at the i-th step of the prediction horizon for test trajectory k. The mean absolute error is defined as
The MAE therefore measures the average absolute deviation between the predicted and exact trajectories over all test samples, prediction steps, and physical observables. Lower values of the MAE correspond to more accurate predictions.
To complement this amplitude-based measure, we evaluate the directional accuracy (DA), which quantifies whether the model correctly reproduces the sign of the local temporal variation of each observable, independently of how well it reproduces its absolute magnitude. To make this precise, we first define the true and predicted increments of each feature between consecutive time steps,
The DA is then defined as the percentage of (trajectory, time step, feature) triples for which the predicted and true increments share the same sign,
(19)
where is the indicator function, equal to one when its argument is true and zero otherwise. For the first predicted time step , the last observed value of the input sequence is used as the reference, i.e., . The DA is reported as a percentage, with 100% corresponding to a prediction that reproduces the correct direction of change for every feature and time step.
The two metrics provide complementary information. While the MAE evaluates how closely the predicted trajectories reproduce the numerical values of the physical observables, the DA evaluates whether the model captures their local temporal trends. More generally, MAE and DA are not equivalent measures of forecasting quality, and a model can score well on one while scoring poorly on the other. Oscillatory dynamics provide an example of this: a model may correctly reproduce the oscillation frequency, rising and falling at the right times and therefore achieving a high DA, while getting the oscillation amplitude wrong, which inflates the MAE. Conversely, a related situation arises when the true dynamics consists of a single, clean oscillation, and the model correctly reproduces its frequency and amplitude, but its prediction is modulated by an additional, spurious high-frequency oscillation.

Fig. 2 Performance of DLinear and the Transformer across the initial-state parameter space . Panel (a) shows the directional accuracy (DA), while panel (b) shows the mean absolute error (MAE). In each panel, the upper row corresponds to DLinear and the lower row to the Transformer. The leftmost column reports the metrics computed from the raw predictions, while the remaining columns show the corresponding results after smoothing the predicted trajectories using windows . In all cases, the metrics are evaluated with respect to the ground-truth trajectories.
of small amplitude superimposed on top of the correctly predicted signal. Because this spurious modulation has small amplitude, the prediction remains numerically close to the true trajectory at every step, and the MAE stays low. However, at the time steps where the spurious oscillation locally reverses the sign of the predicted increment, the predicted direction of motion disagrees with the true one, even though the true dynamics is not oscillating at that frequency at all; this lowers the DA despite the small MAE.
The DA is therefore a purely qualitative metric: it does not depend on the size of the error, only on its sign, and it treats a barely-missed direction the same as a badly-missed one, and a prediction that is off by an arbitrarily large amount the same as one that is off by an infinitesimal one, as long as the sign of the step-to-step change is correct. This makes the DA comparatively insensitive to outliers and to the overall scale of the observable, and therefore particularly informative when comparing performance across different features or different observables of the system, whose magnitudes and dynamical ranges need not coincide, a comparison in which the MAE alone would be dominated by the observables with the largest dynamical range. At the same time, since the DA discards all amplitude information, it cannot by itself distinguish a model that tracks the dynamics closely from one that reproduces only its coarse qualitative pattern; a high DA is therefore a necessary, but not sufficient, condition for an accurate reconstruction of the dynamics, and must be interpreted jointly with the MAE.
4 Results
Trajectory-resolved forecasting performance
We first analyze the predictive performance of the two models across the parameter space defining the initial states. Since each test trajectory corresponds to a distinct initial condition , we evaluate the metrics introduced in Eqs. (17) and (19) separately for each trajectory, averaging only over the prediction horizon and the features:

Fig. 3 Absolute error (AE) over the forecast horizon for the first ten features, corresponding to the local magnetizations. The vertical axis represents physical time and the horizontal axis the feature index. The left and right columns show the Transformer and DLinear predictions, respectively. The three rows correspond to representative test trajectories selected as the best, typical, and worst cases using a joint score for the two models. For each test trajectory, the MAE is first computed by averaging over the forecast horizon and all features, and the resulting values for the Transformer and DLinear are then averaged to define the joint score. The best and worst cases correspond to the lowest and highest joint MAE, respectively, while the typical case is the trajectory whose joint MAE is closest to the test-set average. The color scale indicates the magnitude of the absolute error and is shared across all panels.
The predicted trajectories can exhibit small-amplitude, high-frequency oscillations that strongly affect the directional accuracy, despite having only a minor impact on the overall agreement with the target trajectories. To disentangle these rapid fluctuations from the underlying temporal trend, in Fig. 2 we also report metrics evaluated after smoothing the predicted trajectories. We employ a Savitzky–Golay filter [43], which locally approximates the signal with a second-order polynomial over a sliding window of length w. Increasing w progressively suppresses short-timescale variations, while excessively large windows may also remove genuine dynamical features. Importantly, smoothing is used only as a post-processing tool for this analysis and does not affect the training procedure or the raw model predictions.
Figure 2(a) shows the directional accuracy for DLinear (upper panels) and the Transformer (lower panels), starting from the raw predictions and progressively increasing the smoothing window w from left to right. For the raw DLinear predictions, is approximately uniform over the initial-state parameter space and remains close to 50%. In contrast, the Transformer displays a pronounced dependence on , with substantially higher directional accuracy for and lower values as the initial states approach the Néel limit, while showing little dependence on .
The behavior of DLinear changes substantially when the high-frequency components of the predicted trajectories are filtered out. As w increases, the directional accuracy rises well above 50% over a broad region of parameter space, reaching values above 90% for intermediate smoothing windows, , in a large portion of the parameter space. This strong improvement indicates that the low DA of the raw DLinear predictions originates predominantly from small-amplitude, high-frequency oscillations rather than from an incorrect description of the underlying temporal trend. For w = 100, the DA decreases again, indicating that the smoothing window has become sufficiently large to suppress relevant variations of the dynamics together with the high-frequency components.
The Transformer is considerably less sensitive to smoothing. In particular, the separation between the regions and persists for all the smoothing windows considered. Although intermediate values of improve the directional accuracy to some extent, smoothing does not remove the loss of performance for . This indicates that, in this region, the Transformer does not merely superimpose high-frequency fluctuations on an otherwise accurate forecast, but increasingly fails to reproduce the temporal trend of the target dynamics.
A complementary picture is provided by the mean absolute error, shown in Fig. 2(b). Unlike DA, which is highly sensitive to the sign of consecutive variations, MAE measures the average pointwise deviation between predicted and target trajectories and is therefore much less affected by small-amplitude, high-frequency oscillations. Accordingly, the MAE depends only weakly on the smoothing procedure. For DLinear, it remains low and approximately uniform throughout the parameter space. The Transformer instead exhibits a clear dependence on : its MAE is comparable to that of DLinear for , but increases substantially for , with little dependence on .
Taken together, the two metrics reveal qualitatively different behaviors of the forecasting models. DLinear maintains a low MAE throughout the entire family of initial states, while the apparent loss of directional accuracy in the raw predictions can largely be attributed to small-amplitude, high-frequency oscillations. Once these components are filtered out, the underlying trend is recovered with high directional accuracy. The Transformer, by contrast, performs well in the regime but progressively loses predictive accuracy as the initial states approach the quantum-scarred regime. Its performance is therefore strongly dependent on the dynamical regime, whereas DLinear provides a considerably more uniform forecast across the initial-state parameter space.
Feature- and time-resolved prediction errors
To examine the forecasting performance at the level of individual trajectories and observables, Fig. 3 shows the absolute error (AE),
where and denote the predicted and target values of feature f at time step i of test trajectory k. The AE is the pointwise counterpart of the MAE introduced above, which is obtained by averaging over trajectories, time steps, and features.
We consider three representative test trajectories, selected using the performance of both models on the same initial conditions. For each trajectory, we compute the MAE of each model over the prediction horizon and all features, and average the two values to define a joint score. The trajectories with the lowest and highest joint MAE are selected as the best and worst cases, respectively, while the trajectory whose joint MAE is closest to the test-set average is selected as the typical case. The rows in Fig. 3 correspond to these three trajectories, ordered from best to worst, while the columns compare the Transformer and DLinear. The horizontal axis shows the first ten features, corresponding to the local magnetizations, and the vertical axis spans the prediction interval , following the input interval . A common color scale across all panels reports the magnitude of the absolute error.
The heatmaps reveal qualitatively different error patterns for the two models. For DLinear, the errors remain comparatively small across the three representative trajectories. Their rapid variations in time help explain the low directional accuracy of the raw predictions observed in Fig. 2: even when the predicted trajectory remains close to the target in magnitude, small-amplitude, high-frequency deviations can repeatedly change the sign of consecutive variations and thereby reduce the DA. The strong increase in DA after smoothing is consistent with the suppression of these short-timescale deviations while leaving the overall trajectory largely unchanged.
The Transformer exhibits a stronger dependence on the initial condition. For trajectories where its forecasting performance is favorable, the errors remain relatively small throughout the prediction horizon. In the less favorable regime identified in Fig. 2, however, larger errors persist over extended portions of the prediction window and across several observables. This behavior is most evident for the worst-case trajectory, where the absolute error of the Transformer locally approaches 0.7, while DLinear retains substantially smaller errors over most of the prediction window.
These feature- and time-resolved errors complement the aggregate results of Fig. 2. For DLinear, the low MAE together with the strong effect of smoothing on DA indicates that its main deviations are small-amplitude
Horizon error comparison

Fig. 4 Mean absolute error as a function of physical time over the forecast horizon , obtained by averaging over all test trajectories and features at each prediction time. The solid and dashed lines correspond to the Transformer and DLinear, respectively.
and rapidly varying. For the Transformer, the deterioration observed in the unfavorable parameter regime instead involves larger and more persistent errors, consistent with a genuine loss of forecasting accuracy rather than a sensitivity of the DA metric to high-frequency fluctuations. The local error analysis therefore reinforces the different behavior of the two models identified from the trajectory-resolved metrics.
Error propagation over the forecast horizon
We next examine how the prediction error evolves over the forecast horizon. Figure 4 shows the MAE resolved as a function of the prediction time,
where and the corresponding physical time is .
For DLinear, the MAE initially increases and subsequently settles into a bounded, approximately stationary regime, fluctuating around a nearly constant value without a clear systematic increase over the remainder of the forecast horizon. The residual fluctuations occur on relatively short timescales and remain small in amplitude, so that the prediction error does not accumulate appreciably as the forecast progresses. This behavior is consistent with the trajectory-resolved results of Fig. 2, where DLinear exhibits a low and comparatively uniform MAE across the initial-state parameter space.
The Transformer displays a qualitatively different behavior. Its MAE exhibits pronounced oscillations on longer timescales, together with an overall increase in the magnitude of the error over the forecast horizon. In particular, the error peaks become progressively larger at later prediction times, resulting in a substantially stronger error growth than for DLinear. This behavior
Transformer

DLinear

▲ Mean over samples — Median
Fig. 5 Distribution of the feature-resolved mean absolute error, , over the test trajectories for the first ten features, corresponding to the local magnetizations. The upper and lower panels show the Transformer and DLinear, respectively. For each feature, the boxplot represents the distribution of across the test trajectories. Black lines indicate the median, while red triangles indicate the mean.
is consistent with the strong dependence of the Transformer performance on the initial state observed in Fig. 2. The larger errors associated with the region approaching the Néel limit, , contribute substantially to the trajectory-averaged MAE and therefore to its larger overall magnitude.
The time-resolved analysis thus provides a complementary distinction between the two forecasting models. While the DLinear error remains bounded after an initial transient, the Transformer exhibits larger temporal variations and a stronger growth of the prediction error over the forecast horizon.
Feature-resolved prediction errors
Finally, we examine how the prediction error depends on the individual observables, focusing on the local magnetizations. For each test trajectory k and feature f, we define the feature-resolved MAE by averaging only over the prediction horizon,
For each feature , this yields a distribution of error values, one for each test trajectory. Figure 5 shows these distributions for both forecasting models. Each box represents the interquartile range, with the horizontal line indicating the median, while the whiskers extend to the most extreme values within 1.5IQR and points outside this range are shown individually as outliers. The mean over the test trajectories, , is indicated by a red triangle.
Features 0, ..., 9 correspond to the local magnetizations at sites along the chain. Both models display a relatively regular behavior across sites, although with different spatial profiles. For the Transformer, the median error is approximately uniform along the chain, while the distribution broadens around the central sites, where the upper quartiles and whiskers extend toward larger errors. DLinear exhibits the opposite tendency: the errors and their dispersion are smaller near the center of the chain and increase toward the boundaries.
A more pronounced difference between the two models emerges from the distribution of errors over the test trajectories. DLinear has a lower mean for every feature and generally exhibits narrower distributions. Moreover, its mean and median remain close across the chain, indicating that the average error is representative of the typical trajectory. For the Transformer, instead, the mean lies systematically above the median, revealing a right-skewed distribution with a tail toward larger errors. At the level of the median, the Transformer is competitive with DLinear for several features and is even slightly more accurate at some edge sites, such as features 1 and 8. Its larger mean error therefore does not reflect a uniform degradation across all trajectories, but is driven by a subset of initial conditions for which the prediction error becomes substantially larger.
This picture is consistent with the trajectory-resolved analysis of Fig. 2, where the Transformer performance depends strongly on the initial-state parameter , while DLinear remains comparatively uniform across the parameter space. The upper tail of the Transformer error distributions is consistent with the large errors observed for trajectories approaching the Néel regime, whereas trajectories in the region where the Transformer performs well contribute to the lower-error part of the distribution. The feature-resolved analysis therefore reinforces the main picture emerging from the previous results: DLinear provides consistently low errors across both trajectories and local observables, whereas the Transformer combines accurate predictions for a substantial fraction of the test set with much larger errors for a subset of initial conditions.
5 Discussion and conclusions
Our results reveal a clear contrast between linear and nonlinear forecasting architectures for the observable dynamics of the PXP model. Despite its simple structure, DLinear provides accurate and comparatively uniform predictions across the entire family of initial states considered. The Transformer, in contrast, exhibits a pronounced dependence on the initial-state parameter : its performance is comparable to that of DLinear in the region closer to the homogeneous-state limit, but progressively deteriorates as the initial states approach the Néel limit and the dynamics become increasingly influenced by quantum many-body scarring. In both cases, the forecasting performance shows only a weak dependence on .
The different error analyses presented above provide a consistent picture of this behavior. DLinear maintains a low MAE throughout the initial-state parameter space, while its comparatively low directional accuracy on the raw predictions originates primarily from small-amplitude, high-frequency oscillations. Once these short-timescale components are filtered out, the directional accuracy increases substantially, indicating that the underlying temporal trend is nevertheless well reproduced. The Transformer exhibits a qualitatively different behavior: in the region approaching the Néel limit, its errors become larger and more persistent, and the degradation remains visible after smoothing. This distinction is also reflected in the feature-resolved error distributions, where the Transformer develops a tail of trajectories with substantially larger errors, whereas DLinear remains more uniform across both initial conditions and local observables.
The robust performance of DLinear is particularly notable in view of the different dynamical regimes explored within the same Hamiltonian. The family of initial states considered here continuously connects dynamics closer to the ergodic regime with non-ergodic dynamics characterized by coherent revivals associated with quantum many-body scars. Nevertheless, the observable time series considered in this work can be forecast with high accuracy using a simple linear mapping from a finite window of past observations to their subsequent evolution. Importantly, this should not be interpreted as implying that the underlying quantum dynamics are themselves linear. Rather, it shows that the complexity of the many-body evolution need not translate directly into the complexity of the mapping required to forecast a selected set of observables over the time scales considered here.
Conversely, the greater expressiveness of the Transformer does not provide a systematic advantage in this forecasting task. In particular, its performance deteriorates as the dynamics approach the quantum-scarred regime, despite the presence of coherent and recurrent temporal structures in this region. This result reinforces the observation, already made in classical time-series forecasting [35], that more expressive nonlinear architectures do not necessarily outperform appropriately designed linear models. Our results extend this comparison to observable time series generated by quantum many-body dynamics and show that the relative performance of the two approaches can depend strongly on the dynamical regime being forecast.
The present analysis is restricted to a finite PXP chain, a specific family of initial states, and a selected set of observables and forecasting horizons. Establishing how broadly the observed behavior extends beyond this setting therefore remains an open question. A natural direction for future work is to consider other many-body Hamiltonians exhibiting qualitatively different ergodic and nonergodic regimes, in order to determine whether the robust performance of linear forecasting persists more generally. Extending the framework to digital quantum circuits would provide another setting in which to investigate the relation between the complexity of quantum dynamics and that required for forecasting their observable signatures. Finally, comparing Markovian and non-Markovian quantum dynamics could help clarify how memory effects influence the relative performance of linear and nonlinear forecasting architectures.
Acknowledgements
This work has been funded by MIMI (Ministero delle Imprese e del Made in Italy) with the project STROKE 5.0 (CUP B29J23000430005) funded by MIMI Program num. F/310031/01-05/X56, and by the PNRR MUR project PE0000023-NQSTI via the secondary project “ThAnQ”.
References
[1] Richard P. Feynman. Simulating physics with computers. International Journal of Theoretical Physics, 21(6-7):467–488, 1982.
[2] I. M. Georgescu, S. Ashhab, and Franco Nori. Quantum simulation. Rev. Mod. Phys., 86:153–185, Mar 2014.
[3] Andrew J. Daley, Immanuel Bloch, Christian Kokail, Stuart Flannigan, Natalie Pearson, Matthias Troyer, and Peter Zoller. Practical quantum advantage in quantum simulation. Nature, 607(7920):667–676, 2022.
[4] Ehud Altman, Kenneth R. Brown, Giuseppe Carleo, Lincoln D. Carr, Eugene Demler, Cheng Chin, Brian DeMarco, Sophia E. Economou, Mark A. Eriksson, Kai-Mei C. Fu, Markus Greiner, Kaden R.A. Hazzard, Randall G. Hulet, Alicia J. Kollár, Benjamin L. Lev, Mikhail D. Lukin, Ruichao Ma, Xiao Mi, Shashank Misra, Christopher Monroe, Kater Murch, Zaira Nazario, Kang-Kuen Ni, Andrew C. Potter, Pedram Roushan, Mark Saffman, Monika Schleier-Smith, Irfan Siddiqi, Raymond Simmonds, Meenakshi Singh, I.B. Spielman, Kristan Temme, David S. Weiss, Jelena Vučković, Vladan Vuletić, Jun Ye, and Martin Zwierlein. Quantum simulators: Architectures and opportunities. PRX Quantum, 2:017003, Feb 2021.
[5] J. Ignacio Cirac, David Pérez-García, Norbert Schuch, and Frank Verstraete. Matrix product states and projected entangled pair states: Concepts, symmetries, theorems. Rev. Mod. Phys., 93:045003, Dec 2021.
[6] F. Verstraete, V. Murg, and J.I. Cirac. Matrix product states, projected entangled pair states, and variational renormalization group methods for quantum spin systems. Advances in Physics, 57(2):143–224, March 2008.
[7] Sebastian Paeckel, Thomas Köhler, Andreas Swoboda, Salvatore R. Manmana, Ulrich Schollwöck, and Claudius Hubig. Time-evolution methods for matrix-product states. Annals of Physics, 411:167998, December 2019.
[8] Giuliano Benenti, Giulio Casati, Davide Rossini, and Giuliano Strini. Principles of Quantum Computation and Information: A Comprehensive Textbook. WORLD SCIENTIFIC, January 2018.
[9] Luca D'Alessio, Yariv Kafri, Anatoli Polkovnikov, and Marcos Rigol. From quantum chaos and eigenstate thermalization to statistical mechanics and thermodynamics. Advances in Physics, 65(3):239–362, May 2016.
[10] Hyungwon Kim and David A. Huse. Ballistic spreading of entanglement in a diffusive nonintegrable system. Phys. Rev. Lett., 111:127205, Sep 2013.
[11] Bruno Bertini, Pavel Kos, and Toma ž Prosen.
Entanglement spreading in a minimal model of maximal many-body quantum chaos. Phys. Rev. X, 9:021033, May 2019.
[12] Paolo P. Mazza, Dominik Zietlow, Federico Carollo, Sabine Andergassen, Georg Martius, and Igor Lesanovsky. Machine learning time-local generators of open quantum dynamics. Phys. Rev. Res., 3:023084, Apr 2021.
[13] Naeimeh Mohseni, Junheng Shi, Tim Byrnes, and Michael J. Hartmann. Deep learning of many-body observables and quantum information scrambling. Quantum, 8:1417, 2024.
[14] Hubert Pudzlys, Shreyas Varude, Sam Dillon, Huy Tran, Ta Tang, Zhe Jiang, Xuzhe Ying, and Chunjing Jia. Autoregressive neural network extrapolation of quantum spin dynamics across time and space, 2025.
[15] Michele Coppola, Mari Carmen Bañuls, and Zala Lenarčič. Learning the non-markovian features of subsystem dynamics. SciPost Physics, 19(6), December 2025.
[16] Ryui Kaneko, Masatoshi Imada, Yoshiyuki Kabashima, and Tomi Ohtsuki. Forecasting long-time dynamics in quantum many-body systems by dynamic mode decomposition. Phys. Rev. Res., 7:013085, Jan 2025.
[17] Keisuke Fujii and Kohei Nakajima. Quantum Reservoir Computing: A Reservoir Approach Toward Quantum Machine Learning on Near-Term Quantum Devices, page 423–450. Springer Singapore, 2021.
[18] L. Salatino, L. Mariani, A. Giordano, F. D'Amore, C. Mastroianni, L. Pontieri, A. Vinci, C. Gencarelli, L. Primavera, F. Plastina, J. Settino, and F. Carbone. Forecasting low-dimensional turbulence via multi-dimensional hybrid quantum reservoir computing. Chaos: An Interdisciplinary Journal of Nonlinear Science, 36(8), August 2026.
[19] J. Settino, L. Salatino, L. Mariani, F. D'Amore, M. Channab, L. Bozzolo, S. Vallisa, P. Barillà, A. Policicchio, N. Lo Gullo, A. Giordano, C. Mastroianni, and F. Plastina. Memory-augmented hybrid quantum reservoir computing. Phys. Rev. Appl., 24:024019, Aug 2025.
[20] Antonio Sannia, Roberto Menta, Pratik Sathe, Dario De Santis, Vittorio Giovannetti, Luis Pedro García-Pintos, Davide Venturelli, Gian Luca Giorgi, Roberta Zambrini, and Francesco Caravelli. Temporal information processing on a 4,500-qubit quantum annealer, 2026.
[21] Carlos Ramon-Escandell, Arnau Riera, and Marcin Plodzień. From quantum reservoirs to quantum extreme learning machines through a nearest-neighbor spin chain with tunable quantum memory, 2026.
[22] Antonio Sannia, Rodrigo Martínez-Peña, Miguel C. Soriano, Gian Luca Giorgi, and Roberta Zambrini.
Dissipation as a resource for quantum reservoir computing. Quantum, 8:1291, March 2024.
[23] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30, 2017.
[24] Yuxuan Wang, Haixu Wu, Jiaxiang Dong, Yong Liu, Chen Wang, Mingsheng Long, and Jianmin Wang. Deep time series models: A comprehensive survey and benchmark. IEEE Transactions on Pattern Analysis and Machine Intelligence, pages 1–20, 2026.
[25] Jongseon Kim, Hyungjoon Kim, HyunGi Kim, Dongjun Lee, and Sungroh Yoon. A comprehensive survey of deep learning for time series forecasting: architectural diversity and open challenges. Artificial Intelligence Review, 58(7), April 2025.
[26] Hannes Bernien, Sylvain Schwartz, Alexander Keesling, Harry Levine, Ahmed Omran, Hannes Pichler, Soonwon Choi, Alexander S. Zibrov, Manuel Endres, Markus Greiner, Vladan Vuletić, and Mikhail D. Lukin. Probing many-body dynamics on a 51-atom quantum simulator. Nature, 551(7682):579–584, November 2017.
[27] D. Bluvstein, A. Omran, H. Levine, A. Keesling, G. Semeghini, S. Ebadi, T. T. Wang, A. A. Michailidis, N. Maskara, W. W. Ho, S. Choi, M. Serbyn, M. Greiner, V. Vuletić, and M. D. Lukin. Controlling quantum many-body dynamics in driven rydberg atom arrays. Science, 371(6536):1355–1359, March 2021.
[28] Maksym Serbyn, Dmitry A. Abanin, and Zlatko Papić. Quantum many-body scars and weak breaking of ergodicity. Nature Physics, 17(6):675–685, May 2021.
[29] C. J. Turner, A. A. Michailidis, D. A. Abanin, M. Serbyn, and Z. Papić. Quantum scarred eigenstates in a rydberg atom chain: Entanglement, breakdown of thermalization, and stability to perturbations. Phys. Rev. B, 98:155134, Oct 2018.
[30] Xinhui Liang, Zongpei Yue, Yu-Xin Chao, Zhen-Xing Hua, Yige Lin, Meng Khoon Tey, and Li You. Observation of anomalous information scrambling in a rydberg atom array. Phys. Rev. Lett., 135:050201, Jul 2025.
[31] Pinaki Dutta, Sayan Choudhury, and Vishwanath Shukla. Prethermalization in the pxp model under continuous quasiperiodic driving. Phys. Rev. B, 111:064303, Feb 2025.
[32] Ana Hudomal, Jean-Yves Desaules, Bhaskar Mukherjee, Guo-Xian Su, Jad C. Halimeh, and Zlatko Papić. Driving quantum many-body scars in the pxp model. Phys. Rev. B, 106:104302, Sep 2022.
[33] Anushya Chandran, Thomas Iadecola, Vedika Khemani, and Roderich Moessner. Quantum many-body scars: A quasiparticle perspective. Annual Review
of Condensed Matter Physics, 14(1):443–469, March 2023.
[34] Jie Ren, Andrew Hallam, Lei Ying, and Zlatko Papić. Scarfinder: A detector of optimal scar trajectories in quantum many-body dynamics. PRX Quantum, 6:040332, Nov 2025.
[35] Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu. Are transformers effective for time series forecasting? In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pages 11121–11128, 2023.
[36] Igor Lesanovsky and Hosho Katsura. Interacting fibonacci anyons in a rydberg gas. Phys. Rev. A, 86:041601, Oct 2012.
[37] Joshua M Deutsch. Eigenstate thermalization hypothesis. Reports on Progress in Physics, 81(8):082001, 2018.
[38] Mark Srednicki. Chaos and quantum thermalization. Phys. Rev. E, 50:888–901, Aug 1994.
[39] Marcos Rigol, Vanja Dunjko, and Maxim Olshanii. Thermalization and its mechanism for generic isolated quantum systems. Nature, 452(7189):854–858, April 2008.
[40] Francesco Perciavalle, Gian Marco Rizzo, Francesco Plastina, and Nicola Lo Gullo. Local reminiscence in the pxp model, 2025.
[41] Zhe Li, Shiyi Qi, Yiduo Li, and Zenglin Xu. Revisiting long-term time series forecasting: an investigation on affine mapping. Academia AI and Applications, 2(2), April 2026.
[42] Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems, volume 27, 2014.
[43] Abraham. Savitzky and M. J. E. Golay. Smoothing and differentiation of data by simplified least squares procedures. Analytical Chemistry, 36(8):1627–1639, 1964.