From 89d66df3db0defa9d885fa174616fcf877e9b053 Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Fri, 28 Jun 2024 15:21:51 -0400 Subject: [PATCH] Update doc/docs/Python_Tutorials/Adjoint_Solver.md --- doc/docs/Python_Tutorials/Adjoint_Solver.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/docs/Python_Tutorials/Adjoint_Solver.md b/doc/docs/Python_Tutorials/Adjoint_Solver.md index bf46217fd..cd998a1a7 100644 --- a/doc/docs/Python_Tutorials/Adjoint_Solver.md +++ b/doc/docs/Python_Tutorials/Adjoint_Solver.md @@ -817,7 +817,7 @@ The calculation of the derivative of the diffraction efficiency ($F$) with respe ![](../images/levelset_gradient_backpropagation.png#center) -The derivative $\partial \rho / \partial h$ can be approximated by a finite difference using a one-pixel perturbation applied to the grating height. The calculation is summarized in the schematic below. There are two function evaluations of $\rho(h)$ for which the cost is negligible. Smoothing of the levelset can be performed using a number of different methods including a [signed-distance function](https://en.wikipedia.org/wiki/Signed_distance_function) or convolution filter. In this example, the smoothing is based on downsampling the levelset from a high-resolution grid (10X the resolution of the simulation grid) to the lower-resolution simulation grid using bilinear interpolation. Note that only the boundary pixels are nonzero in the Jacobian matrix in this case. +The derivative $\partial \rho / \partial h$ can be approximated by a finite difference using a one-pixel perturbation applied to the grating height; this is computationally convenient because it greatly simplifies the construction of $\rho(h)$ as explained below. (A finite difference involves two function evaluations of $\rho(h)$, but the cost for this is negligible since it involves no Meep simulations.) The construction of $\rho(h)$ involves two steps: first, constructing a simple binary image $b(h)$ at a high resolution; and second, smoothing $b(h)$ into a continuous level-set function $\rho(h)$. This smoothing of the image can be performed using a number of different methods including a [signed-distance function](https://en.wikipedia.org/wiki/Signed_distance_function) or convolution filter. In this example, the smoothing is based simply on downsampling the image from a high-resolution grid (10X the resolution of the simulation grid) to the lower-resolution simulation grid using bilinear interpolation, which leads to "gray" pixels at the boundaries between materials in a way that changes continuously with $h$. Only these boundary pixels have nonzero derivatives in the Jacobian $\partial\rho/\partial h$ in this case. This calculation is summarized in the schematic below. ![](../images/levelset_jacobian_matrix.png#center)