Designing a Metalens in VirtualLab Fusion¶
🎬 Overview¶
This tutorial walks you through the complete design and simulation workflow for a metalens in VirtualLab Fusion. A metalens is realized as an Optical Digital Twin – an intelligent replica that encapsulates its own simulation model – and can be accessed via the Digital Twin Hub.
The workflow consists of four main steps:
- Configure the metalens – specify the optical environment and define the target phase profile
- Create a surrogate model – define the meta-atom parameter space and train the neural network
- Design and simulate – map the phase profile to discrete meta-atoms and analyze performance
- Export the structure – generate a GDSII file for fabrication
🎥 Prefer to watch? This 4:52 video provides a quick overview of the end-to-end workflow. For a deeper dive, continue reading below.
For detailed technical information about the Metalens [PCA] twin, including model parameters and performance characteristics, refer to the specification sheet.
🚀 Step-by-Step Tutorial¶
Step 1: Metalens Configuration¶
After adding the metalens component to your system, configure the basic properties: the medium after the component and the aperture diameter (shape is always circular). Then define the wavefront phase profile – the phase transformation to be applied by the metalens.
VirtualLab Fusion provides two methods for defining the phase profile:
-
Even Order Radial Polynomials: Define spherical, aspherical, or freeform phase profiles using polynomial coefficients (r², r⁴, ...). Coefficients can also be imported automatically from a Zemax Binary 2 surface.
-
User Defined Formula: Define the phase profile using a mathematical expression in C# via VirtualLab's snippet technology.
🎥 Metalens Configuration: For a detailed walkthrough of the phase profile definition, watch the video below.
Step 2: Creating the Surrogate Model¶
Accurate metalens simulation requires solving Maxwell's equations for millions of meta-atoms - a computationally intensive task that makes testing different designs or integrating metalenses into complete systems impractical. VirtualLab Fusion overcomes this with surrogate models: neural networks trained to predict the optical response of a meta-atom.
Compute once, use everywhere. Instead of running RCWA (Rigorous Coupled-Wave Analysis) on the fly for every meta-atom during design, the neural network is trained once per meta-atom type, covering the full parameter space of geometrical parameters and incident light conditions.
Once trained, the surrogate model is bound to the metalens component. The workflow within VirtualLab Fusion is as follows:
- Initialize training – click the corresponding button in the metalens edit dialog or use the Surrogate ribbon in the main window.
- Configure the solution space – define the geometrical parameters (width, length, radius) and incident light conditions (wavelengths, incidence angles) to be covered by the surrogate model.
- Perform training – run the neural network training process; this requires many RCWA calculations but only once. Training can also be accelerated using distributed computing.
- Bind the model – attach the trained surrogate model to the metalens component with one click via the edit dialog or ribbon.
💡 Note: After training, the surrogate model includes response evaluation tools. You can use these tools independently – outside of full system simulation – to analyze meta-atom behavior and verify optical response before system-level design.
🎥 Creating the Surrogate Model: For a detailed walkthrough of the surrogate model training process, watch the video below.
Step 3: Design & Simulation¶
With the basic configuration of the metalens complete, you can now design and simulate the metalens within your optical system.
The workflow consists of two stages:
-
Ray Tracing (First Look) – Run a ray tracing simulation to verify the general optical function based solely on your defined phase profile. This stage does not require a trained surrogate model and provides a quick performance preview.
-
Field Tracing (The Design Step) – The first time you run a field tracing simulation, a design dialog opens where you can configure the design parameters and perform the design. Once the design is complete, it is stored into the metalens component and the simulation resumes using the designed data.
-
Subsequent Simulations – Once the design step is complete, the design information is cached for subsequent simulations. The results of the design process – such as phase error and efficiency – can be accessed within the edit dialog of the metalens component. This enables fast and accurate modeling of the designed metalens for any input and with any merit function of interest, without repeating the design process.
🎥 Design & Simulation: For a detailed walkthrough of the design and simulation process, watch the video below.
Step 4: Exporting the Structure¶
Once you are satisfied with the performance of your metalens in simulation, you can generate fabrication data. The metalens is now designed, and the built-in fabrication export – accessible via the edit dialog of the metalens component – allows you to configure several parameters and finally generate a standard GDSII file. This file contains the shape, size, and position of every meta-atom in your design and can be easily transferred to fabrication.
The export workflow is as follows:
- Open the edit dialog of the metalens component
- Click the export fabrication data button
- Configure the export parameters and trigger GDSII generation
- Verify the output and inspect the generated GDSII file with standard GDSII viewers such as KLayout
Last updated: March 24, 2026 Tags: metalens surrogate model neural network optical design VirtualLab Fusion