tidy3d.ModeSource#

class tidy3d.ModeSource#

Injects current source to excite modal profile on finite extent plane.

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]) – [units = um]. Size in x, y, and z directions.

  • source_time (Union[GaussianPulse, ContinuousWave]) – Specification of the source time-dependence.

  • name (Optional[str] = None) – Optional name for the source.

  • num_freqs (ConstrainedIntValue = 1) – Number of points used to approximate the frequency dependence of injected field. A Chebyshev interpolation is used, thus, only a small number of points, i.e., less than 20, is typically sufficient to obtain converged results.

  • direction (Literal['+', '-']) – Specifies propagation in the positive or negative direction of the injection axis.

  • mode_spec (ModeSpec = ModeSpec(num_modes=1, target_neff=None, num_pml=(0,, 0), filter_pol=None, angle_theta=0.0, angle_phi=0.0, precision='single', bend_radius=None, bend_axis=None, track_freq='central', type='ModeSpec')) – Parameters to feed to mode solver which determine modes measured by monitor.

  • mode_index (NonNegativeInt = 0) – Index into the collection of modes returned by mode solver. Specifies which mode to inject using this source. If larger than mode_spec.num_modes, num_modes in the solver will be set to mode_index + 1.

Example

>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)
>>> mode_spec = ModeSpec(target_neff=2.)
>>> mode_source = ModeSource(
...     size=(10,10,0),
...     source_time=pulse,
...     mode_spec=mode_spec,
...     mode_index=1,
...     direction='-')

