zlin-opt / meep-adjoint-3d

A quick hack for adjoint gradient computations with MEEP.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a quick hack to compute accurate adjoint gradients for 3D photonic inverse design using MEEP FDTD.

The key ingredients in my hack are:

  1. directly populate the Yee-grid through epsilon_func and amp_func
  2. directly access the dft fields with yee_grid=True

Test

The following is a 3D test structure consisting of two dielectric layers. Each layer has a randomized surface geometry. The degrees of freedom are the thickness of the dielectric at each point on each layer.

alt text

The adjoint code is tested by sweeping the thickness of one of the dielectric layers at some random pixel point, and computing and comparing both the adjoint and finite-difference gradients. Note that in this example, I used a point current at some point above the dielectric and then computed the integrated field intensity |E|^2 at a plane beneath the dielectric.

alt text

The error in percentage between the adjoint and finite-difference calculations.

alt text

About

A quick hack for adjoint gradient computations with MEEP.


Languages

Language:Python 100.0%