Skip to main content

PhotonTorch: a photonic simulation framework based on the deep learning framework PyTorch.

Project description

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 sparse tensor representations under the hood. The Photontorch issue can be followed here

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

photontorch-0.3.1.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

photontorch-0.3.1-py3-none-any.whl (53.7 kB view details)

Uploaded Python 3

File details

Details for the file photontorch-0.3.1.tar.gz.

File metadata

  • Download URL: photontorch-0.3.1.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for photontorch-0.3.1.tar.gz
Algorithm Hash digest
SHA256 78324b4de76e884b3c2c20891dbe7bb3142d19d792fa644989d7893e9cd04f5d
MD5 e39473259193437d0e094ad22798e0ef
BLAKE2b-256 d2e142911d0bce35df312855d2ff1fa2b232296b1d415438874d7df68f9d9dbb

See more details on using hashes here.

File details

Details for the file photontorch-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: photontorch-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 53.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for photontorch-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab7973270de9951d2fda291be6e79d71bde8de2fca06a893baec128a4958a0c9
MD5 5579468bb5bb4881fa2ed94c65df09cc
BLAKE2b-256 e4cb31fc1b8aa4f70832f6166012e6b2a6af315d28ecbcaf5f04d7db17e6fad8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page