{
  "title": "TerminalComponentModeler",
  "public_path": "flex_rf.tidy3d.TerminalComponentModeler",
  "lookup_path": "tidy3d.rf.TerminalComponentModeler",
  "slug": "flex_rf/tidy3d/TerminalComponentModeler",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/terminalcomponentmodeler/",
  "object_kind": "class",
  "introduction": "Tool for modeling two-terminal multiport devices and computing port parameters\nwith lumped and wave ports.",
  "notes": "**S-Parameter Definitions**\n\nThe `s_param_def` parameter controls which wave definition is used to compute scattering\nparameters. Three definitions are supported:\n\n- `\"pseudo\"` (default): Pseudo-waves as defined by Marks and Williams [1]. Uses scaling\n  factor $$F = \\sqrt{\\text{Re}(Z)} / (2|Z|)$$. Wave amplitudes are $$a = F(V + ZI)$$\n  and $$b = F(V - ZI)$$.\n\n- `\"power\"`: Power waves as defined by Kurokawa [3] and described in Pozar [2]. Uses\n  scaling factor $$F = 1 / (2\\sqrt{\\text{Re}(Z)})$$. Wave amplitudes are\n  $$a = F(V + ZI)$$ and $$b = F(V - Z^*I)$$ where $$Z^*$$ is the complex\n  conjugate. Ensures $$|a|^2 - |b|^2$$ represents actual power flow.\n\n- `\"symmetric_pseudo\"`: Equivalent to pseudo-waves except for the scaling factor. Uses\n  $$F = 1 / (2\\sqrt{Z})$$ where the square root is complex. This choice of scaling\n  factor ensures the S-matrix will be symmetric when the simulated device is reciprocal.",
  "examples": "",
  "references": "**[1]** R. B. Marks and D. F. Williams, \"A general waveguide circuit theory,\" J. Res. Natl. Inst. Stand. Technol., vol. 97, pp. 533, 1992.\n\n**[2]** D. M. Pozar, Microwave Engineering, 4th ed. Hoboken, NJ, USA: John Wiley & Sons, 2012.\n\n**[3]** K. Kurokawa, \"Power Waves and the Scattering Matrix,\" IEEE Trans. Microwave Theory Tech., vol. 13, no. 2, pp. 194-202, March 1965.",
  "signature": "class TerminalComponentModeler(AbstractComponentModeler, MicrowaveBaseModel)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/plugins/smatrix/component_modelers/terminal.py",
    "url": "",
    "lineno": 330,
    "endlineno": 2143
  },
  "bases": [
    "AbstractComponentModeler",
    "MicrowaveBaseModel"
  ],
  "parameter_rows": [
    {
      "name": "ports",
      "annotation": "tuple[TerminalPortType, ...]",
      "default": "()",
      "description": "Collection of lumped and wave ports associated with the network. For each port, one simulation will be run with a source that is associated with the port.",
      "origin": "declared"
    },
    {
      "name": "run_only",
      "annotation": "tuple[NetworkIndex, ...] | None",
      "default": "None",
      "description": "Set of matrix indices that define the simulations to run. If `None`, simulations will be run for all indices in the scattering matrix. If a tuple is given, simulations will be run only for the given matrix indices.",
      "origin": "declared"
    },
    {
      "name": "element_mappings",
      "annotation": "tuple[tuple[NetworkElement, NetworkElement, Complex], ...]",
      "default": "()",
      "description": "Tuple of S matrix element mappings, each described by a tuple of (input_element, output_element, coefficient), where the coefficient is the element_mapping coefficient describing the relationship between the input and output matrix element. If all elements of a given column of the scattering matrix are defined by `element_mappings`, the simulation corresponding to this column is skipped automatically.",
      "origin": "declared"
    },
    {
      "name": "radiation_monitors",
      "annotation": "tuple[discriminated_union(DirectivityMonitor | DirectivityMonitorSpec), ...]",
      "default": "()",
      "description": "Facilitates the calculation of figures-of-merit for antennas. These monitors will be included in every simulation and record the radiated fields. Users can specify a combination of `DirectivityMonitor` objects for manual placement and `DirectivityMonitorSpec` objects for automatic generation.",
      "origin": "declared"
    },
    {
      "name": "assume_ideal_excitation",
      "annotation": "bool",
      "default": "False",
      "description": "If `True`, only the excited port is assumed to have a nonzero incident wave amplitude power. This choice simplifies the calculation of the scattering matrix. If `False`, every entry in the vector of incident wave amplitudes (a) is calculated explicitly. This choice requires a matrix inversion when calculating the scattering matrix, but may lead to more accurate scattering parameters when there are reflections from simulation boundaries.",
      "origin": "declared"
    },
    {
      "name": "s_param_def",
      "annotation": "SParamDef",
      "default": "'pseudo'",
      "description": "Wave definition: 'pseudo', 'power', or 'symmetric_pseudo'. Default is 'pseudo'.",
      "origin": "declared"
    },
    {
      "name": "low_freq_smoothing",
      "annotation": "ModelerLowFrequencySmoothingSpec | None",
      "default": "None",
      "description": "The low frequency smoothing parameters for the terminal component simulation.",
      "origin": "declared"
    },
    {
      "name": "structure_priority_mode",
      "annotation": "PriorityMode | None",
      "default": "'conductor'",
      "description": "If not `None`, override the structure priority mode in the simulation. This field only affects structures of `priority=None`. If `equal`, the priority of those structures is set to 0; if `conductor`, the priority of structures made of `LossyMetalMedium` is set to 90, `PECMedium` to 100, and others to 0.",
      "origin": "declared"
    },
    {
      "name": "attrs",
      "annotation": "dict",
      "default": "factory: dict",
      "description": "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.model_dump_json()`.",
      "origin": "inherited"
    },
    {
      "name": "name",
      "annotation": "str",
      "default": "''",
      "description": "",
      "origin": "inherited"
    },
    {
      "name": "simulation",
      "annotation": "Simulation",
      "default": "",
      "description": "Simulation describing the device without any sources present.",
      "origin": "inherited"
    },
    {
      "name": "freqs",
      "annotation": "FreqArray",
      "default": "",
      "description": "Array or list of frequencies at which to compute port parameters.",
      "origin": "inherited"
    },
    {
      "name": "remove_dc_component",
      "annotation": "bool",
      "default": "True",
      "description": "Whether to remove the DC component in the Gaussian pulse spectrum. If `True`, the Gaussian pulse is modified at low frequencies to zero out the DC component, which is usually desirable so that the fields will decay. However, for broadband simulations, it may be better to have non-vanishing source power near zero frequency. Setting this to `False` results in an unmodified Gaussian pulse spectrum which can have a nonzero DC component.",
      "origin": "inherited"
    },
    {
      "name": "custom_source_time",
      "annotation": "SourceTimeType | None",
      "default": "None",
      "description": "If provided, this will be used as specification of the source time-dependence in simulations. Otherwise, a default source time will be constructed.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "base_sim",
      "kind": "function",
      "signature": "base_sim()",
      "description": "The base simulation with all components added, including radiation monitors."
    },
    {
      "name": "get_radiation_monitor_by_name",
      "kind": "function",
      "signature": "get_radiation_monitor_by_name(monitor_name: str)",
      "description": "Find and return a `DirectivityMonitor` monitor by its name."
    },
    {
      "name": "matrix_indices_monitor",
      "kind": "function",
      "signature": "matrix_indices_monitor()",
      "description": "Tuple of all the possible matrix indices."
    },
    {
      "name": "matrix_indices_run_sim",
      "kind": "function",
      "signature": "matrix_indices_run_sim()",
      "description": "Tuple of all the matrix indices that will be used to run simulations."
    },
    {
      "name": "matrix_indices_source",
      "kind": "function",
      "signature": "matrix_indices_source()",
      "description": "Tuple of all the source matrix indices, which may be less than the total number of ports."
    },
    {
      "name": "mode_solver_for_port",
      "kind": "function",
      "signature": "mode_solver_for_port(port_name: str)",
      "description": "Get the mode solver object for a given port."
    },
    {
      "name": "network_dict",
      "kind": "function",
      "signature": "network_dict()",
      "description": "Dictionary associating each unique `NetworkIndex` to a port and mode/terminal index."
    },
    {
      "name": "network_index",
      "kind": "function",
      "signature": "network_index(port: TerminalPortType, mode_index: int | None = None, terminal_label: str | None = None)",
      "description": "Converts the port, and a `mode_index` when the port is a `WavePort`, or a `terminal_label` when the port is a `TerminalWavePort`, to a unique string specifier."
    },
    {
      "name": "plot_port",
      "kind": "function",
      "signature": "plot_port(port: str | TerminalPortType, ax: Ax = None, label_font_size: float | None = None, **kwargs: Any)",
      "description": "Plot a `Simulation` on the port plane."
    },
    {
      "name": "plot_sim",
      "kind": "function",
      "signature": "plot_sim(x: float | None = None, y: float | None = None, z: float | None = None, ax: Ax = None, **kwargs: Any)",
      "description": "Plot a `Simulation` with all sources and absorbers."
    },
    {
      "name": "plot_sim_eps",
      "kind": "function",
      "signature": "plot_sim_eps(x: float | None = None, y: float | None = None, z: float | None = None, ax: Ax = None, **kwargs: Any)",
      "description": "Plot permittivity of the `Simulation`."
    },
    {
      "name": "plot_sim_grid",
      "kind": "function",
      "signature": "plot_sim_grid(x: float | None = None, y: float | None = None, z: float | None = None, ax: Ax = None, **kwargs: Any)",
      "description": "Plot the cell boundaries as lines on a plane defined by one nonzero x,y,z coordinate."
    },
    {
      "name": "sim_dict",
      "kind": "function",
      "signature": "sim_dict()",
      "description": "Generate all the `Simulation` objects for the port parameter calculation."
    },
    {
      "name": "task_name_from_index",
      "kind": "function",
      "signature": "task_name_from_index(source_index: NetworkIndex)",
      "description": "Compute task name for a given network index without constructing simulations."
    }
  ],
  "group": "flex_rf.tidy3d"
}
