Giter VIP home page Giter VIP logo

legume's Introduction

Build Status Documentation Status Code style: yapf pep8

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{minkov2020inverse,
  title={Inverse design of photonic crystals through automatic differentiation},
  author={Minkov, Momchil and Williamson, Ian AD and Andreani, Lucio C and Gerace, Dario and Lou, Beicheng and Song, Alex Y and Hughes, Tyler W and Fan, Shanhui},
  journal={ACS Photonics},
  volume={7},
  number={7},
  pages={1729--1741},
  year={2020},
  publisher={American Chemical Society}
}

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.

legume's People

Contributors

momchilmm avatar ianwilliamson avatar lbc45123 avatar tttttom avatar shanham avatar twhughes avatar

Stargazers

Mehdi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.