Topology optimization of freeform large-area metasurfaces

We demonstrate optimization of optical metasurfaces over $10^5$--$10^6$ degrees of freedom in two and three dimensions, 100--1000+ wavelengths ($\lambda$) in diameter, with 100+ parameters per $\lambda^2$. In particular, we show how topology optimization, with one degree of freedom per high-resolution"pixel,"can be extended to large areas with the help of a locally periodic approximation that was previously only used for a few parameters per $\lambda^2$. In this way, we can computationally discover completely unexpected metasurface designs for challenging multi-frequency, multi-angle problems, including designs for fully coupled multi-layer structures with arbitrary per-layer patterns. Unlike typical metasurface designs based on subwavelength unit cells, our approach can discover both sub- and supra-wavelength patterns and can obtain both the near and far fields.

Metasurfaces offer ultra-compact flat-optics alternatives for traditional bulky systems used in lensing, beam-shaping, holography and beyond [20].The power and versatility of a metasurface resides in aperiodically patterned nanophotonic features covering hundreds or thousands of wavelengths in diameter.The term "meta" often refers to extremely subwavelength features that may be modeled by effective surface impedances [21], but in this work we consider both sub-and supra-wavelength features and do not employ any effective-medium approximation.Understandably, a meta-device poses a more challenging design problem than a traditional optical system since it requires an understanding and control of electromagnetic interactions within a vast number of nanostructures.Typically, such interactions are handled by a locally periodic approximation (LPA) in which the metasurface is divided into computationally tractable independent unit cells with periodic boundary conditions [5,6,7,8,9,10,11,12].One extreme limit of LPA is scalar diffraction theory [22], in which the surface is treated as locally uniform; this is often used to design diffractive surfaces [23] but is unlikely to accurately model subwavelength patterns.Meanwhile, the geometric library which provides the "meta-elements" is made up of primitive shapes such as subwavelength cylindrical or rectangular pillars which can be rapidly modeled (under LPA) by an electromagnetic solver such as RCWA [5,6,7,8,9,10,11,12].However, it may become increasingly difficult and ultimately infeasible to leverage only simple primitive geometries for more complex problems such as broadband achromatic focusing [24,25,26] or controlled angular dispersion [27] which impose stringent demands on the local phase shifts provided by the meta-elements.
Topology optimization (TO) is a large-scale computational technique that can handle an extensive design space, considering the dielectric permittivity at every spatial point as a DoF [1,2,3].In contrast to the heuristic search routines regularly employed by the photonic community such as genetic algorithms [28] or particle swarm methods [29], TO employs gradient-based optimization techniques to explore hundreds to billions of continuous DoFs.Such a capability is made possible by a rapid computation of gradients (with respect to all the DoFs) via adjoint methods [30], which, in the context of electromagnetic inverse de-sign, involve just one additional solution of Maxwell's equations [3].In fact, such techniques have been gaining traction lately in the field of photonic integrated circuits, especially for the design of compact modal multiplexers and converters [31].Only recently, TO-based inverse design methods have been extended to metasurfaces, particularly in the context of freeform meta-gratings [14] and metalenses with angular phase control [15].While such applications reveal TO as a very promising tool for realizing increasingly sophisticated meta-devices, they have been limited to small computational domains 10λ.In this paper, we present a combination of TO and LPA to efficiently design large-area metasurfaces with enhanced functionalities.

