tidy3d.plugins.waveguide.RectangularDielectric#
- class RectangularDielectric[source]#
Bases:
Tidy3dBaseModel
General rectangular dielectric waveguide
- Parameters:
attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are serializable by callingobj.json()
.wavelength (Union[float, ArrayLike[dtype=float, ndim=1]]) – [units = um]. Wavelength(s) at which to calculate modes (in μm).
core_width (Union[NonNegativeFloat, ArrayLike[dtype=float, ndim=1]]) – [units = um]. Core width at the top of the waveguide. If set to an array, defines the widths of adjacent waveguides.
core_thickness (NonNegativeFloat) – [units = um]. Thickness of the core layer.
core_medium (Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D]) – Medium associated with the core layer.
clad_medium (Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D]) – Medium associated with the upper cladding layer.
box_medium (Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D] = None) – Medium associated with the lower cladding layer.
slab_thickness (NonNegativeFloat = 0.0) – [units = um]. Thickness of the slab for rib geometry.
clad_thickness (Optional[NonNegativeFloat] = None) – [units = um]. Domain size above the core layer.
box_thickness (Optional[NonNegativeFloat] = None) – [units = um]. Domain size below the core layer.
side_margin (Optional[NonNegativeFloat] = None) – [units = um]. Domain size to the sides of the waveguide core.
sidewall_angle (float = 0.0) – [units = rad]. 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 (Union[float, ArrayLike[dtype=float, ndim=1]] = 0.0) – [units = um]. 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 (NonNegativeFloat = 0.0) – [units = um]. Sidewall layer thickness (within core).
sidewall_medium (Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D] = None) – Medium associated with the sidewall layer to model sidewall losses.
surface_thickness (NonNegativeFloat = 0.0) – [units = um]. Thickness of the surface layers defined on the top of the waveguide and slab regions (if any).
surface_medium (Union[Medium, AnisotropicMedium, PECMedium, PoleResidue, Sellmeier, Lorentz, Debye, Drude, FullyAnisotropicMedium, CustomMedium, CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomAnisotropicMedium, PerturbationMedium, PerturbationPoleResidue, Medium2D, AnisotropicMediumFromMedium2D] = None) – Medium associated with the surface layer to model surface losses.
origin (Tuple[float, float, float] = (0, 0, 0)) – [units = um]. 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 (NonNegativeFloat = 1e+30) – [units = um]. Length of the waveguides in the propagation direction
propagation_axis (Literal[0, 1, 2] = 0) – Axis of propagation of the waveguide
normal_axis (Literal[0, 1, 2] = 2) – Axis normal to the substrate surface
mode_spec (ModeSpec = ModeSpec(attrs={}, num_modes=2, 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', group_index_step=False, type='ModeSpec')) –
ModeSpec
defining waveguide mode properties.grid_resolution (int = 15) – Solver grid resolution per wavelength.
max_grid_scaling (float = 1.2) – Maximal size increase between adjacent grid boundaries.
Supports
geometries (- Strip and rib)
sidewalls (- Angled)
bends (- Modes in waveguide)
models (- Surface and sidewall loss)
waveguides (- Coupled)
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.
Inherited Common Usage
- 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
>>> import tidy3d.plugins.waveguide as waveguide >>> 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.