Home/Technical Information/Design and Analysis Guides

Design and Analysis Guides

Metalens Design Across Lumerical and Zemax: Design Flow and Validation Guide

The design flow for a diffractive metalens built from cylindrical nanorods, worked across Ansys Lumerical and Zemax OpticStudio: building a phase library from unit-cell analysis (FDTD and RCWA), full-lens analysis by field reconstruction, system-level evaluation with POP, and GDS export.

The goal of this example is to design a diffractive metalens built from cylindrical nanorods. Adjusting the radius and placement of the nanorods produces the desired phase profile across the metalens surface. The design is validated through near-field and far-field analysis in Ansys Lumerical FDTD, RCWA (Rigorous Coupled-Wave Analysis) and OpticStudio.

Notes  Analysis in Zemax requires OpticStudio version 12 or later.

Phase control through meta-atom placement, and an overview of the analysis workflow:

Understanding the simulation workflow and the main results

The metalens design workflow

A metalens is a carefully arranged set of sub-wavelength “unit cells”, or “meta-atoms”. Adjusting the geometry of these unit cells changes the phase above each element in response to a plane wave. Once the phase is known as a function of the geometric parameters, placing meta-atoms at the required positions makes it possible to create a metalens with any phase profile.

Step 1: defining the target phase

The first step is to define the target phase profile of the metalens. For the most common lens types, such as spherical and cylindrical lenses, a known analytic solution can be used. For more complex systems where no analytic solution exists or the calculation is difficult, the ray tracing and optimisation capabilities of OpticStudio can be used to design the ideal phase mask.

Step 2: unit cell simulation, sweeping height and radius

This step varies the height and radius of the nanorod to obtain transmittance, phase and near field. A height is chosen that gives the desired transmittance and phase behaviour, and the phase (or field) against radius results are saved for the next step. The RCWA solver is introduced as a recommended and complementary tool for unit cell simulation, with a comparison against FDTD for validation.

Unit cell simulation: sweeping height and radius

Step 3: full lens design

Once the library of phase and field against radius has been built in step 2, two approaches are available for designing and analysing the complete metalens:

Direct simulation:Build the complete metalens in FDTD from the target phase profile and the phase-against-radius data obtained in the previous step, and simulate it. This approach is simpler, but it can run into difficulties with memory and simulation time, particularly for a large metalens. The near field obtained from the simulation can be used for far-field analysis or exported to a .ZBF file for further propagation in Ansys OpticStudio.

Simulation and configuration of the complete metalens

Full field reconstruction:The near field and far field of the complete metalens can be reconstructed by script from the near-field library of step 2. This avoids a time-consuming simulation of the full lens and is therefore far more efficient than the direct simulation approach. A detailed description of these approaches is given in the corresponding steps of the “Running the workflow, and results” section. We validate the accuracy of the “indirect” approach using a spherical metalens of small radius, then apply the approach to a larger metalens based on a target phase optimised in OpticStudio.

Step 4: propagating the imported beam in OpticStudio

Once the near field of the metalens has been exported to a .ZBF file in the previous step, the POP (Physical Optics Propagation) tool in OpticStudio can be used to propagate the beam through the whole system, bulk optical elements included. POP lets you analyse the phase and irradiance profile at each surface and evaluate the performance of the system. If necessary, the optical setup can be re-optimised in OpticStudio on the basis of the propagation results. Finally, the real beam can be validated by comparing it against the result of propagating an ideal beam through the target phase mask in OpticStudio.

Propagating the imported beam in OpticStudio

Step 5: GDS export

Once the physical geometry of the complete lens and the positions of the meta-elements have been designed, the pattern is normally exported to GDS format for fabrication. Because of the large number of elements involved, however, GDS export can generally take a long time. This step introduces a very fast and versatile GDS export approach using the polystencil command, and shows that it works well even for a large metalens made up of a great many meta-elements.

The design process: from phase design in OpticStudio to structural validation in Lumerical

How to run the model, and a discussion of the main results

Step 1: optimising the target phase profile with OpticStudio

The first step is to design the target phase profile for the intended metalens. For a lens of known geometry such as the ones below, the phase profile can be defined with an analytic expression.

Lens type

In the more general case, where the exact geometry (phase) cannot be written as an expression, it is useful to represent the spatial phase data on an orthogonal grid. This example designs a metalens that optimally focuses a collimated input beam together with a cylindrical lens that has power only in the Y direction. With the cylindrical lens alone, that is without the metalens, a line focus forms along the X axis. Our goal is to achieve the smallest RMS spot radius by optimising the phase mask of the metasurface.

Phase optimisation results

