tidy3d.plugins.waveguide.RectangularDielectric#

class RectangularDielectric[source]#

Bases: Tidy3dBaseModel

General rectangular dielectric waveguide

Parameters:

Attributes

grid_spec

Waveguide grid specification with overriding geometry.

height

Domain height (size in the normal direction).

lateral_axis

Lateral direction axis.

mode_area

Calculate the effective mode area.

mode_solver

Create a mode solver based on this waveguide structure

n_complex

Calculate the complex effective index.

n_eff

Calculate the effective index.

n_group

Calculate the group index.

structures

Waveguide structures for simulation, including the core(s), slabs (if any), and bottom cladding, if different from the top.

width

Domain width (size in the lateral direction).

Methods

plot([x, y, z, ax, source_alpha, monitor_alpha])

Plot each of simulation's components on a plane defined by one nonzero x,y,z coordinate.

plot_eps([x, y, z, freq, alpha, ...])

Plot each of simulation's components on a plane defined by one nonzero x,y,z coordinate.

plot_field(field_name[, val, eps_alpha, ...])

Plot the field for a ModeSolverData with Simulation plot overlaid.

plot_grid([x, y, z, ax])

Plot the cell boundaries as lines on a plane defined by one nonzero x,y,z coordinate.

plot_structures([x, y, z, ax])

Plot each of simulation's structures on a plane defined by one nonzero x,y,z coordinate.

plot_structures_eps([x, y, z, freq, alpha, ...])

Plot each of simulation's structures on a plane defined by one nonzero x,y,z coordinate.

wavelength#
core_width#
core_thickness#
core_medium#
clad_medium#
box_medium#
slab_thickness#
clad_thickness#
box_thickness#
side_margin#
sidewall_angle#
gap#
sidewall_thickness#
sidewall_medium#
surface_thickness#
surface_medium#
origin#
length#
propagation_axis#
normal_axis#
mode_spec#
grid_resolution#
max_grid_scaling#
property lateral_axis#

Lateral direction axis.

property height#

Domain height (size in the normal direction).

property width#

Domain width (size in the lateral direction).

property grid_spec#

Waveguide grid specification with overriding geometry.

property structures#

Waveguide structures for simulation, including the core(s), slabs (if any), and bottom cladding, if different from the top. For bend modes, the structure is a 270 degree bend regardless of length.

property mode_solver#

Create a mode solver based on this waveguide structure

Return type:

ModeSolver

Example

>>> wg = waveguide.RectangularDielectric(
...     wavelength=1.55,
...     core_width=0.5,
...     core_thickness=0.22,
...     core_medium=Medium(permittivity=3.48**2),
...     clad_medium=Medium(permittivity=1.45**2),
...     num_modes=2,
... )
>>> mode_data = wg.mode_solver.solve()
>>> mode_data.n_eff.values
array([[2.4536054 1.7850305]], dtype=float32)
property n_eff#

Calculate the effective index.

property n_complex#

Calculate the complex effective index.

property n_group#

Calculate the group index.

property mode_area#

Calculate the effective mode area.

plot(x=None, y=None, z=None, ax=None, source_alpha=None, monitor_alpha=None, **patch_kwargs)[source]#

Plot each of simulation’s components on a plane defined by one nonzero x,y,z coordinate.

Parameters:
  • x (float = None) – position of plane in x direction, only one of x, y, z must be specified to define plane.

  • y (float = None) – position of plane in y direction, only one of x, y, z must be specified to define plane.

  • z (float = None) – position of plane in z direction, only one of x, y, z must be specified to define plane.

  • source_alpha (float = None) – Opacity of the sources. If None, uses Tidy3d default.

  • monitor_alpha (float = None) – Opacity of the monitors. If None, uses Tidy3d default.

  • ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.

Returns:

The supplied or created matplotlib axes.

Return type:

matplotlib.axes._subplots.Axes

plot_eps(x=None, y=None, z=None, freq=None, alpha=None, source_alpha=None, monitor_alpha=None, ax=None)[source]#

Plot each of simulation’s components on a plane defined by one nonzero x,y,z coordinate. The permittivity is plotted in grayscale based on its value at the specified frequency.

Parameters:
  • x (float = None) – position of plane in x direction, only one of x, y, z must be specified to define plane.

  • y (float = None) – position of plane in y direction, only one of x, y, z must be specified to define plane.

  • z (float = None) – position of plane in z direction, only one of x, y, z must be specified to define plane.

  • freq (float = None) – Frequency to evaluate the relative permittivity of all mediums. If not specified, evaluates at infinite frequency.

  • alpha (float = None) – Opacity of the structures being plotted. Defaults to the structure default alpha.

  • source_alpha (float = None) – Opacity of the sources. If None, uses Tidy3d default.

  • monitor_alpha (float = None) – Opacity of the monitors. If None, uses Tidy3d default.

  • ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.

