GaussianPort

class photonforge.GaussianPort(center, input_vector, waist_radius, waist_position=0, polarization_angle=0, field_tolerance=0.001)

Gaussian beam port.

This 3D port models a Gaussian beam that can be used, for example, for grating and edge couplers. It must be placed in a homogeneous medium.

Parameters:
  • center (Sequence[float]) – Port position in 3D.

  • input_vector (Sequence[float]) – 3D input vector (beam propagation direction).

  • waist_radius (float) – Waist radius of the beam.

  • waist_position (float) – Waist position along the input direction. Positive (negative) values result in the waist being in front of (behind) the input plane.

  • polarization_angle (float) – Polarization angle (in degrees) for the electric field with respect to the plane formed by the input direction and the largest input direction component (in absolute value). If the input direction is aligned to one of the Cartesian axes, this plane is not well-defined and the angle is measured from the x axis for inputs in y or z, and measured from y for input in x.

  • field_tolerance (float) – Relative field magnitude used to define the size of this port. The port dimensions are defined such that the field magnitude at the boundaries are below this level with respect to the maximum.

Notes

Argument waist_position has the opposite meaning of Tidy3D’s GaussianBeam.waist_distance, that is, they will have opposite signs to denote the same beam.

Argument polarization_angle has the same meaning as Tidy3D’s GaussianBeam.pol_angle, except that it is defined in degrees.

See also

Grating Coupler

Methods

copy([deep])

Create a copy of this port.

fields(x, y, z, frequency[, medium])

Calculate the fields from this Gaussian beam.

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_monitor(frequencies, name[, medium])

Create a Tidy3D FieldMonitor from this port.

to_tidy3d_source(frequencies[, name, medium])

Create a Tidy3D GaussianBeam from this port.

Attributes

added_solver_modes

Additinal modes to include in mode solver runs for this port (read only).

as_bytes

Byte representation of the port (read only).

center

Gaussian port center.

classification

Port classification: optical or electrical (read only).

field_tolerance

Gaussian beam field tolerance.

input_vector

Gaussian port input direction.

num_modes

Number of modes supported by this port (read only).

polarization_angle

Gaussian beam polarization angle.

properties

Object properties.

waist_position

Gaussian beam waist position.

waist_radius

Gaussian beam waist radius.

added_solver_modes

Additinal modes to include in mode solver runs for this port (read only).

Type:

int

as_bytes

Byte representation of the port (read only).

Type:

bytes

center

Gaussian 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:

GaussianPort

field_tolerance

Gaussian beam field tolerance.

Type:

float

fields(x, y, z, frequency, medium=1.0)

Calculate the fields from this Gaussian beam.

Parameters:
  • x (float | Sequence[float]) – Coordinate in x for field computation.

  • y (float | Sequence[float]) – Coordinate in y for field computation.

  • z (float | Sequence[float]) – Coordinate in z for field computation.

  • frequency – (float | Sequence[float]) Frequency for computation.

  • medium (MediumType | Sequence[float] | float) – Tidy3D medium or relative permittivity of the port background medium as a single value or a sequence with one value for each frequency.

Returns:

Complex field amplitudes, electric and magnetic normalization coefficients, and electric and magnetic polarization vectors.

Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

Notes

The returned amplitude is a 2-dimensional numpy array with shape (F, N), in which F and N are the sizes of the frequency and the coordinates sequences, respectively.

The normalization coefficients are arrays with one element per frequency value (size F).

Arguments x, y, and z must all have the same size N or be a single value.

Each component of the electric (magnetic) field can be obtained by multiplying the complex amplitude by the electric (magnetic) normalization coefficient and the corresponding vector component.

input_vector

Gaussian 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 (read only).

Type:

int

polarization_angle

Gaussian beam polarization angle.

Type:

float

properties

Object properties.

Type:

Properties

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 Gaussian port.

Return type:

GaussianPort

to_tidy3d_monitor(frequencies, name, medium=1.0)

Create a Tidy3D FieldMonitor from this port.

Parameters:
  • frequencies (Sequence[float]) – Frequencies for the field monitor.

  • name (str) – Name for the created monitor.

  • medium (MediumType | Sequence[float] | float) – Tidy3D medium or relative permittivity of the port background medium as a single value or a sequence with one value for each frequency.

Returns:

Tidy3D FieldMonitor.

Return type:

tidy3d.FieldMonitor

to_tidy3d_source(frequencies, name=None, medium=1.0)

Create a Tidy3D GaussianBeam from this port.

Parameters:
  • frequencies (Sequence[float]) – Frequencies for the source.

  • name (str | None) – Optional name for the created source.

  • medium (MediumType | Sequence[float] | float) – Tidy3D medium or relative permittivity of the port background medium as a single value or a sequence with one value for each frequency.

Returns:

Tidy3D Gaussian beam.

Return type:

tidy3d.GaussianBeam

waist_position

Gaussian beam waist position.

Type:

float

waist_radius

Gaussian beam waist radius.

Type:

float