Creates a mapping information file (.lmap) for a metalens or a grating with spatial variation. This script command is used with the Lumerical Sub-Wavelength model plugin.
For further information on the Lumerical Sub-Wavelength Model, please see the Knowledge Base article on Lumerical Sub-Wavelength Model plugin: Introduction and data Generation.
Note: This script command does not support the legacy .json file format for the LSWM, only the .lswm format.
| Syntax | Description |
|---|---|
| lmapexport(“lswm_file”, map_info); |
Exports a .lmap file for a given .lswm file for a grating with spatial variation. The .lmap file is created in the same directory as the .lswm file, and carries the same name as the input .lswm file, except with an .lmap extension.
|
| lmapexport(“lswm_file”, metalens_info, phase_info, “output_file”, gds_flag); |
Exports a .lmap file for a given .lswm file for a metalens, uses the following arguments:
|
Configuration structures for grating with spatial variation
The following table describes fields in the map_info struct.
| Field | Description |
|---|---|
| map_type | Coordinates of the map, either “rect” for rectilinear coordinates, or “polar” for polar coordinates. |
| spatial_info |
A struct containing the definition of points for the spatial variation. Contains the following fields if the map is “rect”:
Contains the following fields if the map is “polar”:
|
| cell_type_map | A 2D matrix defining the index map for each grid point, see the subsection “Definition of the index map” in Lumerical Sub-Wavelength Model: How to Simulate a Grating with Spatial Variations for further information. |
Configuration structures for metalens
The following tables describes the fields in the metalens_info struct.
| Field | Description |
|---|---|
| lens_size | A matrix indicating the total size of the x- and y-directions, in mm. The format of the array is [size_x, size_y]. |
| centering | Optional. Coordinates of the center of the phase map on the metalens surface, in mm. Defaults to [0,0]. |
The following table describes the fields in the phase_info struct.
Note: This command supports up to two phase targets. All variables with suffix _1 correspond to the first phase target, and all variables with suffix _2 correspond to the second phase target. Variables with the _2 suffixes are all optional.
| Field | Description |
|---|---|
| reference_wavelength |
A matrix with reference wavelength for the phase design, in µm.
|
| jones_vector |
A matrix defining Jones vectors defining the target polarization before and after the metalens.
|
| coefficients |
A cell array defining coefficients to define the phase targets.
|
| direction | A string indication the direction for all phase targets. Either “forward” or “backward” is accepted. |
Example - Exporting a .lmap file for a spatially varying grating in rectilinear coordinates
map_type = "rect";
lswmFile = "grating.lswm";
cellTypeMap = [ 0,2,0,2;0,2,0,2];
sizeX = 0.1;
sizeY = 0.2;
cx = 0.1;
cy = 0.0;
spatialInfo = {"size_x":sizeX, "size_y": sizeY, "decenter_x":cx, "decenter_y":cy};
mapInfo = {"map_type":map_type, "spatial_info":spatialInfo, "cell_type_map":cellTypeMap};
lmapexport(lswmFile,mapInfo);
Example - Exporting a .lmap file for a metalens with two phase targets
metalensSize = [2,2]; # size in mm
centering=[0,0];
metalensInfo = {"lens_size":metalensSize,"centering":centering};
reference_wavelength = [0.4, 0.4]; #in micrometers
jones_vector = [1,0,0;1,0,0; 0,1,0; 0,1,0]; # phase angle in degrees
coefficients = {0.5, {3, 30, 0}, {3, 30,0}, 0, {0, 0, 1}, {0, 0,1}}; #{focus_1, r2n_1, xnym_1, focus_2, r2n_2, xnym_2}
phaseInfo={"reference_wavelength":reference_wavelength, "jones_vector":jones_vector, "coefficients":coefficients, "direction":"forward"};
lmapexport("metalens_test.lswm",metalensInfo,phaseInfo," metalens_test.lmap",false);
See Also