Once the target phase profile has been optimised, export the phase map from OpticStudio and use it as input to Lumerical for modelling the physical structure of the sub-wavelength unit cells.

1. Open the Zemax model with its initial settings ( phaseDesign_start.zar ). The phase profile is a constant zero at the initial stage.\n2. Run the local optimizer to optimise the target phase profile.

Target phase profile

This step designs the phase profile the metalens needs, using ray tracing.

In OpticStudio a metasurface can be described by a diffractive surface type, which applies an additional phase on top of a base refractive or reflective surface. The phase profile produces an extra bending of the rays.
This sample case uses the Binary 1 surface type, which describes the phase as an extended polynomial in X and Y, based on theoretical expectation:

Metalens Phase equation

where
phi: the phase at the metalens surface
M: the diffraction order
N: the number of polynomial coefficients in the series
x, y: spatial coordinates normalised to the radius of the metalens

Taking symmetry into account, and to avoid an over-complex phase profile that would not improve the solution significantly, the optimisation process uses only the coefficient of the x2 term as a variable, and quantifies the optimisation target with the default merit function for RMS spot size.
Based on the optimisation, the ideal phase profile is described by the expression below:

φ(x,y)=−11.703648x2

Optimized phase

As expected, with this cylindrical phase profile in the orthogonal X direction, the collimated input is focused to a diffraction-limited spot.

Step 2: building the phase library from unit cell analysis (FDTD / RCWA)

This step builds a library of phase as a function of nanorod radius, targeting a 2*pi phase variation over the range of radii considered. This library is later used as a mapping tool for placing a nanorod with the desired phase at each grid point of the metalens.
We also sweep the nanorod height to find the value that gives the highest possible transmittance. Once the desired nanorod height is found, another sweep builds a library of the near field as a function of radius, which is used in step 3 to reconstruct the near field and far field of the full lens. Two options are provided for the unit cell simulation, FDTD and RCWA, with their accuracy and compute time compared. FDTD is known for its generality across materials, geometries and wavelength ranges, while RCWA is recognised as a very effective tool for simulating periodic structures. The better choice may depend on the geometry of the structure, the materials, the source and the number of frequency points required. For details, see the RCWA solver page.

Option 1: FDTD

1. unit_cell.fsp, set the "radius" of the "model" object to 50 nm and run the simulation.\n2. Visualise "Ex" from the field monitor results. Repeat with a radius value of 100 nm.

One key result we are interested in is the phase of the electric field above the nanorod in response to a plane wave. In this example the cylinder radius is varied to introduce the required phase change. This behaviour is easy to confirm by looking at the field in the xz plane. Below are the real(Ex) results for cylinders of 50 nm and 100 nm radius. Because the cylinder has a higher refractive index than its surroundings, the propagating field for the larger radius sees a higher effective index than for the smaller radius. This ability to change the effective optical path length of the incident light by varying the nanorod radius is one of the key properties this example makes use of.

electric field compare at different radius
3. Run the script fdtd_unit_cell_plot_phase_T.lsf and obtain the following.\nPlot the results of the "height" sweep object to display phase and transmittance

Below are two-dimensional maps of phase and transmittance against rod height and radius. We found that above a height of 1.3 um, the phase variation over the given radius range (0.05 to 0.15 um) exceeds 2*pi. Transmittance at that height is high, above 0.9, and uniform across all radii, so both of the above requirements are met.

phase and transmission in terms of the height and radius of the rod by FDTD simulation

A line plot at a height of 1.3 um from the image above (dotted line) is shown below.

phase and transmission vs radius at 1.3um height.
4. Run the script  fdtd_unit_cell_export_phase_field.lsf  and obtain the following.\n    Plot the phase and field from the results of the "radius" sweep object.

The next plot shows the radius required to obtain a given phase, which is the transpose of the phase-against-radius plot above. The data is then interpolated onto finer “phase” and “radius” data points, which improves the match between the target phase and the actual phase produced by the radius chosen.

plot showing the required radius to produce a certain phase

For the same reason, the field data from the sweep is also interpolated onto denser “phase” data points and saved together with the radius data. The field data can also be sampled to reduce the data size, which makes calculating the near field and far field of the whole lens faster in the next step. The next image shows the near field for a 50 nm radius at different sampling values.

nearfield for a 50 nm radius at different sampling values.

Option 2: RCWA

The principle of the metalens unit cell simulation in RCWA is the same as in FDTD. The focus here is on showing what the RCWA results look like.

Comparing accuracy and simulation time against the FDTD solver ultimately provides guidance on which solver to choose.
The RCWA solver also has a GUI object, but here we use the script command rcwa. This script takes information on the geometry, source and simulation configuration and returns transmission and reflection, amplitude and field.

