Simulation setup

settings

Specify the simulation settings.

Parameters:
  • profile (str) – label of the profile these settings apply to, default: ‘_default’

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

  • frequency (float) – [Hz] simulation frequency (an alternative to setting the wavelength), default: None

  • 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 set as a string with two characters ‘XX’; the first character is the south boundary condition, the second character is the west boundary condition; ‘0’: no symmetry (metal boundary), ‘S’: symmetric Ex, ‘A’: anti-symmetric Ex; alternatively, ‘TE’ and ‘TM’ can be specified to use the any symmetry available to find the fundamental TE and TM modes; use ‘TE-h’, ‘TE-v’, ‘TM-h’, and ‘TM-v’ to specify only horizontal or vertical symmetry for TE or TM modes; when using an (anti-)symmetric boundary, the pml_NSEW_bool setting is copied from the north/east perimeter to the south/west perimeter; 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: 1e-12

  • bend_radius (float) – [nm] waveguide bend radius relative to the center of the window, 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

  • pml_order (float) – polynomial grading exponent of the pml stretch profile, default: 3

  • pml_reflection (float) – the target round-trip reflection that the pml is designed for, which sets the maximum pml conductivity; must be greater than 0 and less than 1, default: 1e-8

  • pml_kappa_max (float) – the maximum real coordinate stretch, reached at the outer pml face; must be at least 1, default: 7

  • pml_alpha_max (float) – the complex-frequency-shifted (CFS) pml term, where 0 disables it; raise it if the solve returns too many artificial pml modes, where 0.1*omega*eps_0 is a reasonable starting point that is small enough to barely move the physical modes, default: 0

  • remove_pml_modes_bool (bool) – automatically remove the artificial modes of the pml regions from the mode list, identified as modes carrying less than 75% of their power inside the simulation window, default: False

  • background_material (str or ~MaterialProperties or ~MaterialSpec) – background material, either a material name (from the material database) or a ~MaterialProperties or ~MaterialSpec object, default: “Vacuum”

  • 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

  • subpixel_avg (bool) – whether to use sub-pixel averaging of the permittivity/permeability at shape boundaries for improved accuracy, default: True

  • generate_chi2 (bool) – whether to generate the second-order nonlinear susceptibility (chi2) tensor for the simulation window, default: False

  • include_heat (bool) – whether to include heat-related material properties when meshing for FEM heat calculations, default: True

  • propagation_resolution – [nm] resolution in the z-direction for plotting EME propagation results, default: wavelength/10

  • eme_scattering (bool) – whether or not to automatically calculate scattering for all possible shapes within EME calculations, default: False

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

add_material

Add a custom material by specifying a wavelength dependent equation.

Parameters:
  • name (str) – material name, this will override the built-in material name if an idential name is used; 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 . + - ^ * / ( ) [ ]”; a list of three equations can also be specified for non-isotropic materials, like ‘[n_xx, n_yy, n_zz]’; the string must have less than 1000 characters

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

  • wavelength_range (list) – [um] list of the minimum and maximum wavelength recommended for the refractive index equation, default: [0.2, 2.0]

  • citation (str) – reference displayed in material explorer for the custom material, default: ‘User defined.’

  • loss (float) – the loss of the material in ‘dB/m’, default: 0.

  • thermal_conductivity (float) – [W/m·K] thermal conductivity of the material, default: 1e-10

  • resistivity (float) – [Ohm-nm] resistivity of the material, default: infinity

  • dn_dT (float) – [K^-1] change in refractive index per change in temperature, relative to 298 K, default: 0

  • eps_r_dc (float) – [-] relative permittivity at ~1 kHz, default: 1.0

  • d (list (3x6) or None) – second-order nonlinear susceptibility d-matrix with shape (3, 6); use None for linear materials, default: None

  • phi (float) – phi angle of the crystal orientation in cylidrical coordinates, default: 0

  • theta (float) – theta angle of the crystal orientation in cylidrical coordinates, default: 0

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

import_database

Import a custom material database by specifying custom materials in a text file.

Parameters:
  • filename (str) – name of text file to be imported

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

Here is an example of several custom materials in the database text file to be imported. See the add_material function for parameter details. Each custom material must contain the name and refractive_index_equation, separated by a new line. Comments can be added with ‘#’ or ‘%’.

name = custom_name_1
refractive_index_equation = equation_1
wavelength_unit = um (optional)
wavelength_range = [0.2, 2.0] (optional)
citation = reference_1 (optional, default: “User defined by database import.”)