Formulation
Because we employ a general optimization framework, we have great flexibility in what function of the electromagnetic fields to optimize (our "objective" function f ) [16].For many light-focusing problems, it is convenient to simply maximize the electric-field intensity at a focal point r 0 [16]: Here, the set of DoFs ¯ (r) is related to the position-dependent dielectric profile via (r) = ( st − bg ) ¯ (r) + bg , where st (bg) denotes the relative permittivity of the structural (background) dielectric material.Whereas ¯ is a continuous DoF allowed to have intermediate values between 0 and 1, we employ Heaviside projection filters [1] to ensure that the final optimal design is binary, i.e., ¯ optimal ∈ {0, 1}.In this work, we consider only the binary filter to theoretically illustrate our design method.More generally, a variety of additional geometric filters and constraints can be straightforwardly incorporated into the formulation, including regularization filters and curvature constraints [1,32,33] to impose design robustness and minimum feature sizes conducive to fabrication.The objective function f represents the far-field intensity obtained by convolving the free-space Green's function G 0 with the near-field E at some reference plane r s over the entire metasurface.(To be precise, the free-space Green's function is convolved with equivalent surface currents which are given by the tangential field components [34].)Here, E is the steady-state solution to the frequency-domain Maxwell's equation: in response to the incident current J at a frequency ω where we set the magnetic permeability µ = 1 for typical optical materials.To efficiently model a large device area, we use the locally periodic approximation [16], in which the metasurface is broken up into multiple smaller cells, each of which is independently simulated with periodic boundary conditions (Fig. 1).The total near-field E is, therefore, approximated by the set of disjoint intra-cell electric fields which must be engineered such that they all constructively add up at the focal point.
The optimization typically involves thousands of DoFs which must be efficiently handled by a numerical algorithm.Within the scope of TO, this requires efficient calculations of the derivatives ∂f ∂¯ at every pixel point in the device region, which we obtain by an adjoint method [3,30]: where the adjoint field Ẽ is evaluated by solving an additional Maxwell's equation: We emphasize that our framework is entirely different from the common approach where an ideal phase profile to be realized is approximately fitted with zeroth-order phase shifts allowed by primitive scattering elements, each residing within a sub-wavelength unit cell [5,6,7,8,9,10,11,12].In contrast, our approach greatly broadens the structural design space by considering non-intuitive shapes and forms as well as supra-wavelength unit cells within which the amplitude and phase of the electric field may vary considerably and must be fully taken into account during optimization.

Numerical Implementation
To ensure a speedy computation, we numerically implement the optimization problem (1) in C. Each of the cells is either solved by a C implementation of the finite-difference frequency-domain method (FDFD) [35] or the rigorous coupledwave analysis (RCWA) [18].To model a large surface area rapidly, all the cells are independently simulated in an "embarrassingly parallel" fashion using the message-passing interface (MPI) library [36,37].The simulated results are then consolidated to compute the global objective and gradients.The structural update during optimization is provided by a standard gradient-based nonlinearoptimization algorithm [38,39] with a free-software implementation [40].We note that the discretization error in the gradients arising from the discrepancy between the formal adjoint method and the numerical Maxwell's solver (such as RCWA) is practically negligible ( 0.01%).

Applications
The major advantage of a large-scale computational approach consists in its flexibility for handling multi-objective problems, such as those prescribing the behavior of a single metasurface for a set of frequencies and incident current conditions {ω i , J i }.In such cases, the optimization problem can be easily extended by the maximin formulation: which can be recast into an equivalent differentiable form [41]:

Metalens Concentrator
To demonstrate the efficacy of our design technique, we optimize a multi-layered 2D metalens (Fig. 2) that can concentrate incoming light at 11 incident angles {θ ( • ) = 3i i = 0, 1, ..., 10} to the same focus.The lens consists of five layers of TiO 2 (refractive index n ≈ 2.4), four of which are buried in silica (n ≈ 1.5).The diameter of the lens is D = 1200λ, where λ is the operational wavelength, and the focal length is F = 1000λ, corresponding to a rather high NA of 0.51.For simplicity, we consider the electric field to be polarized along the y axis.During the optimization, the entire lens is broken up into 240 cells, each of which is 5λ long, for 3 × 10 5 DoFs in total, while the entire computation is parallelized over 1200 CPUs.While we perform the optimization with the locally periodic approximation, we validate the optimized result with rigorous full-wave FDTD simulations [42] (Fig. 2) in which we compute the actual electric fields over the entire metasurface without any uncontrolled approximation.The lens is shown to exhibit diffraction-limited focusing at all the optimized angles with the fullwidth-at-maximum (FWHM) of ∼ λ while the average transmission efficiency is found to be T ≈ 40% .The average efficiency of 40% seems to violate Lorentz reciprocity and, in particular, the concentration bound ≤ 1  11 predicted by [43].However, there is no such violation because, although the output field profiles have the same prominent peak at the optical axis, they are never entirely alike for any two input angles due to the weak but distinct diffracting patterns away from the axis.

