Source-linked AI summary

Nanophotonic Inverse Design with SPINS: Software Architecture and Practical Considerations

Logan Su, Dries Vercruysse, Jinhie Skarda, Neil V. Sapra, Jan A. Petykiewicz, Jelena Vuckovic

arXiv:1910.04829v2physics.app-ph

TL;DR

Nanophotonic inverse design needs efficient ways to explore large design spaces and practical guidance for navigating non-convex optimization. The paper presents SPINS as a graph-based, extensible framework for gradient-based design, demonstrates its use in wavelength demultiplexers, and analyzes objectives, initialization, and local minima. SPINS emphasizes reproducibility and flexible experimentation, while one discrete-device example shows that constrained parametrization and incomplete continuous optimization can limit performance.

  • Problem

    Photonic design methods based on simple geometries or low-dimensional searches explore only a small fraction of possible designs, motivating efficient large-space inverse design and guidance for its practical control knobs.

  • Method

    SPINS formulates nanophotonic optimization with node-based computational graphs and transformation sequences, supporting gradient-based objectives, continuous-to-discrete design, and extensible experimentation.

  • Results

    SPINS provides a flexible framework used for wavelength-demultiplexer designs and records optimization dependencies to support reproducible, restartable experiments.

  • Takeaways & Limitations

    Practical inverse-design performance depends on objective formulation, parametrization, initialization, and local-minimum structure, making these control knobs central to using SPINS effectively.

  • Takeaways & Limitations

    The discrete-device example underperformed its continuous-stage reference because feature-size-aware cubic parametrization was more restrictive and continuous optimization stopped before convergence.

Abstract

from arXiv · show

A computational nanophotonic design library for gradient-based optimization called SPINS is presented. Borrowing the concept of computational graphs, SPINS is a design framework that emphasizes flexibility and reproducible results. The mathematical and architectural details to achieve these goals are presented, and practical considerations and heuristics for using inverse design are discussed, including the choice of initial condition and the landscape of local minima.

1 Introduction

SPINS is introduced as a flexible, reproducible framework for gradient-based nanophotonic inverse design. The paper also identifies practical design choices, especially objective functions and initialization, that shape optimization.

  • Conventional geometry-based methods explore only a small fraction of possible photonic designs because they use few degrees of freedom.
  • Gradient-based inverse design uses sensitivities of the loss to explore large design spaces efficiently, requiring only one additional electromagnetic simulation for the adjoint gradient.
  • SPINS represents optimization problems as node-based problem graphs, remaining agnostic to the optimization procedure and nanophotonic application.
  • Problem graphs can be saved and restored, supporting reproducible results and restarted optimizations.
  • Using inverse design effectively requires choosing objective functions and initial conditions while analyzing the local minima reached by optimization.
  • The paper develops inverse-design mathematics, presents SPINS and a wavelength-demultiplexer example, and discusses practical optimization heuristics.

2 Inverse Design Formulation Overview

The inverse-design formulation maps parametrized permittivity through electromagnetic simulation to objectives, while fabrication constraints and non-convexity motivate staged optimization. SPINS supports continuous-to-discrete transformations and multiple objective formulations.

  • 2.1 General Optimization Problem: Photonic inverse design generally optimizes an objective over electric fields generated by a parametrized permittivity distribution, subject to fabricability constraints.
  • 2.2 Parametrization ϵ(p): Fabrication limits include discrete material values, vertically invariant permittivity in top-down lithography, and minimum feature sizes.
  • 2.2 Parametrization ϵ(p): Parametrization imposes fabrication constraints indirectly, such as by defining grating-edge distances or binary levelset devices.
  • 2.3 Simulation E(ϵ): The electromagnetic simulation maps permittivity to electric fields by inverting Maxwell’s equations, with sources injecting modes into the device.
  • 2.4 Objective Function f(E): Objective functions measure goals such as modal-overlap transmission or target transmission and can combine multiple frequency-specific sub-objectives.
  • 2.4 Objective Function f(E): The objective’s form determines trade-offs among competing sub-objectives, so designers must balance them according to the desired behavior.
  • 2.5 Solving the Design Problem: Direct discrete optimization often performs poorly because the landscape is highly non-convex and requires a good initial condition.
  • 2.5 Solving the Design Problem: A staged strategy relaxes permittivity continuously, discretizes the result, and then optimizes the discrete device under fabrication constraints.

3 Framework Overview

