Source code of QCPINN described in the paper: QCPINN: Quantum-Classical Physics-Informed Neural Networks for Solving PDEs.
QCPINN/
├── data/ # Cavity datasets from simulation
├── models/ # Saved models from training
├── qcpinn.yaml # Conda environment file
└── src/
├── contour_plots/ # Plotting functions
├── data/ # Data generator
├── nn/ # Neural network modules
├── notebooks/ # Jupyter notebooks (training, testing, visualization)
├── trainer/ # Training scripts
└── utils/ # Utility functions and helpers
See the
src/notebooks/folder for hands-on examples and further documentation.
Anaconda/Miniconda (recommended) or any other Python environment.
Clone the repository and set up the environment:
git clone https://github.com/afrah/QCPINN.git
cd QCPINN
conda env create -f qcpinn.yaml
conda activate qcpinnTrain models for different PDEs using the following commands:
# Helmholtz
python -m src.trainer.helmholtz_hybrid_trainer
# Cavity
python -m src.trainer.cavity_hybrid_trainer
# Klein-Gordon
python -m src.trainer.klein_gordon_hybrid_trainer
# Wave
python -m src.trainer.wave_hybrid_trainer
# Diffusion
python -m src.trainer.diffusion_hybrid_trainerJupyter notebooks for training, testing, and visualization are in src/notebooks/.
Note: I used VS Code with the Jupyter extension for working on the notebooks.
After training, generate plots and evaluate results:
# Helmholtz
python -m src.contour_plots.helmholtz_hybrid_plotting
# Cavity
python -m src.contour_plots.cavity_hybrid_plotting
# Klein-Gordon
python -m src.contour_plots.klein_gordon_hybrid_plotting
# Wave
python -m src.contour_plots.wave_hybrid_plotting
# Diffusion
python -m src.contour_plots.diffusion_hybrid_plottingAmplitude vs. Angle Encodings
# Cavity
python -m src.testing.cavity_test
# Helmholtz
python -m src.testing.helmholtz_testOutput plots and data are saved in the results directory.
Helmholtz Equation
Cavity flow
Wave Equation
Klein_Gordon Equation
Convection Diffusion
Comparisio of Different Embeddings
CV-QCPINN model Results
If you encounter issues or have questions, please open an issue.
Contributions are welcome! Please open an issue or submit a pull request.
MIT LICENSE
If you find this work useful, please consider citing:
@article{Farea:2025:MLST,
author={Farea, Afrah and Khan, Saiful and ÇELEBİ, Mustafa Serdar},
title={QCPINN: Quantum-Classical Physics-Informed Neural Networks for Solving PDEs},
journal={Machine Learning: Science and Technology},
url={http://iopscience.iop.org/article/10.1088/2632-2153/ae1c91},
year={2025},
}