Multi-wavelength Focusing
Another example we consider is a partially achromatic 2D metalens (Fig. 3) with discrete chromatic aberration corrections at three wavelengths {λ 1 , λ 2 , λ 3 } with λ 2 = λ 1 /1.2 and λ 3 = λ 1 /1.38.In particular, one may choose λ 1 = 650 nm, λ 2 = 540 nm and λ 3 = 470 nm, corresponding to red, green and blue (RGB) wavelengths.The lens consists of two layers of TiO 2 (n ≈ 2.4), one of which is buried in silica (n ≈ 1.5).The diameter of the lens is D = 200λ 1 and the focal length is F = 100λ 1 , corresponding to NA = 0.71.During the optimization, the entire lens is broken up into 40 cells, each of which is 5λ long, for 1.6 × 10 4 DoFs in total, while the entire computation is parallelized over just 20 CPUs.At the desired frequencies, the lens is shown to focus a normally incident y-polarized beam at or near the diffraction limit with the FWHMs of ≈ 0.71λ 1 , 0.72λ 2 and 0.76λ 3 respectively and with an average transmission efficiency of ∼ 71%.Recently, broadband achromatic metalenses have been gaining widespread attention for full color imaging; although the state-of-theart designs continuously cover the full visible spectrum, they are mostly limited to smaller lens diameters and/or low NA [24,25,26].Our results suggest that multi-layer designs enabled by TO could alleviate many of these limitations by allowing more complex geometries to be explored.
Generally, a high-NA multi-wavelength design is a challenge for LPA because the design rapidly varies across the surface, resulting in the scattering "noise" visible in a full-wave simulation of the entire structure but not captured by the conjoined LPA solution (Fig. 3), in contrast to the multi-angle case in Fig. 2. One consequence is that the focusing efficiencies at the three wavelengths (defined as the integrated field intensity around the focal spot divided by the total intensity over the image plane [44]) are found to be ∼ 51%, 50% and 45% while LPA predicts ∼ 78%, 55% and 60% respectively.Note that our objective function (1) merely maximizes the intensity at the focal spot but does not necessarily suppress stray diffractions elsewhere which become apparent even in LPA predictions (Fig. 3).If desired, the optimal design can be further refined by improving the LPA wavefront by minimizing a phase error [15] or wavefront error objective [16].At the same time, deviations from LPA may be mitigated by considering larger metasurfaces where LPA is more appropriate, by including higher-order corrections to LPA [19], or by incorporating optimization constraints designed to enforce the validity of LPA.For example, the optimization process may be augmented with constraints restricting the structural variations between neighboring cells or specifying a bound on the physical residual: where the double curl operator is applied over the whole surface without LPA.Note that evaluating the residual r requires just a single matrix-vector multiplication, albeit involving a very large and sparse matrix, and can be made relatively cheap and fast when parallelized over several cores.

Three-dimensional Examples
Next, we turn to proof-of-concept 3D examples.First, we consider a collection of 3D cells, each of which has an area L x × L y = λ × λ.The cells are repeated along y but are allowed to differ from each other along x.Fig. 4 shows the corresponding "cylindrical" lens (NA=0.71)comprising such cells which focuses a normally-incident y-polarized beam to a focal line running parallel to the yaxis.The lens, though periodic along y, shows complex geometric variations along both x and y within each cell.A rigorous FDTD simulation of the whole lens shows the focusing behavior with a transmission efficiency of 75%.Although the design of a monochromatic lens, no matter the geometric complexity, is only useful to illustrate the method, we note that our framework enables a relatively cheap and fairly quick computation using as few as 25 CPUs over a span of a few minutes while considering the entire structure with as many as 200 cells and 4 × 10 4 DoFs in total.
Lastly, we consider the full 3D lens (Fig. 5) with cells varying along both x and y.The lens has 6400 λ × λ cells, corresponding to NA=0.37, with 6.4 × 10 5 DoFs in total.Again, our framework enables a cheap and speedy design of the entire lens, utilizing 40 CPUs and lasting only a few minutes.A major computational hurdle actually arises after the optimization: given the enormous size, the lens cannot be readily simulated via FDTD using a few CPUs.Instead, we provide an approximate far-field profile computed from the LPA combination of the unit-cell simulations, which has been shown to give excellent accuracy for monochromatic designs [13] and good accuracy even for the complex multifrequency designs in Sec.3.2.
These preliminary results suggest promising ways to scale up the 3D metasurface design.In particular, the computational workload can be reduced by orders of magnitude via rotational symmetry, specifically, by considering just a single row of cells and rotating it to fully cover the entire surface.Such an approach is, in fact, a more common practice in metalens design [5,6,7,8,9,10,11,12,13] rather than considering all the cells as we did here.Also, polarization insensitivity could be ensured by further imposing appropriate symmetries, such as C 4v within each cell.Combined with such symmetry-related reductions, an access to several hundreds or low thousands of CPUs (readily available on institutional supercomputers or commercial cloud computing services) amply allow for the design of high-NA wide-area metalenses with greatly enhanced functionalities including broadband achromaticity and large-angle aberration corrections.

