tidy3d.plugins.waveguide.RectangularDielectric#
- class RectangularDielectric[source]#
Bases:
Tidy3dBaseModel
General rectangular dielectric waveguide
- Parameters:
wavelength (Attribute:
wavelength
) –Type
Union[float, ArrayLike[dtype=float, ndim=1]]
Default
Units
um
Description
Wavelength(s) at which to calculate modes (in μm).
core_width (Attribute:
core_width
) –Type
Union[NonNegativeFloat, ArrayLike[dtype=float, ndim=1]]
Default
Units
um
Description
Core width at the top of the waveguide. If set to an array, defines the widths of adjacent waveguides.
core_thickness (Attribute:
core_thickness
) –Type
NonNegativeFloat
Default
Units
um
Description
Thickness of the core layer.
core_medium (Attribute:
core_medium
) –Type
Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D]
Default
Description
Medium associated with the core layer.
clad_medium (Attribute:
clad_medium
) –Type
Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D]
Default
Description
Medium associated with the upper cladding layer.
box_medium (Attribute:
box_medium
) –Type
Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D]
Default
= None
Description
Medium associated with the lower cladding layer.
slab_thickness (Attribute:
slab_thickness
) –Type
NonNegativeFloat
Default
= 0.0
Units
um
Description
Thickness of the slab for rib geometry.
clad_thickness (Attribute:
clad_thickness
) –Type
Optional[NonNegativeFloat]
Default
= None
Units
um
Description
Domain size above the core layer.
box_thickness (Attribute:
box_thickness
) –Type
Optional[NonNegativeFloat]
Default
= None
Units
um
Description
Domain size below the core layer.
side_margin (Attribute:
side_margin
) –Type
Optional[NonNegativeFloat]
Default
= None
Units
um
Description
Domain size to the sides of the waveguide core.
sidewall_angle (Attribute:
sidewall_angle
) –Type
float
Default
= 0.0
Units
rad
Description
Angle of the core sidewalls measured from the vertical direction (in radians). Positive (negative) values create waveguides with bases wider (narrower) than their tops.
gap (Attribute:
gap
) –Type
Union[float, ArrayLike[dtype=float, ndim=1]]
Default
= 0.0
Units
um
Description
Distance between adjacent waveguides, measured at the top core edges. An array can be used to define one gap per pair of adjacent waveguides.
sidewall_thickness (Attribute:
sidewall_thickness
) –Type
NonNegativeFloat
Default
= 0.0
Units
um
Description
Sidewall layer thickness (within core).
sidewall_medium (Attribute:
sidewall_medium
) –Type
Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D]
Default
= None
Description
Medium associated with the sidewall layer to model sidewall losses.
surface_thickness (Attribute:
surface_thickness
) –Type
NonNegativeFloat
Default
= 0.0
Units
um
Description
Thickness of the surface layers defined on the top of the waveguide and slab regions (if any).
surface_medium (Attribute:
surface_medium
) –Type
Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D]
Default
= None
Description
Medium associated with the surface layer to model surface losses.
origin (Attribute:
origin
) –Type
Tuple[float, float, float]
Default
= (0, 0, 0)
Units
um
Description
Center of the waveguide geometry. This coordinate represents the base of the waveguides (substrate surface) in the normal axis, and center of the geometry in the remaining axes.
length (Attribute:
length
) –Type
NonNegativeFloat
Default
= 1e+30
Units
um
Description
Length of the waveguides in the propagation direction
propagation_axis (Attribute:
propagation_axis
) –Type
Literal[0, 1, 2]
Default
= 0
Description
Axis of propagation of the waveguide
normal_axis (Attribute:
normal_axis
) –Type
Literal[0, 1, 2]
Default
= 2
Description
Axis normal to the substrate surface
mode_spec (Attribute:
mode_spec
) –Type
ModeSpec
Default
= ModeSpec(num_modes2, target_neffNone, num_pml(0,, 0), filter_polNone, angle_theta0.0, angle_phi0.0, precision’single’, bend_radiusNone, bend_axisNone, track_freq’central’, group_index_stepFalse, type’ModeSpec’)
Description
ModeSpec
defining waveguide mode properties.grid_resolution (Attribute:
grid_resolution
) –Type
int
Default
= 15
Description
Solver grid resolution per wavelength.
max_grid_scaling (Attribute:
max_grid_scaling
) –Type
float
Default
= 1.2
Description
Maximal size increase between adjacent grid boundaries.
Supports: - Strip and rib geometries - Angled sidewalls - Modes in waveguide bends - Surface and sidewall loss models - Coupled waveguides
Attributes
Waveguide grid specification with overriding geometry.
Domain height (size in the normal direction).
Lateral direction axis.
Calculate the effective mode area.
Create a mode solver based on this waveguide structure
Calculate the complex effective index.
Calculate the effective index.
Calculate the group index.
Waveguide structures for simulation, including the core(s), slabs (if any), and bottom cladding, if different from the top.
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
withSimulation
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. IfTrue
, 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
withSimulation
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
, orz
).
- Returns:
The supplied or created matplotlib axes.
- Return type:
matplotlib.axes._subplots.Axes
- __hash__()#
Hash method.