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

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

  • waist_radius – Waist radius of the beam.

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

  • polarization_angle – 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 – 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, frequencies[, 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

as_bytes

Byte representation of the port (read only).

center

Gaussian port center.

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.

waist_position

Gaussian beam waist position.

waist_radius

Gaussian beam waist radius.

as_bytes

Byte representation of the port (read only).

center

Gaussian port center.

copy(deep=False)

Create a copy of this port.

Parameters:

deep – If set, creates a deep copy.

Returns:

New copy.

field_tolerance

Gaussian beam field tolerance.

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

Calculate the fields from this Gaussian beam.

Parameters:
  • x – Coordinate (or sequence) in the x axis for field computation.

  • y – Coordinate (or sequence) in the y axis for field computation.

  • z – Coordinate (or sequence) in the z axis for field computation.

  • frequency – Frequency (or sequence) at which to compute the fields.

  • medium – Tidy3D medium or relative permittivity of the port background medium as a single value or a sequence with one value for each frequency.

Returns:

Tuple with complex field amplitudes, electric and magnetic normalization coefficients, and electric and magnetic polarization vectors.

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.

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

polarization_angle

Gaussian beam polarization angle.

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.

to_tidy3d_monitor(frequencies, name, medium=1.0)

Create a Tidy3D FieldMonitor from this port.

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

  • name – Name for the created monitor.

  • medium – 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.

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

Create a Tidy3D GaussianBeam from this port.

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

  • name – Optional name for the created source.

  • medium – 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 GaussianBeam.

waist_position

Gaussian beam waist position.

waist_radius

Gaussian beam waist radius.