In this article, a workflow for the design and simulation of a cm-scale metalens is presented. The nano-element are modeled in Lumerical and the RCWA method is used to create a database of the phase and amplitude induced by a single cell as a function of its radius. The data is passed to OpticStudio for integration into a ray tracing system, where a collimated beam is focused by the metalens.
[[NOTE:]] This feature is only available in Ansys Zemax OpticSudio Premium/Enterprise. For the generation of the .h5 file, Ansys Lumerical of version 2023R2 or higher is required. Multiwavelength is supported only from version 2025R1 or higher of the plugin.
Overview
Understand the simulation workflow and key results
Metalenses are advanced optical structures composed of nano-elements. By adjusting locally the individual cells, it is possible to create complex optical functions. However, it is a real challenge to simulate this kind of device on a large scale because it is not periodic, and it is composed of a large number of nano-elements. In addition, metalenses are intrinsically based on wave optics, but there is a need to integrate them into ray-tracing systems.
Details on the method to create a metalens, with the validation of the RCWA computation, can be found in the article Small-scale metalens - Field propagation . That workflow presenting a smaller scale metalens was suitable to simulate the beam propagation through the optical system with the Physical Optics Propagation (POP) tool of OpticStudio. However, it presents the limitation in the maximum size of the lens that can be simulated, essentially due to the memory required. In this article, a different workflow to design a large metalens with a diameter of 20mm is presented. In this workflow, we demonstrate that we can design a metalens at the nano-element level and assemble it up to the centimeter-scale. The metalens is then integrated into a ray-tracing system in OpticStudio. We also provide a process to extract the metalens information into a GDS file for manufacturing.
Step 1: Target phase definition
The first step is to define the target phase profile for the metalens. For a scale beyond a few hundreds of microns, the memory requirement to produce, store, and use a full phase map is too great for typical CPU. In this workflow, we use a target phase profile that can be defined analytically, such as a spherical or cylindrical profile. Ansys OpticStudio can also be used to optimize the wavefront desired in the metalens plane within the full optical system, so that the target phase can be defined with a function with a discrete number of coefficients (e.g. a polynomial).For an example with a more advanced optimization workflow, see Eye tracking optical system with a metalens or Fiber Endoscope Design Using Metalens for Illumination and Collection .
Step 2: Unit cell simulations – Height and radius sweep (Not covered)
In Lumerical, a sweep of the parameters of the unit cell (e.g. radius of a nanorod) is performed to generate a database of parametric nano-element responses. For more details, see step 2 in the article Small-scale metalens - Field propagation .
Step 3: Generation of the nano-elements map and integration in OpticStudio
Based on the target phase profile and the database defined in the previous steps, a large metalens is defined. The database is written into a file that includes a map with indexes, pointing at a discrete list of possible values for the phase and amplitude of every cell. This file is then used in the Zemax plugin included in the download package to integrate the large lens into a ray-tracing system.
Step 4: GDS generation
The GDS export is still supported at this scale, see the article Small-scale metalens - Field propagation for more details.
Run and Results
Instructions for running the model and discussion of key results
Note: initial step 0 is included in the script file named: generate_metalens_data.lsf, where a window pops-up and informs the user for the memory requirements of the model.
Step 1: Target phase definition
For practical cases, Ansys Zemax Opticstudio can be used to derived the desired phase function with an optimization process. For more details on this process, see see Eye tracking optical system with a metalens or Fiber Endoscope Design Using Metalens for Illumination and Collection . In this example. We use a simple phase function that can be defined analytically, so we can use simple function defined directly in the lumerical script.
The generation of a metalens with a diameter of 20mm can take a little time. It is recommended to go through the example a first time with a smaller lens (e.g. with a diameter of 2mm and a focal length of 5mm).
- Open the script [[generate_metalens_data.lsf]], set the focal length and the lens radius, and run Part 1 to observe the 1D profile.
At a scale of several millimeters in diameter with a resolution at a nanoscale given by the size of the nano-elements, generating a file containing a full map of the desired target phase would require additional effort in memory. Instead, we restrict the target phase profile to a map that can be described analytically by a function. In this article, we target a spherical lens with a radius of 10mm and a focal length of 50mm.
Note that it is important to maintain the numerical aperture (NA) at a reasonable value. If the metalens is designed to target a lens profile that is very fast, the phase variation on the edges may exceed what can be achieved considering the resolution of the nano-elements. In order to ensure a \(2 \pi\) phase coverage between unit cells, the numerical aperture should satisfy the Nyquist sampling criteria [1] as follows:
$$\text{NA}<\frac{\lambda}{2p}$$
Where \(p\) is the size of a unit cell, \(\lambda\) is the design wavelength, and NA=Radius/focal. Beyond this fundamental limit, limitations in the metalens model are expected when the gradient of the wrapped phase is too steep and experiences rapid jumps when using the local phase gradient method. See the discussion in the appendix for more details.
Step 2: Unit cell simulations – Height and radius sweep (Not covered)
- Run the script [[generate_meta-atom_database.lsf]].
This step consists of performing a sweep on the cell parameters (e.g. the radius of the nanorod) to determine the relation between the local characteristic of the cell element and its output phase and amplitude. The procedure is not impacted by the final scale of the metalens. For more details, see step 2 in the article Small-scale metalens - Field propagation . The output file for this sweep containing the database information of phase and amplitude is [[phase_amp_vs_radius_wave_theta_phi.h5]].
Note that the sweep is performed for a discrete number of phases, which implies a discrete number of possible radii for the nanorods. The discretization is present in the resulting phase and emulates the natural manufacturing constraints of the nano-elements as in reality only a certain discrete number of different meta-atoms can be produced.
It is also important to set the RCWA solver parameters. The sweep is performed for a given spectral and angular range. It is recommended to ensure the angular range cover the maximum expected incidence, and that the spectral range includes the design wavelength for which the target phase was defined.
Step 3: Generation of the nano-elements map and integration in OpticStudio
Generation of the Phase map with Lumerical
- Run Part 2 of the script [[generate_metalens_data.lsf]].
- Locate the [[.h5]] file that was generated by the script and copy it in the folder Zemax>DLL>Surfaces.
Based on the target phase profile and the phase library defined in the previous steps, a lens with a cm-scale is defined. The .h5 file contains a map with indexes, pointing at a discrete list of possible values for the phase and amplitude of every cell, where each index points to an entry in a list of possible phase and amplitude values. Each entry corresponds to a nano-pillar characterized by its radius.
Note that the phase and amplitude database is computed for each incident angle defined in the RCWA object. If you check the RCWA solver parameters in the "Excitation" tab, you should see that in this example we run the RCWA for incident angles within 0-40°. It is also important to note that the range of phi should either be -180° to 180°, or simply set with phi=0° as a single value.
The database of amplitude and phase values is independent of the scale, but the index map increases with the size of the lens. As the file size increases with the number of nano-elements in the design, it is recommended to perform preliminary tests with smaller diameters. In the case of oblique incident, the database becomes more extensive as the different incident angles need to be considered, see link to article for more information. A single average unit cell value suffices to represent the phase and amplitude response, more details of this process (down-sampling) are explained on step 2 of the article Small-Scale Metalens.
Integration in OpticStudio
- Open the file [[metalens_20mm.zprj]].
- Check the parameters of the sytem:
- The [[.h5]] file is set in the comment column of the metalens surface.
- The method selected for the metalens surface is set to 1. This is the recommended method, see the appendix for more information.
- In the Multi-configuration Editor, two different wavelengths are considered. For 550nm, we select 2 different diffraction orders.
The metalens is set in OpticStudio on a User Defined surface, with the DLL [[lumerical-metalens-XXXX.dll]](where 'XXXX' represents the version and time-stamp). The data are then read by inserting in the Comment column the name of the [[.h5]] file that was generated (including the extension). It may take a little time for the data to load in the case of a metalens with a diameter of 20mm .
Two different methods are available to compute the output direction of a ray after interaction with the metalens element. The selection is made by setting the parameter “Method”. The value 0 corresponds to the Local Phase Gradient method, while the values 1 and 2 corresponds to the Windowed Fourier Transform (WFT) method with different levels of accuracy. The differences between the 2 methods are explained in the appendix.
By default, we consider the WFT method, as it is more accurate and offer the possibility to examine multiple order of diffraction.
Compared to the phase gradient method, the WFT provides the option to select the desired order. In this context, the “order” may not corresponds exactly to the standard definition of a diffraction order. The peaks detected in the angular space are sorted out by decreasing strength. “Order 0” corresponds to the order with the highest energy. If the value of the order parameter is higher than the number of peaks detected, the latest order is used (weakest peak).
Step 4: GDS Generation
- Open the script [[gds_export.lsf]]. Set the focal length to 50mm and the lens radius to 10mm, and run the script.
The export into GDS format is an essential final step for manufacturing. This feature is still supported at this large scale, please take a look at the article Small-scale metalens - Field propagation for more details.
Important model settings
Description of important objects and settings used in this model
- Even with this updated workflow, the maximum size that can be simulated is limited by the RAM of the computer. With a 64Gb of RAM, the maximum size that can be generated is a metalens with a radius of a little over 10mm.
- For the moment only meta-atoms insensitive to polarization are supported by the ray-tracing.
- The metalens is comprised of a unit cell with a finite dimension, and the library is generated with a discrete value of possible phase. The F-number of the lens should be such that the phase profile does not vary faster than what can be resolved by the unit cells.
- Since both methods to determine the output direction of the rays relies on the local profile surroundings the location where the ray hits the metalens, a certain loss of accuracy may be expected at the edges of the metalens when part of the surrounding is outside the metalens. It may induce rays hitting the border of the lens to not be deflected as desired. It is therefore recommended to set the aperture size a little smaller than the actual size of the metalens. In our case the aperture diameter of the system is set to 19.8mm since the diameter of the metalens is 20mm. It is recommended to use the aperture type "Entrance Pupil diameter" to ensure the correct size of the metalens..
- In the RCWA sweep for the generation of the meta-atom database, the angular range for phi should be either only 0, or cover -pi to pi.
Updating the Model with Your Parameters
Instructions for updating the model based on your device parameters
- The focal length, size of the lens, and phase function defined in Step 1 may be customized to generate different functions
- In this example, the radius of the nanorods is used as the main parameter to induce the desired phase. Different custom unit cells may be defined, and parameters such as height and duty cycle may also be part of the sweep to generate the desired database library similar to what is demonstrated in Step 2.
- During the RCWA sweep, it is possible to generate the database quickly with only a small number of sample point (e.g. 10nm sampling for the radii)for the meta-atom parameters. Assuming the phase varies relatively smoothly with the meta-atom parameters, spline interpolation is then used to refine the database (e.g. 1nm sampling for the radii). If for some reason the variation is not smooth, it may be better to perform the sweep directly with more points, to change the interpolation from splin to linear ("interp" instead of "spline"), or even to not do any interpolation. This is especially the case when the size of the meta-atom is such that it reaches a resonance, causing a typically a deep in the amplitude profile for certain cases.
Taking the Model Further
Information and tips for users that want to further customize the model
The [[.h5]] file only provides wrapped phase information. It actually corresponds to the physical structure of the metalens that covers typically \(0-2\pi \) only with the meta-atom parameter range.This is sufficient for computing the ray bending since only the phase gradient is used in the first method, and the wrapping also does not impact the computation with the WFT. However, there could be advantages to unwrap the phase for further analysis, such as the OPD. Since unwrapping the phase is not trivial, we provide an option in the parameters that allows to set a reference phase profile that can be used by Zemax to unwrap correctly the phase profile of the metalens. Note that this option is available only when the local phase gradient method is selected ("Method =0"). The equation for the reference phase map works as follows:
$$\Phi = \Phi_{sphere,cylinder}+\Phi_{radial\,polynomial}+\Phi_{xy\,polynomial}$$
where
$$\Phi_{sphere,cylinder}= Order * \frac{2\pi}{\lambda}(f-\sqrt{f^2+c_x x^2+c_y y^2})$$
$$\Phi_{radial\,polynomial}= Order * \frac{2\pi}{\lambda} \sum\limits_{i=1}^{N} A_i r^i $$
$$\Phi_{xy\,polynomial}=Order * \frac{2\pi}{\lambda} \sum\limits_{i=1}^{N,M} B_{i,j} x^i y^j$$
For the case of our example with a simple spherical profile, it should look like this:
Whith this option enabled, it is possible to visualize the unwrapped phase with the "surface Phase" analysis tool.
Additional Resources
Related Publications
- Mu Ku Chen, Yongfeng Wu, Lei Feng, Qingbin Fan, Minghui Lu, Ting Xu, and Din Ping Tsai "Principles, Functions, and Applications of Optical Meta-Lens", Advanced Optical Materials, Volume 9, Issue 4 (January 2021); https://doi.org/10.1002/adom.202001414
See Also
- Small-scale metalens - Field propagation
- Eye tracking optical system with a metalens
- Fiber Endoscope Design Using Metalens for Illumination and Collection
Appendix
Additional background information and theory
Two different propagation methods are available to compute the direction of the output rays after they interact with the metalens.
Local Phase Gradient Method
The local phase gradient method is applied when the parameter “Method” is set to 0.
With this method, the integration into the ray tracing is using an interpolation around the surrounding phase value at the spatial location where the ray hit the metalens, in order to determine the local phase gradient. The output direction of the ray for the m th order is then computed as follows:
$$n_2 X_2 = n_1 X_1 + \frac{m\lambda}{2\pi}\frac{dP}{dx}$$
$$n_2 Y_2 = n_1 Y_1 + \frac{m\lambda}{2\pi}\frac{dP}{dy}$$
$$Z_2 = \sqrt{1-X_2^2-Y_2^2}$$
Where (\(X_i, Y_i, Z_i\)) are the ray unit vectors for the input and output rays, \(n_1\) and \(n_2\) are the refractive indexes of the approach and exit media, \(\lambda\) is the wavelength, \(m\) is the diffraction order, and \(P(x,y)\) is the local phase in radian. Note that \(z\) is assumed to be the normal vector to the surface.
Two different interpolation methods are made available to compute the bending of the rays from the phase gradient. The method can be selected in the parameters of the surface in OpticStudio. The value 1 calls for bilinear interpolation while the value 3 corresponds to a bicubic interpolation. The bicubic interpolation may be a little more accurate while the bilinear method is expected to be a little more robust to the phase jumps.
Windowed Fourier Transform
The WFT method is applied when the parameter “Method” is set to 1 or 2, corresponding respectively to “fast” and “standard” settings.
It is recommended to use Method=1 as it is expected to provide results with better speed and accuracy.
The principle of the WFT method is to consider the ray that hits the metalens as a local plane wave. A window is applied on the metalens profile (phase and amplitude), and a Fast Fourier transform (FFT) operation is applied to obtain the angular space information. The different orders of diffraction induced by the metalens generate each a peak that is detected in angular space. The position of these peaks in angular space enables to compute the corresponding output direction for the rays after the interaction with the metalens element.
One key aspect regarding this method is the size of the window. The accuracy in angular space is inversely proportional to the window size, so the size of the window needs to be large enough. However, since an FFT operation is performed for each rays, the computation speed becomes an issue if the window is too large. When selecting method 1 or 2, a parameter is available to set the window size (in unit of lambda). The default is set at \(100\lambda \), but a rule of thumb is to set it at \( 2\sqrt (\frac{f}{\pi \times \lambda}) \).
Method 1 provides a fast implementation of the WFT with advanced parameters for the window selection. It is expected to be fast and accurate enough to provide MTF results matching experimental measurements. Method 2 is a more standard implementation of the WFT. It is much slower, which makes it less comfortable to use for window size higher than \(150\lambda \). It is still provided for potential corner cases that could trigger unexpected behavior with the other implementation.
Notes between the different methods
The local phase gradient method is fast as it relies on simpler computation. It may be useful for initial design phase, or quick assessment at a single wavelength. When the wavelength is different than the design wavelength, it is expected for the phase gradient method to not provide accurate results. One reason is that at a different wavelength, the phase jumps induced by the metalens structure do not match anymore with the jumps between \(0\) and \(2\pi\), which produces a periodicity of the phase jumps that do not match with the phase profile.
The WFT provides more accurate results, even at wavelengths different than the wavelength of design. It also supports multiple order, which allows for a deeper analysis of the system. However, the accuracy of the results (especially the MTF) may vary based on the choice of the window size.