Skip to content

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: +SKIP

See Also

Fiber ports guide

MethodDescription
copyCreate a copy of this port.
is_connected_toCheck if this port is connected to another one.
matchesCheck if this port matches another one.
reflectedCreate a reflected version of this port.
to_tidy3d_mode_solverCreate a Tidy3D ModeSolver from this port.
to_tidy3d_monitorCreate a Tidy3D ModeMonitor from this port.
to_tidy3d_sourceCreate a Tidy3D ModeSource from this port.
to_tidy3d_structuresCreate 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(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

Returns

bool: Boolean indicating if the ports are connected.

matches(self, port)

Check if this port matches another one.

Args

Returns

bool: Boolean indicating if the ports match.

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(
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_rotation in the ModeSpec used by the mode solver.

Returns

ModeSolver: Tidy3D mode solver.

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_rotation in the ModeSpec used by the monitor.
  • technology (Technology | None): Technology specification used for the default target_neff.

Returns

tidy3d.ModeMonitor: Tidy3D mode monitor.

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_rotation in the ModeSpec used by the source.
  • technology (Technology | None): Technology specification used for the default target_neff.

Returns

tidy3d.ModeSource: Tidy3D mode source.

to_tidy3d_structures(self)

Create Tidy3D structures by extruding this port.

Returns

list[tidy3d.Structure]: Tidy3D structures from the cross-section.

AttributeDescription
added_solver_modesint: Additinal modes to include in mode solver runs for this port.
centerndarray: Fiber port center.
classificationLiteral[“optical”, “electrical”]: Port classification: optical or electrical (read only).
cross_sectionlist[tuple[Rectangle | Circle | Polygon | Path, MediumType]]: Fiber port cross-section structures and media.
extrusion_limitsndarray: Fiber port extrusion limits.
input_vectorndarray: Fiber port input direction.
num_modesint: Number of modes supported by this port.
polarizationLiteral["", “TE”, “TM”]: Mode polarization selection.
propertiesProperties: Object properties.
sizendarray: Fiber port cross-section size.
target_nefffloat | None: Target effective index for port modes (None for the default).

int: Additinal modes to include in mode solver runs for this port.

ndarray: Fiber port center.

Literal[“optical”, “electrical”]: Port classification: optical or electrical (read only).

list[tuple[Rectangle | Circle | Polygon | Path, MediumType]]: Fiber port cross-section structures and media.

ndarray: Fiber port extrusion limits.

ndarray: Fiber port input direction.

int: Number of modes supported by this port.

Literal["", “TE”, “TM”]: Mode polarization selection.

Properties: Object properties.

ndarray: Fiber port cross-section size.

float | None: Target effective index for port modes (None for the default).