This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Unifying and accelerating level-set and density-based topology optimization by subpixel-smoothed projection

Alec M. Hammond    \authormark1* Ardavan Oskooi    \authormark1 Ian M. Hammond    \authormark2 Mo Chen    \authormark3 Stephen E. Ralph    \authormark4 and Steven G. Johnson\authormark4 1Meta, 1 Hacker Way, Menlo Park, CA 94025, USA
2Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, Cambridge, MA 02139, USA
3Department of Mathematics, Massachusetts Institute of Technology, Cambridge, MA 02139, USA
4School of Electrical and Computer Engineering, Georgia Institute of Technology, Atlanta, GA 30308, USA
\authormark*alec.m.hammond@gmail.com
Abstract

We introduce a new “subpixel-smoothed projection” (SSP) formulation for differentiable binarization in topology optimization (TopOpt) as a drop-in replacement for previous projection schemes, which suffer from non-differentiability and/or slow convergence as binarization improves. Our new algorithm overcomes these limitations by depending on both the underlying filtered design field and its spatial gradient, instead of the filtered design field alone. We can now smoothly transition between density-based TopOpt (in which topology can easily change during optimization) and a level-set method (in which shapes evolve in an almost-everywhere binarized structure). We demonstrate the effectiveness of our method on several photonics inverse-design problems and for a variety of computational methods (finite-difference, Fourier-modal, and finite-element methods). SSP exhibits both faster convergence and greater simplicity.

journal: oe

1 Introduction

Photonics topology optimization (TopOpt) is a form of “inverse design” [1] in which freeform arrangements of materials are evolved to maximize a given design objective (e.g. transmitted power), with millions of degrees of freedom (DOFs) that can be used to explore nearly arbitrary geometries, including arbitrary topologies (e.g. how many “holes” are present). TopOpt algorithms are divided into an unfortunate dichotomy, however: there are level-set set methods [2] that can exactly describe discontinuous “binary” materials (e.g. silicon in some regions and air in others) but make it more difficult for optimization to change the topology [3]; versus density-based methods [3, 4] that allow the topology to change by smoothly evolving one material to another, but which become more and more difficult to optimize as the structure is “binarized” to be everywhere one material or another. The key difficulty centers around the computation of derivatives: in order to optimize efficiently over many parameters, the design objective must be differentiable with respect to the DOFs, and the derivatives must be well behaved, e.g. lacking sharp “kinks” where the second derivative (Hessian matrix) is suddenly huge in some directions (such an “ill-conditioned” Hessian slows optimization convergence [5, 6]). In density-based methods, binarization involves a “projection” step in which the material is projected towards one extreme or an other, controlled by a steepness hyper-parameter β\beta, but the projection becomes more ill-conditioned as β\beta increases and the structure becomes more binary (more physical). In this paper, we develop a new form of projection that allows us to bridge the gap between density-based and level-set methods: we employ density DOFs ρ\rho that can smoothly describe changes in topology, but our new projection scheme also allows us to increase β\beta to \infty (equivalent to a level set) while retaining well-behaved derivatives.

In a level-set method, the DOFs are a level-set function ϕ(x)\phi(\vec{x}) which denotes one material (e.g. silicon) when ϕ<0\phi<0 and another material (e.g. air) when ϕ>0\phi>0; unfortunately, when the topology changes (e.g. two boundaries intersect or a new hole appears), differentiation with respect to ϕ\phi requires complicated “topological derivative” algorithms [3] that can be onerous to implement, so in practice a level-set implementation may be restricted to the initially chosen topology (which is also known as “shape optimization” with a fixed topology [3]). In density-based TopOpt (reviewed in Sec. 2), the DOFs are a density function ρ(x)\rho(\vec{x}) for which ρ=0\rho=0 represents one material, ρ=1\rho=1 represents another material, and intermediate 0<ρ<10<\rho<1 values represent unphysical “interpolated” materials (e.g. interpolating the refractive index) [7]. This makes the physical solution easy to differentiate with respect to ρ\rho and allows the topology to continuously change (e.g. a new “hole” can appear as ρ\rho goes smoothly from 1 to 0 in some region), but optimization may lead to unphysical designs in which many intermediate materials are present. To combat this, and also to regularize the problem by introducing a minimum lengthscale, density-based methods introduce two additional density fields [8, 9, 10, 11, 12] (Fig. 1a–c): a smoothed ρ~\tilde{\rho} given by the convolution of ρ\rho with a minimum-lengthscale low-pass filter, followed by a projection ρ^\hat{\rho} that passes ρ~\tilde{\rho} through a step function to binarize it to either 0 or 11. A step function is not differentiable, however, so in practice the projection step uses a smoothed “sigmoid” function characterized by a steepness parameter β\beta, as shown in the top row of Fig. 2. As β\beta increases towards \infty, the structure becomes more binarized, at the cost of slower optimization convergence because the derivative approaches zero everywhere except at the step where it diverges (and its second derivative becomes ill-conditioned). Managing this tradeoff requires cumbersome empirical tuning of the rate at which the hyper-parameter β\beta is increased during optimization, in order to obtain a mostly binarized structure with good performance in a reasonable time.

Refer to caption
Figure 1: Schematic of “three-field” approach to density-based topology optimization: (a) an initial density field ρ\rho (here for the waveguide-crossing problem of Fig. 6) is (b) low-pass filtered to a smoothed/grayscale density ρ~\tilde{\rho} and then (c) projected to a binarized density ρ^\hat{\rho} with steepness hyper-parameter β\beta, which represents the physical material arrangement. Step (c) is not differentiable for a step-function (β=\beta=\infty) projection, but could theoretically be made differentiable by smoothing the edges at infinite spatial resolution to obtain (d) ρ~^\hat{\tilde{\rho}}, indicated by the dashed “not practical” arrow. Our new algorithm obtains (d) ρ~^\hat{\tilde{\rho}} directly from (b) ρ~\tilde{\rho}. The result ρ~^\hat{\tilde{\rho}} is almost-everywhere binary except for a thin “subpixel” boundary layer (e) within the grid resolution Δx\sim\Delta x of the interface. This layer allows it to have a finite gradient (f) (nonzero only near boundaries) with respect to the density ρ\rho (a).

