How do I set an inverse design problem?

Contents

How do I set an inverse design problem?#

Date

Category

2023-12-21 19:01:14

Inverse Design

With Tidy3Dโ€™s integration with Autograd, setting up an inverse design workflow is straightforward.

All you need to do is define a function to create the Simulation object as a function of the optimization parameters, run the simulation, post-process the data, and return the cost function. Once this function is defined, you can call autograd.value_and_grad to run the simulation and obtain the gradients.

General Workflow#

  1. Create a make_sim function
    This function takes in the optimization parameters and returns a Simulation object.

  2. Define a post-processing function
    This function calculates the objective (cost) function from the resulting SimulationData object.

  3. Wrap it all in a single function
    This wrapper receives the optimization parameters, creates and runs the simulation, applies the post-processing, and returns the objective function.

  4. Use autograd.value_and_grad
    Input the wrapper function into autograd.value_and_grad to obtain both the cost function value and its derivatives. These gradients can then be used in a gradient-based optimization algorithm to guide the inverse design process.

We highly recommend watching the Inverse Design lectures if youโ€™re new to the adjoint method. You can also explore this tutorial for an introduction to automatic differentiation and adjoint optimization.