Returns:

The supplied or created matplotlib axes.

Return type:

matplotlib.axes._subplots.Axes

plot_structures(x=None, y=None, z=None, ax=None)[source]#

Plot each of simulation’s structures on a plane defined by one nonzero x,y,z coordinate.

Parameters:
  • x (float = None) – position of plane in x direction, only one of x, y, z must be specified to define plane.

  • y (float = None) – position of plane in y direction, only one of x, y, z must be specified to define plane.

  • z (float = None) – position of plane in z direction, only one of x, y, z must be specified to define plane.

  • ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.

Returns:

The supplied or created matplotlib axes.

Return type:

matplotlib.axes._subplots.Axes

plot_structures_eps(x=None, y=None, z=None, freq=None, alpha=None, cbar=True, reverse=False, ax=None)[source]#

Plot each of simulation’s structures on a plane defined by one nonzero x,y,z coordinate. The permittivity is plotted in grayscale based on its value at the specified frequency.

Parameters:
  • x (float = None) – position of plane in x direction, only one of x, y, z must be specified to define plane.

  • y (float = None) – position of plane in y direction, only one of x, y, z must be specified to define plane.

  • z (float = None) – position of plane in z direction, only one of x, y, z must be specified to define plane.

  • freq (float = None) – Frequency to evaluate the relative permittivity of all mediums. If not specified, evaluates at infinite frequency.

  • reverse (bool = False) – If False, the highest permittivity is plotted in black. If True, it is plotteed in white (suitable for black backgrounds).

  • cbar (bool = True) – Whether to plot a colorbar for the relative permittivity.

  • alpha (float = None) – Opacity of the structures being plotted. Defaults to the structure default alpha.

  • ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.

Returns:

The supplied or created matplotlib axes.

Return type:

matplotlib.axes._subplots.Axes

plot_grid(x=None, y=None, z=None, ax=None, **kwargs)[source]#

Plot the cell boundaries as lines on a plane defined by one nonzero x,y,z coordinate.

Parameters:
  • x (float = None) – position of plane in x direction, only one of x, y, z must be specified to define plane.

  • y (float = None) – position of plane in y direction, only one of x, y, z must be specified to define plane.

  • z (float = None) – position of plane in z direction, only one of x, y, z must be specified to define plane.

  • ax (matplotlib.axes._subplots.Axes = None) – Matplotlib axes to plot on, if not specified, one is created.

  • **kwargs – Optional keyword arguments passed to the matplotlib LineCollection. For details on accepted values, refer to Matplotlib’s documentation.

Returns:

The supplied or created matplotlib axes.

Return type:

matplotlib.axes._subplots.Axes

plot_field(field_name, val='real', eps_alpha=0.2, robust=True, vmin=None, vmax=None, ax=None, **sel_kwargs)[source]#

Plot the field for a ModeSolverData with Simulation plot overlaid.

Parameters:
  • field_name (str) – Name of field component to plot (eg. 'Ex'). Also accepts 'E' and 'H' to plot the vector magnitudes of the electric and magnetic fields, and 'S' for the Poynting vector.

  • val (Literal['real', 'imag', 'abs', 'abs^2', 'dB'] = 'real') – Which part of the field to plot.

  • eps_alpha (float = 0.2) – Opacity of the structure permittivity. Must be between 0 and 1 (inclusive).

  • robust (bool = True) – If True and vmin or vmax are absent, uses the 2nd and 98th percentiles of the data to compute the color limits. This helps in visualizing the field patterns especially in the presence of a source.

  • vmin (float = None) – The lower bound of data range that the colormap covers. If None, they are inferred from the data and other keyword arguments.

  • vmax (float = None) – The upper bound of data range that the colormap covers. If None, they are inferred from the data and other keyword arguments.

  • ax (matplotlib.axes._subplots.Axes = None) – matplotlib axes to plot on, if not specified, one is created.

  • sel_kwargs (keyword arguments used to perform .sel() selection in the monitor data.) – These kwargs can select over the spatial dimensions (x, y, z), frequency or time dimensions (f, t) or mode_index, if applicable. For the plotting to work appropriately, the resulting data after selection must contain only two coordinates with len > 1. Furthermore, these should be spatial coordinates (x, y, or z).

Returns:

The supplied or created matplotlib axes.

Return type:

matplotlib.axes._subplots.Axes

__hash__()#

Hash method.