Skip to content

ycchen1989/Quantum_Long_Short_Term_Memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

QLSTM for Time-Series Forecasting with Quantum Circuits

This repository implements a Quantum Long Short-Term Memory (QLSTM) model for time-series forecasting. It integrates parameterized quantum circuits (VQCs) into a classical LSTM architecture using PennyLane and PyTorch.


πŸš€ Highlights

  • 🧠 Custom QLSTMCell with VQC-based gates (input, forget, cell, output)
  • πŸ” Sequence modeling using CustomLSTM
  • πŸ“‰ Real-time loss tracking and automatic PDF plotting
  • πŸ§ͺ Tested on damped simple harmonic motion (SHM) synthetic dataset
  • πŸ’Ύ Supports model/result saving for reproducibility

πŸ§ͺ Dataset

We use a toy damped simple harmonic motion dataset defined in data/damped_shm.py, which generates:

  • Input: [batch_size, seq_len, 1] time-series
  • Target: [batch_size, 1] next-step prediction

πŸš€ How to Run

python QLSTM_v0.py

Running the script will:

  • 🧠 Train a QLSTM model for 100 epochs
  • πŸ’Ύ Save plots and model checkpoints under the folder:
    QLSTM_TS_MODEL_DAMPED_SHM_1/
  • πŸ“Š Generate the following visualizations:
    • Training/testing loss curves
    • Ground truth vs. predicted output plots

πŸ“š Citation / Reference

If you find this repository useful for your research or teaching, please consider citing the following paper:

@inproceedings{chen2022quantum,
  title={Quantum long short-term memory},
  author={Chen, Samuel Yen-Chi and Yoo, Shinjae and Fang, Yao-Lung L},
  booktitle={Icassp 2022-2022 IEEE international conference on acoustics, speech and signal processing (ICASSP)},
  pages={8622--8626},
  year={2022},
  organization={IEEE}
}