Skip to main content

Photontorch

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.

Installation

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 https://git.photontorch.com/photontorch.git
./install-git-hooks.sh # 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

Documentation

Read the full documentation here: https://docs.photontorch.com

Dependencies

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 pytorch.org for more installation options for your CUDA version)
  • numpy: conda install numpy
  • scipy: conda install scipy

Optional (but recommended) dependencies

  • tqdm: conda install tqdm [progress bars]
  • networkx: conda install networkx [network visualization]
  • matplotlib: conda install matplotlib [visualization]
  • pytest: conda install pytest [to run tests]
  • pandoc: conda install pandoc [to generate docs]
  • sphinx: pip install sphinx nbsphinx [to generate docs]
  • torch-lfilter: pip install torch-lfilter [faster lfilter for detectors]

Reference

If you're using Photontorch in your work or feel in any way inspired by it, we ask you 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.

Known issues

  • Complex tensor support. Complex tensors are not supported in PyTorch/Photontorch. Wherever complex tensors would be applicable, Photontorch expects a real-valued tensor with the real and imag part stacked in the first dimension. The Photontorch issue can be followed here and the PyTorch issue here.
  • Sparse tensor support. A lot of memory usage can probably be avoided when transitioning to a sparse tensor representation for the connection matrices and scatter matrices. The Photontorch issue can be followed here

License

Photontorch used to be available under a custom Academic License, but Since October 2020, Photontorch is now fully open source and available under the AGPLv3.

Copyright © 2020, Floris Laporte - UGent - AGPLv3

Metadata

Release files for photontorch 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for photontorch 0.4.1
File Size Uploaded
photontorch-0.4.1.tar.gz 42.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for photontorch 0.4.1
File Interpreter ABI Platform
photontorch-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 107.5 kB

Release files / photontorch-0.4.1.tar.gz

Download URL photontorch-0.4.1.tar.gz
Size 42.9 kB
Tags Source
SHA-256 checksum
How to use checksums
50d2e2c8a24c914cc7afee1eea6efb8bccfbc19ff9652a9af46efad28caa6381
BLAKE2b-256 checksum
How to use checksums
c3d94e93d117745b5bff5b51aae0228918f359764d465aed6118f2a700f64b46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release files / photontorch-0.4.1-py3-none-any.whl

Download URL photontorch-0.4.1-py3-none-any.whl
Size 64.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b2e60d5885692ec0cf2f6dc13d787b3125b086410279d0729486fa8c902b44f0
BLAKE2b-256 checksum
How to use checksums
b52161a64a8900a6dd445a87a6a7bbdfcd0b838907866e68ab63545c9d5fac4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page