tidy3d.rf.MicrowaveModeSpec#

class MicrowaveModeSpec[source]#

Bases: AbstractModeSpec, MicrowaveBaseModel

The MicrowaveModeSpec class specifies how quantities related to transmission line modes and microwave waveguides are computed. For example, it defines the paths for line integrals, which are used to compute voltage, current, and characteristic impedance of the transmission line.

Parameters:
  • attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • 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 (float = 0.0) – [units = rad]. Polar angle of the propagation axis from the injection axis.

  • angle_phi (float = 0.0) – [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.

  • precision (Literal['auto', 'single', 'double'] = double) – 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(attrs={}, filter_key=None, filter_reference=0.0, filter_order='over', sort_key=None, sort_reference=None, sort_order='ascending', track_freq='central', type='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] = None) – 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.

  • impedance_specs (Union[Annotated[Union[tidy3d.components.microwave.path_integrals.specs.impedance.AutoImpedanceSpec, tidy3d.components.microwave.path_integrals.specs.impedance.CustomImpedanceSpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})], tuple[Optional[Annotated[Union[tidy3d.components.microwave.path_integrals.specs.impedance.AutoImpedanceSpec, tidy3d.components.microwave.path_integrals.specs.impedance.CustomImpedanceSpec], FieldInfo(default=PydanticUndefined, discriminator='type', extra={})]], ...]] = AutoImpedanceSpec(attrs={}, type='AutoImpedanceSpec')) – Field controls how the impedance is calculated for each mode calculated by the mode solver. Can be a single impedance specification (which will be applied to all modes) or a tuple of specifications (one per mode). The number of impedance specifications should match the number of modes field. When an impedance specification of None is used, the impedance calculation will be ignored for the associated mode.

  • tem_polarization_threshold (ConstrainedFloatValue = 0.995) – Threshold for classifying modes as TEM, TE, or TM based on mean TE/TM fraction across frequencies. A mode is classified as TEM if both mean TE and TM fractions are greater than or equal to this threshold. Similarly, a mode is classified as TE (or TM) if the mean TE (or TM) fraction is greater than or equal to this threshold.

  • qtem_polarization_threshold (ConstrainedFloatValue = 0.95) – Threshold for classifying modes as quasi-TEM based on TE/TM fraction at the lowest frequency. A mode is classified as quasi-TEM if both TE and TM fractions at the lowest frequency are greater than or equal to this threshold.

Example

>>> import tidy3d as td
>>> # Using automatic impedance calculation (single spec, will be duplicated for all modes)
>>> mode_spec_auto = td.MicrowaveModeSpec(
...     num_modes=2,
...     impedance_specs=td.AutoImpedanceSpec()
... )
>>> # Using custom impedance specification for multiple modes
>>> voltage_spec = td.AxisAlignedVoltageIntegralSpec(
...     center=(0, 0, 0), size=(0, 0, 1), sign="+"
... )
>>> current_spec = td.AxisAlignedCurrentIntegralSpec(
...     center=(0, 0, 0), size=(2, 1, 0), sign="+"
... )
>>> custom_impedance = td.CustomImpedanceSpec(
...     voltage_spec=voltage_spec, current_spec=current_spec
... )
>>> mode_spec_custom = td.MicrowaveModeSpec(
...     num_modes=1,
...     impedance_specs=custom_impedance
... )

Attributes

Methods

check_impedance_specs_consistent_with_num_modes(...)

Check that the number of impedance specifications is equal to the number of modes.

Inherited Common Usage

impedance_specs#
tem_polarization_threshold#
qtem_polarization_threshold#
classmethod check_impedance_specs_consistent_with_num_modes(val, values)[source]#

Check that the number of impedance specifications is equal to the number of modes. A single impedance spec is also permitted.

__hash__()#

Hash method.