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.
- π§ 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
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
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
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}
}