Examples · Documentation · Index · Module Index

Photontorch is a photonic simulator for highly parallel simulation and optimization of photonic circuits in time and frequency domain. Photontorch features CUDA enabled simulation and optimization of photonic circuits. It leverages the deep learning framework PyTorch to view the photonic circuit as essentially a recurrent neural network. This enables the use of native PyTorch optimizers to optimize the (physical) parameters of the circuit.


Stable version

Photontorch can be installed with pip:

pip install photontorch

Development version

During development or to use the most recent Photontorch version, clone the repository and link with pip:

git clone
./ # Unix [Linux/Mac/BSD/...]
install-git-hooks.bat  # Windows
pip install -e photontorch

During development, use pytest to run the tests from within the root of the git-repository:

pytest tests


Required dependencies

  • Python 2.7 (linux only) or 3.6+. It’s recommended to use the Anaconda distribution.

  • pytorch >=1.5.0: conda install pytorch (see for more installation options for your CUDA version)

  • numpy : conda install numpy

  • scipy : conda install scipy


If you’re using Photontorch in your work or feel in any way inspired by it, please be so kind to cite us in your work.

Floris Laporte, Joni Dambre, and Peter Bienstman. “Highly parallel simulation and optimization of photonic circuits in time and frequency domain based on the deep-learning framework PyTorch.” Scientific reports 9.1 (2019): 5918.

Where to go from here?

Check out the first example: A brief introduction to Photontorch.


Photontorch is available under an Academic License. This means that there are no restrictions on the usage in a purely non-commercial or academic context. For commercial applications you can always contact the authors.

Copyright © 2020, Floris Laporte - Universiteit Gent - Ghent University - Academic License.