tidy3d.rf.WavePort#

class WavePort[source]#

Bases: AbstractWavePort

Class representing a single modal-driven wave port.

Parameters:
  • center (Optional[tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]]] = None) – [units = um]. Center of object in x, y, and z.

  • size (tuple[Union[NonNegativeFloat, autograd.tracer.Box], Union[NonNegativeFloat, autograd.tracer.Box], Union[NonNegativeFloat, autograd.tracer.Box]]) – [units = um]. Size in x, y, and z directions.

  • name (str) – Unique name for the port.

  • direction (Literal['+', '-']) – ‘+’ or ‘-’, defining which direction is considered ‘input’.

  • num_grid_cells (Optional[int] = 5) – Number of mesh grid cells in the transverse plane of the WavePort. Used in generating the suggested list of MeshOverrideStructure objects. Must be greater than or equal to 3. When set to None, no grid refinement is performed.

  • conjugated_dot_product (bool = False) – Use conjugated or non-conjugated dot product for mode decomposition.

  • frame (Optional[PECFrame] = PECFrame()) – Add a thin frame around the source during FDTD run for an improved injection.

  • absorber (Union[bool, ABCBoundary, ModeABCBoundary] = True) – Place a mode absorber in the port. If True, an automatically generated mode absorber is placed in the port. If ABCBoundary or ModeABCBoundary, a mode absorber is placed in the port with the specified boundary conditions.

  • extrude_structures (bool = False) – Extrudes structures that intersect the wave port plane by a few grid cells when True, improving mode injection accuracy.

  • reference_impedance (Union[Literal['Z0'], complex, ImpedanceModeDataArray, ImpedanceTerminalDataArray] = Z0) – [units = ohm]. User-specified reference impedance for S-parameter computation. If Z0 (default), the characteristic impedance is used. Otherwise, it can be a single complex value applied to all modes, or a data array specified for each. If the data array misses some modes, 50 Ohm is applied to the missing ones.

  • mode_spec (MicrowaveModeSpec = MicrowaveModeSpec()) – Parameters to feed to mode solver which determine modes and how transmission line quantities, e.g., characteristic impedance, are computed.

  • mode_index (Optional[NonNegativeInt] = None) – Index into the collection of modes returned by mode solver. Specifies which mode to inject using this port. Deprecated. Use the ‘mode_selection’ field instead.

  • mode_selection (Optional[tuple[int, ...]] = None) – Selects specific mode(s) to use from the mode solver. Can be a single integer for one mode, or a tuple of integers for multiple modes. If None (default), all modes from the mode_spec are used. Indices must be non-negative and less than mode_spec.num_modes.

Notes

By default, the characteristic impedance of each mode is used as the reference impedance for S-parameter calculations.

Attributes

Methods

compute_current(sim_data)

Helper to compute current flowing through the port.

compute_voltage(sim_data)

Helper to compute voltage across the port.

get_characteristic_impedance_matrix(...)

Retrieve the characteristic impedance matrix of the port.

get_port_impedance(sim_mode_data, mode_index)

Retrieve the reference impedance of the port for a specific mode.

to_source(source_time[, snap_center, ...])

Create a mode source from the wave port.

mode_spec#
mode_index#
mode_selection#
to_source(source_time, snap_center=None, mode_index=0, mode_spec=None)[source]#

Create a mode source from the wave port.

Parameters:
  • source_time (SourceTimeType) – Source time specification.

  • snap_center (float, optional) – Position to snap the source center to along injection axis.

  • mode_index (int) – Mode index to inject.

  • mode_spec (MicrowaveModeSpecType, optional) – Resolved mode specification with integer num_modes. If None, uses self._mode_spec but raises SetupError if num_modes=’auto’.

get_characteristic_impedance_matrix(sim_mode_data)[source]#

Retrieve the characteristic impedance matrix of the port.

compute_voltage(sim_data)[source]#

Helper to compute voltage across the port.

compute_current(sim_data)[source]#

Helper to compute current flowing through the port.

get_port_impedance(sim_mode_data, mode_index)[source]#

Retrieve the reference impedance of the port for a specific mode.

Returns the diagonal element of the reference impedance matrix for the given mode. When reference_impedance is set to "Z0", this equals the characteristic impedance; otherwise it returns the user-specified reference impedance.

Parameters:
  • sim_mode_data (Union[SimulationData, MicrowaveModeData]) – Simulation data containing the mode monitor results, or the mode data directly. If SimulationData is provided, the mode data is extracted using the port’s mode monitor name.

  • mode_index (int) – Index of the mode for which to compute the impedance. This selects a specific mode from the mode spectrum computed by the mode solver.

Returns:

Frequency-dependent reference impedance for the specified mode. The impedance is complex-valued and varies with frequency.

Return type:

FreqModeDataArray