Skip to content

afrah/QCPINN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QCPINN: Quantum-Classical Physics-Informed Neural Networks

Source code of QCPINN described in the paper: QCPINN: Quantum-Classical Physics-Informed Neural Networks for Solving PDEs.


Project Structure

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.

Getting Started

Prerequisites

Anaconda/Miniconda (recommended) or any other Python environment.

Installation

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 qcpinn

Training Models

Train 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_trainer

Jupyter notebooks for training, testing, and visualization are in src/notebooks/.

Note: I used VS Code with the Jupyter extension for working on the notebooks.

Inference

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_plotting

Testing

Amplitude vs. Angle Encodings

# Cavity
python -m src.testing.cavity_test

# Helmholtz
python -m src.testing.helmholtz_test

Output plots and data are saved in the results directory.

Results

Helmholtz Equation

  • Embedding: Angle
  • Topology: Cascade
  • Configuration link
  • Results folder

Cavity flow

  • Embedding: Angle
  • Topology: Cascade
  • Configuration link
  • Results folder

Wave Equation

  • Embedding: Angle
  • Topology: Cross-mesh
  • Configuration link
  • Results folder

Klein_Gordon Equation

  • Embedding: Angle
  • Topology: Cascade
  • Configuration link
  • Results folder

Convection Diffusion

  • Embedding: Angle
  • Topology: Cascade
  • Configuration link
  • Results folder

Comparisio of Different Embeddings

  • Loss convergence Helomholtz plot
  • Loss convergence Cavity flow plot

CV-QCPINN model Results

  • Configuration link
  • Loss convergence Helomholtz plot
  • Loss convergence Cavity flow plot

Support

If you encounter issues or have questions, please open an issue.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

MIT LICENSE

References

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},
}

About

QCPINN: Quantum-Classical Physics-Informed Neural Networks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors