tidy3d.EMEModeSpec#

class EMEModeSpec[source]#

Bases: ModeSpec

Mode specification for EME cells.

Parameters:
  • num_modes (PositiveInt = 1) – Number of modes returned by mode solver.

  • target_neff (Optional[PositiveFloat] = None) – Guess for effective index of the mode.

  • num_pml (tuple[NonNegativeInt, NonNegativeInt] = (0, 0)) – Number of standard pml layers to add in the two tangential axes.

  • filter_pol (Optional[Literal['te', 'tm']] = None) – The solver always computes the num_modes modes closest to the given target_neff. If filter_pol==None, they are simply sorted in order of decreasing effective index. If a polarization filter is selected, the modes are rearranged such that the first n_pol modes in the list are the ones with the selected polarization fraction larger than or equal to 0.5, while the next num_modes - n_pol modes are the ones where it is smaller than 0.5 (i.e. the opposite polarization fraction is larger than 0.5). Within each polarization subset, the modes are still ordered by decreasing effective index. 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.

  • angle_theta (Literal[0.0] = 0.0) – [units = rad]. Polar angle of the propagation axis from the injection axis. Not currently supported in EME cells. Use an additional ‘ModeSolverMonitor’ and ‘sim_data.smatrix_in_basis’ to achieve off-normal injection in EME.

  • angle_phi (Literal[0.0] = 0.0) – [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis. Not currently supported in EME cells. Use an additional ‘ModeSolverMonitor’ and ‘sim_data.smatrix_in_basis’ to achieve off-normal injection in EME.

  • precision (Literal['auto', 'single', 'double'] = auto) – The solver will be faster and using less memory under single precision, but more accurate under double precision. Choose 'auto' to apply double precision if the simulation contains a good conductor, single precision otherwise.

  • bend_radius (Optional[float] = None) – [units = um]. 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.

  • bend_axis (Optional[Literal[0, 1]] = None) – 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).

  • angle_rotation (bool = False) – Defines how modes are computed when angle_theta is not zero. If False, a coordinate transformation is applied through the permittivity and permeability tensors.If 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 the n_eff calculated at the reference plane. The second option can produce more accurate results, but more care must be taken, for example, in ensuring that the original mode plane intersects the correct geometries in the simulation with rotated structures. Note: currently only supported when angle_phi is a multiple of np.pi.

  • track_freq (Optional[Literal['central', 'lowest', 'highest']] = None) – Deprecated. Use ‘sort_spec.track_freq’ instead.

  • group_index_step (Union[PositiveFloat, bool] = False) – 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, the default of 0.005 is used.

  • sort_spec (ModeSortSpec = ModeSortSpec()) – Defines how to filter and sort modes within each frequency. If track_freq is not None, the sorting is only exact at the specified frequency, while at other frequencies it can change depending on the mode tracking.

  • interp_spec (Optional[ModeInterpSpec] = ModeInterpSpec(sampling_spec=ChebSampling(num_points=5), method=’poly’, reduce_data=True)) – Specification for 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. Requires frequency tracking to be enabled (sort_spec.track_freq must not be None) to ensure consistent mode ordering across frequencies.

  • bend_medium_frame (Literal['global', 'co_rotating'] = global) – Interpretation of media in bent EME cells. Choose 'global' when the material axes are fixed in physical space, matching the global-frame convention used in FDTD. Choose 'co_rotating' when the material profile should bend with the local waveguide cross-section, as in a bent fiber or a custom profile defined on straight EME coordinates. The default is 'global'. Custom media in bent EME cells, including CustomAnisotropicMedium, are currently supported only for 'co_rotating'. With 'global', orientation-sensitive anisotropic bends may need multiple cells instead of num_reps or EMELengthSweep; check convergence with respect to the number of EME cells.

  • increasing_mode_tolerance (NonNegativeFloat = 0.0) – Unitless tolerance on -Im(n_eff) when filtering increasing modes from the EME propagation basis. A mode is dropped only if Im(n_eff) < -increasing_mode_tolerance. Set a small positive value such as 1e-6 to keep weakly increasing modes caused by numerical noise; leave it at 0.0 to preserve historical behavior.

Notes

Inherits from ModeSpec but overrides several defaults and constraints for use in EME simulations:

  • Propagation angles (angle_theta, angle_phi) are locked to 0. For off-normal injection, use a ModeSolverMonitor together with EMESimulationData.smatrix_in_basis().

  • Default precision is 'auto' (double precision for structures with good conductors, single precision otherwise).

  • Includes a bend_medium_frame field to control whether media in bent EME cells are interpreted in the global frame or as co-rotating with the local waveguide frame.

  • Bent sections containing orientation-sensitive anisotropic media may require multiple EME cells when bend_medium_frame='global', because the local mode problem can change with absolute bend angle. This applies to both AnisotropicMedium and reciprocal FullyAnisotropicMedium; check convergence with respect to the number of EME cells when refining such bends.

  • Includes an interp_spec field for frequency interpolation of modes, which can significantly reduce cost for broadband simulations.

  • Includes an increasing_mode_tolerance field for EME-only filtering of weakly increasing modes. The default 0.0 preserves the previous behavior, while positive values treat small negative imaginary effective indices as numerical noise.

Attributes

interp_spec

angle_theta

angle_phi

precision

bend_medium_frame

increasing_mode_tolerance

num_modes

target_neff

num_pml

filter_pol

bend_radius

bend_axis

angle_rotation

track_freq

group_index_step

sort_spec

interp_spec#
angle_theta#
angle_phi#
precision#
bend_medium_frame#
increasing_mode_tolerance#