Simulation setup


Specify the simulation settings.

  • wavelength (float) – [nm] wavelength, default: 1550

  • x_resolution (float) – [nm] resolution in the x-direction, default: 10

  • y_resolution (float) – [nm] resolution in the y-direction, default: 10

  • window_width (float) – [nm] simulation window width

  • window_height (float) – [nm] simulation window height

  • boundary_condition (str, length = 2) – boundary condition ‘XX’, index 0 is the south boundary symmetry, index 1 is the west boundary symmetry, ‘0’: no symmetry, ‘S’: symmetric, ‘A’: asymmetric, ‘TE’ and ‘TM’ are also accepted and are translated to the maximum symmetry available for the fundamental TE and TM modes, the pml_NSEW_bool setting is also copied from the north/east to the south/west boundary for vertical/horizontal symmetry conditions, default: ‘00’

  • num_modes (int) – number of modes to solve for, default: 1

  • field_to_solve (str) – either ‘Et’ or ‘Ht’ to specify whether the transverse electric field or magnetic field is solved, default: ‘Et’

  • max_effective_index (float) – maximum value for the effective refractive index, if max_effective_index is 0 the maximum refractive index found in the simulation window is used, default: 0

  • tolerance (float) – eigenmode solver convergence tolerance, if tolerance = 0 the computer’s precision is used, default: 0

  • bend_radius (float) – [nm] waveguide bend radius, must be positive and larger than window_width/2, if bend_radius = 0 no bending is used in the calculation, default: 0

  • pml_NSEW_bool (list, length = 4) – indicates whether to use a pml on each of the 4 boundaries, [north, south, east, west], 0: no pml, 1: use pml, default: [0,0,0,0]

  • num_pml_layers (int or list with length = 4) – number of pml layers to use, either a single value that is applied to all boundaries or a list of 4 values, default: 10

  • remove_pml_modes_bool (bool) – automatically remove pml modes, default: True

  • background_refractive_index (str or float) – background refractive index, either a material name or a value, default: 1.0

  • expansion_resolution (float or list) – [nm] single value or list of 4 values for the stretched grid resolution; [north, south, east, west], the grid is gradually transitioned from res to expansion_resolution, default: 20

  • expansion_size (float or list) – [nm] single value or list of 4 values for the approximate stretched distance; [north, south, east, west], default: 0

  • simulation_name (str) – simulation name, default: ‘emode’


Add a custom material by specifying a wavelength dependent equation.

  • name (str) – material name; a variable user_material_[name] will be created

  • refractive_index_equation (str) – refractive index equation to evaluate as a function of the wavelength parameter ‘x’, where imaginary numbers are specified with a preceding ‘j’; only the following characters are allowed in the equation string: “0123456789 x j . + - ^ / ( ) [ ]”; the string must have less than 300 characters

  • wavelength_unit (str) – either ‘nm’ or ‘um’ to specify the unit for the wavelength parameter ‘x’, default: ‘um’

  • simulation_name (str) – simulation name, default: ‘emode’


Create or update a shape with attributes. These parameters are saved with ‘shape_’+name+’/’ preceding the attribute name. If a name is not given, a number will be allocated as the shape name.

  • name (str) – shape name, default: an auto-generated number

  • refractive_index (float, list, or str) – refractive index value, list of values [n_xx, n_yy, n_zz], or material name, default: 1.0

  • permeability (float, list, or str) – relative permeability value, list of values [mu_xx, mu_yy, mu_zz], or material name, default: 1.0

  • loss_dB_per_m (float) – [dB/m] material propagation loss, default: 0

  • vertices (list (N,2) or int) – list of N vertices that define a closed polygon, if specified vertices is used to define the shape (width, height, position, mask, etch, fill are ignored), to disable vertices, set vertices to 0, default: 0

  • width (float) – shape width, gets set to the window_width if not specified, default: None

  • height (float) – shape height, default: 0

  • position (list, length = 2) – centered x and y positions relative to the shape width and height, if y position is negative then it is treated like a layer stacked on top of the previous layer, default: [0,-1]

  • mask (float or list, length = 2) – mask width for etching, centered on x-position set by position, if list with length of 2 the first value is the mask width and the second value is the x-offset relative to the x-position set by position, default: width

  • etch_depth (float) – etch depth for a layer outside the mask region, thickness = height - etch_depth, default: 0

  • sidewall_angle (float) – etched sidewall angle in degrees, 0 is perfectly vertical, 90 is the maximum, this decreases the width at the top of the shape to create the angle, default: 0

  • fill_refractive_index (float, list, or str) – refractive index (similar to refractive_index parameter) to fill the etched region when a planar layer is added on top of the current layer, default: take the background refractive index

  • fill_permeability (float, list, or str) – relative permeability (similar to permeability parameter) to fill the etched region when a planar layer is added on top of the current layer, default: take the background relative permeability

  • shape_type (str) – set shape type as ‘planar’, ‘conformal’ (only uses name, refractive_index, and height), or ‘ellipse’ (only uses name, refractive_index, width, height, position, sidewall_angle, and priority), default: ‘planar’

  • priority (float) – a number that signifies the order in which shapes will be drawn, a higher priority gets drawn over a lower number priority, default: auto-generated interger based on order called

  • simulation_name (str) – simulation name, default: ‘emode’