FiberPort¶
- class photonforge.FiberPort(center, input_vector, size, extrusion_limits, cross_section=(), num_modes=1, polarization=None, target_neff=1, 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. - Parameters:
- 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] | complex) – Cross-section extrusion limits when generating the 3D structures the make the port waveguide. 
- 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) – Target effective index for numerical mode solving. 
- 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. 
 
 - Notes - 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 = Circle((2.01, 2)) >>> fiber_port = 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( ... [C_0 / 1.55], technology=basic_technology() ... ) >>> ms_data = mode_solver.solve() >>> ms_data.to_dataframe() wavelength n eff k eff TE (Ey) fraction \ f mode_index 1.934145e+14 0 1.55 1.449396 0.0 0.992008 1 1.55 1.449395 0.0 0.007978 wg TE fraction wg TM fraction mode area f mode_index 1.934145e+14 0 0.996852 0.995951 24.310145 1 0.996839 0.995961 24.305397 - See also - Methods - copy([deep])- Create a copy of this port. - is_connected_to(port)- Check if this port is connected to another one. - matches(port)- Check if this port matches another one. - Create a reflected version of this port. - to_tidy3d_mode_solver(frequencies[, ...])- Create a Tidy3D - ModeSolverfrom this port.- to_tidy3d_monitor(frequencies, name[, ...])- Create a Tidy3D - ModeMonitorfrom this port.- to_tidy3d_source(frequencies[, mode_index, ...])- Create a Tidy3D - ModeSourcefrom this port.- Create Tidy3D structures by extruding this port. - Attributes - Additinal modes to include in mode solver runs for this port. - Byte representation of the port (read only). - Fiber port center. - Port classification: optical or electrical (read only). - Fiber port cross-section structures and media. - Fiber port extrusion limits. - Fiber port input direction. - Number of modes supported by this port. - Mode polarization selection. - Object properties. - Fiber port cross-section size. - Target effective index for port modes. - added_solver_modes¶
- Additinal modes to include in mode solver runs for this port. - Type:
- int 
 
 - as_bytes¶
- Byte representation of the port (read only). - Type:
- bytes 
 
 - center¶
- Fiber port center. - Type:
- ndarray 
 
 - classification¶
- Port classification: optical or electrical (read only). - Type:
- Literal[“optical”, “electrical”] 
 
 - copy(deep=False)¶
- Create a copy of this port. - Parameters:
- deep (bool) – If set, creates a deep copy. 
- Returns:
- New copy. 
- Return type:
 
 - cross_section¶
- Fiber port cross-section structures and media. 
 - extrusion_limits¶
- Fiber port extrusion limits. - Type:
- ndarray 
 
 - input_vector¶
- Fiber port input direction. - Type:
- ndarray 
 
 - is_connected_to(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. - Parameters:
- port (Port | FiberPort | GaussianPort) – Port against which to check. 
- Returns:
- Boolean indicating if the ports are connected. 
- Return type:
- bool 
 
 - matches(port)¶
- Check if this port matches another one. - Parameters:
- port (Port | FiberPort | GaussianPort) – Port against which to check. 
- Returns:
- Boolean indicating if the ports match. 
- Return type:
- bool 
 
 - num_modes¶
- Number of modes supported by this port. - Type:
- int 
 
 - polarization¶
- Mode polarization selection. - Type:
- Literal[“”, “TE”, “TM”] 
 
 - properties¶
- Object properties. - Type:
 
 - reflected()¶
- 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:
- Reflected Fiber port. 
- Return type:
 
 - size¶
- Fiber port cross-section size. - Type:
- ndarray 
 
 - target_neff¶
- Target effective index for port modes. - Type:
- float 
 
 - to_tidy3d_mode_solver(frequencies, mesh_refinement=None, group_index=False, technology=None, use_angle_rotation=False)¶
- Create a Tidy3D - ModeSolverfrom this port.- Parameters:
- 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 the- ModeSpecused by the mode solver.
 
- Returns:
- Tidy3D mode solver. 
- Return type:
- ModeSolver 
 
 - to_tidy3d_monitor(frequencies, name, use_angle_rotation=False)¶
- Create a Tidy3D - ModeMonitorfrom this port.- Parameters:
- 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 the- ModeSpecused by the monitor.
 
- Returns:
- Tidy3D mode monitor. 
- Return type:
- tidy3d.ModeMonitor 
 
 - to_tidy3d_source(frequencies, mode_index=0, name=None, use_angle_rotation=False)¶
- Create a Tidy3D - ModeSourcefrom this port.- Parameters:
- 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 the- ModeSpecused by the source.
 
- Returns:
- Tidy3D mode source. 
- Return type:
- tidy3d.ModeSource 
 
 - to_tidy3d_structures()¶
- Create Tidy3D structures by extruding this port. - Returns:
- Tidy3D structures from the cross-section. 
- Return type:
- list[tidy3d.Structure]