SPINS structures nanophotonic optimization as a problem graph plus a sequence of transformations. This separation supports modular experimentation, automatic differentiation, reproducibility, and remote or resumable execution.

  • SPINS assembles parametrizations, simulations, overlaps, and objective functions from reusable building blocks to formulate diverse design problems.
  • An optimization plan combines a complete problem graph with transformations that modify parametrization values or convert parametrization forms.
  • The computational graph maps parametrization to permittivity, electric fields, sub-objectives, and a combined final objective, including wavelength-dependent simulations.
  • Because the graph describes dependencies without performing computation during setup, users can assemble and share alternative objective functions from simple blocks.
  • Reverse-mode autodifferentiation computes gradients automatically, removing the need to implement gradient calculations manually.
  • The framework records optimization sequences and hyperparameters, supports resuming from any iteration, and can generate problems for remote execution.
  • Designers can add custom nodes and transformations or rearrange objectives and transformation sequences after observing optimization outcomes.
  • The demultiplexer example targets 1400 nm routing to the upper waveguide and 1550 nm routing to the lower waveguide while illustrating practical framework flexibility.

4 Wavelength Demultiplexer Design Examples

SPINS is applied to three-dimensional wavelength demultiplexer designs spanning continuous, fabricable discrete, and amplitude-and-phase-controlled devices. The examples show how objective construction, parametrization, discretization, and added phase constraints affect performance and optimization behavior.

  • Device setup: The benchmark targets routing 1400 nm to the upper waveguide and 1550 nm to the lower waveguide in a 2.5 um x 2.5 um 3D design area.The simulated platform uses 220 nm SOI, 400 nm input and output waveguides, and n = 3.5 for illustration.
  • Objective function: The four-term objective maximizes desired transmissions while rejecting the opposite wavelengths, balancing competing transmission and crosstalk goals.The squared difference favors balanced performance, while rejection terms discourage crosstalk.
  • Device A1: The continuous device reaches 95% transmission at both 1400 nm and 1550 nm with over 19 dB crosstalk suppression.This direct-parametrization result estimates an upper bound for the chosen design area because its continuous design space is larger than that of fabricable devices.
  • Device A1: The continuous optimization mostly converges by iteration 30, with the remaining 70 iterations improving transmission by around 5%.The authors therefore suggest that 20–30 iterations often suffice for estimating device performance, while poor early performance may indicate a need for a larger design area.
  • Device A2: The fabricable discrete device achieves 84% transmission at 1400 nm, 90% at 1550 nm, and over 20 dB crosstalk suppression after continuous and discrete transformations.Discretization initially increases the objective, but the discrete optimization eventually recovers the continuous-stage performance sufficiently well.
  • Device B: Adding phase control produces 91% transmission at 1400 nm and 90% at 1550 nm with around 19 dB crosstalk suppression, while bringing both output phases nearly to zero.The added phase constraint lowers transmission by around 5% relative to the phase-unconstrained device, with similar optimization cost.

5 Practical Considerations

Gradient-based nanophotonic optimization reaches varied local minima, so practical performance depends on initialization, design freedom, fabrication constraints, and repeated trials. The analyzed demultiplexer designs show structured local-minimum classes and strong dependence on initial material distribution.

  • Local Minima and Initialization: 297 optimizations reached local minima with generally similar objective performance despite vastly different initial conditions.The demultiplexer study repeated the same optimization with random initial conditions.
  • Local Minima and Initialization: Four approximate local-minimum classes include silicon blocks with holes, two splitter-like classes, splitter-grating structures, and mixtures of these classes.The splitter-grating class appeared best-performing, while the two splitter-like classes differed in grating placement and performance.
  • Local Minima and Initialization: Initial mean permittivity strongly correlates with final mean permittivity, while final mean pixel values remain roughly between 0.2 and 0.8.The initial value also strongly influences the class of optimized device.
  • Local Minima and Initialization: Small Gaussian perturbations to an initial condition can generate varied final structures and performance even within the same structural class.The authors use this observation to motivate generating multiple related starting points.
  • Device Performance Bounds: Larger design areas generally improve performance and reduce variation, whereas larger feature sizes produce worse devices and greater performance variation.With large feature sizes and small design areas, running more optimizations becomes important.

6 Conclusion

SPINS structures nanophotonic inverse-design problems as flexible computational graphs with automatic differentiation and explicit dependencies. The paper combines this framework with practical heuristics for objectives, parametrizations, initialization, and simulation management.

  • Conclusion: SPINS uses small software building blocks to assemble flexible optimization plans rather than prescribing a specific design methodology.The framework is intended to support different optimization procedures and nanophotonic problem types.
  • Conclusion: Backpropagation computes gradients automatically, while explicit dependencies record hyperparameters and allow optimizations to restart from any point.The graph representation also supports future optimization of the computational graph for hardware performance.
  • Conclusion: The paper studies objective functions, parametrizations, and initial conditions through wavelength-demultiplexer design and analyzes local minima to derive initialization heuristics.Additional guidance covers electromagnetic simulations, discretization, and optimizer choice.

A.1 Parametrization, Selection Matrix, and Permittivity Distribution