To overcome this challenge, we present a new density projection (ρ~^\hat{\tilde{\rho}}), “subpixel-smoothed projection” (SSP), which supports a seamless transition from density-based to level-set optimization. Our approach offers a drop-in replacement for existing projection functions, and allows designers to leverage all their existing topology-optimization tooling—the only implementation difference is that our ρ~^(𝐱)\hat{\tilde{\rho}}(\mathbf{x}) depends on both ρ~\tilde{\rho} and ρ~\|\nabla\tilde{\rho}\| at 𝐱\mathbf{x}, rather than just on ρ~\tilde{\rho} as for the old ρ^\hat{\rho}. Let the computational mesh spacing/resolution be of order Δx\Delta x. Conceptually, SSP as if the filtered density ρ~\tilde{\rho} were first interpolated and projected to yield the conventional ρ^\hat{\rho} at “infinite” resolution (regardless of Δx\Delta x), which is then convolved with a Δx\Delta x-diameter smoothing filter to yield a density ρ~^\hat{\tilde{\rho}} (depicted in Fig. 2 and Fig. 1d–e) that is binary almost everywhere (for β=\beta=\infty) as the mesh resolution increases (Δx0\Delta x\to 0), but which changes differentiably as ρ\rho changes. As depicted in Fig. 1, we make this conceptual algorithm practical by instead computing ρ~^\hat{\tilde{\rho}} directly from the filtered density ρ~\tilde{\rho}, with the “infinite-resolution smoothing” performed analytically via a planar/linear approximation of the ρ~=0.5\tilde{\rho}=0.5 level set. In particular, Sec. 3 proposes an efficient algorithm, compatible with any dimensionality, that yields a mostly twice-differentiable pointwise function ρ~^(ρ~,ρ~)\hat{\tilde{\rho}}(\tilde{\rho},\|\nabla\tilde{\rho}\|), except at changes in topology where it reduces to ρ^\hat{\rho} (Sec. 3.1). We demonstrate the flexibility of SSP by applying it in Sec. 4 to various TopOpt problems with three different Maxwell solvers: finite-difference time domain (FDTD) [13], a Fourier modal method (FMM) [14], and a finite-element method (FEM) [15]; the same approach is also directly applicable to non-photonics TopOpt problems (Sec. 5). Several test problems are taken from our recently published photonics-testbed suite [16], and SSP results in final designs comparable to traditional TopOpt, but with faster convergence at large β\beta and more rapid β\beta increases. We also show how SSP can be applied to both topology optimization (by incrementing the projection steepness β\beta in a few steps to β=\beta=\infty) as well as to shape optimization (in which the binary design is optimized for a fixed topology with β=\beta=\infty, which is now differentiable (for a fixed topology). We demonstrate that SSP’s better-conditioned formulation of the projection problem can require fewer optimization iterations at large β\beta than the conventional density-projection scheme. By eliminating the density/level-set dichotomy, we believe that SSP should not only improve performance and simplicity—β\beta can be increased to \infty as soon as the topology stabilizes, without sacrificing convergence rate—but may additionally lead to improvements in other aspects of topology optimization, such as techniques for imposing lengthscale constraints or more accurate discretization schemes (Sec. 5).

Refer to caption
Figure 2: Top row: traditional projection ρ^(ρ~)\hat{\rho}(\tilde{\rho}) (of a smoothed quarter-circle) with different steepness parameters β\beta. As β\beta increases, ρ^\hat{\rho} becomes more binary, but is not differentiable (not optimizable) at β=\beta=\infty and is “stiff” (large second derivatives in some directions) for large β\beta (leading to slow optimization in Fig. 5). Bottom row: new smoothed-projection ρ~^\hat{\tilde{\rho}} depends on both ρ~\tilde{\rho} and ρ~\|\nabla\tilde{\rho}\| at each point, is almost-everywhere binary for β=\beta=\infty (except in a 1-pixel layer) while remaining differentiable and non-stiff (bounded second derivatives and fast optimization convergence in Fig. 5) for arbitrarily large (even infinite) β\beta.

2 Review of density-based topology optimization

Conceptually, density-based topology optimization maps some array of density values to a real-space grid that is discretized in some fashion (e.g. finite differences, finite elements). Each pixel within this array is then continuously optimized by interpolating between two or more constituent materials. To ensure the final design is binary (and thus, physically realizable), the threshold condition (β\beta) of a nonlinear projection function is gradually increased. The canonical optimization problem explored throughout this work corresponds to a frequency-domain, differentiable maximization problem over a single figure of merit (FOM) f(𝐄)f(\mathbf{E}):

max𝝆,tFOM(ρ,𝐄1,,𝐄n)s.t.×1μ0μr×𝐄nωn2ϵ0ϵr(ρ)𝐄n=iωn𝐉nn{1,2,,N}0𝝆1,\begin{matrix}&\max_{\boldsymbol{\rho},t}\mathrm{FOM}(\rho,\mathbf{E}_{1},\ldots,\mathbf{E}_{n})&\\ \ s.t.&\nabla\times\frac{1}{\mu_{0}\mu_{r}}\nabla\times\mathbf{E}_{n}-\omega_{n}^{2}\epsilon_{0}\epsilon_{r}(\rho)\mathbf{E}_{n}=\ -i\omega_{n}\mathbf{J}_{n}&n\in\left\{1,2,\dots,N\right\}\\ &0\leq\boldsymbol{\rho}\leq 1&\ \\ \ \end{matrix}\,, (1)

where ρ\rho is the spatially varying material “density” (parameterized by the design degrees of freedom or “DOFs” 𝝆\boldsymbol{\rho}), 𝐄n\mathbf{E}_{n} is the time-harmonic electric-field solution at frequency ωn\omega_{n}, ϵr\mathbf{\epsilon}_{r} is the relative permittivity as a function of the density ρ\rho at each point in space, and 𝐉n\mathbf{J}_{n} is the time-harmonic current density (the source term). While we solve problems constrained by Maxwell’s equations throughout this paper, we emphasize that our new smoothed-projection approach is agnostic to the underlying physics and applicable to any TopOpt problem. Adjoint methods (also known as “backpropagation” or “reverse-mode” differentiation) allow one to compute the gradient of any FOM with respect to all DOFs using just two Maxwell solves (the “forward” and “adjoint” problems) [1, 4].

As discussed earlier, to map the “latent” design variables (ρ\rho) to the permittivity profile (ε\varepsilon), one first filters the design variables such that

ρ~=k~(𝐱)ρ,{\tilde{\rho}}=\tilde{k}(\mathbf{x})*\rho, (2)

where ρ~\tilde{\rho} is the filtered design field, k~\tilde{k} is the filter kernel, and * is a problem-dependent multidimensional convolution [8, 12]. The filter radius R~\tilde{R} (or bandwidth 1/R~\sim 1/\tilde{R}) is typically determined by the minimum desired lengthscale in the design, and is much larger than the underlying grid/mesh spacing Δx\Delta x—this regularizes the optimization problem to ensure convergence with resolution and is also related to enforcement of fabrication constraints [11, 17]. Alternatively, one can omit an explicit filtering step by representing the degrees of freedom directly in terms of ρ~\tilde{\rho}, represented by some smooth/band-limited basis/parameterization [18, 19, 20].

Next, the filtered design variables are projected onto a nearly binary density field, ρ^\hat{\rho}, using the sigmoid projection function, Pβ,η(ρ~)P_{\beta,\eta}(\mathbf{\tilde{\rho}}):

ρ^=Pβ,η(ρ~)=tanh(βη)+tanh(β(ρ~η))tanh(βη)+tanh(β(1η)),\hat{\rho}=P_{\beta,\eta}(\tilde{\rho})=\frac{\rm tanh\left(\beta\eta\right)+\rm tanh\left(\beta\left(\mathbf{{\tilde{\rho}}}-\eta\right)\right)}{\rm tanh\left(\beta\eta\right)+\rm tanh\left(\beta\left(1-\eta\right)\right)}, (3)

where β\beta controls the strength of the binarization (β\beta\to\infty corresponds to a Heaviside step function of ρ~η\tilde{\rho}-\eta, while β0+\beta\to 0^{+} gives the identity mapping ρ^ρ~\hat{\rho}\to\tilde{\rho}) and η\eta describes the location of the threshold point (the level set ρ~=η\tilde{\rho}=\eta). Finally, these projected densities are linearly interpolated between two (possibly anisotropic) material tensors ε𝟎\mathbf{\varepsilon_{0}} and ε𝟏\mathbf{\varepsilon_{1}} at each point 𝐱\mathbf{x}, most commonly via

ε(ρ^(𝐱))=ρ^(𝐱)ε𝟎+(1ρ^(𝐱))ε𝟏.\varepsilon(\hat{\rho}(\mathbf{x}))=\hat{\rho}(\mathbf{x})\mathbf{\varepsilon_{0}}+(1-\hat{\rho}(\mathbf{x}))\mathbf{\varepsilon_{1}}. (4)

Such linear interpolation between two materials works well if the materials are both non-metallic (positive ε\varepsilon). Different interpolation techniques are employed when optimizing with metals to avoid nonphysical zero crossings in the interpolated ε\varepsilon [21], and more generally any differentiable pointwise mapping from ρ^\hat{\rho} to the material properties could be employed.

Optimization typically proceeds as follows: (i) the design is initialized with some guess (e.g. a uniform “gray” region ρ=0.5\rho=0.5) and a relatively low value for β\beta; (ii) an optimization algorithm iteratively updates this design according to the value of the FOM and its gradient at each step; (iii) once optimization is sufficiently converged, β\beta is increased and the optimization algorithm is restarted using the best performing topology from the previous “epoch”. This process is repeated until the final design is acceptably binary and the performance meets the desired specifications. This “β\beta-scheduling” procedure is highly problem dependent, requiring significant effort and experience-gained heuristics to avoid slow convergence. If one increases β\beta too rapidly, then the optimization problem quickly becomes stiffer and stiffer, slowing down the overall convergence. Conversely, if one evolves β\beta too slowly, then finding a high-performing binary design is also computationally expensive because of the large number of optimization epochs.

Importantly, when differentiating through the physics of the problem, one first computes the gradient with respect to ρ^\hat{\rho} (which directly determines the physical parameters), rather than 𝝆\boldsymbol{\rho} (the design variables). As such, one must use the chain rule (“backpropagation”) to compute the gradient with respect to 𝝆\boldsymbol{\rho}, which is needed by the optimization algorithm. Consequently, the step-function projection is a problem: the resulting gradient approaches zero almost everywhere as β\beta\to\infty (and becomes non-differentiable at the step itself). In other words, standard density-based TopOpt methodologies cannot produce useful gradients for purely binary designs. The amount of binarization is directly related to the value of β\beta, but the designer must avoid making this value too large (regardless of the underlying schedule); at the final step, if β\beta is sufficiently large, the structure can hopefully be “rounded” to the closest binary structure without greatly degrading performance. In contrast, level-set methods avoid this issue by establishing sophisticated methods to differentiate with respect to an interface, which becomes especially cumbersome when the topology changes (e.g. when interfaces cross). By introducing subpixel smoothing into the density-based formulation, we will remove the non-differentiable discontinuity induced by the projection function and allow the designer to arbitrarily specify β\beta.

3 Efficient subpixel-smoothed projection

As β\beta\to\infty, ρ^\hat{\rho} becomes a discontinuous function of ρ~\tilde{\rho}, and even for large finite β\beta one encounters ill-conditioning problems due to the exponentially large second derivatives. These issues are closely related to the fact that ρ^\hat{\rho} is a discontinuous function of space 𝐱\mathbf{x}: as ρ~\tilde{\rho} changes, the location of the level set ρ~=η\tilde{\rho}=\eta changes smoothly (except at changes in topology), but the discontinuity of ρ^\hat{\rho} in space means that this smooth interface motion translates to a discontinuous dependence ρ^(ρ~(𝐱))\hat{\rho}(\tilde{\rho}(\mathbf{x})) at any given 𝐱\mathbf{x}. However, if we could smooth the discontinuities in space—but only near the interfaces so that the projection remains mostly binary—then ρ^\hat{\rho} would become a differentiable function of ρ~(𝐱)\tilde{\rho}(\mathbf{x}) due to the smooth interface motion (except at topology changes, discussed in Sec. 3.1), even for β=\beta=\infty. This strategy corresponds conceptually to a post-projection smoothing, but in practice must be implemented in conjunction with projection as explained below.

That is, we could conceptually remove the ρ^\hat{\rho} discontinuity (in space, and hence in ρ~\tilde{\rho}) by convolving ρ^\hat{\rho} with a smoothing kernel, if this convolution could somehow be evaluated at infinite spatial resolution, as depicted by the dashed “not practical” arrow in Fig. 1. That is, imagine that we could evaluate the exact convolution (*) over the computational domain Ω\Omega:

ρ~^(𝐱)=kρ^=Ωk^(𝐱𝐱)ρ^(𝐱)dΩ,\hat{\tilde{\rho}}(\mathbf{x})=k*\hat{\rho}=\int_{\Omega}\hat{k}(\mathbf{x}-\mathbf{x}^{\prime})\hat{\rho}(\mathbf{x}^{\prime})\mathop{}\!\mathrm{d}\Omega^{\prime}\,, (5)

where k^(𝐱)0\hat{k}(\mathbf{x})\geq 0 is a localized (radius-R^\hat{R}) smoothing kernel, with kdΩ=1\int k\mathop{}\!\mathrm{d}\Omega=1 and k^=0\hat{k}=0 for 𝐱>R^\|\mathbf{x}\|>\hat{R}, and where the support diameter 2R^Δx2\hat{R}\gtrsim\Delta x is proportional to the spacing/resolution Δx\Delta x of our computational grid or mesh (below, we chose R^=0.55Δx\hat{R}=0.55\Delta x to make it slightly larger than a voxel). (Because ρ~^\hat{\tilde{\rho}} will be sampled onto a computational grid or mesh, or at quadrature points in a finite-element method [15], we want 2R^2\hat{R} to be slightly greater than the maximum sample spacing Δx\Delta x to avoid “frozen” gradients where the derivative is zero at all sampled 𝐱\mathbf{x}.) If we could do this, then ρ~^\hat{\tilde{\rho}} would have two desirable properties: (i) it would remain 0 or 11 as β\beta\to\infty except in a radius-R^\hat{R} (“subpixel”) neighborhood of interfaces (i.e. binary almost everywhere as the computational resolution increases: Δx0\Delta x\to 0); and (ii) if k^\hat{k} is sufficiently smooth, then ρ~^\hat{\tilde{\rho}} will be a differentiable function of 𝐱\mathbf{x} and also of the underlying ρ\rho even for β\beta\to\infty (as long as the position of the ρ~=η\tilde{\rho}=\eta level set changes smoothly with ρ\rho). The challenge is to make the computation of such a ρ~^\hat{\tilde{\rho}} practical and efficient.

Refer to caption
Figure 3: Schematic of proposed subpixel smoothing routine, shown here in the β\beta\to\infty limit (step-function projection ρ^\hat{\rho}). A simulation algorithm discretizes the geometry on some grid or mesh with spacing Δx\sim\Delta x (a). At a particular grid point 𝐱\mathbf{x}, a smoothing sphere is chosen with diameter 2R^Δx2\hat{R}\gtrsim\Delta x (b). In a small region, the interface is approximately planar (ρ~\perp\nabla\tilde{\rho}), at a distance dd from 𝐱\mathbf{x}. Conceptually, a subpixel-smoothed ρ~\tilde{\rho} is constructed by convolving ρ^\hat{\rho} with some smoothing kernel of radius R^\hat{R}, resulting in an almost-every binary discretized structure (c) (ρ~^{0,1}\hat{\tilde{\rho}}\in\{0,1\} for dR^d\geq\hat{R}). To make this practical and differentiable, we compute ρ~^\hat{\tilde{\rho}} from ρ~\tilde{\rho} instead of from ρ^\hat{\rho}.

The key fact is that the underlying filtered field ρ~\tilde{\rho} is, by construction, smooth and slowly varying (on the scale of the filter radius R~R^Δx/2\tilde{R}\gg\hat{R}\sim\Delta x/2), which allows us to smoothly interpolate it to any point 𝐱\mathbf{x} in space—thus implicitly defining ρ^(𝐱)=Pβ,η(ρ~(𝐱))\hat{\rho}(\mathbf{x})=P_{\beta,\eta}(\tilde{\rho}(\mathbf{x})) at infinite resolution—and furthermore it implies that ρ~\tilde{\rho} can normally be linearized in a small neighborhood 𝐱𝐱R^R~\|\mathbf{x}^{\prime}-\mathbf{x}\|\leq\hat{R}\ll\tilde{R}:

ρ~(𝐱)ρ~(𝐱)+ρ~|𝐱(𝐱𝐱).\tilde{\rho}(\mathbf{x}^{\prime})\approx\tilde{\rho}(\mathbf{x})+\left.\nabla\tilde{\rho}\right|_{\mathbf{x}}\cdot(\mathbf{x}^{\prime}-\mathbf{x})\,. (6)

This allows us to vastly simplify the smoothing computation of ρ~^\hat{\tilde{\rho}} as explained below, and will ultimately allow us to completely replace the integral (5) with a simple local function of ρ~\tilde{\rho} and ρ~\|\nabla\tilde{\rho}\|. Moreover, in the linearized approximation, the signed distance dd from any point 𝐱\mathbf{x} to the (approximately planar) ρ~=η\tilde{\rho}=\eta level set (i.e., the ρ^\hat{\rho} discontinuity at β=\beta=\infty) is simply:

d=ηρ~(𝐱)ρ~|𝐱,d=\frac{\eta-\tilde{\rho}(\mathbf{x})}{\left\|\left.\nabla\tilde{\rho}\right|_{\mathbf{x}}\right\|}\,, (7)

as depicted in Fig. 3. Note that we define d>0d>0 or d<0d<0 for ρ~\tilde{\rho} below or above η\eta, corresponding to ρ^(𝐱)=0\hat{\rho}(\mathbf{x})=0 or 11 for β\beta\to\infty, respectively. (For cases where optimization causes two interfaces to meet, changing the topology of the level set, the effect of this linearization is discussed in Sec. 3.1.)

The next step is to choose the smoothing kernel to be rotationally symmetric k^(𝐱)=k^(𝐱)\hat{k}(\mathbf{x})=\hat{k}(\|\mathbf{x}\|), and to rewrite the convolution (5) in spherical coordinates. (Henceforth, we will always view the convolution as being performed in 3d: even if the underlying problem is 1d or 2d, we will treat it as conceptually “extruded” into 3d, e.g. a 2d ρ(x1,x2)\rho(x_{1},x_{2}) is treated as a 3d x3x_{3}-invariant function.) In particular, we center the spherical coordinates at 𝐱\mathbf{x}, where the “zz” axis (θ=0\theta=0, zx3z\neq x_{3}) is oriented in the ρ~\nabla\tilde{\rho} direction, and approximate the integral (5) in terms of the linearized ρ~\tilde{\rho} from Eq. (6):

ρ~^(𝐱)2π0π0k^(r)Pβ,η(ρ~(𝐱)+ρ~rcosθ)r2sin(θ)drdθ.\hat{\tilde{\rho}}(\mathbf{x})\approx 2\pi\int_{0}^{\pi}\int_{0}^{\infty}\hat{k}(r)P_{\beta,\eta}(\tilde{\rho}(\mathbf{x})+\|\nabla\tilde{\rho}\|r\cos\theta)\,r^{2}\sin(\theta)\mathop{}\!\mathrm{d}r\mathop{}\!\mathrm{d}\theta\,. (8)

In principle, Eq. (8) is already computationally tractable: at each point 𝐱\mathbf{x} in our grid/mesh where we want to compute ρ~^\hat{\tilde{\rho}}, we evaluate ρ~\tilde{\rho} and ρ~\nabla\tilde{\rho}, and then apply a numerical-quadrature routine to evaluate the integral. This is especially cheap for β\beta\to\infty because the integral is simply 11 or 0 except for points 𝐱\mathbf{x} where |d|<R^|d|<\hat{R}, so quadrature need only be employed at a small set of points near the interface. However, we can make further efficiency gains by the choice of kernel k^\hat{k} and other approximations described below.

First, consider the limit β\beta\to\infty, for which P,ηP_{\infty,\eta} is a Heaviside step function. Suppose that the point 𝐱\mathbf{x} is within |d|<R^|d|<\hat{R} of the ρ^\hat{\rho} interface, and is on the ρ^=0\hat{\rho}=0 side (d0d\geq 0) as in Fig. 3. In this case, the integral (8) simplifies even further to a function F(d)F(d) that depends on dd alone:

F(d)=2π0π/2dsecθk^(r)r2sin(θ)drρ^=1 regiondθ.F(d)=2\pi\int_{0}^{\pi/2}\underbrace{\int_{d\sec\theta}^{\infty}\hat{k}(r)\,r^{2}\sin(\theta)\mathop{}\!\mathrm{d}r}_{\hat{\rho}=1\mbox{ region}}\mathop{}\!\mathrm{d}\theta\,. (9)

For any given kernel k^(r)\hat{k}(r), this function F(d)F(d) could be precomputed. If the kernel k^\hat{k} is simply a “top-hat” filter k^(r)=constant\hat{k}(r)=\text{constant} for rR^r\leq\hat{R} and k^(r)=0\hat{k}(r)=0 for r>R^r>\hat{R}, then F(d)F(d) is a “fill factor” of the ρ^=1\hat{\rho}=1 region inside the sphere, and can be computed analytically. For d<0d<0, we let F(d)=1F(d)F(-d)=1-F(d): the fill factor is inverted (equivalent to inverting ρ^1ρ^\hat{\rho}\to 1-\hat{\rho}). However, rather than specifying k^(r)\hat{k}(r) and computing F(d)F(d), it is attractive to instead choose F(d)F(d) and infer k^(r)\hat{k}(r), because F(d)F(d) directly determines the smoothness of ρ~^\hat{\tilde{\rho}} as a function of ρ\rho (recalling that dd is a smooth function of ρ~\tilde{\rho}, which in turn is a smooth function of ρ\rho). The algebraic details are given in Appendix A, where we construct an inexpensive, twice-differentiable, monotonic, piecewise-polynomial choice of FF, denoted as F2(d)F_{2}(d):

F2(d)={121516dR^+58(dR^)3316(dR^)5|d|R^0d>R^1d<R^,F_{2}(d)=\begin{cases}\frac{1}{2}-\frac{15}{16}\frac{d}{\hat{R}}+\frac{5}{8}\left(\frac{d}{\hat{R}}\right)^{3}-\frac{3}{16}\left(\frac{d}{\hat{R}}\right)^{5}&|d|\leq\hat{R}\\ 0&d>\hat{R}\\ 1&d<-\hat{R}\end{cases}\,, (10)

which is continuous with a continuous derivative and second derivative, satisfies F2(d)=1F2(d)F_{2}(-d)=1-F_{2}(d), and turns out to correspond to a parabolic kernel k^2(r)\hat{k}_{2}(r) proportional to 1(r/R^)21-(r/\hat{R})^{2} for rR^r\leq\hat{R}. We also show how to construct an infinitely differentiable FF if desired: see Eq. (25).

Thus, for β\beta\to\infty, this ρ~^\hat{\tilde{\rho}} function is twice differentiable (in dd and hence ρ\rho) by construction (except at changes in topology as discussed in Sec. 3.1), is almost-everywhere binary (in the limit of Δx0\Delta x\to 0), and is notably cheap to compute at any desired point 𝐱\mathbf{x} in space:

  1. 1.

    Given the smooth ρ~\tilde{\rho} function, interpolate it and its gradient to 𝐱\mathbf{x} (e.g. via bilinear interpolation in a gridded finite-difference method),

  2. 2.

    Compute dd by Eq. (7),

  3. 3.

    Compute ρ~^(𝐱)=F(d)\hat{\tilde{\rho}}(\mathbf{x})=F(d) for the chosen FF, e.g. Eq. (10) or (25). This is generalized to Eq. (11) for finite β\beta below.

Each of these steps is differentiable, so backpropagating derivatives to ρ\rho for adjoint differentiation is straightforward. Much like the computation of ρ^\hat{\rho} in standard TopOpt, ρ~^\hat{\tilde{\rho}} is a purely local function of ρ~\tilde{\rho} at each 𝐱\mathbf{x}, with the only difference being that it now depends on both ρ~\tilde{\rho} and ρ~\|\nabla\tilde{\rho}\|. (In a discretized grid/mesh, such local quantities are determined by interpolating adjacent mesh points.) Moreover, even though ρ~^ρ^\hat{\tilde{\rho}}\to\hat{\rho} as Δx0\Delta x\to 0, it remains a well-conditioned function of the ρ~\tilde{\rho} values (it has bounded second derivatives) on any discretized mesh, as discussed in Appendix B.

For finite β\beta, one could fall back to numerical integration of Eq. (8). However, we can greatly speed up the finite-β\beta computation by making two approximations, which still result in a differentiable ρ~^\hat{\tilde{\rho}} that reproduces the convolution (8) above as β\beta\to\infty. First, for points |d|R^|d|\geq\hat{R} far from the level set, we simply omit the smoothing and choose ρ~^(𝐱)=ρ^(𝐱)\hat{\tilde{\rho}}(\mathbf{x})=\hat{\rho}(\mathbf{x}) as in conventional TopOpt: far from an interface, the projection ρ^\hat{\rho} is nearly constant within the smoothing radius R^\hat{R}, so there is not much point in smoothing it further. Second, for points |d|<R^|d|<\hat{R} close to the level set, we employ the β\beta\to\infty fill-fraction function F(d)F(d) as above, with the modification that we average values of ρ^\hat{\rho} evaluated on the two sides of the level set, denoted by ρ^\hat{\rho}_{-} and ρ^+\hat{\rho}_{+} and defined below, instead of averaging 0 and 11. Rather than an approximation for Eq. (8), this can be viewed as simply a new definition of ρ~^\hat{\tilde{\rho}}, namely:

ρ~^(𝐱)={(1F(d))ρ^+F(d)ρ^+,if |d|<R^ρ^(𝐱),otherwise,\hat{\tilde{\rho}}(\mathbf{x})=\begin{cases}(1-F(d))\hat{\rho}_{-}+F(d)\hat{\rho}_{+},&\text{if }|d|<\hat{R}\\ \hat{\rho}(\mathbf{x}),&\text{otherwise},\end{cases} (11)

where ρ^±\hat{\rho}_{\pm} are obtained by projecting the linearized approximation of ρ~\tilde{\rho} at two points along the ρ~\nabla\tilde{\rho} direction (so that they still depend only on ρ~\tilde{\rho} and ρ~\|\nabla\tilde{\rho}\| at 𝐱\mathbf{x}) within R^\hat{R} of 𝐱\mathbf{x}:

ρ^±(𝐱)=Pβ,η(ρ~(𝐱)±R^ρ~F(d)),\hat{\rho}_{\pm}(\mathbf{x})=P_{\beta,\eta}\left(\,\tilde{\rho}(\mathbf{x})\pm\hat{R}\,\|\nabla\tilde{\rho}\|\,F(\mp d)\,\right)\,, (12)

corresponding to two points on either side of the level set separated by a distance R^F(d)+R^F(d)=R^\hat{R}F(-d)+\hat{R}F(d)=\hat{R}. This ρ~^\hat{\tilde{\rho}}, demonstrated in Fig. 4, is constructed to make Eq. (11) monotonic and twice differentiable in dd, and also so that Eq. (11) reduces to ρ~^F(d)\hat{\tilde{\rho}}\to F(d) (as above) in the limit β\beta\to\infty (in which case ρ^0\hat{\rho}_{-}\to 0 and ρ^+1\hat{\rho}_{+}\to 1) as well as to ρ~^ρ~\hat{\tilde{\rho}}\to\tilde{\rho} as β0+\beta\to 0^{+} (no projection), as can be shown via straightforward algebra. In particular, note that Eq. (12) re-uses our function F(d)F(d) purely for convenience, exploiting the fact that FF goes smoothly from 11 at d=R^d=-\hat{R} to 0 at d=R^d=\hat{R} to make Eq. (11) transition smoothly to the ρ^(𝐱)\hat{\rho}(\mathbf{x}) case as d±R^d\to\pm\hat{R}.

Refer to caption
Figure 4: Subpixel-smoothed projections ρ~^(x)\hat{\tilde{\rho}}(x), Eq. (11), applied to an example ρ~(x)=12tanh(x/R~)+12\tilde{\rho}(x)=\frac{1}{2}\tanh(x/\tilde{R})+\frac{1}{2} (dashed black) for R~=10R^\tilde{R}=10\hat{R}, with a threshold η=0.5\eta=0.5, for various steepness parameters β\beta. (ρ~\tilde{\rho} is nearly linear for 4<x/R^<4-4<x/\hat{R}<4, so Eq. (7) gives dxd\approx-x.) The shaded region indicates the smoothing radius R^\hat{R} around the level set ρ~=η\tilde{\rho}=\eta. For β=0+\beta=0^{+} (dashed black), our formula is equivalent to no projection (ρ~^=ρ~\hat{\tilde{\rho}}=\tilde{\rho}), while for β=\beta=\infty (solid green) we obtain our chosen “fill-fraction” curve F(d)F(d); for reference, the step-function projection ρ^\hat{\rho} for β=\beta=\infty is also shown (dashed green). Here, we use F=F2F=F_{2} from Eq. (10), so the ρ~^\hat{\tilde{\rho}} curves are all twice differentiable by construction, despite the fact that the piecewise definitions change at d/R^=±1d/\hat{R}=\pm 1.

Our new subpixel-smoothed projection ρ~^\hat{\tilde{\rho}} (11) is computationally inexpensive while offering two fundamental benefits over traditional projection (3): (i) the ability to optimize even as β\beta\to\infty; and (ii) improved convergence for large finite values of β\beta (because it has a bounded second derivatives regardless of β\beta, from Appendix B, leading to better-conditioned optimization problems [6]). In Sec. 4, we quantify these advantages with numerical experiments, a simple example of which is shown in Fig. 5.

3.1 Differentiating through changes in topology

As the density ρ\rho is optimized, one occasionally encounters situations where the topology (the connectivity and number of holes/islands) of ρ^\hat{\rho} changes (for β=\beta=\infty), for example when the diameter of some ρ^=0\hat{\rho}=0 region goes to zero. In such cases, where two interfaces approach within a separation R^\sim\hat{R}, the linearized ρ~\tilde{\rho} of Eq. (6) is no longer accurate at points adjacent to both interfaces. For example, at a point midway between two interfaces, ρ~\tilde{\rho} will reach a local minimum (or maximum) where ρ~\nabla\tilde{\rho} vanishes, in which case the second derivative of ρ~\tilde{\rho} cannot be neglected, nor can the interface be treated as a single plane. (Correspondingly, dd passes through ±\pm\infty.) What happens to our ρ~^\hat{\tilde{\rho}} formulas in such cases?

If we employ the linearization-based construction of Eq. (11), the behavior near changes in topology is straightforward and relatively benign: it overestimates dd because of the small denominator in Eq. (7), so Eq. (11) reduces to the traditional projection ρ^\hat{\rho}. Thus, SSP’s ability to optimize through changes in topology is no worse than in traditional density-based topology optimization: it is differentiable for finite β\beta. For β\beta\to\infty, with Eq. (11) we can still perform “shape optimization” (fixed topology) as demonstrated in Sec. 4, but a discontinuity occurs for changes in topology. Thus, in order to perform full topology optimization, we still follow the traditional strategy [22, 8, 7] of optimizing over a sequence of increasing β\beta values, except that now we can increase β\beta much more quickly (e.g. β=16,32,\beta=16,32,\infty) as long as the finite-β\beta calculations first obtain the desired topology so that the β=\beta=\infty optimization need only adjust the shape.

Moreover, our formulation offers a future pathway to performing topology optimization directly for β=\beta=\infty as well, without requiring cumbersome topological derivatives. By monitoring the second derivative of ρ~\tilde{\rho} (e.g. using bicubic interpolation), one can determine when the linearization (6) fails, and for those points 𝐱\mathbf{x} one could simply switch to a more complicated smoothing procedure. Since such points, where the topology is changing, will occur over only a tiny subset of the design region, the expense of even a brute-force convolution/quadrature at those points should be negligible. We plan to explore this possibility in subsequent work as discussed in Sec. 5, but for the present even the simplified SSP formulation of Eq. (11) appears to be greatly superior to traditional projection.

Refer to caption
Figure 5: Comparison of the new subpixel-smoothed projection ρ~^\hat{\tilde{\rho}} (orange) to standard projection ρ^\hat{\rho} (blue), for optimizing transmission through a waveguide crossing (inset, Sec. 4.1). (a) Projected densities vs. position in the vicinity of an interface (small red circle, inset): for β=\beta=\infty, standard projection ρ^\hat{\rho} is a discontinuous step function, whereas the new ρ~^\hat{\tilde{\rho}} rises continuously over a 1-pixel (Δx\sim\Delta x) distance. (b) Gradient norm ρFOM\|\nabla_{\rho}\text{FOM}\| of the optimization figure of merit (FOM) as a function of projection steepness β\beta: for ρ^\hat{\rho}, the gradient is (almost everywhere) zero as β\beta\to\infty, preventing optimization from making progress; for the new ρ~^\hat{\tilde{\rho}}, the gradient converges to a nonzero value. (c) Optimization progress (FOM vs. iteration) for the waveguide crossing (Sec. 4.1) with β=32\beta=32: the standard projection converges much more slowly than smoothed projection, because the former is “stiff” (ill-conditioned second derivatives) for large β\beta. (d) Optimization progress for β=\beta=\infty: standard projection makes no progress (due to zero gradients), whereas smoothed projection converges at almost the same rate as (c).

4 Numerical experiments

Here, we present numerical experiments using three different Maxwell discretization techniques to illustrate the flexibility of our new SSP method. First, we design a 2d silicon-photonic crossing using a hybrid time-/frequency-domain adjoint solver [7] compatible with Meep, a free and open-source finite-difference time-domain (FDTD) code (FDTD) [23]. The SSP formula (11) is implemented as a vectorized function in Python, automatically differentiable via the autograd software [24]. We demonstrate that SSP is directly compatible with shape optimization (where an initial design topology is already identified and optimized at β=\beta=\infty) and with freeform topology optimization (at finite β\beta then β=\beta=\infty as discussed in Sec. 3.1) on an example 2d waveguide-crossing [25] design problem. We also show greatly accelerated convergence compared to traditional density projection (3) for a large finite β=32\beta=32.

Next, we illustrated the versatility of SSP by applying it to other problems taken from our photonics-optimization test suite [16], as well as to other computational-electromagnetics methods. We design a 3d diffractive metasurface using FMMAX [26], a differentiable and GPU-accelerated Fourier Modal Method (FMM) code written in Python. We then design a 2d metallic nanoparticle to enhance near-field concentration using a finite-element electromagnetics solver implemented in the Julia software package Gridap [27], demonstrating that the same method is applicable to discretizations employing unstructured meshes.

4.1 FDTD: Integrated Waveguide Crossing

The goal of the silicon photonics waveguide crossing is to maximize transmission from one side to the other while minimizing crosstalk into the orthogonal waveguides. Here, the design region is 3 μ\mum ×\times 3 μ\mum, with ρ\rho discretized at a resolution of 60 pixels/μ\mum, twice the FDTD simulation resolution (30 pixels/μ\mum). An eigenmode source injects the fundamental EzE_{z}-polarized (out-of-plane) mode from the left, and a monitor records the fraction of power leaving the waveguide on the right in this same mode. The amplitude αm±\alpha_{m}^{\pm} of an outgoing mode (power |αm±|2\sim|\alpha_{m}^{\pm}|^{2}) is given by overlap integral [28].

αm±=A[𝐄(r)×𝐇m±(r)+𝐄m±(r)×𝐇(r)]𝐧^dA\alpha_{m}^{\pm}=\int_{A}\left[\mathbf{E}^{*}(r)\times\mathbf{H}_{m}^{\pm}(r)+\mathbf{E}_{m}^{\pm}(r)\times\mathbf{H}^{*}(r)\right]\cdot\mathbf{\hat{n}}\mathop{}\!\mathrm{d}A (13)

for the mthm^{\mathrm{th}} mode for the forward (++) and backward (-) directions, 𝐄(r)\mathbf{E}(r) and 𝐇(r)\mathbf{H}(r) are the Fourier-transformed total (simulated) fields at a particular frequency, 𝐄m±(r)\mathbf{E}_{m}^{\pm}(r) and 𝐇m±(r)\mathbf{H}_{m}^{\pm}(r) are the eigenmode profiles (normalized to unit power) at the same frequency for the forward- (++) and backward- (-) propagating modes, and AA is a waveguide cross-section.

To simplify the optimization problem, we explicitly enforce horizontal, vertical, and C4C^{4}-rotational symmetries using differentiable transformations on the design degrees of freedom before filtering and SSP-projecting them, so that the crossing works well in all four directions. (Separate optimization constraints intended to minimize power in the orthogonal waveguides are not needed because optimization attains nearly 100100% transmission.) The resulting optimization problem is described by

max𝝆|α0+|2P0s.t.×1μ0μr×𝐄ω2ϵ0ϵr(ρ)𝐄=iω𝐉0𝝆1,\begin{matrix}&\max_{\boldsymbol{\rho}}\frac{|\alpha_{0}^{+}|^{2}}{P_{0}}&\\ \ \mathrm{s.t.}&{\nabla\times\frac{1}{\mu_{0}\mu_{r}}\nabla\times\mathbf{E}-\omega^{2}\epsilon_{0}\epsilon_{r}(\rho)\mathbf{E}=\ -i\omega\mathbf{J}}\\ &0\leq\boldsymbol{\rho}\leq 1&\ \\ \ \end{matrix}, (14)

where |α0+|2|\alpha_{0}^{+}|^{2} is the power propagating in the fundamental mode through the output waveguide and normalized by the total input power, P0P_{0}. For these experiments, we optimize at a single wavelength, λ=1.55μ\lambda=1.55\mum (in which case it is known that nearly 100% transmission can be achieved via resonant effects [29]).

First, we design the crossing using density-based topology optimization. A 2d array of density voxels (ρ\rho) is uniformly initialized to 0.5 (gray) before applying the symmetry, filtering, and SSP transformations as described above. We apply the CCSA optimization algorithm [30] implemented within the NLopt library [31] for a sequence β=16,32,\beta=16,32,\infty of β\beta values, for 30 iterations at each β\beta. Fig. 6 shows the geometric and performance evolution of the optimization. As expected, the optimizer produces a strictly binary device that exhibits high transmission from left to right, with a freeform structure entirely different from the initial conditions, exhibiting several disconnected regions. One common phenomenon typical of topology optimization is the sudden drop in performance when the projection parameter changes from β=32\beta=32 to β=\beta=\infty: the resulting change in geometry is so drastic that all the performance gains from the previous iterations are apparently lost. To combat these effects, designers often tune a “schedule” for gradual increase of β\beta, requiring extensive trial and error. In this case, however, gradual increase of β\beta is not needed: the original performance is quickly recovered by shape optimization at β=\beta=\infty, only slightly adjusting the geometry.

Refer to caption
Figure 6: Transmission FOM vs. iteration for optimizing a silicon (ε=12\varepsilon=12) waveguide crossing, using subpixel-smoothed projection and FDTD [23, 7] simulations. (a) Topology optimization by increasing β\beta during optimization (β=16,32,\beta=16,32,\infty) starting with ρ=0.5\rho=0.5 (it. 0 inset). (b) Shape optimization (β=\beta=\infty, fixed topology) starting with a naive crossing (it. 0 inset). Upper insets show sequence of optimized shapes at different iterations (it.), where the DOF are restricted to a triangle (red dashed) to impose four-fold symmetry. Lower insets show entire computational cell (including PML absorbing boundaries) and simulated electric field EzE_{z} (red/blue = postive/negative) for the final structure.

Alternatively, we can start with a reasonable initial condition for the design with a chosen topology, and simply optimize that directly via shape optimization at β=\beta=\infty. SSP allows us to use the same machinery as before, but set β=\beta=\infty from the beginning. In this case the structure was initialized to a “naive” waveguide crossing consisting of a binary cross shape (it. 0 in Fig. 6). We ran the optimizer for 60 iterations. Fig. 6 illustrates the geometric and performance evolution of this shape optimization. The resulting structure exhibits performance comparable to that of the topology optimized structure, but the design itself more closely resembles the naive crossing—as expected, the topology of the structure remains unchanged (no new holes or islands). As such, techniques like this are best applied when an intelligent starting guess is already known.

4.2 FMM: Metasurface Diffraction Grating

We now describe the optimization of a 3d metasurface diffraction grating, similar to a number of prior studies [32, 33, 34, 35, 36], with the specific parameters taken from our optimization test suite [16] and implemented in the invrs-io gym [37]. The grating consists of a single silicon layer (n=3.45n=3.45) resting on a silica substrate (n=1.45n=1.45), and is designed to deflect normally-incident, linearly pp-polarized (Ex,HyE_{x},H_{y}) light in air (n=1n=1) to the +1 diffraction order (θ=50\theta=50^{\circ}). The wavelength used is 1050 nm and the thickness of the silicon layer is 325 nm. The grating is periodic in the xx and yy directions, with a reflection symmetry in the yy- direction; the unit cell is 1370 nm ×\times 525 nm.

We simulated the grating using FMMAX [26], a free and open-source implementation of the Fourier modal method (FMM, also known as rigorous coupled wave analysis, RCWA) written in jax [38], which is both GPU-accelerated and differentiable.

The figure of merit for this problem is the diffraction efficiency: the fraction of the incident power deflected into the desired diffraction order. The resulting optimization problem is described by

max𝝆|α1+|2P0s.t.×1μ0μr×𝐄ω2ϵ0ϵr(ρ)𝐄=iω𝐉0𝝆1,\begin{matrix}&\max_{\boldsymbol{\rho}}\frac{|\alpha_{1}^{+}|^{2}}{P_{0}}&\\ \ \mathrm{s.t.}&{\nabla\times\frac{1}{\mu_{0}\mu_{r}}\nabla\times\mathbf{E}-\omega^{2}\epsilon_{0}\epsilon_{r}(\rho)\mathbf{E}=\ -i\omega\mathbf{J}}&0\leq\boldsymbol{\rho}\leq 1&\ \\ \ \end{matrix}, (15)

where α1+\alpha_{1}^{+} corresponds to the mode amplitude [similar to Eq. (13)] of the pp-polarized (HyH_{y}) +1+1 diffraction order, and P0P_{0} is the total injected power from the normally incident planewave.

As with the waveguide crossing above, we first optimized the structure using topology optimization. We ran the optimization for 30 iterations per β\beta, with β=8,16,\beta=8,16,\infty. We initialized the structure with uniform random ρ[0,1]\rho\in[0,1] values at each pixel, and dimensions of 472×\times180 pixels, projected to mirror symmetry in yy (i.e., effectively only 90 pixels are free parameters in that direction). Fig. 7(a) shows the geometric and performance evolution of the diffractive metasurface designed using topology optimization. The final structure yields a diffraction efficiency of 95.4%, which is within 2% of the highest performing devices previously reported for this problem [32, 33, 34, 16], with a fully binary design whose topology was determined by optimization. As discussed in Ref. 16, this problem has many local optima, depending on the initial ρ\rho, but most random starting points converge to a performance >90>90%.

Refer to caption
Figure 7: Optimization of a 3d metagrating (insets) maximize transmission of a normal-incident planewave (from below) into the first diffracted order [16], starting from random structures, using subpixel-smoothed projection and Fourier modal method (FMM) [14] simulations. (a) Topology optimization, using β=16,32,\beta=16,32,\infty, halted at 90 iterations with performance 93.293.2%. (b) Shape optimization (β=\beta=\infty); halted at 60 iterations with final best performance 95.495.4% (from iteration 57), similar to previous work [32, 33, 34, 16].

Next, we performed shape optimization, using the same initial ρ\rho, but now projected to a random binary ρ~^\hat{\tilde{\rho}} via β=\beta=\infty from the beginning. We ran the optimization for 60 iterations at β=\beta=\infty. Fig. 7(b) shows the geometric and performance evolution. The final structure yields a diffraction efficiency of 93.2%, which is close to that of the topology optimization result, but represents a different local optimum. Shape optimization is more restricted by the topology of the initial guess, although we find it does occasionally change the topology (despite the lack of differentiability at these transitions): some small “island” structures disappear, though new islands do not nucleate.

4.3 FEM: Near-field Focusing

Finally, we tested the near-field focusing design problem from Ref. 16, where the objective is to design a metallic structure which enhances the incidence of scattering, such that it focuses onto a molecule (located in the center of the structure), inspired by related problems in plasmonic-resonance design [39]. Monochromatic light at 532 nm and polarized in the plane (i.e., HzH_{z}) is incident upon a silver (n=0.054+3.429in=0.054+3.429i), 2d device that utilizes combined plasmonic and spatial resonances, with the metal constrained to lie within an annulus (a disc with a hole), to enhance the field at the center. The figure of merit for this problem is to maximize the light intensity at the molecule, and the resulting optimization problem is described by

max𝝆|𝑬(𝒙0)|2|𝑬(0)(𝒙0)|2|𝑬|2=|Hz|2s.t.[1ε(ρ)k2μ0μr]Hz(𝒙)=f(𝒙)0𝝆1,\begin{matrix}&\max_{\boldsymbol{\rho}}\frac{|\boldsymbol{E}(\boldsymbol{x}_{0})|^{2}}{|\boldsymbol{E}^{(0)}(\boldsymbol{x}_{0})|^{2}}&|\boldsymbol{E}|^{2}=|\nabla H_{z}|^{2}&\\ \ \mathrm{s.t.}&{\left[-\nabla\cdot\frac{1}{\varepsilon(\rho)}\nabla-k^{2}\mu_{0}\mu_{r}\right]H_{z}(\boldsymbol{x})=f(\boldsymbol{x}){}}&0\leq\boldsymbol{\rho}\leq 1&\ \\ \ \end{matrix}, (16)

where HzH_{z} is the field measured at the molecule, 𝑬(0)\boldsymbol{E}^{(0)} is the input field (or the field at the molecule in the absence of the metal structure), and f(𝒙)f(\boldsymbol{x}) is the magnetic current density which for this problem is just an incident plane wave 𝑬(0)\boldsymbol{E}^{(0)}.

To simulate this structure, we used Gridap [27], a free/open-source finite-element method (FEM) implementation in Julia. The corresponding weak form for this problem is defined by

a(u,v,p)=Ω[(Λv)1ε(ρ)Λuk2uv]dΩ,a(u,v,p)=\int_{\Omega}\left[\nabla(\Lambda v)\cdot\frac{1}{\varepsilon(\rho)}\Lambda\nabla u-k^{2}uv\right]\mathop{}\!\mathrm{d}\Omega, (17)

where uu and vv are first-order Lagrangian basis functions, k^\hat{k} is the normalized wavenumber, and Λ\Lambda is a perfectly matched layer (PML) operator [13]. A triangular mesh at a resolution of 1 nm was generated to discretize the fields over the design domain, with outer radius 100100 nm. Although one could discretize ρ\rho on the same triangular mesh as the fields, we instead chose to discretize ρ\rho on a Cartesian grid of 532×532532\times 532 pixels for a 200×200200\times 200 nm square enclosing the design region; ρ~\tilde{\rho} is then set to zero (air) outside of the annular design domain. In center of the design region, the material is constrained to be air within a 1010 nm region: this regularizes the problem by prohibiting sharp tips yielding arbitrarily large fields at the focal spot [16]. Outside the design region, the material is also air, with a mesh resolution of 20 nm. We use PML around the boundaries, and the total simulation region was 800 nm by 600 nm. An incident planewave is generated by a line-current source 200 nm above the top boundary.

From integrating the weak form for each pair of basis functions, one constructs a “stiffness” matrix AA [15], which is a function of ε(ρ~^(𝐱))\varepsilon(\hat{\tilde{\rho}}(\mathbf{x})), so the subpixel smoothing occurs within the matrix assembly. The weak form is integrated element-by-element by a quadrature rule within each triangle, a weighted sum over quadrature points [15]. ρ~\tilde{\rho} is bilinearly interpolated from the Cartesian ρ\rho grid, along with its gradient onto each quadrature point, at which point ρ~^\hat{\tilde{\rho}} (SSP) is computed and hence the material ε\varepsilon. Because we are interpolating between air (Reε>0\operatorname{Re}\varepsilon>0) and metal (Reε<0\operatorname{Re}\varepsilon<0), it turns out to be preferable to compute ε=n2\varepsilon=n^{2} by linearly interpolating the complex refractive index nn with weight ρ~^\hat{\tilde{\rho}} [16, 40]. The standard adjoint method for the operator yields the gradient of the objective function with respect to the materials at the quadrature points. It is then straightforward to further backpropagate through the projection, the bilinear interpolation [41], and the filtering steps.

As in the previous sections, we performed density-based topology optimization: we ran the optimization for 100 iterations at each β\beta, for β=8.0,16.0,32.0,\beta=8.0,16.0,32.0,\infty. Fig. 8 illustrates the geometric and the performance evolution. Because surface-plasmon resonances in such nano-metallic structures can be very sensitive to small surface features, we evaluate the final objective value at high resolution, using a conforming contour of the mesh constructed via the marching squares algorithm [42] applied to ρ^\hat{\rho} (not ρ~^\hat{\tilde{\rho}}) with β=\beta=\infty. The results show a slight improvement (g1130g\approx 1130) over the published solution (g1030g\approx 1030[39] in the testbed [16], with a qualitatively similar geometry. This confirms that our smoothed projection is compatible with optimization over FEM discretizations on unstructured meshes, even for metallic/plasmonic structures where the fields are especially sensitive to interfaces.

Refer to caption
Figure 8: Topology optimization of a 2d metallic (Ag) particle to maximize field intensity 𝐄2\|\mathbf{E}\|^{2} at the center of an annular design region (lower-right inset) [16], using subpixel-smoothed projection and a finite-element method (FEM). Figure of merit (focusing strength 𝐄2\|\mathbf{E}\|^{2} relative to incident planewave amplitude 𝐄02\|\mathbf{E}_{0}\|^{2}) vs. iteration while increasing β=8,16,32,\beta=8,16,32,\infty. Resulting FOM and design are similar to previous work [16].

5 Conclusion

We believe that the subpixel-smoothed projection (SSP) scheme introduced in this paper should be widely useful for topology optimization (TO) in many fields—nothing about the construction of our ρ~^\hat{\tilde{\rho}} is specific to electromagnetism. SSP both simplifies and accelerates density-based TO, allowing β\beta to be increased very quickly without concern for ill-conditioning or “frozen” gradients, and at the same time guarantees almost-everywhere binarization of the final structure (without the need for additional penalty terms in problems where the physics might otherwise push ρ~\tilde{\rho} to η\approx\eta in order to counteract finite-β\beta projection [43, 44, 45]). Furthermore, because SSP simply replaces ρ^(ρ~)\hat{\rho}(\tilde{\rho}) with a new function ρ~^(ρ~,ρ~)\hat{\tilde{\rho}}(\tilde{\rho},\nabla\tilde{\rho}), our approach should be easy to “drop in” to existing TO software without extensive modifications, and we have shown that it works well in both uniform-grid (e.g. FDTD and FMM) and unstructured-mesh (FEM) discretizations.

Furthermore, we believe that there are many opportunities for future developments building off of the smoothed-projection ideas presented in this paper. We have already begun to revisit methods to impose fabrication-lengthscale constraints [11, 17], which we believe can be further simplified and refined now that one can simply set β=\beta=\infty to ensure binarization. As mentioned in Sec. 3.1, there is the potential for a more sophisticated smoothed-projection scheme that allows one to differentiate through changes in topology for β=\beta=\infty (instead of requiring β\beta to be increased in a few stages) by relaxing the ρ~\tilde{\rho}-linearization approximation. (Even with the current scheme, we sometimes observe changes in topology at β=\beta=\infty where the optimizer “steps over” the non-differentiability, e.g. to delete a small hole, but this cannot be relied on with algorithms whose convergence proofs assume differentiability.) Another exciting opportunity is to exploit the level-set information in ρ~\tilde{\rho} to improve accuracy of the PDE discretization of the material interfaces—in other work, we’ve shown that one can improve accuracy in electromagnetism using anisotropic smoothing [46, 47], and there has also been other research on high-order discretization schemes exploiting subpixel interface knowledge [48]. In the finite-element context, we are working to both improve accuracy of the matrix assembly (quadrature over the mesh elements) and allow smaller subpixel smoothing radii R^\hat{R}, by adaptively subdividing the mesh in the vicinity of the level set, analogous to methods developed for immersed-boundary FEM techniques [49].

Appendix A: Construction of smoothing kernels

As explained in Sec. 3, for β\beta\to\infty the subpixel-smoothed “fill factor” F(d)F(d) has a particularly simple form (9) that depends only on the distance dd from the current point 𝐱\mathbf{x} to the interface ρ^=η\hat{\rho}=\eta and on the smoothing kernel k^(r)\hat{k}(r). Rather than specifying k^(r)\hat{k}(r) and computing F(d)F(d), it is convenient to proceed in the reverse direction: construct a fill factor F(d)F(d) with the desired properties (symmetry, differentiability, binary outside a compact domain, monotonicity) and infer k^(r)\hat{k}(r). In this Appendix, we derive the straightforward algebraic relationship between F(d)F(d) and k^(r)\hat{k}(r), and propose two possible choices of F(d)F(d).

Differentiating Eq. (9) for F(d)F(d) (with d0d\geq 0) with respect to dd yields:

F(d)=2π0π/2k^(dsecθ)d2sec2(θ)tan(θ)dθ=2πdk^(ξ)ξdξF^{\prime}(d)=-2\pi\int_{0}^{\pi/2}\hat{k}(d\sec\theta)d^{2}\sec^{2}(\theta)\tan(\theta)\mathop{}\!\mathrm{d}\theta=-2\pi\int_{d}^{\infty}\hat{k}(\xi)\xi\mathop{}\!\mathrm{d}\xi\, (18)

where we have let ξ=dsecθ\xi=d\sec\theta, and hence taking a second derivative yields:

F′′(d)=2πk^(d)d.F^{\prime\prime}(d)=2\pi\hat{k}(d)d\,. (19)

Although this F(d)F(d) was initially derived for d0d\geq 0 (i.e. ρ^=0\hat{\rho}=0 at the origin), we can straightforwardly extend it to d<0d<0 by the mirror relation F(d)=1F(d)F(-d)=1-F(d) (which follows from inverting ρ^1ρ^\hat{\rho}\to 1-\hat{\rho} and then re-inverting the result). This also implies that F(0)=1F(0)=12F(0)=1-F(0)=\frac{1}{2}. We also impose the boundary condition F()=0F(\infty)=0, since a localized smoothing kernel must yield zero when the interface is far away, along with F()=1F(-\infty)=1 (when the interface is far in the other direction) and F(±)=0F^{\prime}(\pm\infty)=0. The unit-integral normalization of k^(r)\hat{k}(r) follows automatically from these relations, since we can integrate by parts to obtain:

4π0k^(r)r2dr\displaystyle 4\pi\int_{0}^{\infty}\hat{k}(r)r^{2}\mathop{}\!\mathrm{d}r =20F′′(r)rdr\displaystyle=2\int_{0}^{\infty}F^{\prime\prime}(r)r\mathop{}\!\mathrm{d}r (20)
=2F(r)r|020F(r)dr\displaystyle=\left.2F^{\prime}(r)r\right|_{0}^{\infty}-2\int_{0}^{\infty}F^{\prime}(r)\mathop{}\!\mathrm{d}r (21)
=2F(0)=1.\displaystyle=2F(0)=1\,. (22)

For a compactly supported k^(r)\hat{k}(r) that =0=0 for r>R^r>\hat{R}, it also follows that F(d)=0F(d)=0 for d>R^d>\hat{R} and =1=1 for d<R^d<-\hat{R}. To make ρ~^\hat{\tilde{\rho}} differentiable, it is necessary that F(d)F(d) be differentiable, hence its derivative FF^{\prime} must go to zero at d=±R^d=\pm\hat{R}. Some optimization algorithms may implicitly assume twice differentiability (even if the second derivative is not explicitly supplied) [5, 6], so it is also desirable to have F′′F^{\prime\prime} be continuous (i.e., F′′F^{\prime\prime} should go to zero at d=±R^d=\pm\hat{R}).

The computationally cheapest twice-differentiable F(d)F(d) is probably a piecewise polynomial. The symmetry relation implies that F(d)12F(d)-\frac{1}{2} must be odd (containing only odd powers of dd). The six boundary conditions (on F,F,F′′F,F^{\prime},F^{\prime\prime}) at d=±R^d=\pm\hat{R} reduce to three conditions for an odd function, and hence we must have at least three free coefficients. This means that F(d)F(d) must be at least a degree-5 polynomial, and solving algebraically for the coefficients satisfying the boundary conditions leads to the polynomial function F2F_{2} of Eq. (10), which also turns out to be monotonic. By Eq. (19), the corresponding smoothing kernel is a continuous, concave, quadratic “bump”:

k^2(r)=F2′′(r)2πr=12πR^3{154[1(rR^)2]rR^0r>R^,\hat{k}_{2}(r)=\frac{F_{2}^{\prime\prime}(r)}{2\pi r}=\frac{1}{2\pi\hat{R}^{3}}\begin{cases}\frac{15}{4}\left[1-\left(\frac{r}{\hat{R}}\right)^{2}\right]&r\leq\hat{R}\\ 0&r>\hat{R}\end{cases}\,, (23)

although we do not actually use this k^(r)\hat{k}(r) directly for any calculation.

If one has a high-order PDE discretization or an optimization algorithm that relies on the existence of third or higher derivatives, it might be desirable to have an even smoother F(d)F(d). Rather than going to ever higher degrees of polynomials, it may be convenient for such cases to simply construct an infinitely differentiable (CC^{\infty}) fill factor. For this purpose, we could employ, for example, a well-known CC^{\infty} monotonic “transition function” [50, ch. 2]:

τ(u)={11+exp(1u11u)0<u<10u01u1,\tau(u)=\begin{cases}\frac{1}{1+\exp\left(\frac{1}{u}-\frac{1}{1-u}\right)}&0<u<1\\ 0&u\leq 0\\ 1&u\geq 1\end{cases}\,, (24)

which goes smoothly from τ(0)=0\tau(0)=0 to τ(1)=1\tau(1)=1 (all derivatives vanish at u=0+u=0^{+} and u=1u=1^{-}), satisfying τ(1u)=1τ(u)\tau(1-u)=1-\tau(u). In terms of τ(u)\tau(u), we can then define:

F(d)=τ(12d2R^)F_{\infty}(d)=\tau\left(\frac{1}{2}-\frac{d}{2\hat{R}}\right)\, (25)

for which all derivatives go to zero as d±R^d\to\pm\hat{R}, and it satisfies all of our other conditions on F(d)F(d). (Of course, there are many other choices of CC^{\infty} functions. This particular FF_{\infty} has about twice the slope of our polynomial F2F_{2} at d=0d=0, so to get a similar-looking ρ~^\hat{\tilde{\rho}} one would need to roughly double the smoothing radius R^\hat{R}.)

Appendix B: Resolution-independent second-derivatives

As discussed in the main text, traditional topology optimization employing ρ^\hat{\rho} tends to converge slowly for large finite β\beta because of the exponentially large second derivatives of the projection function Pβ,ηP_{\beta,\eta}, which lead to an ill-conditioned Hessian (second-derivative) matrix for any objective function depending on ρ^\hat{\rho}. At first glance, it may seem that our new ρ~^\hat{\tilde{\rho}} has the same problem at high resolutions (small Δx\Delta x), since by construction we have ρ~^ρ^\hat{\tilde{\rho}}\to\hat{\rho} as Δx0\Delta x\to 0. Fortunately, this does not lead to ill-conditioning at high resolutions: the derivatives of ρ~^\hat{\tilde{\rho}} with respect to space (𝐱\mathbf{x}) diverge as Δx0\Delta x\to 0 for β=\beta=\infty, but not the derivatives with respect to the discretized ρ~\tilde{\rho} values.

This is easiest to see with a 1d example. Suppose that we have ρ~\tilde{\rho} on an equispaced 1d finite-difference grid ρ~k=ρ~(kΔx)\tilde{\rho}_{k}=\tilde{\rho}(k\Delta x), and we wish to evaluate ρ~^\hat{\tilde{\rho}} at a point (n+12)Δx(n+\frac{1}{2})\Delta x halfway in between two grid points nn and n+1n+1. To evaluate dd from Eq. (7), we might perform a piecewise-linear interpolation of ρ~\tilde{\rho}, giving

d=Δxηρ~n+ρ~n+12|ρ~n+1ρ~n|,d=\Delta x\frac{\eta-\frac{\tilde{\rho}_{n}+\tilde{\rho}_{n+1}}{2}}{|\tilde{\rho}_{n+1}-\tilde{\rho}_{n}|}\,,

which is Δx\Delta x multiplied by a dimensionless function of ρ~\tilde{\rho}. However, when we plug this into F(d)F(d) to evaluate ρ~^\hat{\tilde{\rho}}, the Δx\Delta x factor cancels: F(d)F(d) is a function of d/R^d/\hat{R}, and R^\hat{R} is proportional to Δx\Delta x. Hence, the derivatives of ρ~^\hat{\tilde{\rho}} at this grid point with respect to ρ~k\tilde{\rho}_{k} are bounded regardless of resolution. (This is true even when the denominator of dd approaches zero, since in that regime FF is constant so all derivatives vanish.)

The same fortunate effect also holds for more general meshes/discretizations, as long as ρ~(𝐱)\tilde{\rho}(\mathbf{x}) is represented in terms of values sampled at a set of points in space (e.g. FEM nodes), because dimensional considerations ensure that ρ~\nabla\tilde{\rho} must then be 1Δx\frac{1}{\Delta x} multiplied by a dimensionless (Δx\Delta x-independent) linear combination of the ρ~\tilde{\rho} samples. Hence, d/R^d/\hat{R} will always be a Δx\Delta x-independent function of the discretized ρ~\tilde{\rho} values, and a similar cancellation occurs for the R^ρ~\hat{R}\|\nabla\tilde{\rho}\| factor in Eq. (12).

\bmsection

Funding This material is based upon work supported in part by the National Science Foundation (NSF) Center “EPICA” under Grant No.1 2052808, https://epica.research.gatech.edu/. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the NSF. MC, IMH, and SGJ were supported in part by the US Army Research Office through the Institute for Soldier Nanotechnologies (award W911NF-23-2-0121) and by a grant from the Simons Foundation. SER was supported by the Georgia Electronic Design Center of the Georgia Institute of Technology.

\bmsection

Acknowledgments We are grateful to Rodrigo Arietta Candia and Giuseppe Romano at MIT for helpful comments, and to Francesc Verdugo at Vrije Universiteit Amsterdam for assistance with the Gridap FEM software.

\bmsection

Disclosures The authors declare no conflicts of interest.

\bmsection

Data availability Data underlying the results presented in this paper are available upon request.

References

  • [1] S. Molesky, Z. Lin, A. Y. Piggott, W. Jin, J. Vucković, and A. W. Rodriguez, “Inverse design in nanophotonics,” \JournalTitleNature Photonics 12, 659–670 (2018).
  • [2] N. P. van Dijk, K. Maute, M. Langelaar, and F. Van Keulen, “Level-set methods for structural topology optimization: a review,” \JournalTitleStructural and Multidisciplinary Optimization 48, 437–472 (2013).
  • [3] O. Sigmund and K. Maute, “Topology optimization approaches,” \JournalTitleStructural and Multidisciplinary Optimization 48, 1031–1055 (2013).
  • [4] J. Jensen and O. Sigmund, “Topology optimization for nano-photonics,” \JournalTitleLaser & Photonics Reviews 5, 308–321 (2010).
  • [5] J. Nocedal and S. J. Wright, Numerical Optimization (Springer, 2006), 2nd ed.
  • [6] D. P. Bertsekas, Nonlinear Programming (Athena Scientific, 2016), 3rd ed.
  • [7] A. M. Hammond, A. Oskooi, M. Chen, Z. Lin, S. G. Johnson, and S. E. Ralph, “High-performance hybrid time/frequency-domain topology optimization for large-scale photonics inverse design,” \JournalTitleOptics Express 30, 4467–4491 (2022).
  • [8] B. S. Lazarov, F. Wang, and O. Sigmund, “Length scale and manufacturability in density-based topology optimization,” \JournalTitleArchive of Applied Mechanics 86, 189–218 (2016).
  • [9] L. Hägg and E. Wadbro, “On minimum length scale control in density based topology optimization,” \JournalTitleStructural and Multidisciplinary Optimization 58, 1015–1032 (2018).
  • [10] X. Qian and O. Sigmund, “Topological design of electromechanical actuators with robustness toward over-and under-etching,” \JournalTitleComputer Methods in Applied Mechanics and Engineering 253, 237–251 (2013).
  • [11] M. Zhou, B. S. Lazarov, F. Wang, and O. Sigmund, “Minimum length scale in topology optimization by geometric constraints,” \JournalTitleComputer Methods in Applied Mechanics and Engineering 293, 266–282 (2015).
  • [12] K. Svanberg and H. Svärd, “Density filters for topology optimization based on the Pythagorean means,” \JournalTitleStructural and Multidisciplinary Optimization 48, 859–875 (2013).
  • [13] A. Taflove and S. C. Hagness, Computational Electrodynamics: The Finite-Difference Time-Domain Method (Artech house, 2005).
  • [14] H. Kim, J. Park, and B. Lee, Fourier Modal Method and Its Applications in Computational Nanophotonics (CRC Press Boca Raton, 2012).
  • [15] J.-M. Jin, The Finite Element Method in Electromagnetics (John Wiley & Sons, 2015).
  • [16] M. Chen, R. E. Christiansen, J. A. Fan, G. Işiklar, J. Jiang, S. G. Johnson, W. Ma, O. D. Miller, A. Oskooi, M. F. Schubert et al., “Validation and characterization of algorithms and software for photonics inverse design,” \JournalTitleJournal of the Optical Society of America B 41, A161–A176 (2024).
  • [17] A. Hammond, A. Oskooi, S. Johnson, and S. Ralph, “Photonic topology optimization with semiconductor-foundry design-rule constraints,” \JournalTitleOptics Express 29 (2021).
  • [18] D. A. White, M. L. Stowell, and D. A. Tortorelli, “Toplogical optimization of structures using Fourier representations,” \JournalTitleStructural and Multidisciplinary Optimization 58, 1205–1220 (2018).
  • [19] C. Sanders, M. Bonnet, and W. Aquino, “An adaptive eigenfunction basis strategy to reduce design dimension in topology optimization,” \JournalTitleInternational Journal for Numerical Methods in Engineering 122, 7452–7481 (2021).
  • [20] A. Chandrasekhar and K. Suresh, “Approximate length scale filter in topology optimization using Fourier enhanced neural networks,” \JournalTitleComputer-Aided Design 150, 103277 (2022).
  • [21] R. E. Christiansen, J. Vester-Petersen, S. P. Madsen, and O. Sigmund, “A non-linear material interpolation for design of metallic nano-particles using topology optimization,” \JournalTitleComputer Methods in Applied Mechanics and Engineering 343, 23–39 (2019).
  • [22] F. Wang, B. S. Lazarov, and O. Sigmund, “On projection methods, convergence and robust formulations in topology optimization,” \JournalTitleStructural and Multidisciplinary Optimization 43, 767–784 (2011).
  • [23] A. F. Oskooi, D. Roundy, M. Ibanescu, P. Bermel, J. D. Joannopoulos, and S. G. Johnson, “MEEP: A flexible free-software package for electromagnetic simulations by the FDTD method,” \JournalTitleComputer Physics Communications 181, 687–702 (2010).
  • [24] D. Maclaurin, D. Duvenaud, and R. P. Adams, “Autograd: Effortless gradients in numpy,” in ICML 2015 AutoML Workshop, vol. 238 (2015), p. 5.
  • [25] S. Wu, X. Mu, L. Cheng, S. Mao, and H. Fu, “State-of-the-art and perspectives on silicon waveguide crossings: A review,” \JournalTitleMicromachines 11, 326 (2020).
  • [26] M. F. Schubert and A. M. Hammond, “Fourier modal method for inverse design of metasurface-enhanced micro-LEDs,” \JournalTitleOptics Express 31, 42945–42960 (2023).
  • [27] S. Badia and F. Verdugo, “Gridap: An extensible finite element toolbox in Julia,” \JournalTitleJournal of Open Source Software 5, 2520 (2020).
  • [28] A. W. Snyder and J. Love, Optical Waveguide Theory (Springer Science & Business Media, 2012).
  • [29] S. G. Johnson, C. Manolatou, S. Fan, P. Villeneuve, J. D. Joannopoulos, and H. A. Haus, “Elimination of cross talk in waveguide intersections,” \JournalTitleOptics Letters 23, 1855–1857 (1998).
  • [30] K. Svanberg, “A class of globally convergent optimization methods based on conservative convex separable approximations,” \JournalTitleSIAM journal on optimization 12, 555–573 (2002).
  • [31] S. G. Johnson, “The NLopt nonlinear-optimization package,” https://github.com/stevengj/nlopt (2007).
  • [32] D. Sell, J. Yang, S. Doshay, R. Yang, and J. A. Fan, “Large-angle, multifunctional metagratings based on freeform multimode geometries,” \JournalTitleNano letters 17, 3752–3757 (2017).
  • [33] D. Sell, J. Yang, E. W. Wang, T. Phan, S. Doshay, and J. A. Fan, “Ultra-high-efficiency anomalous refraction with dielectric metasurfaces,” \JournalTitleAcs Photonics 5, 2402–2407 (2018).
  • [34] D. Sell, J. Yang, S. Doshay, and J. A. Fan, “Periodic dielectric metasurfaces with high-efficiency, multiwavelength functionalities,” \JournalTitleAdvanced Optical Materials 5, 1700645 (2017).
  • [35] J. Jiang and J. A. Fan, “Global optimization of dielectric metasurfaces using a physics-driven neural network,” \JournalTitleNano letters 19, 5366–5372 (2019).
  • [36] J. Jiang and J. A. Fan, “Simulator-based training of generative neural networks for the inverse design of metasurfaces,” \JournalTitleNanophotonics 9, 1059–1069 (2020).
  • [37] M. F. Schubert, “invrs-gym: a toolkit for nanophotonic inverse design research,” (2024).
  • [38] J. Bradbury, R. Frostig, P. Hawkins, M. J. Johnson, C. Leary, D. Maclaurin, G. Necula, A. Paszke, J. VanderPlas, S. Wanderman-Milne, and Q. Zhang, “JAX: composable transformations of Python+NumPy programs,” http://github.com/google/jax (2018).
  • [39] R. E. Christiansen, J. Michon, M. Benzaouia, O. Sigmund, and S. G. Johnson, “Inverse design of nanoparticles for enhanced raman scattering,” \JournalTitleOptics Express 28, 4444–4462 (2020).
  • [40] R. E. Christiansen, J. Vester-Petersen, S. P. Madsen, and O. Sigmund, “A non-linear material interpolation for design of metallic nano-particles using topology optimization,” \JournalTitleComputer Methods in Applied Mechanics and Engineering 343, 23–39 (2019).
  • [41] I. M. Hammond, “3-D topology optimization of spatially averaged surface-enhanced Raman devices,” Ph.D. thesis, Massachusetts Institute of Technology (2024).
  • [42] C. Maple, “Geometric design and space planning using the marching squares and marching cube algorithms,” in 2003 international conference on geometric modeling and graphics, 2003. Proceedings, (IEEE, 2003), pp. 90–95.
  • [43] J. S. Jensen and O. Sigmund, “Topology optimization of photonic crystal structures: A high-bandwidth low-loss T-junction waveguide,” \JournalTitleJOSA B 22, 1191–1198 (2005).
  • [44] S. E. Hansen, G. Arregui, A. N. Babar, R. E. Christiansen, and S. Stobbe, “Inverse design and characterization of compact, broadband, and low-loss chip-scale photonic power splitters,” \JournalTitleMaterials for Quantum Technology 4, 016201 (2024).
  • [45] M. Chen, K. F. Chan, A. M. Hammond, C. H. Chan, and S. G. Johnson, “Inverse design of 3d-printable metalenses with complementary dispersion for terahertz imaging,” (2025). ArXiv:2502.10520.
  • [46] A. Farjadpour, D. Roundy, A. Rodriguez, M. Ibanescu, P. Bermel, J. D. Joannopoulos, S. G. Johnson, and G. Burr, “Improving accuracy by subpixel smoothing in FDTD,” \JournalTitleOptics Letters 31, 2972–2974 (2006).
  • [47] A. F. Oskooi, C. Kottke, and S. G. Johnson, “Accurate finite-difference time-domain simulation of anisotropic media by subpixel smoothing,” \JournalTitleOptics Letters 34, 2778–2780 (2009).
  • [48] Y.-M. Law and J.-C. Nave, “High-order FDTD schemes for Maxwell’s interface problems with discontinuous coefficients and complex interfaces based on the correction function method,” \JournalTitleJournal of Scientific Computing 91 (2022).
  • [49] A. V. Kumar, “Survey of immersed boundary approaches for finite element analysis,” \JournalTitleJournal of Computing and Information Science in Engineering 20 (2020).
  • [50] J. Nestruev, Smooth Manifolds and Observables (Springer, 2010).