GaussianPort
GaussianPort( center, input_vector, waist_radius, waist_position=0, polarization_angle=0, field_tolerance=0.001, *, waist_distance=None,)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.
Args
- 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.
- waist_distance (float | None): Distance from the beam waist to the input plane. Positive (negative) values indicate that the distance is measured towards the positive (negative) global axis, i.e., if the beam waist is at the origin, the input plane is on the positive (negative) side of the axis.
Note
Arguments waist_position and waist_distance represent the
same specification with different conventions. Only one must be
specified. For convenience, waist_distance matches Tidy3D’s
GaussianBeam.waist_distance definition.
Argument polarization_angle has the same meaning as Tidy3D’s
GaussianBeam.pol_angle, except that it is defined in degrees,
not in radians.
See Also
Methods
Section titled “Methods”| Method | Description |
|---|---|
copy | Create a copy of this port. |
fields | Calculate the fields from this Gaussian beam. |
is_connected_to | Check if this port is connected to another one. |
matches | Check if this port matches another one. |
reflected | Create a reflected version of this port. |
to_tidy3d_monitor | Create a Tidy3D GaussianOverlapMonitor from this port. |
to_tidy3d_source | Create a Tidy3D GaussianBeam from this port. |
copy(self, deep=False)Create a copy of this port.
Args
- deep (bool): If set, creates a deep copy.
Returns
GaussianPort: New copy.
fields
Section titled “fields”fields(self, x, y, z, frequency, medium=1.0)Calculate the fields from this Gaussian beam.
Args
- 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
tuple[ndarray, ndarray, ndarray, ndarray, ndarray]: Complex field amplitudes, electric and magnetic normalization coefficients, and electric and magnetic polarization vectors.
Note
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.
is_connected_to
Section titled “is_connected_to”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
- port (Port | FiberPort | GaussianPort): Port against which to check.
Returns
bool: Boolean indicating if the ports are connected.
matches
Section titled “matches”matches(self, port)Check if this port matches another one.
Args
- port (Port | FiberPort | GaussianPort): Port against which to check.
Returns
bool: Boolean indicating if the ports match.
reflected
Section titled “reflected”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
GaussianPort: Reflected Gaussian port.
to_tidy3d_monitor
Section titled “to_tidy3d_monitor”to_tidy3d_monitor(self, frequencies, name, medium=1.0)Create a Tidy3D GaussianOverlapMonitor from this port.
Args
- 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: Tidy3D FieldMonitor.
to_tidy3d_source
Section titled “to_tidy3d_source”to_tidy3d_source(self, frequencies, name=None, medium=1.0)Create a Tidy3D GaussianBeam from this port.
Args
- 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.GaussianBeam: Tidy3D Gaussian beam.
Attributes
Section titled “Attributes”| Attribute | Description |
|---|---|
added_solver_modes | int: Additinal modes to include in mode solver runs for this port (read only). |
center | ndarray: Gaussian port center. |
classification | Literal[“optical”, “electrical”]: Port classification: optical or electrical (read only). |
field_tolerance | float: Gaussian beam field tolerance. |
input_vector | ndarray: Gaussian port input direction. |
num_modes | int: Number of modes supported by this port (read only). |
polarization_angle | float: Gaussian beam polarization angle. |
properties | Properties: Object properties. |
waist_distance | float: Gaussian beam waist distance. |
waist_position | float: Gaussian beam waist position. |
waist_radius | float: Gaussian beam waist radius. |
added_solver_modes
Section titled “added_solver_modes”int: Additinal modes to include in mode solver runs for this port (read only).
center
Section titled “center”ndarray: Gaussian port center.
classification
Section titled “classification”Literal[“optical”, “electrical”]: Port classification: optical or electrical (read only).
field_tolerance
Section titled “field_tolerance”float: Gaussian beam field tolerance.
input_vector
Section titled “input_vector”ndarray: Gaussian port input direction.
num_modes
Section titled “num_modes”int: Number of modes supported by this port (read only).
polarization_angle
Section titled “polarization_angle”float: Gaussian beam polarization angle.
properties
Section titled “properties”Properties: Object properties.
waist_distance
Section titled “waist_distance”float: Gaussian beam waist distance.
waist_position
Section titled “waist_position”float: Gaussian beam waist position.
waist_radius
Section titled “waist_radius”float: Gaussian beam waist radius.