FiberPort
FiberPort( center, input_vector, size, extrusion_limits, cross_section=(), num_modes=1, polarization=None, target_neff=None, added_solver_modes=0,)Fiber beam port.
This 3D port models an optical fiber or any type of waveguide extruded from a 2D cross-section.
Args
- center (Sequence[float]): Port position in 3D.
- input_vector (Sequence[float]): 3D input vector (beam propagation direction).
- size (Sequence[float] | complex): 2D cross-section size for mode solver.
- extrusion_limits (Sequence[float]): Cross-section extrusion limits when generating the 3D structures the make the port waveguide, in the form
(lower, upper). The lower limit must be negative and defines how far behind the port plane (w.r.t. the input vector) the structures extend. The upper limit must be positive and defines how far along the input vector direction the structures are extruded. - cross_section (Sequence[tuple[Rectangle | Circle | Polygon | Path, MediumType]]): Sequence of 2D structure and a medium tuples defining the fiber cross-section.
- num_modes (int): Number of modes supported by this port.
- polarization (Literal["", “TE”, “TM”] | None): Mode polarization selection.
- target_neff (float | None): Target effective index for numerical mode solving. If
None, the square root of the largest real permittivity among the cross-section and background media at the mode solving frequencies is used. - added_solver_modes (int): Additional modes to solve for in mode solver runs (useful when filtering modes by polarization). These are not included in S paramters computed for ports if this type.
Note
The cross section is centered around (0, 0). Extruded structures are translated to the port center after extrusion.
Extrusion limits must be non-zero in both directions to guarantee that the cross-section intersects the inside of the extruded geometries.
Example
>>> # Slightly elliptical core to break mode degeneracy>>> core = pf.Circle((2.01, 2))>>> fiber_port = pf.FiberPort(... (-10, 50, 1),... (1, 0, 0),... (10, 10),... (-100, 0.1),... cross_section=[(core, td.Medium(permittivity=1.46**2))],... num_modes=2,... target_neff=2,... )>>> mode_solver = fiber_port.to_tidy3d_mode_solver(... [pf.C_0 / 1.55], technology=pf.basic_technology()... )>>> ms_data = mode_solver.solve() # doctest: +SKIP>>> ms_data.to_dataframe() # doctest: +SKIPSee Also
Methods
Section titled “Methods”| Method | Description |
|---|---|
copy | Create a copy of this port. |
is_connected_to | Check if this port is connected to another one. |
matches | Check if this port matches another one. |
reflected | Create a reflected version of this port. |
to_tidy3d_mode_solver | Create a Tidy3D ModeSolver from this port. |
to_tidy3d_monitor | Create a Tidy3D ModeMonitor from this port. |
to_tidy3d_source | Create a Tidy3D ModeSource from this port. |
to_tidy3d_structures | Create Tidy3D structures by extruding this port. |
copy(self, deep=False)Create a copy of this port.
Args
- deep (bool): If set, creates a deep copy.
Returns
FiberPort: New copy.
is_connected_to
Section titled “is_connected_to”is_connected_to(self, port)Check if this port is connected to another one.
Two ports are connected when they are placed in the same location, have opposite input directions and compatible modes.
Args
- port (Port | FiberPort | GaussianPort): Port against which to check.
Returns
bool: Boolean indicating if the ports are connected.
matches
Section titled “matches”matches(self, port)Check if this port matches another one.
Args
- port (Port | FiberPort | GaussianPort): Port against which to check.
Returns
bool: Boolean indicating if the ports match.
reflected
Section titled “reflected”reflected(self)Create a reflected version of this port.
The new port points the opposite direction of the original port and has the opposite beam mode.
Returns
FiberPort: Reflected Fiber port.
to_tidy3d_mode_solver
Section titled “to_tidy3d_mode_solver”to_tidy3d_mode_solver( self, frequencies, mesh_refinement=None, group_index=False, technology=None, use_angle_rotation=False,)Create a Tidy3D ModeSolver from this port.
Args
- frequencies (Sequence[float]): Frequencies for the mode solver.
- mesh_refinement (float | None): Minimal number of mesh elements per wavelength used for mode solving.
- group_index (bool): Boolean indicating whether the mode solver should include group index computation.
- technology (Technology | None): Technology specification for this port.
- use_angle_rotation (bool): Enable the use of
angle_rotationin theModeSpecused by the mode solver.
Returns
ModeSolver: Tidy3D mode solver.
to_tidy3d_monitor
Section titled “to_tidy3d_monitor”to_tidy3d_monitor( self, frequencies, name, use_angle_rotation=False, technology=None)Create a Tidy3D ModeMonitor from this port.
Args
- frequencies (Sequence[float]): Frequencies for the mode monitor.
- name (str): Name for the created monitor.
- use_angle_rotation (bool): Enable the use of
angle_rotationin theModeSpecused by the monitor. - technology (Technology | None): Technology specification used for the default
target_neff.
Returns
tidy3d.ModeMonitor: Tidy3D mode monitor.
to_tidy3d_source
Section titled “to_tidy3d_source”to_tidy3d_source( self, frequencies, mode_index=0, name=None, use_angle_rotation=False, technology=None,)Create a Tidy3D ModeSource from this port.
Args
- frequencies (Sequence[float]): Frequencies for the mode source.
- mode_index (int): Mode index to be used as source (must be less than the number of modes supported by this port).
- name (str | None): Optional name for the created source.
- use_angle_rotation (bool): Enable the use of
angle_rotationin theModeSpecused by the source. - technology (Technology | None): Technology specification used for the default
target_neff.
Returns
tidy3d.ModeSource: Tidy3D mode source.
to_tidy3d_structures
Section titled “to_tidy3d_structures”to_tidy3d_structures(self)Create Tidy3D structures by extruding this port.
Returns
list[tidy3d.Structure]: Tidy3D structures from the cross-section.
Attributes
Section titled “Attributes”| Attribute | Description |
|---|---|
added_solver_modes | int: Additinal modes to include in mode solver runs for this port. |
center | ndarray: Fiber port center. |
classification | Literal[“optical”, “electrical”]: Port classification: optical or electrical (read only). |
cross_section | list[tuple[Rectangle | Circle | Polygon | Path, MediumType]]: Fiber port cross-section structures and media. |
extrusion_limits | ndarray: Fiber port extrusion limits. |
input_vector | ndarray: Fiber port input direction. |
num_modes | int: Number of modes supported by this port. |
polarization | Literal["", “TE”, “TM”]: Mode polarization selection. |
properties | Properties: Object properties. |
size | ndarray: Fiber port cross-section size. |
target_neff | float | None: Target effective index for port modes (None for the default). |
added_solver_modes
Section titled “added_solver_modes”int: Additinal modes to include in mode solver runs for this port.
center
Section titled “center”ndarray: Fiber port center.
classification
Section titled “classification”Literal[“optical”, “electrical”]: Port classification: optical or electrical (read only).
cross_section
Section titled “cross_section”list[tuple[Rectangle | Circle | Polygon | Path, MediumType]]: Fiber port cross-section structures and media.
extrusion_limits
Section titled “extrusion_limits”ndarray: Fiber port extrusion limits.
input_vector
Section titled “input_vector”ndarray: Fiber port input direction.
num_modes
Section titled “num_modes”int: Number of modes supported by this port.
polarization
Section titled “polarization”Literal["", “TE”, “TM”]: Mode polarization selection.
properties
Section titled “properties”Properties: Object properties.
ndarray: Fiber port cross-section size.
target_neff
Section titled “target_neff”float | None: Target effective index for port modes (None for the default).