# ModeSpec
Stores specifications for the mode solver to find an electromagnetic mode.
Note, the planar axes are found by popping the injection axis from {x, y, z}. For example, if injection axis is y, the planar axes are ordered {x, z}.
# Number of Modes
num_modes: Number of modes returned by the mode solver.
Type: integer
- Unit: unitless
- Constraint: greater than 0
- Default: 1
# Target Effective Index
target_neff: Guess for effective index of the mode.
Type: floating-point number
- Unit: unitless
- Constraint: greater than 0
- Default: None
# Number of PML Layers
num_pml: Number of standard pml layers to add in the two tangential axes.
Type: integer
- Unit: unitless
- Constraint: greater than or equal to 0
- Default: (0, 0)
# Polar Angle
angle_theta: Polar angle of the propagation axis from the injection axis.
Type: floating-point number
- Unit: choose between rad or degree (default)
- Default: 0
# Azimuth Angle
angle_phi: Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.
Type: floating-point number
- Unit: choose between rad or degree (default)
- Default: 0
# Angle Rotation
angle_rotation: Defines how modes are computed when angle_theta is not zero.
Options:
False: A coordinate transformation is applied through the permittivity and permeability tensors.True: The structures in the simulation are first rotated to compute a mode solution at a reference plane normal to the structure's azimuthal direction. Then, the fields are rotated to align with the mode plane, using then_effcalculated at the reference plane.
Note: Currently only supported when
angle_phiis a multiple ofnp.pi.
# Bend Radius
bend_radius: A curvature radius for simulation of waveguide bends.
Can be negative, in which case the mode plane center has a smaller value than the curvature center along the tangential axis perpendicular to the bend axis.
Type: floating-point number
- Unit: choose between m, μm (default), or nm
- Default: None
# Bend Axis
bend_axis: Index into the two tangential axes defining the normal to the plane in which the bend lies.
This must be provided if bend_radius is not None.
For example, for a ring in the global xy-plane, and a mode plane in either the xz or the yz plane, the bend_axis is always 1 (the global z axis).
Options:
- None
- 0
- 1
Default: None
# Group Index Computation Control
group_index_step: Control the computation of the group index alongside the effective index. If set to a positive value, it sets the fractional frequency step used in the numerical differentiation of the effective index to compute the group index. If set to True, a value of 0.15 is used.
Options:
- False: The mode solver will not calculate the group index.
- True: The mode solver will calculate the group index using a fractional frequency step of 0.15 or other user input value.
Default: True
# Polarization Filtering
sort_spec: Specification for filtering and sorting modes within each frequency using ModeSortSpec.
The mode sorting specification provides a two-stage process:
Filtering stage: An optional filtering step splits modes into two groups based on a threshold applied to
filter_key. Modes "over" or "under"filter_referenceare placed first, with the remaining modes placed next.Sorting stage: An optional sorting step orders modes within each group according to
sort_key, optionally with respect tosort_referenceand in the specifiedsort_order.
# Filter Key
filter_key: Quantity used to filter modes into two groups before sorting.
Options:
- None
- n_eff
- k_eff
- TE_fraction
- TM_fraction
- wg_TE_fraction
- wg_TM_fraction
- mode_area
Default: None
# Filter Reference
filter_reference: Reference value used in the filtering stage.
Type: floating-point number
Default: 0.0
# Filter Order
filter_order: Select whether the first group contains values over or under the reference.
Options:
- over
- under
Default: over
# Sort Key
sort_key: Quantity used to sort modes within each filtered group. If None, sorting is by descending effective index.
Options:
- None
- n_eff
- k_eff
- TE_fraction
- TM_fraction
- wg_TE_fraction
- wg_TM_fraction
- mode_area
Default: None
# Sort Reference
sort_reference: If provided, sorting is based on the absolute difference to this reference value.
Type: floating-point number
Default: None
# Sort Order
sort_order: Sort order for the selected key or difference to reference value.
Options:
- ascending
- descending
Default: ascending
# TE/TM Fraction Definitions
TE_fraction is defined as the integrated intensity of the E-field component parallel to the first plane axis, normalized to the total in-plane E-field intensity. Conversely, TM_fraction uses the E-field component parallel to the second plane axis.
wg_TE_fraction and wg_TM_fraction are waveguide-specific definitions of the TE and TM fractions.
# Track Mode Frequency
track_freq: If provided, enables cross-frequency mode tracking. Can be 'lowest', 'central', or 'highest', which refers to the frequency index in the list of frequencies. The mode sorting would then be exact at the specified frequency, while at other frequencies it can change depending on the mode tracking.
Options:
- None
- central
- lowest
- highest
Default: central
# Frequency Interpolation
interp_spec: Specification for mode frequency interpolation using ModeInterpSpec.
This feature allows computing modes at a reduced set of frequencies and interpolating to obtain results at all requested frequencies. This can significantly reduce computational cost for broadband simulations where modes vary smoothly with frequency.
Note: Frequency interpolation requires frequency tracking to be enabled to ensure mode ordering is consistent across frequencies.
# Sampling Specification
sampling_spec: Defines how sampling frequencies are selected. Can be one of UniformSampling, ChebSampling, or CustomSampling.
Options:
- None
- UniformSampling: Uniformly spaced frequency points.
- ChebSampling: Chebyshev nodes for better edge accuracy.
- CustomSampling: User-defined frequency points.
Default: None
# Uniform Sampling
UniformSampling: Uniformly spaced frequency sampling points.
num_points: Number of uniformly spaced frequency sampling points.
Type: integer
- Constraint: greater than or equal to 2
# Chebyshev Sampling
ChebSampling: Chebyshev node frequency sampling, which provides better interpolation accuracy especially near the edges of the frequency range.
num_points: Number of Chebyshev nodes for frequency sampling.
Type: integer
- Constraint: greater than or equal to 3
# Custom Sampling
CustomSampling: User-defined frequency sampling points.
freqs: Custom array of frequency sampling points.
Type: array of floating-point numbers
- Constraint: at least 2 frequency points required
# Interpolation Method
method: The interpolation method used to estimate mode data at intermediate frequencies.
Options:
- linear: Linear interpolation between sampling points.
- cubic: Cubic spline interpolation for smoother results.
- polynomial: Polynomial interpolation using all sampling points.
Default: linear
# Reduce Data
reduce_data: If Yes, only the mode data at the sampling frequencies is stored in the output. If No, interpolated data at all requested frequencies is stored.
Options:
- Yes
- No
Default: Yes
# Single or Double Precision in Mode Solver
precision: The solver will be faster and using less memory under single precision, but more accurate under double precision. With the default auto, apply double precision if the simulation contains a good conductor, single precision otherwise.
Options:
- auto
- single
- double
Default: auto
# Colocate Fields
colocate: Toggle whether fields should be colocated to grid cell boundaries (i.e. primal grid nodes).
Options:
- Yes: Fields will NOT be colocated to grid cell boundaries.
- No: Fields will be colocated to grid cell boundaries.
Default: Yes