QCAAPatchTF: Quantum-Classical Self-Attention Advanced Patch based Transformer

June 8, 2026 ยท View on GitHub

QCAAPatchTF is a quantum-classical hybrid attention module embedded into an advanced patch based transformer architecture which is suitable for deep time series analysis.

We provide a neat code base to evaluate advanced deep time series models or develop your model, which covers five mainstream tasks: long- and short-term forecasting, anomaly detection, and classification.

https://arxiv.org/pdf/2504.00068

Time Series Library (TSLib)

TSLib is an open-source library for deep learning researchers, especially for deep time series analysis.

We provide a neat code base to evaluate advanced deep time series models or develop your model, which covers five mainstream tasks: long- and short-term forecasting

Leaderboard for Time Series Analysis as Baseline Models

Compared models of this leaderboard. โ˜‘ means that their codes have already been included in this repo.

  • iTransformer - iTransformer: Inverted Transformers Are Effective for Time Series Forecasting [ICLR 2024] [Code].
  • PatchTST - A Time Series is Worth 64 Words: Long-term Forecasting with Transformers [ICLR 2023] [Code].
  • ETSformer - ETSformer: Exponential Smoothing Transformers for Time-series Forecasting [arXiv 2022] [Code].
  • Non-stationary Transformer - Non-stationary Transformers: Exploring the Stationarity in Time Series Forecasting [NeurIPS 2022] [Code].
  • FEDformer - FEDformer: Frequency Enhanced Decomposed Transformer for Long-term Series Forecasting [ICML 2022] [Code].
  • Pyraformer - Pyraformer: Low-complexity Pyramidal Attention for Long-range Time Series Modeling and Forecasting [ICLR 2022] [Code].
  • Autoformer - Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting [NeurIPS 2021] [Code].
  • Informer - Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting [AAAI 2021] [Code].
  • Reformer - Reformer: The Efficient Transformer [ICLR 2020] [Code].
  • Transformer - Attention is All You Need [NeurIPS 2017] [Code].

Usage Install Python 3.8. For convenience, execute the following command. pip install -r requirements.txt

Prepare Data. You can obtain the well pre-processed datasets from [Google Drive]. Train and evaluate model. We provide the experiment scripts for all benchmarks under the folder ./scripts/. You can reproduce the experiment results as the following examples:

long-term forecast

bash ./scripts/long_term_forecast/ETT_script/QCAAPatchTF.sh

short-term forecast

bash ./scripts/short_term_forecast/QCAAPatchTF.sh

anomaly detection

bash ./scripts/anomaly_detection/PSM/QCAAPatchTF.sh

classification

bash ./scripts/classification/QCAAPatchTF.sh

Develop your own model. Add the model file to the folder ./models. You can follow the ./models/Transformer.py. Include the newly added model in the Exp_Basic.model_dict of ./exp/exp_basic.py. Create the corresponding scripts under the folder ./scripts.

Contact

If you have any questions or suggestions, feel free to contact our maintenance team:

Current:

Sanjay Chakraborty (Postdoc, sanjay.chakraborty@liu.se) Or describe it in Issues.