1. Run the script rcwa_unit_cell_plot_phase_T.lsf and plot the phase.

The two-dimensional phase and transmission maps at a height of 1.3 um and their line plots show that the RCWA results agree very well with the FDTD results. A convergence test would narrow the difference between them further.

phase and transmission in terms of the height and radius of the rod by RCWA simulation
FDTD and RCWA compare of phase and transmission vs radius at 1.3um height.
2. Run the script rcwa_export_phase_field.lsf. Take the results from the height sweep object, interpolate the "radius (or field) against phase" data and save it as "EH_and_phase_vs_radius_interp_rcwa.mat" for the next step.

The RCWA field results also agree well with the FDTD ones:

field result from RCWA shows a good match with the FDTD ones

Step 3: full lens analysis and improving efficiency with “field reconstruction”

With the target phase from step 1 and the radius/field against phase library from step 2, we are ready to design the complete metalens.

Phase-to-radius mapping for the metalens

Whatever the target phase, designing the lens requires converting a spatial phase profile into a spatial distribution of radii (nanorods). A spherical phase profile is shown as an example below, but the principle applies to any phase profile.

Phase-to-radius mapping for metalens

Direct simulation (a spherical lens of small radius)

Once the distribution of radii is known, the complete lens can be built and simulated in FDTD. This may be the simplest approach, but

it is not the most efficient, particularly for a metalens of large radius (>100 um). As with any large simulation, it can require a great deal of memory and a long simulation time. The large number of meta-elements can also make building the structure in FDTD and visualising it in the GUI slow.

1. Open the simulation file full_lens.fsp and run it.\n2. Visualise the amplitude and angle of Ex from the field monitor.

The metalens structure group loads the phase and radius data from step 2, performs the phase-to-radius mapping and places nanorods of the correct radius at the required positions.

full lens schematic

The simulation injects a plane wave. A circular aperture made of PEC (perfect electrical conductor) is placed between the source and the metalens to limit the incident area. The near-field results from the field monitor are as follows:

nearfield of full metalens direct simulation

The incident field is largely blocked by the PEC (perfect electrical conductor) aperture. Part of it, however, is diffracted at the edge of the aperture, visible as small ripples in the amplitude and phase plots. An ideal hyperbolic lens has perfect rotational symmetry, whereas this metalens is discretised as an array of nanorods on a rectilinear grid, so no such symmetry effect appears in the simulation results.

3. Run "part 1" of the script file fdtd_full_lens_plot_field.lsf.

The measured phase agrees well with the target phase overall.

full metalens phase simulation and target

How the incident field changes as it passes through the metalens can be visualised with a movie monitor or a time monitor. A movie monitor increases simulation time substantially, so it may be better to use a 2D time monitor instead and take snapshots of the field in time. A GIF animation of the field is shown below.

wavefront of the propagating field clearly shows inward bending

The wavefront of the propagating field is clearly bending inwards, showing the convergence of light expected from a lens with a spherical phase profile.

4. Run "part 2" of the script, fdtd_full_lens_plot_field.lsf.

The far-field projection along the propagation axis (z) shows the focal length of the metalens to be about 79.4 um. The FWHM (full width at half maximum) of the beam at the focal plane is about 2.4 um. The calculated focal length is somewhat off the target value of 100 um. The main reason is thought to be that the lens is small, so there are few nanorods to map the 2*pi variation across the lens radius. Increasing the lens size, and optimising other parameters such as the period, may improve the result.

Metalens farfield direct simulation

Field reconstruction (a spherical lens of small radius)

Instead of a time-consuming direct simulation of the whole lens, the near field and far field of the whole lens can be reconstructed using the near-field library from step 2. Again we use a spherical lens of relatively small radius (11 um) and compare against the direct simulation results to validate this approach.

1 – Near-field stitching and far-field projection

This method builds the near field of the whole lens by stitching together the unit cell simulation near fields corresponding to the phase at each grid point of the target phase distribution. Because the lens radius of interest is 11 um, only the region within a radius of 11 um is filled with matching fields, and the field outside is set to zero.

schematic nearfield stitching
1. Run "part 1" of the script, stitch_nearfield_11um_lens.lsf.\n2. Display the amplitude and angle of the "Ex" component in the visualizer.
fdtd stitched nearfield

The amplitude of the stitched near field looks rather different from that of the direct FDTD simulation. This is due to slight differences in the settings used by the two approaches:
– the use of a PEC aperture in FDTD

– the reconstruction method assumes local periodicity, whereas in FDTD the size of adjacent cells can differ where the radius of neighbouring rods changes abruptly

