Automatic differentiation accelerated shape optimization approaches to photonic inverse design on rectilinear simulation grids

Sean Hooten, Peng Sun, Liron Gantz, Marco Fiorentino, Raymond G. Beausoleil, Thomas Van VaerenbergharXiv 2023

This paper, recently published by researchers at Hewlett Packard Labs and NVIDIA, tackles a major bottleneck in photonic inverse design: the computational cost of calculating gradients for shape-based optimization. By introducing a library of differentiable geometry primitives called AutoDiffGeo, the authors demonstrate how to leverage automatic differentiation (AutoDiff) to achieve massive speedups in design cycles without sacrificing device performance.

TL;DR

The authors replace slow finite-difference calculations with automatic differentiation to compute material Jacobians in photonic shape optimization. By using a new library of differentiable shape primitives and logic operations (AutoDiffGeo), they achieve over 50× acceleration in gradient calculations and 4× total wall-clock speedups for complex 3D photonic designs.

What Problem Does This Paper Address?

In photonic inverse design, we use the Adjoint Variables Method (AVM) to efficiently calculate how changing a design parameter (like the width of a waveguide) affects a performance metric (like light coupling efficiency). However, there is a hidden cost: the "material Jacobian."

On the rectilinear grids used in FDTD (Finite-Difference Time-Domain) simulations, we must calculate how the permittivity ($\epsilon$) of every single grid cell changes with respect to every design parameter. Traditionally, this is done via finite-difference (FD): perturb a parameter, re-mesh the geometry, re-calculate the grid, and see what changed. When a single parameter (like a taper's length) affects thousands of grid cells, and you have hundreds of parameters, this step becomes a massive computational drag—sometimes exceeding the time taken by the actual electromagnetic simulations.

Methods

The core innovation is AutoDiffGeo, a framework that defines photonic structures using closed-form, differentiable expressions rather than discrete polygons.

  • Differentiable Primitives: Instead of hard boundaries, shapes are defined using smooth nonlinear functions (like sigmoids or piecewise linear functions). This allows the "blurry" transition at a shape's edge to be mathematically differentiable.
  • Differentiable Logic: The authors developed differentiable versions of Boolean operations (Union and Intersection) using min and max functions, allowing complex devices to be built from simple building blocks.
  • Late Projection: To keep AutoDiff efficient, the authors emphasize projecting parameters onto the high-dimensional simulation grid as late as possible in the computational graph.
  • Sub-pixel Smoothing: A major challenge was ensuring these smooth "AutoDiff" shapes didn't introduce more discretization error than standard volumetric averaging. The authors show that specific functions (like piecewise linear) can perfectly match standard smoothing for rectilinear shapes.
Figure 1: 2D multi-mode-interferometer-like (MMI-like) structure consists of the union of 4 rectangles.

Datasets (Design Benchmarks)

The authors validated their approach on three increasingly complex integrated photonic components:

  1. 2D Multi-etch Blazed Grating Coupler: A structure with 94 variables where parameters affect the entire grid.
  2. 2D Non-adiabatic Waveguide Taper: A 23 $\mu$m long transition with 100 sine-series coefficients defining the boundary.
  3. 3D Polarization-Splitting Grating Coupler (PSGC): A massive simulation with ~29 million voxels and 325 parameters.

Key Insights and Ideas

  • Finite-Difference is the Bottleneck: In many high-dimensional shape optimizations, the time spent calculating the material Jacobian via FD is actually greater than the time spent running the forward and adjoint Maxwell solvers.
  • Exact vs. "Exact Enough": The paper proposes two paths. Prop 1 uses AutoDiffGeo shapes for the entire optimization (fast but slightly different physics). Prop 2 uses standard physics for the fields but uses AutoDiffGeo just for the gradient (a "noisy gradient" approach). Both work remarkably well.
  • The Power of $k_r$: By tuning the inverse-length-scale ($k_r$), designers can control how "blurry" a shape boundary is. High $k_r$ values approach the sharp "staircasing" limit, while lower values provide smoother gradients for the optimizer.
Figure 2: Two-dimensional representations of shape primitives constructed from differentiable function compositions. Here, we assume a sigmoid nonlinearity with characteristic inverse-length-scale k = kr/∆x, such that σk(x) 7→σ(kx) where σ is the sigmoid function and ∆x = 0.08 is the uniform mesh discretization. We vary kr along each column. Function definitions and parameters used in this example may be found in Table 2.

Key Results

  • Massive Gradient Speedup: For the 2D grating coupler, the gradient calculation was accelerated by up to 2751× compared to finite-difference.
  • Total Time Savings: For the 3D PSGC, the AutoDiff approach resulted in a 4× total wall-clock speedup. What previously took 38 minutes per gradient step now takes about 36 seconds.
  • Better Convergence: Because AutoDiff provides numerically exact derivatives (compared to the approximations of FD), the optimizers often reached better final designs. For the blazed grating, AutoDiff achieved an insertion loss of 0.20 dB, while the FD version stalled at 0.46 dB.

Limitations and Future Work

  • Concave Polygons: The current library natively supports convex and star-convex shapes. Arbitrary concave shapes currently require complex unions/intersections or Schwarz-Christoffel conformal mappings.
  • Anisotropy: Standard high-end sub-pixel smoothing uses anisotropic permittivity tensors at boundaries. AutoDiffGeo currently uses a scalar approximation, which may introduce small errors in highly resonant structures.
  • Open Source: The authors have integrated this work into the open-source EMopt toolkit, making these accelerations available to the wider photonics community.

Summary updated

BibTeX
@misc{hooten2023automatic,
  author = {Sean Hooten and Peng Sun and Liron Gantz and Marco Fiorentino and Raymond G. Beausoleil and Thomas Van Vaerenbergh},
  title = {{Automatic differentiation accelerated shape optimization approaches to photonic inverse design on rectilinear simulation grids}},
  year = {2023},
  eprint = {2311.05646},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.05646},
}
Figure