The Lumerical Sub-Wavelength Model (LSWM) plugin can be used to model nano-scale structures with planar layers and/or periodic patterns as optical property in Ansys Speos or Zemax OpticStudio for macro-scale optical simulation. Typical examples of these structures are coatings, polarizer elements, diffraction gratings, and metalenses with feature sizes comparable to or smaller than the wavelength of light. The data describing the surface scattering is saved into an LSWM or JSON file format and then loaded to Speos or Zemax OpticStudio as a surface property.
This article explains how to extract the scattering data from nano-scale simulations with different Lumerical solvers. For further information on how to use the LSWM plugin in Speos see Lumerical Sub-Wavelength Model: Usage in Speos. For further information on how to use the LSWM plugin in Zemax OpticStudio see Lumerical Sub-Wavelength Model plugin: Usage in Zemax OpticStudio.
Introduction
With the LSWM plugin, the coating, polarizer, diffraction grating, or metalens is accurately simulated in Lumerical FDTD, RCWA, or STACK, and the properties of the surface are saved into an LSWM or JSON data file. This data file can then be imported into Speos or Zemax OpticStudio as a surface property to model the characteristics of the subwavelength structures in a ray-tracing simulation. Different solvers are used for different types of structures:
- Coatings are modelled as surfaces with specular scattering and transmission. They can be simulated with Lumerical STACK.
- Diffraction gratings, which are periodic devices, are modelled as surfaces that scatter light to the supported grating orders. The LSWM model supports 1D and arbitrary 2D grating lattices. The diffraction gratings can be simulated with Lumerical FDTD or RCWA. For a comparison between FDTD and RCWA, please see the RCWA Solver Introduction.
Note: Lumerical FDTD only supports 1D or 2D Cartesian gratings, or gratings that can easily be simulated as a Cartesian grating, such as a triangular lattice where the unit cell can be doubled in size to create a rectangular unit cell. On the other hand, Lumerical RCWA supports non-Cartesian gratings with non-orthogonal lattice vectors. - The exact same LSWM data format is used for metalenses as well to characterize the response of the unit cells with respect to wavelength and incident angles. Metalens unit cells can be simulated with Lumerical FDTD or RCWA. More details about metalens applications can be found here: Introduction to metalens workflows.
- Idealized coating, polarizer, or grating properties can also be generated with a script and exported to a data file.
The main benefit of using the LSWM file format instead of the JSON file format is it has much smaller file size thanks to the fact that JSON is an ASCII-based text format while LSWM is based on the binary HDF5 file format. Besides, the LSWM data format allows for improved accuracy due to the updated interpolation methods. Further details about the specific LSWM data format can be found in this article: HDF5 meta-atom design and database file format.
Exporting Surface Properties from Lumerical RCWA
The LSWM surface property data can be exported directly from the RCWA solver object after an RCWA simulation is run. To calculate and export the LSWM data from a RCWA simulation:
- Set up the RCWA simulation as you would a normal RCWA simulation.
- Set the propagation direction to both in the General tab of the RCWA settings.
- Enable the report grating characterization option in the Results tab of the RCWA settings.
- Run the simulation.
- Right click on the grating_characterization result in the Result View of the RCWA solver and select Export to LSWM or Export to JSON. A dialog window will appear to finalize the data export options.
- In case of Export to LSWM, in the dialog window, first review the Lattice angle and Backward definitions. If exporting LSWM from RCWA grating_characterization results, then these parameters are grayed out and read directly from the RCWA solver settings. On the other hand, if exporting from a sweep, the Lattice angle and Backward definition settings can be adjusted directly in the dialog window if needed to adjust any changes. Next, enable the Lossless option if the cladding or substrate material is lossless, and enable the Interpolate over incident angle or Interpolate over wavelength options if linear interpolation of responses is preferred. Users can also enable the Truncate order option and set the Min and Max orders to keep (inclusive) to allow truncation of grating orders. Besides, users can select the Resampling parameter to be None, Theta, Phi or Wavelength, and set the number of points to resample under the value parameter to initiate resampling in one of the parameters. Finally, select a path and name for the generated LSWM file either by directly editing the text box or clicking the Save as... button to open a file dialog.
For further details about how to export from a sweep, refer to this article: Lumerical Sub-Wavelength Model: How to Simulate a Grating with Spatial Variations. - In case of Export to JSON, in the dialog window enable the Lossless upper option if the upper (cladding) material is lossless, and enable the Lossless lower option if the lower (substrate) material is lossless. Then select a path and name for the generated JSON file either by directly editing the text box or clicking the Save as... button to open a file dialog.
- Click the OK button to save the file.
Alternatively, one can use the lswmexport script command to export the grating characterization data into an LSWM or JSON file. For further details about the syntax, required data format, and detailed descriptions see lswmexport - Script command.
Note: The range of wavelengths and angles that you select for the RCWA simulation will be the wavelengths and angles in the LSWM data. These should cover the expected range of wavelengths and incident angles of the rays on the surface in the Speos or Zemax OpticStudio ray-tracing simulations.
1D and 2D diffraction gratings
An example RCWA simulation is provided in the "1D_diffraction_grating.fsp" simulation file. The LSWM surface properties data file can be exported by following the instructions given above with this file or using the lswmexport script command.
Initially, the RCWA simulation is run with only normal incident light and 25 wavelengths. This allows us to quickly perform the simulation and get the RCWA results. Later, a full range of incident angles and wavelengths can be simulated relatively quickly using RCWA as discussed below.
To create a data file which fully characterizes the structure for all angles of incidence and wavelengths, the following changes to the RCWA solver object in the "1D_diffraction_grating.fsp" file can be made:
- incident angle = range
- minimum theta = 0, maximum theta = 85, and theta points = 18 which gives 5-degree increments
- minimum phi = -180, maximum phi = 180 and phi points = 37, which gives 10-degree increments
- minimum wavelength = 0.4 microns, maximum wavelength = 0.7 microns, and frequency points = 25
Note: This simulation can take one to several hours on a computer to complete depending on the resources.
Metalens unit cell characterization
In case of using the LSWM data format to characterize the unit cell response of metalenses, there are some specific properties that must be set. The polarization must be set to SP, and incident angle and wavelength interpolation must be turned off. For more details see: Large-Scale Metalens – Ray Propagation.
Exporting Surface Properties from Lumerical STACK
A python script-based approach is used to calculate and export the surface properties from Lumerical STACK. The attached python files contain functions that automate setting up and running the required simulations, and saving the results into the correct LSWM or JSON format. The required functions can be imported into the Script Workspace using the script command python to load the corresponding file with the function definitions.
The user must define the range of incident angles and wavelengths that will be calculated during the simulation. It is always assumed that the Z axis is normal to the surface and the directions of incident light are defined using the theta and phi angles in these examples. The precise definition of the angles and orientations is given in the Appendix. Note that if a single value is specified for theta, phi or wavelength, then the surface property is assumed to be independent of that variable. For example, for an azimuthally symmetric coating, a single value (phi = 0) should be used. Similarly, for a wavelength-independent surface, a single value of wavelength should be used.
The general workflow for exporting surface properties from STACK simulations is as follows:
- Define the sub-wavelength geometry, material properties, and required simulation objects. This may be done entirely in script.
- Define the wavelength and incident angle ranges for the source in a script file.
- Run the script file to launch the necessary simulations and export the results to an LSWM or JSON file.
The details of these steps will depend on the type of the surface. In each case a driver script (“demo_*.py”) is necessary to call all the required functions from the “stack_export_lswm.py” or “stack_export_json.py” scripts, which rely on the “stack_utility.py” definitions of general purpose functions to calculate the surface characteristics. For a detailed description of the syntax and parameters for these functions, see the corresponding python files in the article attachments.
Coatings with Isotropic and Anisotropic materials
When simulating coating structures with the STACK solver, the geometry and simulation parameters are all defined in a script file. The “stack_multi_phi” function in the file “stack_utility.py” file runs the Lumerical STACK simulations, and then the results are exported to LSWM or JSON files using the “stack_export_lswm.py” or “stack_export_json.py” scripts respectively. The detailed descriptions of the functions can be found in the script files. It is worth noting that the code relies on the stackrt script command to calculate the reflection and transmission of a plane wave through a multi-layer stack using the analytic transfer matrix method.
Since the 2022 R1.2 release, the Lumerical STACK solver supports anisotropic materials as well, which can be applied for optical films including polarizers, half-wave plates (HWP), and quarter-wave plates (QWP) too. Further details about how to model antireflective circular polarizers can be found in this example. Besides, the attached “demo_polarizer.py” and “demo_QWP.py” python scripts demonstrate how to to generate the data files from STACK using python. The scripts generate LSWM data files with both XY and SP interpolation bases and JSON files for illustration purposes. The generated data files are all attached and ready to be used in Zemax OpticStudio or Speos ray-tracing simulations.
Idealized Surfaces
This section provides examples for various solutions for creating data files for idealized surface structures to be used in ray-tracing applications without the use of nano-scale Lumerical simulations.
First, the “single_JonesMatrix_lswm_export.py” python code demonstrates how to generate an LSWM file for an ideal Jones matrix input describing a perfect polarizer that transmits in X and reflects in Y, for both forward and backward incidence. This example uses the XY basis for both the polarization data and the interpolation setting too, since this is the simplest solution that does not require any rotation of the Jones matrix during the data generation.
Besides, the “GratingExport_test_functions.lsf” script file contains several functions for creating JSON files for idealized surfaces without the use of simulation too. The lsf script showcases data generation for the following surface types:
- Specular reflection with user-specified transmission/reflection (“simpleRT”)
- Surfaces based on Jones matrices (“jonesMatrix”)
- Diffraction gratings with user-specified order efficiencies, including:
- Gratings with equal response for upper and lower incidence (“grating_test_symmetrical” and “grating_test_simple_cartesian”)
- Gratings with different response for upper and lower incidence (“grating test”)
- 1D gratings (“grating_test_1D”)
See the function descriptions at the beginning of the “GratingExport_test_functions.lsf” script file for more information. See the “GratingExport_test_workflow.lsf” script file for examples of the use of these functions.
Spatial Variation
The DLL also supports LSWM and JSON files with spatial variation. For more information on how to create a grating presenting a spatial variation, see Lumerical Sub-Wavelength Model: How to Simulate a Grating with Spatial Variations.
Appendix
Angle, polarization, and order definitions
In the data file, when a grid of polar and azimuthal angles (\(\theta\) and \(\phi\)) are used, they are defined as \(\theta = acos(|\hat{k}_z|)\) and \(\phi = atan2(\hat{k}_y, \hat{k}_x)\), where \(\hat{k} = \vec{k}/|\vec{k}|\) is the unit vector that defines the direction of the incident or scattered plane wave. The absolute value in the expression of \(\theta\) means that the value of \(\theta\) in the data file will always be between 0 and 90 degrees, even for light incident from the upper material, rather than between 90 and 180 degrees, as shown in the diagram above. This definition is different than what is used below to define the S and P polarization convention.
The meaning of S and P polarization is defined with respect to the following s and p unit vectors:
$$\hat{s} = \begin{bmatrix} \sin(\phi)\\ -\cos(\phi)\\ 0\\ \end{bmatrix}$$
$$\hat{p} = \begin{bmatrix} \cos(\theta_2)\cos(\phi)\\ \cos(\theta_2)\sin(\phi)\\ -\sin(\theta_2)\\ \end{bmatrix}$$
where \(\theta_2 = acos(\hat{k}_z)\). Note that the subscript 2 is used to differentiate this polar angle from the one described above and ranges from 0 to 180 degrees.
The diffracted orders are characterized by a pair of integers (n, m) which define the in-plane scattered wave vector as a function of the incident in-plane wavevector and the reciprocal lattice vectors of the grating according to the following equation:
$$\vec{k}^{||}_{out} = \vec{k}^{||}_{in} + n\vec{G}_1 + m\vec{G}_2$$
It is important to note that the reciprocal lattice vectors themselves are defined in the data file, and therefore scattering direction for a given value of (n, m) depends on that definition. In the diagram above, we assume a rectangular lattice with reciprocal lattice vectors
$$\vec{G}_1 = \vec{G}_x = \begin{bmatrix} 2\pi/a_x\\ 0\\ \end{bmatrix}$$
$$\vec{G}_2 = \vec{G}_y = \begin{bmatrix} 0\\2\pi/a_y\\ \end{bmatrix}$$
where \(a_x\) and \(a_y\) are the pitch along the X and Y axes respectively. For more information on grating theory, see the next section Additional background information and diffraction grating theory.
Additional Background Information and Diffraction Grating Theory
A simple diffraction grating is shown above. We can calculate the possible output angles for normally incident light by considering the condition for constructive interference:
$$a \sin(\theta) = n\lambda$$
where \(n\) is an integer which is used to categorize the different orders. We can see that when \(n\) is non-zero, the output angle depends on wavelength, which means we can use gratings for applications where we want to separate the wavelengths of light, such as spectrometers.
For more complicated situations, such as light incident at different angles or 2D gratings, the condition of constructive interference can be more easily expressed in terms of the in-plane wavevectors of the input and output light by:
$$\vec{k}^{||}_{out} = \vec{k}^{||}_{in} + n\vec{G}_1 + m\vec{G}_2$$
where \(n\) and \(m\) are integers, and \(\vec{G}_1\) and \(\vec{G}_2\) are the reciprocal lattice vectors defined by \(\vec{G}_i \cdot \vec{a}_j = 2\pi \delta_{ij}\) and \(\vec{a}_j\) are the primitive lattice vectors. For un-patterned surfaces, the reciprocal lattice vectors are zero, and the above equation reduces to Snell’s law. Similarly, for highly subwavelength gratings or meta-surfaces, where \(\vec{G}_1\) and \(\vec{G}_2\) are larger than the wavenumber, only the order with n = m = 0 is supported and we also have Snell’s law.
While the possible output angles of a grating can be easily determined from the wavelength, the lattice period (or primitive lattice vectors), the incident angles and the refractive indices of the surrounding media, the order efficiencies and polarizations cannot. The order efficiency is the fraction of incident power that diffracts to a particular order. To determine the order efficiency (and polarization) we must use a physical solver such as FDTD, STACK or RCWA and save this information to LSWM or JSON file.
Exporting Surface Properties from Lumerical FDTD
Diffraction grating properties can be calculated with both FDTD and RCWA, but RCWA is the recommended approach as introduced in the chapter Exporting Surface Properties from Lumerical RCWA. Note that typically FDTD simulations can take much longer than RCWA simulations. The workflow for FDTD and RCWA diffraction grating simulations are similar, an FDTD grating simulation needs to be set up in an FSP file. The FSP file must include an FDTD simulation region and the “Grating S parameters” analysis group from the Object Library. This FDTD simulation will be run as-is by the export workflow, so simulation settings like boundary conditions and simulation time should be set properly by the user in the file. However, unlike in case of RCWA, the FDTD simulation must be run first, and then the data must be converted into the correct format before finally saving the data file. For more details or examples scripts about data export from FDTD, please contact support.
JSON schema
The JSON schema is defined in the file "grating-surface-schema.json". It should be noted that the suffix upper or lower mean the (z>0) and (z<0) half spaces respectively, as shown in the diagram in Angle, polarization, and order definitions, and refers to the direction of incident radiation. For example, grat_results_upper refers to the properties when light is incident from the upper half space.
The data is a function of wavelength as well as incident angle (either defined by a grid of polar and azimuthal angles, or in plane unit vectors, or in plane wave vectors). If any of this is only specified once, it is assumed to be constant. For example, if only one value of azimuthal angle is specified, then the resulting model will be independent of azimuthal angle.
Please contact support if you need more information on each data element in the JSON file.
LSWM schema
Details of the LSWM data format are discussed in this article: HDF5 meta-atom design and database file format. Please contact support if you need more information on each data element in the LSWM file.