Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subpixel smoothing example for metagrating problem #62

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

smartalecH
Copy link

@smartalecH smartalecH commented Mar 19, 2024

Here, we use fmmax, the invrs.io gym, along with some handy autograd-wrapper functions to take meep's recently added subpixel smoothing functionality, and optimize the metagrating example.

Importantly, this example shows how one can use fmmax (an RCWA/FMM tool) and still evolve β→∞.

We have an explicit shape optimization example (β=∞):

image

As well as an explicit topology optimization example (β=16, 64, ∞):

image

Everything was very straightforward thanks to all the existing code!

(note that we need to merge the corresponding PR in meep first)

(cc @oskooi, @mfschubert, @stevengj, @mochen4, @hammy4815)

@mfschubert
Copy link
Contributor

Nice! FYI if you use agjax.experimental.wrap_for_jax (code) then you can also jit the entire calculation.

@smartalecH
Copy link
Author

@mfschubert I wonder if there is a clean way to directly compute the vector fields from this formulation, which has a level set. In other words, we know the normal direction and distance to the nearest interface at every point, so perhaps this doesn't require solving a mini optimization problem?

@mfschubert
Copy link
Contributor

@smartalecH This is an interesting thought, and in general a level set view may be fruitful to take. However, my sense is that we will still have to solve an optimization problem---recall that when computing the vector fields, we balance smoothness with alignment to the permittivity gradient. So, in some cases the optimal field is not aligned with the gradient, and a direct calculation from the permittivity (however it may be parameterized) may not produce such a field. But, maybe there is some cleverness that I am not thinking of this morning. Let's chat about it further.

@oskooi
Copy link
Collaborator

oskooi commented Mar 21, 2024

The optimal designs reported in the testbed paper (Section F and Fig. 8) have a diffraction efficiency of ~93%.

What are the values for the two designs shown above? What are the values of the designs computed using Meep?

Note: there is already a Meep script (metagrating_meep.py) which can be used for validation. The input is a CSV file of the design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants