Skip to main content

Differentiable plane-wave and guided-mode expansion for photonic crystals

Project description

logo

legume (le GUided Mode Expansion) is a python implementation of the GME method for photonic crystal slabs, including multi-layer structures. Plane-wave expansion for purely 2D structures is also included. Also, we have an autograd backend that allows gradients of all output values with respect to all input parameters to be computed efficiently!

Install

Easiest way:

pip install legume-gme

Alternatively, just git clone this repository, and make sure you have all the requirements installed.

Documentation and examples

Go to our documentation to find a number of examples, as well as a detailed API reference.

The examples can also be found in ipython notebook form in /docs/examples.

Here's an example of a computation of the photonic bands of a photonic crystal, compared to Fig. 2(b) in Chapter 8 of the photonic crystal bible, Molding the Flow of Light.

Quasi-TE bands of a photonic crystal slab

We have only computed the quasi-TE modes of the slab (positive symmetry w.r.t. the plane bisecting the slab), which should be compared to the red lines in the figure on the right. The agreement is very good! And, the guided-mode expansion allows us to also compute the quasi-guided modes above light-line, together with their associated quality factor. These modes are typically hard to filter out in first-principle simulations, so legume is great for studying those.

Autograd

Optimizing the quality factor of a photonic crystal cavity

One exciting feature of legume is the autograd backend that can be used to automatically compute the gradient of the eigenmodes and eigenfrequencies with respect to any input parameters! In the optimization shown above, we tune the positions of the holes of a cavity in order to increase the quality factor. As is common in photonic crystal resonators, small modifications lead to tremendous improvement. The gradient of the quality factor with respect to the positions of all holes is computed in parallel using reverse-modeautomatic differentiation.

Citing

If you find legume useful for your research, we would apprecite you citing our paper. For your convenience, you can use the following BibTex entry:

@article{legume,
  title = {legume},
  author = {Minkov, Momchil and Williamson, Ian A. D. and Gerace, Dario and Andreani, Lucio C. and Lou, Beicheng and Song, Alex Y. and Hughes, Tyler W. and Fan, Shanhui},
  year = {2020},
  month = feb,
  volume = { ... },
  pages = { ... },
  doi = { ... },
  journal = { ... },
  number = { ... }
}

Acknowledgements

Apart from all the contributors to this repository, all the authors of the paper cited above contributed in various ways with the development of this package. Our logo was made by Nadine Gilmer. The backend switching between numpy and autograd follows the implementation in the fdfd package of Floris Laporte.

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

legume-gme-0.1.1.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

legume_gme-0.1.1-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

Details for the file legume-gme-0.1.1.tar.gz.

File metadata

  • Download URL: legume-gme-0.1.1.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5

File hashes

Hashes for legume-gme-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d4a0f629b80bbc92fdf04fb4c907b4b1279f04fce5e7187e4b7d58492e9af681
MD5 86b65bdabc257a5c0dbd362c6fba0bdb
BLAKE2b-256 1fae0932ff50b1177dab0baaa9940deb97714df6fb1c1514b2c497072a10da5c

See more details on using hashes here.

File details

Details for the file legume_gme-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: legume_gme-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 51.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5

File hashes

Hashes for legume_gme-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84ecb16deb3adb2adbaeadfed4e31770b731990c0bb5749420f08506481b0486
MD5 2c56b6944bec9eb1eeb11452b0c7c10b
BLAKE2b-256 32abb3df0dfe1bc6ad1b442223f42f3fe293e61b5c7d209b70624ad32727ea39

See more details on using hashes here.

Supported by

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