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 – Port position in 3D.

  • input_vector – 3D input vector (beam propagation direction).

  • size – 2D cross-section size for mode solver.

  • extrusion_limits – Cross-section extrusion limits when generating the 3D structures the make the port waveguide.

  • cross_section – Sequence of 2-tuples with a 2D structure and a medium defining the fiber cross-section.

  • num_modes – Number of modes supported by this port.

  • polarization – Mode polarization selection.

  • target_neff – Target effective index for numerical mode solving.

  • added_solver_modes – 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

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.

reflected()

Create a reflected version of this port.

to_tidy3d_mode_solver(frequencies[, ...])

Create a Tidy3D ModeSolver from this port.

to_tidy3d_monitor(frequencies, name)

Create a Tidy3D ModeMonitor from this port.

to_tidy3d_source(frequencies[, mode_index, name])

Create a Tidy3D ModeSource from this port.

to_tidy3d_structures()

Create Tidy3D structures by extruding this port.

Attributes

added_solver_modes

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

as_bytes

Byte representation of the port (read only).

center

Fiber port center.

classification

optical or electrical (read only).

cross_section

Fiber port cross-section structures and media.

extrusion_limits

Fiber port extrusion limits.

input_vector

Fiber port input direction.

num_modes

Number of modes supported by this port.

polarization

Mode polarization selection.

size

Fiber port cross-section size.

target_neff

Target effective index for port modes.

added_solver_modes

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

as_bytes

Byte representation of the port (read only).

center

Fiber port center.

classification

optical or electrical (read only).

Type:

Port classification

copy(deep=False)

Create a copy of this port.

Parameters:

deep – If set, creates a deep copy.

Returns:

New copy.

cross_section

Fiber port cross-section structures and media.

extrusion_limits

Fiber port extrusion limits.

input_vector

Fiber port input direction.

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 against which to check.

Returns:

Boolean indicating if the ports are connected.

matches(port)

Check if this port matches another one.

Parameters:

port – Port against which to check.

Returns:

Boolean indicating if the ports match.

num_modes

Number of modes supported by this port.

polarization

Mode polarization selection.

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.

size

Fiber port cross-section size.

target_neff

Target effective index for port modes.

to_tidy3d_mode_solver(frequencies, mesh_refinement=None, group_index=False, technology=None)

Create a Tidy3D ModeSolver from this port.

Parameters:
  • frequencies – Sequence of frequency values for the mode solver.

  • mesh_refinement – Minimal number of mesh elements per wavelength used for mode solving.

  • group_index – Boolean indicating whether the mode solver should include group index computation.

  • technology – Technology specification for this port.

Returns:

Tidy3D mode solver.

to_tidy3d_monitor(frequencies, name)

Create a Tidy3D ModeMonitor from this port.

Parameters:
  • frequencies – Sequence of frequency values for the mode monitor.

  • name – Name for the created monitor.

Returns:

Tidy3D ModeMonitor.

to_tidy3d_source(frequencies, mode_index=0, name=None)

Create a Tidy3D ModeSource from this port.

Parameters:
  • frequencies – Sequence of frequency values for the mode source.

  • mode_index – Mode index to be used as source (must be less than the number of modes supported by this port).

  • name – Optional name for the created source.

Returns:

Tidy3D ModeSource.

to_tidy3d_structures()

Create Tidy3D structures by extruding this port.

Returns:

List of Tidy3D structures.