SPINS separates design parameters from the permittivity distribution through parametrization and a selection matrix. This representation accommodates lower-dimensional descriptions, equality constraints, normalization, and fabrication-aware binary structures.

  • Selection Matrix: A selection matrix can map a lower-dimensional parametrization into the full permittivity distribution, with 2D descriptions often sufficient under top-down lithography.The parametrization can remain general because the selection matrix may also be the identity.
  • Selection Matrix: The selection matrix captures equality constraints such as symmetry and periodicity while normalizing θ between 0 and 1.Normalization makes parametrizations less dependent on specific device materials.
  • Parametrization: The direct parametrization assigns θ(p) = p and is useful for estimating required device area, although it may not impose fabrication constraints well.Other parametrizations can encode fabrication structure more naturally.
  • Levelset Parametrization: Levelset parametrizations define binary devices by assigning different materials above and below a zero-valued levelset contour.The zero crossing determines the device contour.
  • Levelset Parametrization: Levelsets avoid over-constraining designs to binary pixels and make differentiable minimum-feature-size constraints more natural.A binary device need not align with a binary pixel grid.

A.1.2 Implementation Details

SPINS implements geometric and simulation structure through generated selection matrices and modular graph nodes. Solver choice is tied to the spectral needs and boundary conditions of the device, while the framework remains solver-agnostic in principle.

  • Selection Matrix Implementation: SPINS generates selection matrices from foreground and background permittivity distributions to support complicated geometries such as arbitrarily shaped polygons and gaps.The generated construction avoids requiring complicated selection matrices to be specified entirely by hand.
  • Levelset Implementation: Figure 10 contrasts grid-aligned binary pixels with misaligned devices whose sampled pixels become non-binary, while levelsets remain binary by construction.The zero contour defines the device boundary between two materials.
  • Selection Matrix Implementation: The selection-matrix implementation samples more finely than the Yee grid, averages onto that grid, applies a mask, and then enforces symmetry conditions.These steps produce the final discretized permittivity representation.
  • Simulation Nodes: SPINS treats sources and simulation spaces as graph nodes so the simulation node can focus on mapping permittivity to fields independently of specific sources or boundaries.This modularity separates simulation execution from problem-specific setup.
  • Simulation Method: FDFD is generally faster for a few wavelengths, FDTD may suit broad spectra, and RCWA may suit periodic-boundary problems.Optimization time is dominated by simulation time, making solver selection consequential; this manuscript implements FDFD.

A.2.1 Implementation Details

SPINS combines dimension-specific FDFD solvers with GPU acceleration and differentiable function nodes. Its objective-function nodes support composable evaluation and gradients while preserving performance for complex operations.

  • FDFD solvers: SPINS maintains its own FDFD and mode-solver implementations to precisely specify sources and enable accurate adjoint calculations.Radiation boundaries use SC-PMLs.
  • FDFD solvers: 2D simulations use direct matrix inversion, typically run on CPUs, whereas 3D simulations use iterative solvers because direct inversion is computationally intractable.The 2D default is motivated by empirically faster direct solves; 3D solves require matrix-vector products.
  • GPU acceleration: SPINS distributes sliced simulation regions across multiple GPUs to reduce electromagnetic simulation time.GPU placement matters because devices exchange information every iteration, and cross-motherboard GPUs are undesirable.
  • Function nodes: Generic function nodes accept inputs, produce outputs, and can compute gradients, ranging from simple operations to performance-critical composite operations.Log-sum-exp is implemented as one node to avoid overflow or underflow, while FDFD remains a single node for speed.

A.4 Transformations

SPINS executes optimization through ordered transformations over a computational graph. The graph supports automatic differentiation, parallel electromagnetic simulations, monitoring, logging, and restoration of optimization state.

  • Transformations: SPINS represents optimization as an ordered sequence of transformations, including sub-optimizations and operations such as thresholding.Transformations can accept interchangeable optimizers through a lightweight interface.
  • Graph execution: A workspace materializes graph nodes into Python objects during transformation execution, allowing transformations to perform calculations on referenced objectives and operations.The computational graph mirrors these objects and their dependencies.
  • Parallel execution: Explicit graph dependencies enable automatic parallelization, so electromagnetic simulations run in parallel while remaining computations are serial.Electromagnetic simulations are identified as the dominant computational cost.
  • Differentiation: Reverse-mode autodifferentiation computes gradients efficiently for one output and many parametrization inputs, with electromagnetic backpropagation implemented as an adjoint simulation.The adjoint uses the same permittivity with a different source.
  • Monitoring and reproducibility: Monitors probe graph-node outputs for logging, and standardized logs preserve optimization state for analysis, restarting failed runs, and restoring earlier iterations.Examples include saving electric fields and sub-objectives.

B.1 FDFD Simulation Considerations