Conclusion and Outlook
We have provided an efficient computational framework for the inverse design of large-area freeform metasurfaces.We have also presented various examples including multi-angle and multi-wavelength metalens designs that demonstrate the versatility and power of our method.We expect that a large-scale optimization technique like ours may become indispensable for tackling challenging problems which inherently call for a large design space with multiple layers.In particular, our method may greatly benefit the design of a polarizationinsensitive large-area high-NA single-piece metalens with chromatic and achromatic aberration corrections over the entire visible spectrum and over a large field of view.On the other hand, our framework need not be limited to metalens design.In fact, the particular objective we presented above might be more naturally suited for three-dimensional sculpting of the far-field intensity (or thin-film holography).Another intriguing application particularly suitable for the RCWA-based optimization framework is to inverse-design the far field between two meta-devices separated by thick (many-wavelengths) spacing lay-ers.Ultimately, one would like to address the most challenging problem of electromagnetic design: to intimately manipulate the near-field physics of large aperiodic structures in which ultra-rich modal interactions involving both extended and localized resonances may offer a superb playground for exploring novel phenomena and devising next-generation technologies such as solid-state Lidar systems [45], strongly enhanced light-matter interactions and nonlinear processes [46,47,48,49,50], near-field radiative heat transfer [51], and optonanomechanical engineering [52,53].While LPA offers asymptotic advantages in the limit of "adiabatic" nearly periodic surfaces, our optimization framework also provides a promising pathway for handling a wider variety of large aperiodic systems by incorporating additional constraints (Sec.3.2) or by augmenting LPA with domain decomposition concepts [54] including using the conjoined LPA solution as a preconditioner, using other boundary conditions (e.g.mirror boundaries), and using overlapping domains [55,56].domain problems via schur complement domain decomposition.Optics Express, 26(13):16925-16939, 2018.

Figure 1 :Figure 2 :
Figure1: An arbitrary aperiodic multi-layered meta-structure (top) is approximated by solving a set of periodic scattering problems (bottom), one for each unit cell (shaded areas), to obtain the approximate near fields over the entire metasurface.

Figure 3 :
Figure 3: Multi-layered 2D metalens (NA=0.45)chromatically corrected at the wavelengths λ 1 = 650 nm, λ 2 = 540 nm and λ 3 = 470 nm.The lens consists of two layers of TiO 2 , with thicknesses of 0.5λ 1 and 0.2λ 1 respectively, situated above and within the silica substrate.Three different portions of the lens have been magnified for an easy viewing of the device geometry; note the scale bars.The far field profiles are obtained by full-wave simulations of the entire structure (the upper panel) and by locally periodic approximation (the lower panel), exhibiting at-or near-diffraction limited focusing.

Figure 4 :
Figure 4: Monochromatic 3D cylindrical metalens (NA=0.71)with aperiodic cells along the x axis.The lens consists of a single TiO 2 layer above the silica substrate.Three different portions have been magnified for easy viewing; note the scale bars.The shaded area shows an example of a λ × λ cell.A full-wave simulation of the entire structure shows the diffraction-limited focusing.

Figure 5 :
Figure 5: Monochromatic 3D metalens (NA=0.37).A few portions of the lens have been magnified for easy viewing; note the scale bars.The lens consists of a single TiO 2 layer above the silica substrate.The far field profile is obtained by locally periodic approximation, showing diffraction-limited focusing.