# comment about my custom_SiO2 material
name = custom_SiO2
refractive_index_equation = (1 + 0.696166/(1 - (0.0684043/x)^2) + 0.4079426/(1 - (0.1162414/x)^2) + 0.8974794/(1 - (9.896161/x)^2))^0.5
wavelength_unit = um
wavelength_range = [0.21, 6.7]
citation = ‘(1) I. H. Malitson, “Interspecimen comparison of the refractive index of fused silica,” J. Opt. Soc. Am. 55, 1205 (1965). (2) C. Z. Tan, “Determination of refractive index of silica glass for infrared wavelengths by IR spectroscopy,” J. Non-Cryst. Solids 223, 158 (1998).’

% comment about my custom_name_3 material
name = custom_name_3
refractive_index_equation = equation_3
wavelength_unit = nm
shape

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.

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

  • material (~MaterialSpec, ~MaterialProperties, or str) – the material for this shape. Takes a string reference to a material in the Material Database, or a ~MaterialSpec or ~MaterialProperties object. default: “Vacuum”

  • loss_dB_per_m (float) – [dB/m] material propagation loss, if not set by the material parameter, default: 0

  • vertices (list (N,2), list of list (N,2), or int) – list of N vertices that define a closed polygon, or a list of such vertex lists to define multiple disjoint polygons in one shape; 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, if left unspecified the shape is unbounded in x, extending past both sides of the simulation window, default: None

  • height (float or str) – shape height, or ‘full_height’ for a shape that is unbounded upward, extending past the top of the simulation window; nothing can be automatically stacked on top of a shape of unbounded height, default: 0

  • position (list, length = 2) – centered x and y positions relative to the shape width and height, if the y position is left unspecified then it is treated like a layer stacked on top of the previous layer, if only a single value is provided it is assumed to be the x position and the y position is left unspecified, default: (0, ‘auto’)

  • mask (float or list) – mask width for etching, centered on x-position set by position and mask_offset, or a list of arbitrary length to specify multiple mask regions in combination with a list of mask_offset values, default: width

  • mask_offset (float or list) – the x-position offset for the mask parameter, or a list of arbitrary length to specify multiple mask regions in combination with a list of mask values, default: 0

  • tone (str) – ‘n’/’N’ or ‘p’/’P’ to define the pattern tone as negative or positive for the mask parameter, default: n

  • 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; only applied to etched features (height, mask, and a nonzero etch_depth must all be specified for this parameter to have any effect), default: 0

  • fill_material (~MaterialSpec, ~MaterialProperties, or str) – the material for the fill for this shape. Takes the same values as material, as well as “transparent_fill” (the default). “transparent_fill” results in the fill being the background.

  • correlation_length (float or list) – interfacial roughness correlation length, a single value is applied to all interfaces, a list of 2 applies the first value to all vertical interfaces and the second value to all horizontal interfaces, a list the length of the number of edges applies each value to the corresponding edge, default: [0,0]

  • roughness_rms (float or list) – interfacial roughness standard deviation in nm rms, a single value is applied to all interfaces, a list of 2 applies the first value to all vertical interfaces and the second value to all horizontal interfaces, a list the length of the number of edges applies each value to the corresponding edge, default: [0,0]

  • shape_type (str) – set shape type as ‘planar’, ‘conformal’ (only uses name, material, height, and priority), ‘polygon’ (only uses name, vertices, material and priority), or ‘ellipse’ (only uses name, material, width, height, position, sidewall_angle (the angle of the ellipse), 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 integer based on order called

  • fem_resolution (float) – [nm] approximate resolution to target for triangular meshing used by FEM functions, default: 500

  • current (float) – [A] current flowing through the cross-section of the shape, which can generate heat, default: 0

  • voltage (float) – [V] voltage of the shape, None for floating, default: None

  • heat_only (bool) – specifies a shape that will only be rendered when meshing for a heat calculation, default: False

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

Note

Shapes are positioned in absolute coordinates, independent of the simulation window, so a shape may extend beyond the window and the window can be resized or offset without re-seating the geometry. A layer whose bottom edge rests on y = 0, the reference plane that the automatic stacking starts from, is treated as the substrate: its material continues downward without bound, so a window that extends below y = 0 resolves to that layer rather than to the background material.

reset

Clear simulation settings, shape definitions, or both.

Parameters:
  • kind (str) – either ‘shapes’, ‘settings’, or ‘all’ to specify what data is cleared, default: ‘shapes’

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