Shape optimization approaches to inverse design offer low-dimensional, physically-guided parameterizations of structures by representing them as combinations of shape primitives. However, on discretized rectilinear simulation grids, computing the gradient of a user objective via the adjoint variables method requires a sum reduction of the forward/adjoint field solutions and the Jacobian of the simulation material distribution with respect to the structural shape parameters. These shape parameters often perturb large or global parts of the simulation grid resulting in many non-zero Jacobian entries, which are typically computed by finite-difference in practice. Consequently, the gradient calculation can be non-trivial. In this work we propose to accelerate the gradient calculation by invoking automatic differentiation (AutoDiff) in instantiations of structural material distributions. In doing so, we develop extensible differentiable mappings from shape parameters to shape primitives and differentiable effective logic operations (denoted AutoDiffGeo). These AutoDiffGeo definitions may introduce some additional discretization error into the field solutions because they relax notions of sub-pixel smoothing along shape boundaries. However, we show that some mappings (e.g. simple cuboids) can achieve zero error with respect to volumetric averaging strategies. We demonstrate AutoDiff enhanced shape optimization using three integrated photonic examples: a multi-etch blazed grating coupler, a non-adiabatic waveguide transition taper, and a polarization-splitting grating coupler. We find accelerations of the gradient calculation by AutoDiff relative to finite-difference often exceed 50x, resulting in total wall time accelerations of 4x or more on the same hardware with little or no compromise to final device performance. Our code is available open source at https://github.com/smhooten/emopt
翻译:逆向设计中的形状优化方法通过将结构表示为形状基元的组合,提供了低维、物理引导的结构参数化。然而,在离散化的矩形仿真网格上,通过伴随变量法计算用户目标函数的梯度需要对前向/伴随场解以及仿真材料分布对结构形状参数的雅可比矩阵进行求和归约。这些形状参数通常会扰动仿真网格的大范围或全局部分,导致大量非零雅可比矩阵元素,实践中这些元素通常通过有限差分法计算。因此,梯度计算可能较为复杂。本文提出在结构材料分布的实例化过程中引入自动微分(AutoDiff)来加速梯度计算。为此,我们开发了从形状参数到形状基元的可扩展可微映射以及可微有效逻辑运算(记为AutoDiffGeo)。这些AutoDiffGeo定义可能会在场解中引入额外的离散化误差,因为它们放松了沿形状边界的亚像素平滑概念。然而,我们表明某些映射(例如简单立方体)相对于体积平均策略可以实现零误差。我们通过三个集成光子学示例演示了AutoDiff增强的形状优化:多刻蚀闪耀光栅耦合器、非绝热波导过渡锥度以及偏振分束光栅耦合器。我们发现AutoDiff相对于有限差分法的梯度计算加速比常超过50倍,在相同硬件上总运行时间加速比达4倍或以上,且对最终器件性能几乎没有影响。我们的代码已在https://github.com/smhooten/emopt 开源。