tidy3d.plugins.Port#

class tidy3d.plugins.Port#

Specifies a port in the scattering matrix.

Parameters
  • center (Tuple[float, float, float] = (0.0, 0.0, 0.0)) – [units = um]. Center of object in x, y, and z.

  • size (Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat] = None) – [units = um]. Size in x, y, and z directions.

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

  • mode_spec (ModeSpec = ModeSpec(num_modes=1, target_neff=None, num_pml=(0,, 0), sort_by='largest_neff', angle_theta=0.0, angle_phi=0.0, bend_radius=None, bend_axis=None, type='ModeSpec')) – Specifies how the mode solver will solve for the modes of the port.

  • mode_indices (Optional[Tuple[NonNegativeInt]] = None) – Indices into modes returned by the mode solver to use in the port. If None, all modes returned by the mode solver are used in the scattering matrix. Otherwise, the scattering matrix will include elements for each supplied mode index.

  • name (ConstrainedStrValue = None) – Unique name for the port.

Show JSON schema
{
   "title": "Port",
   "description": "Specifies a port in the scattering matrix.\n\nParameters\n----------\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n    [units = um].  Center of object in x, y, and z.\nsize : Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat] = None\n    [units = um].  Size in x, y, and z directions.\ndirection : Literal['+', '-'] = None\n    '+' or '-', defining which direction is considered 'input'.\nmode_spec : ModeSpec = ModeSpec(num_modes=1, target_neff=None, num_pml=(0,, 0), sort_by='largest_neff', angle_theta=0.0, angle_phi=0.0, bend_radius=None, bend_axis=None, type='ModeSpec')\n    Specifies how the mode solver will solve for the modes of the port.\nmode_indices : Optional[Tuple[NonNegativeInt]] = None\n    Indices into modes returned by the mode solver to use in the port. If ``None``, all modes returned by the mode solver are used in the scattering matrix. Otherwise, the scattering matrix will include elements for each supplied mode index.\nname : ConstrainedStrValue = None\n    Unique name for the port.",
   "type": "object",
   "properties": {
      "center": {
         "title": "Center",
         "description": "Center of object in x, y, and z.",
         "default": [
            0.0,
            0.0,
            0.0
         ],
         "units": "um",
         "type": "array",
         "minItems": 3,
         "maxItems": 3,
         "items": [
            {
               "type": "number"
            },
            {
               "type": "number"
            },
            {
               "type": "number"
            }
         ]
      },
      "type": {
         "title": "Type",
         "default": "Port",
         "enum": [
            "Port"
         ],
         "type": "string"
      },
      "size": {
         "title": "Size",
         "description": "Size in x, y, and z directions.",
         "units": "um",
         "type": "array",
         "minItems": 3,
         "maxItems": 3,
         "items": [
            {
               "type": "number",
               "minimum": 0
            },
            {
               "type": "number",
               "minimum": 0
            },
            {
               "type": "number",
               "minimum": 0
            }
         ]
      },
      "direction": {
         "title": "Direction",
         "description": "'+' or '-', defining which direction is considered 'input'.",
         "enum": [
            "+",
            "-"
         ],
         "type": "string"
      },
      "mode_spec": {
         "title": "Mode Specification",
         "description": "Specifies how the mode solver will solve for the modes of the port.",
         "default": {
            "num_modes": 1,
            "target_neff": null,
            "num_pml": [
               0,
               0
            ],
            "sort_by": "largest_neff",
            "angle_theta": 0.0,
            "angle_phi": 0.0,
            "bend_radius": null,
            "bend_axis": null,
            "type": "ModeSpec"
         },
         "allOf": [
            {
               "$ref": "#/definitions/ModeSpec"
            }
         ]
      },
      "mode_indices": {
         "title": "Mode Indices.",
         "description": "Indices into modes returned by the mode solver to use in the port. If ``None``, all modes returned by the mode solver are used in the scattering matrix. Otherwise, the scattering matrix will include elements for each supplied mode index.",
         "type": "array",
         "minItems": 1,
         "maxItems": 1,
         "items": [
            {
               "type": "integer",
               "minimum": 0
            }
         ]
      },
      "name": {
         "title": "Name",
         "description": "Unique name for the port.",
         "minLength": 1,
         "type": "string"
      }
   },
   "required": [
      "size",
      "direction",
      "name"
   ],
   "additionalProperties": false,
   "definitions": {
      "ModeSpec": {
         "title": "ModeSpec",
         "description": "Stores specifications for the mode solver to find an electromagntic mode.\nNote, the planar axes are found by popping the injection axis from {x,y,z}.\nFor example, if injection axis is y, the planar axes are ordered {x,z}.\n\nParameters\n----------\nnum_modes : PositiveInt = 1\n    Number of modes returned by mode solver.\ntarget_neff : Optional[PositiveFloat] = None\n    Guess for effective index of the mode.\nnum_pml : Tuple[NonNegativeInt, NonNegativeInt] = (0, 0)\n    Number of standard pml layers to add in the two tangential axes.\nsort_by : Literal['largest_neff', 'te_fraction', 'tm_fraction'] = largest_neff\n    The solver will always compute the ``num_modes`` modes closest to the ``target_neff``, but they can be reordered by the largest ``te_fraction``, defined as the integral of the intensity of the E-field component parallel to the first plane axis normalized to the total in-plane E-field intensity. Similarly, ``tm_fraction`` uses the E field component parallel to the second plane axis.\nangle_theta : float = 0.0\n    [units = rad].  Polar angle of the propagation axis from the injection axis.\nangle_phi : float = 0.0\n    [units = rad].  Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.\nbend_radius : Optional[float] = None\n    [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.\nbend_axis : Optional[Literal[0, 1]] = None\n    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).\n\nExample\n-------\n>>> mode_spec = ModeSpec(num_modes=3, target_neff=1.5)",
         "type": "object",
         "properties": {
            "num_modes": {
               "title": "Number of modes",
               "description": "Number of modes returned by mode solver.",
               "default": 1,
               "exclusiveMinimum": 0,
               "type": "integer"
            },
            "target_neff": {
               "title": "Target effective index",
               "description": "Guess for effective index of the mode.",
               "exclusiveMinimum": 0,
               "type": "number"
            },
            "num_pml": {
               "title": "Number of PML layers",
               "description": "Number of standard pml layers to add in the two tangential axes.",
               "default": [
                  0,
                  0
               ],
               "type": "array",
               "minItems": 2,
               "maxItems": 2,
               "items": [
                  {
                     "type": "integer",
                     "minimum": 0
                  },
                  {
                     "type": "integer",
                     "minimum": 0
                  }
               ]
            },
            "sort_by": {
               "title": "Ordering of the returned modes",
               "description": "The solver will always compute the ``num_modes`` modes closest to the ``target_neff``, but they can be reordered by the largest ``te_fraction``, defined as the integral of the intensity of the E-field component parallel to the first plane axis normalized to the total in-plane E-field intensity. Similarly, ``tm_fraction`` uses the E field component parallel to the second plane axis.",
               "default": "largest_neff",
               "enum": [
                  "largest_neff",
                  "te_fraction",
                  "tm_fraction"
               ],
               "type": "string"
            },
            "angle_theta": {
               "title": "Polar Angle",
               "description": "Polar angle of the propagation axis from the injection axis.",
               "default": 0.0,
               "units": "rad",
               "type": "number"
            },
            "angle_phi": {
               "title": "Azimuth Angle",
               "description": "Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.",
               "default": 0.0,
               "units": "rad",
               "type": "number"
            },
            "bend_radius": {
               "title": "Bend radius",
               "description": "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.",
               "units": "um",
               "type": "number"
            },
            "bend_axis": {
               "title": "Bend axis",
               "description": "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).",
               "enum": [
                  0,
                  1
               ],
               "type": "integer"
            },
            "type": {
               "title": "Type",
               "default": "ModeSpec",
               "enum": [
                  "ModeSpec"
               ],
               "type": "string"
            }
         },
         "additionalProperties": false
      }
   }
}

Fields
  • direction (Literal['+', '-'])

  • mode_indices (Tuple[pydantic.types.NonNegativeInt])

  • mode_spec (tidy3d.components.mode.ModeSpec)

  • name (str)

attribute direction: Literal['+', '-'] [Required]#

‘+’ or ‘-’, defining which direction is considered ‘input’.

attribute mode_indices: Tuple[pydantic.types.NonNegativeInt] = None#

Indices into modes returned by the mode solver to use in the port. If None, all modes returned by the mode solver are used in the scattering matrix. Otherwise, the scattering matrix will include elements for each supplied mode index.

Validated by
  • evaluate_mode_indices

attribute mode_spec: tidy3d.components.mode.ModeSpec = ModeSpec(num_modes=1, target_neff=None, num_pml=(0, 0), sort_by='largest_neff', angle_theta=0.0, angle_phi=0.0, bend_radius=None, bend_axis=None, type='ModeSpec')#

Specifies how the mode solver will solve for the modes of the port.

attribute name: str [Required]#

Unique name for the port.

Constraints
  • minLength = 1