Meep contains a density-based adjoint solver for efficiently computing the gradient of an arbitrary function of the mode coefficients (S-parameters) or DFT fields with respect to on a discrete spatial grid in a subregion of the cell (i.e., a
MaterialGrid class object) over a broad bandwidth. Regardless of the number of degrees of freedom for the grid points, just two separate timestepping runs are required. The first run is the "forward" calculation to compute the objective function. The second run is the "adjoint" calculation to compute the gradient of the objective function with respect to the design variables which involves a special type of source distribution and postprocessing of the results (i.e., the DFT fields within the design region). This module is implemented entirely in Python using autograd. Additionally, the adjoint solver supports topology optimization by providing the functionality to wrap an optimization library around the gradient computation.
There are six Jupyter notebooks that demonstrate the main features of the adjoint solver.
More documentation will be available soon.