SPINS recommends reducing simulation cost during optimization while preserving sufficient accuracy, then managing discretization and objective construction carefully. Practical choices include grid spacing, solver settings, parametrization, and multi-objective weighting.

  • FDFD simulation: Lower-quality electromagnetic simulations can reduce computation time during early optimization because highly accurate fields are not initially required.The paper recommends maximizing grid spacing and reports Δx ≈ λ/10 as sufficient during optimization.
  • FDFD simulation: Boundary permittivity averaging improves accuracy at relatively large grid spacings, including for binary 3D pixels on the staggered Yee grid.SPINS uses a weighted average based on the fraction of each cell occupied by the materials.
  • FDFD simulation: Solver error thresholds can be relaxed when fields are needed only in selected regions, such as excluding slowly converging but irrelevant PML fields.The appropriate threshold depends on the solver and where fields enter the objective computation.
  • Discretization: Continuous-to-discrete conversion often reduces device performance, so successful discretization must allow later optimization to recover continuous-stage performance.Discreteness and feature size are the main empirical factors affecting discretization.
  • Discretization: Mostly discrete continuous structures tend to discretize better, while longer optimization does not necessarily eliminate intermediate permittivities.Mitigations include discreteness penalties, forcing discreteness, and staged continuous optimizations.
  • Discretization: Discretization becomes difficult when continuous feature sizes are much smaller than the target discrete feature sizes.A cubically interpolated parametrization can better map continuous and discrete feature sizes.
  • Objective functions: Transmission-and-phase objectives encode an implicit trade-off, and unrealistic amplitude targets can cause optimization to neglect phase.The objective uses the squared distance between the output scattering element and its target complex value.
  • Objective functions: Combining sub-objectives into one function defines their trade-off, while variable weights trace the trade-off curve but are often selected by trial and error.A maximum or smooth maximum can instead emphasize the worst-performing metric.

B.3.3 Broadband Objective

SPINS supports broadband and constrained electromagnetic optimization by combining wavelength-specific objectives with general parametrizations, constraints, and differentiable simulation models. Gradient computation uses reverse-mode differentiation through the electromagnetic solver to avoid one simulation per parameter.

  • Broadband objective: Broadband objectives sum objective values at nearby wavelengths, with wavelength spacing and sample count determining bandwidth coverage and optimization cost.Too-large spacing can miss spectral behavior between samples, while too-small spacing increases the number of simulations.
  • Optimization methods: SPINS supports gradient-free, first-order, second-order, and quasi-Newton optimization methods, with quasi-Newton methods approximating the Hessian from previous gradients.Second-order methods can converge faster, but direct Hessian computation is intractable for electromagnetic optimization.
  • Optimization methods: The most effective optimizer can depend on the device and constraints, with examples including MMA plus L-BFGS-B for cavities and SLSQP for grating optimization.L-BFGS-B cannot handle arbitrary constraints.
  • Problem formulation: A general electromagnetic design problem optimizes an objective over electric fields, permittivities, and parametrization variables subject to equality and inequality constraints.Fields and permittivities may represent different wavelengths, temperatures, carrier concentrations, or fabrication-error variants.
  • Problem formulation: Parametrizations indirectly specify permittivity distributions so fabrication constraints can be imposed naturally through variables such as feature spacing or level sets.Selection matrices define how parametrizations produce permittivity distributions.
  • Gradient computation: Complex-valued electromagnetic quantities require Wirtinger derivatives because the real-valued objective is generally non-holomorphic.The objective derivatives depend on the objective form, while the structure gradient follows from the parametrization.
  • Gradient computation: Reverse-mode backpropagation reduces gradient evaluation through electromagnetic simulation from one simulation per parametrization element to one simulation.For FDFD, the adjoint simulation uses a source derived from the objective derivative with respect to the electric field.

D Local Minima Analysis Details

The analysis explores local minima using varied initial conditions and nonlinear spectral embedding, finding that continuous minima determine the observed discrete local minima.

  • Initialization: Three initialization methods—blurred random noise, Perlin noise, and Gabor noise—were used to capture diverse relevant local minima.The blurred random noise structures were generated from uniformly random parametrization values followed by Gaussian filtering with random width.
  • Visualization: Spectral embedding was used to visualize high-dimensional device structures because the space may be nonlinear and PCA is linear.The embedding maps high-dimensional vectors into a low-dimensional representation.
  • Continuous and discrete minima: The continuous-structure analysis reached the same conclusions as the discrete analysis, showing that discrete local minima are determined by continuous minima.The continuous and discrete structures typically closely resemble each other.
  • Visualization: The spectral embedding of optimized continuous structures was colored by transmission at 1550 nm and by the mean pixel value of the initial condition.The embedding coordinates u1 and u2 represent the first and second embedding vectors.
Loading 1910.04829v2…