both amplitudes are in the same ball park and the overall phase results show a good match

That said, the two amplitudes are in a similar range and the overall phase results also agree well.

3. Run "part 2" of the script, stitch_nearfield_11um_lens.lsf.
The farfield results from the stitched nearfield match direct simulation results very well in terms of the focal distance, spot size and intensity.

Overall, the stitched near-field results agree very well with the direct simulation results in focal length, spot size and intensity.

2 – Summing the far fields of the unit cells

This is equivalent to the near-field stitching approach but in the opposite order. Here we first build a far-field library from the near-field library built in step 2. We then sum the far-field contributions of all the nanorods, accounting for the phase change due to their displacement from the origin. Mathematically, the method is described as follows:

farfield summation formula
1. Run the script sum_farfield_11um_lens.lsf.
The farfield results (on a 1m radius hemisphere) from the direct simulation and the reconstruction by summation match very well

The far-field simulation over a hemisphere of 1 m radius and the reconstruction by summation agree very well.

Field reconstruction (a lens with a phase profile optimised in OpticStudio, radius = 100 um)

Having confirmed the validity of the “field reconstruction” approach for a small lens by comparing against direct simulation, we now extend it to a larger metalens design whose 2D phase profile was optimised in OpticStudio (step 1). Here we use the near-field stitching approach.

1. Run the script stitch_nearfield_ZOS_R100um.lsf.

The image below shows the phase of the stitched near field, which resembles the ideal phase profile obtained in step 1. The script exports the reconstructed near field as a .ZBF file for further propagation and validation in OpticStudio in the next step.

phase of the stitched nearfield

Step 4: evaluating system-level performance with POP (physical optics propagation)

The Enear_lens_extended.zbf file exported in step 3 can be imported directly into OpticStudio, propagated through the rest of the system and analysed and evaluated further. To confirm that the physical model of the metalens is a realistic representation of the required phase mask, we compared the real beam defined by the .ZBF file against an ideal top-hat beam propagated through the target phase mask.

1. Open the final simulation file including beam propagation (phaseDesign_ZBF.zar).\n2. Compare the propagation results of the ideal beam and the real beam.

Beam propagation results

This step uses the POP tool in OpticStudio to analyse the propagation of the beam imported from the previous step. First, to analyse the real beam, we use a ZBF-file-based beam definition that depends on the near-field distribution, propagate the beam from a dummy surface after the metalens, and propagate it through the whole system to the focus. Then, for comparison, we propagate a top-hat beam through the ideal phase profile and then through the whole system.

Below are the irradiance distributions at the focus after the two propagations.

irradiance distributions after the two propagations at the focus.

The results agree well, validating the nanoscale model of the metalens.

Step 5: fast GDS export for fabrication with the polystencil command

Once the physical geometry of the whole lens and the positions of the meta-elements have been designed, the last step is writing out GDS format for fabrication. Because of the number of elements, however, GDS export generally takes a long time unless care is taken. Here we use the polystencil command, which extracts the vertices of the polygons on a particular Z plane. This method works for meta-elements of any shape and can describe several elements within a unit cell.

1. Run the script  gds_export.lsf .

The script loads the unit cell simulation file and first builds a library of vertices as a function of radius. Using the radius-against-phase data and the two-dimensional target phase distribution, it then adds polygons to the GDS file.

The images below are GDS exports of the two target phase maps used above. The one on the left is for the spherical metalens of 11 um radius, which works out to about 1900 elements. That image takes just one second to export. The one on the right is the GDS of the cylindrical phase mask with a 100 um radius.

It has about 150,000 elements, and exporting it to GDS took just five seconds.
This GDS export approach handles millions of elements comfortably, and with a small change to the script it can handle larger lenses still.

The GDS export approach can easily handle millions of elements and would work for larger lenses with slight modifications to the script.

The reasoning behind the simulation parameter settings for accurate analysis

A description of the important objects and settings used in this model

Convergence and simulation time in the unit cell analysis

Variables of the “model”

object has height, radius and period as variables. The position and span of the simulation region, monitors and source are set automatically from these parameters.

The “S parameters” analysis group

A script sets the span and centre of the metamaterial automatically to match the height of the “model”.

Simulation time

In a unit cell simulation, the simulation time required at each sweep point can differ. As a precaution, the current simulation time is set to 10,000. It is a good idea to confirm that every sweep ended by reaching the auto shutoff level, which can be done by including the “status” result from “FDTD”.

PEC aperture settings and reducing memory load in large-scale analysis

PEC aperture

To block field leakage outside the lens, a stop made of PEC material is placed immediately in front of the metalens. Its radius is set automatically by the script within the “model”.

