tidy3d.ModeSource

tidy3d.ModeSource#

class ModeSource[source]#

Bases: AbstractModeSource

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

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

  • 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.

  • source_time (Union[GaussianPulse, ContinuousWave, CustomSourceTime, BroadbandPulse, BasebandStep, BasebandGaussianPulse, BasebandRectangularPulse, BasebandCustomSourceTime]) – Specification of the source time-dependence.

  • num_freqs (int = 1) – Number of points used to approximate the frequency dependence of the injected field. For ‘chebyshev’, a Chebyshev interpolation is used with ‘num_freqs’ terms (max 20). For ‘pole_residue’, the mode solver samples at ‘num_freqs’ uniform frequencies and fits ceil((num_freqs - 1) / 3) poles; higher values provide denser sampling and more poles for the fit (max 50).

  • broadband_method (Literal['chebyshev', 'pole_residue'] = chebyshev) – Method for representing the frequency dependence of the injected field. ‘chebyshev’ uses Chebyshev polynomial interpolation (default). ‘pole_residue’ uses a pole-residue (vector fitting) decomposition with auxiliary differential equation (ADE) time stepping. The pole-residue method can be more accurate for highly dispersive modes and uses fewer broadband terms than frequency samples.

  • use_colocated_integration (bool = True) – If True (default), source power normalization uses fields interpolated to grid cell boundaries (colocated). If False, uses fields at native Yee grid positions (non-colocated). Should match the use_colocated_integration setting on monitors for consistent power normalization. Experimental feature that can give improved accuracy by avoiding interpolation of fields to Yee cell positions for integration.

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

  • mode_spec (Union[ModeSpec, MicrowaveModeSpec, MicrowaveTerminalModeSpec] = ModeSpec()) – Parameters to feed to mode solver which determine modes measured by monitor.

  • frame (Optional[PECFrame] = None) – Add a thin frame around the source during the FDTD run to improve the injection quality. The frame is positioned along the primal grid lines so that it aligns with the boundaries of the mode solver used to obtain the source profile.

  • 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.

Notes

Using this mode source, it is possible selectively excite one of the guided modes of a waveguide. This can be computed in our eigenmode solver tidy3d.plugins.mode.ModeSolver and implement the mode simulation in FDTD.

Mode sources are normalized to inject exactly 1W of power at the central frequency.

The modal source allows you to do directional excitation. Illustrated by the image below, the field is perfectly launched to the right of the source and there’s zero field to the left of the source. Now you can contrast the behavior of the modal source with that of a dipole source. If you just put a dipole into the waveguide, well, you see quite a bit different in the field distribution. First of all, the dipole source is not directional launching. It launches waves in both directions. The second is that the polarization of the dipole is set to selectively excite a TE mode. But it takes some propagation distance before the mode settles into a perfect TE mode profile. During this process, there is radiation into the substrate.

../../../_images/mode_vs_dipole_source.png

Practical Advice

Place mode sources in waveguide sections with a uniform cross-section. The mode profile is computed assuming translational invariance (or constant bend radius) along the injection axis. For bent waveguides, set bend_radius and bend_axis accordingly. Avoid placing mode sources at tapers, junctions, or other locations where the cross-section is changing.

Example

>>> from tidy3d import GaussianPulse
>>> 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='-')

See also

tidy3d.plugins.mode.ModeSolver:

Interface for solving electromagnetic eigenmodes in a 2D plane with translational invariance in the third dimension.

Notebooks:
Lectures:

Attributes

mode_index

mode_spec

frame

direction

use_colocated_integration

num_freqs

broadband_method

source_time

size

center

name

mode_index#