APF (Augmented Partial Factorization) is an efficienct method proposed in Nature Computational Science 2, 815–822 (2022) that can solve multi-input electromagnetic forward problems in one shot, offering substantial speed-up and memory usage reduction compared to existing methods. Here, we generalize APF to enable efficient gradient computation for and inverse design of multi-input nanophotonic devices.
This repository includes codes used to inverse design a metasurface beam splitter using APF method, which splits the incident light equally into the
inverse_design_beam_splitter.m
: Build the system and perform the optimizationFoM_and_grad.m
: Compute the figure of merit and its gradient with respect to optimization variables.constraint_and_grad.m
: Build the inequality constraint and its gradient with respect to optimization variables.gradient_descent_BLS.m
: Perform the gradient-descent optimization with the learning rate determined by backtracking line search.build_epsilon_pos.m
: Build the permittivity profile.
To take fully advantage of the APF method and efficienctly perform optimizations, one needs to
- Install MESTI.m [download it and add the
MESTI.m/src
folder to the search path using theaddpath
command in MATLAB], the serial version of MUMPS and its MATLAB interface. - Install NLopt to use various well-developed algorithms for optimizations. If
NLopt
is not installed, one can specify other methods ininverse_design_beam_splitter.m
. - Run
inverse_design_beam_splitter.m
[one can customise the optimization usingoptions
; check the documentation of this file for more details].
An animation on the evolution of the metasurface and its transmission matrix is shown below.
See the corresponding paper Fast Multichannel Inverse Design through Augmented Partial Factorization for more details.