Git Product home page Git Product logo

ceviche-challenges's Introduction

Ceviche Challenges: Photonic Inverse Design Suite

The ceviche_challenges module contains a suite of photonic inverse design challenge problems, backed by the open source ceviche finite difference frequency domain (FDFD) simulator, and packaged into a standard API for calculating scattering parameters and fields. Gradients and automatic differentiation capabilities are provided by HIPS autograd.

The suite of challenge problems may be used to benchmark different topology optimization algorithms in designing relevant photonic components. The suite includes several integrated photonic components, including a waveguide beam splitter, a waveguide mode converter, a waveguide bend, and a wavelength division multiplexer (WDM).

The code in this module was used to produce the results in the Inverse Design of Photonic Devices with Strict Foundry Fabrication Constraints paper.

Challenge problems

Waveguide bend

Waveguide bend

Beam splitter

Beam splitter

Mode converter

Mode converter

Wavelength division multiplexer (WDM)

Wavelength division multiplexer (WDM)

Installation

ceviche_challenges can be installed via pip:

pip install ceviche_challenges

Usage

ceviche_challenges provides several "prefab" component configurations, which live in the following submodules:

  • ceviche_challenges.beam_splitter.prefabs
  • ceviche_challenges.mode_converter.prefabs
  • ceviche_challenges.waveguide_bend.prefabs
  • ceviche_challenges.wdm.prefabs

Each component type (i.e. beam splitter, mode converter, etc) has an associated model class for performing simulations and returning complex-valued scattering parameters. An example using the 2 um x 2 um waveguide bend prefab is shown below.

import numpy as np
import ceviche_challenges

spec = ceviche_challenges.waveguide_bend.prefabs.waveguide_bend_2umx2um_spec()
params = ceviche_challenges.waveguide_bend.prefabs.waveguide_bend_sim_params()
model = ceviche_challenges.waveguide_bend.model.WaveguideBendModel(params, spec)

# The model class provides a convenience property, `design_variable_shape`
# which specifies the design shape it expects.
design = np.ones(model.design_variable_shape)

# The model class has a `simulate()` method which takes the design variable as
# an input and returns scattering parameters and fields.
s_params, fields = model.simulate(design)

The model class can also be used inside of an objective function to perform an optimization. Gradients and loss function automatic differentiation is supported by HIPS autograd.

import autograd
import autograd.numpy as npa

# Construct a loss function, assuming the `model` and `design` from the code
# snippet above are instantiated.

def loss_fn(x):
  """A simple loss function taking mean s11 - mean s21."""
  s_params, _ = model.simulate(x)
  s11 = npa.abs(s_params[:, 0, 0])
  s21 = npa.abs(s_params[:, 0, 1])
  return npa.mean(s11) - npa.mean(s21)

loss_value, loss_grad = autograd.value_and_grad(loss_fn)(design)

There are a number of other features in the device model class, such as returning an image of the structure. These features are best explored by reading the code and the function docstrings, as we don't have comprehensive standalone documentation at this time.

Citation

If you find ceviche_challenges to be useful for your research, please consider citing our paper. A BibTex citation is provided below for convenience.

@article{schubert_inverse_2022,
  title = {Inverse Design of Photonic Devices with Strict Foundry Fabrication Constraints},
  author = {Schubert, Martin F. and Cheung, Alfred K. C. and Williamson, Ian A. D. and Spyra, Aleksandra and Alexander, David H.},
  journal = {ACS Photonics},
  volume = {9},
  number = {7},
  pages = {2327-2336},
  year = {2022},
  doi = {10.1021/acsphotonics.2c00313},
}

ceviche-challenges's People

Contributors

ianwilliamson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ceviche-challenges's Issues

Question about ceviche-challenges module and parameters which defines fabrication constrains in the paper are missing?

Hello,

In the presentation, it is confirmed: "The code in this module was used to produce the results in the [Inverse Design of Photonic Devices with Strict Foundry Fabrication Constraints] paper."

The thing is taking in account for the example "waveguide bend" as its explained in "Usage" section, the objects overrides design parameters but Fabrication Constraint parameters are not inputs for simulations and I don't know how to make the inverse design of one of this results that's shown in the paper. If it is possible can you illustrate us with a full example for "waveguide bend" for example? (I remark if it is possible)

It is the loaded parameter for simulation, there are others for fabrication constrains, where are they?? the code is full to got results in the paper?

def waveguide_bend_2umx2um_spec(**overrides) -> spec.WaveguideBendSpec:
"""Design spec for a waveguide bend with a 2 um x 2 um design region."""
defaults = spec.WaveguideBendSpec(
wg_width=200 * u.nm,
wg_length=750 * u.nm,
wg_mode_padding=750 * u.nm,
padding=400 * u.nm,
port_pml_offset=50 * u.nm,
variable_region_size=(2000 * u.nm, 2000 * u.nm),
cladding_permittivity=1.0,
slab_permittivity=12.25,
input_monitor_offset=50 * u.nm,
pml_width=20,
)
return dataclasses.replace(defaults, **overrides)

def waveguide_bend_sim_params(**overrides) -> params.CevicheSimParams:
"""Simulation parameters appropriate for the waveguide bend."""
defaults = params.CevicheSimParams(
resolution=50 * u.nm,
wavelengths=u.Array([1550.], u.nm),
)
return dataclasses.replace(defaults, **overrides)

I'm waiting for replaying and thanks in advance,

Convenience Functions?

The readme states

There are a number of other features in the device model class, such as returning an image of the structure. These features are best explored by reading the code and the function docstrings, as we don't have comprehensive standalone documentation at this time.

I have been going through the code and was not able to identify functions used to plot the simulations/structures.
Maybe you can point me in the right direction?

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.