Show JSON schema
{
   "title": "ModeSource",
   "description": "Injects current source to excite modal profile on finite extent plane.\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]\n    [units = um].  Size in x, y, and z directions.\nsource_time : Union[GaussianPulse, ContinuousWave]\n    Specification of the source time-dependence.\nname : Optional[str] = None\n    Optional name for the source.\nnum_freqs : ConstrainedIntValue = 1\n    Number of points used to approximate the frequency dependence of injected field. A Chebyshev interpolation is used, thus, only a small number of points, i.e., less than 20, is typically sufficient to obtain converged results.\ndirection : Literal['+', '-']\n    Specifies propagation in the positive or negative direction of the injection axis.\nmode_spec : ModeSpec = ModeSpec(num_modes=1, target_neff=None, num_pml=(0,, 0), filter_pol=None, angle_theta=0.0, angle_phi=0.0, precision='single', bend_radius=None, bend_axis=None, track_freq='central', type='ModeSpec')\n    Parameters to feed to mode solver which determine modes measured by monitor.\nmode_index : NonNegativeInt = 0\n    Index into the collection of modes returned by mode solver.  Specifies which mode to inject using this source. If larger than ``mode_spec.num_modes``, ``num_modes`` in the solver will be set to ``mode_index + 1``.\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)\n>>> mode_spec = ModeSpec(target_neff=2.)\n>>> mode_source = ModeSource(\n...     size=(10,10,0),\n...     source_time=pulse,\n...     mode_spec=mode_spec,\n...     mode_index=1,\n...     direction='-')",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "default": "ModeSource",
         "enum": [
            "ModeSource"
         ],
         "type": "string"
      },
      "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"
            }
         ]
      },
      "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
            }
         ]
      },
      "source_time": {
         "title": "Source Time",
         "description": "Specification of the source time-dependence.",
         "anyOf": [
            {
               "$ref": "#/definitions/GaussianPulse"
            },
            {
               "$ref": "#/definitions/ContinuousWave"
            }
         ]
      },
      "name": {
         "title": "Name",
         "description": "Optional name for the source.",
         "type": "string"
      },
      "num_freqs": {
         "title": "Number of Frequency Points",
         "description": "Number of points used to approximate the frequency dependence of injected field. A Chebyshev interpolation is used, thus, only a small number of points, i.e., less than 20, is typically sufficient to obtain converged results.",
         "default": 1,
         "minimum": 1,
         "maximum": 99,
         "type": "integer"
      },
      "direction": {
         "title": "Direction",
         "description": "Specifies propagation in the positive or negative direction of the injection axis.",
         "enum": [
            "+",
            "-"
         ],
         "type": "string"
      },
      "mode_spec": {
         "title": "Mode Specification",
         "description": "Parameters to feed to mode solver which determine modes measured by monitor.",
         "default": {
            "num_modes": 1,
            "target_neff": null,
            "num_pml": [
               0,
               0
            ],
            "filter_pol": null,
            "angle_theta": 0.0,
            "angle_phi": 0.0,
            "precision": "single",
            "bend_radius": null,
            "bend_axis": null,
            "track_freq": "central",
            "type": "ModeSpec"
         },
         "allOf": [
            {
               "$ref": "#/definitions/ModeSpec"
            }
         ]
      },
      "mode_index": {
         "title": "Mode Index",
         "description": "Index into the collection of modes returned by mode solver.  Specifies which mode to inject using this source. If larger than ``mode_spec.num_modes``, ``num_modes`` in the solver will be set to ``mode_index + 1``.",
         "default": 0,
         "minimum": 0,
         "type": "integer"
      }
   },
   "required": [
      "size",
      "source_time",
      "direction"
   ],
   "additionalProperties": false,
   "definitions": {
      "GaussianPulse": {
         "title": "GaussianPulse",
         "description": "Source time dependence that describes a Gaussian pulse.\n\nParameters\n----------\namplitude : NonNegativeFloat = 1.0\n    Real-valued maximum amplitude of the time dependence.\nphase : float = 0.0\n    [units = rad].  Phase shift of the time dependence.\nfreq0 : PositiveFloat\n    [units = Hz].  Central frequency of the pulse.\nfwidth : PositiveFloat\n    [units = Hz].  Standard deviation of the frequency content of the pulse.\noffset : ConstrainedFloatValue = 5.0\n    Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).\n\nExample\n-------\n>>> pulse = GaussianPulse(freq0=200e12, fwidth=20e12)",
         "type": "object",
         "properties": {
            "amplitude": {
               "title": "Amplitude",
               "description": "Real-valued maximum amplitude of the time dependence.",
               "default": 1.0,
               "minimum": 0,
               "type": "number"
            },
            "phase": {
               "title": "Phase",
               "description": "Phase shift of the time dependence.",
               "default": 0.0,
               "units": "rad",
               "type": "number"
            },
            "type": {
               "title": "Type",
               "default": "GaussianPulse",
               "enum": [
                  "GaussianPulse"
               ],
               "type": "string"
            },
            "freq0": {
               "title": "Central Frequency",
               "description": "Central frequency of the pulse.",
               "units": "Hz",
               "exclusiveMinimum": 0,
               "type": "number"
            },
            "fwidth": {
               "title": "Fwidth",
               "description": "Standard deviation of the frequency content of the pulse.",
               "units": "Hz",
               "exclusiveMinimum": 0,
               "type": "number"
            },
            "offset": {
               "title": "Offset",
               "description": "Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).",
               "default": 5.0,
               "minimum": 2.5,
               "type": "number"
            }
         },
         "required": [
            "freq0",
            "fwidth"
         ],
         "additionalProperties": false
      },
      "ContinuousWave": {
         "title": "ContinuousWave",
         "description": "Source time dependence that ramps up to continuous oscillation\nand holds until end of simulation.\n\nParameters\n----------\namplitude : NonNegativeFloat = 1.0\n    Real-valued maximum amplitude of the time dependence.\nphase : float = 0.0\n    [units = rad].  Phase shift of the time dependence.\nfreq0 : PositiveFloat\n    [units = Hz].  Central frequency of the pulse.\nfwidth : PositiveFloat\n    [units = Hz].  Standard deviation of the frequency content of the pulse.\noffset : ConstrainedFloatValue = 5.0\n    Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).\n\nExample\n-------\n>>> cw = ContinuousWave(freq0=200e12, fwidth=20e12)",
         "type": "object",
         "properties": {
            "amplitude": {
               "title": "Amplitude",
               "description": "Real-valued maximum amplitude of the time dependence.",
               "default": 1.0,
               "minimum": 0,
               "type": "number"
            },
            "phase": {
               "title": "Phase",
               "description": "Phase shift of the time dependence.",
               "default": 0.0,
               "units": "rad",
               "type": "number"
            },
            "type": {
               "title": "Type",
               "default": "ContinuousWave",
               "enum": [
                  "ContinuousWave"
               ],
               "type": "string"
            },
            "freq0": {
               "title": "Central Frequency",
               "description": "Central frequency of the pulse.",
               "units": "Hz",
               "exclusiveMinimum": 0,
               "type": "number"
            },
            "fwidth": {
               "title": "Fwidth",
               "description": "Standard deviation of the frequency content of the pulse.",
               "units": "Hz",
               "exclusiveMinimum": 0,
               "type": "number"
            },
            "offset": {
               "title": "Offset",
               "description": "Time delay of the maximum value of the pulse in units of 1 / (``2pi * fwidth``).",
               "default": 5.0,
               "minimum": 2.5,
               "type": "number"
            }
         },
         "required": [
            "freq0",
            "fwidth"
         ],
         "additionalProperties": false
      },
      "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.\nfilter_pol : Optional[Literal['te', 'tm']] = None\n    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 decresing 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.\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.\nprecision : Literal['single', 'double'] = single\n    The solver will be faster and using less memory under single precision, but more accurate under double precision.\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).\ntrack_freq : Optional[Literal['central', 'lowest', 'highest']] = central\n    Parameter that turns on/off mode tracking based on their similarity. Can take values ``'lowest'``, ``'central'``, or ``'highest'``, which correspond to mode tracking based on the lowest, central, or highest frequency. If ``None`` no mode tracking is performed.\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
                  }
               ]
            },
            "filter_pol": {
               "title": "Polarization filtering",
               "description": "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 decresing 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.",
               "enum": [
                  "te",
                  "tm"
               ],
               "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"
            },
            "precision": {
               "title": "single or double precision in mode solver",
               "description": "The solver will be faster and using less memory under single precision, but more accurate under double precision.",
               "default": "single",
               "enum": [
                  "single",
                  "double"
               ],
               "type": "string"
            },
            "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"
            },
            "track_freq": {
               "title": "Mode Tracking Frequency",
               "description": "Parameter that turns on/off mode tracking based on their similarity. Can take values ``'lowest'``, ``'central'``, or ``'highest'``, which correspond to mode tracking based on the lowest, central, or highest frequency. If ``None`` no mode tracking is performed.",
               "default": "central",
               "enum": [
                  "central",
                  "lowest",
                  "highest"
               ],
               "type": "string"
            },
            "type": {
               "title": "Type",
               "default": "ModeSpec",
               "enum": [
                  "ModeSpec"
               ],
               "type": "string"
            }
         },
         "additionalProperties": false
      }
   }
}

attribute mode_index: pydantic.types.NonNegativeInt = 0#

Index into the collection of modes returned by mode solver. Specifies which mode to inject using this source. If larger than mode_spec.num_modes, num_modes in the solver will be set to mode_index + 1.

Constraints
  • minimum = 0

attribute mode_spec: tidy3d.components.mode.ModeSpec = ModeSpec(num_modes=1, target_neff=None, num_pml=(0, 0), filter_pol=None, angle_theta=0.0, angle_phi=0.0, precision='single', bend_radius=None, bend_axis=None, track_freq='central', type='ModeSpec')#

Parameters to feed to mode solver which determine modes measured by monitor.

property angle_phi#

Azimuth angle of propagation.

property angle_theta#

Polar angle of propagation.