The metalens structure group

To visualise target phase against position and radius against position, set “make plot” in the “metalens” structure group to “1” and click the “Test” button on the “Script” tab. Phase_vs_radius.ldf also stores material data and other geometry data, to make setting up the full lens simulation easier.

Rendering detail

When there are many structures to draw, the display can become slow. This happens particularly with a large metalens. To avoid the problem, set the structure rendering detail in the “metalens” structure group to a low value.

The farfieldsettings script command

Projecting the near field from a large frequency monitor can make the far-field calculation take a very long time. To reduce compute time without sacrificing accuracy, the farfieldsettings script command can be used to downsample the near-field data points.

ZBF array size and sampling in wave analysis (POP)

Array size for the ZBF file

This ensures good sampling of the beam both near and far from the focus when propagating with the POP tool in OpticStudio.

Propagate with the POP tool in OpticStudio and set the array size to X = w*sqrt(pi*n), where w is the waist size and n is the number of points.

Pilot beam radius

To confirm that POP uses the correct propagation method for the ZBF file, change the Output Pilot Radius under Surface Properties > Physical Optics to User-defined X-Radius = -4.0671, Y-Radius = 0.

Changing the design parameters (geometry, period, focal length) and redesigning

How to update the model for your device parameters

Geometry

If you want to change the geometry of the metalens, be sure to update the full lens simulation file as well as the unit cell. The “model” object and the “sweep” object must be updated with the correct parameters.

Period and wavelength

When changing the wavelength or the unit cell period, it is generally wise to avoid multiple grating orders, which can complicate the metalens design.

Focal length

A longer focal length generally means a larger lens radius, which in turn means more memory and more simulation time. Before moving to a larger device it may be a good idea to run a preliminary test on a smaller one to validate the concept.

Physical considerations for avoiding discrepancies and errors in the analysis results

It is common for the measured phase to deviate from the target phase in this way. There are various possible reasons:

– diffraction at the PEC aperture

– breakdown of local periodicity between adjacent nanorods: the phase obtained in step 2 assumes an infinite series of nanorods of the same diameter. Where the radius of adjacent nanorods changes very little, the structure can be assumed locally periodic, so the phase-radius relationship from step 2 still holds. This example uses relatively small radii, and the change in phase (and therefore radius) between adjacent nanorods may be somewhat abrupt.

– departure from sub-wavelength operation: as the nanorod radius grows, strong field interaction can occur between adjacent nanorods.

– mesh refinement: a coarse mesh may not represent fine features well.

To improve the results, you might try:

– changing the unit cell period so that operation is sub-wavelength throughout

– increasing the radius of the metalens

– refining the mesh

Extending to broadband analysis and circularly polarised metalenses

Information and tips for users who want to customise the model further

Broadband simulation

The current example is based on a simulation at a single frequency. It can be extended to a broadband simulation by changing the simulation settings and the scripts. This relates to the extra dimension (frequency) added to the data.

Different lens geometries

This example applies easily to lenses of different geometry (phase profile). To design a flat metalens equivalent to a spherical, cylindrical or axicon lens, for example, simply use the corresponding phase expression and

generate the 2D target phase map. Once the phase/field against radius library is built, the library can be reused to test the near-field and far-field behaviour of a lens of any geometry quickly.

Placement of the “meta-atoms”

This example uses a rectangular lattice to build the whole metalens from square unit cells. The nanorod radius at each lattice point is calculated and a structure is added at each lattice site. This works fine when the number of elements is small. For a large metalens with an enormous number of elements, however, it can be very slow. In that case, rather than generating the pattern element by element, the symmetry of the design can be exploited to speed up pattern generation. You might also consider a non-periodic arrangement of unit cells to represent the phase profile better.

Circular polarisation

Simulating a metalens with chiral properties requires circularly polarised light.

Additional resources

Additional documentation, examples and training material

Video

Held on Friday 19 May 2023: a webinar on metalens design with Ansys Lumerical and Ansys Zemax

  1. P.Yeh, “Optical Waves in Layered Media“, Wiley-InterScience, chap.3, 2005.
  2. M. Khorasaninejad et al., “Visible Wavelength Planar Metalenses Based on Titanium Dioxide“, IEEE Journal of Selected Topics in Quantum Electronics, 4700216 (2017)
  3. Designing large, high-efficiency, high-numerical-aperture, transmissive meta-lenses for visible light” Optics Express, Vol.24, Issue 5, pp.5110- 5124 (2016)

Talk to us about your design and analysis

Our engineers can advise on building a design flow for your application, and on validating an analysis model, from practical experience.