finesse.components.space module

Space-type objects representing physical distances between components.

class finesse.components.space.Space(*args, **kwargs)[source]

Bases: Connector

Represents a space between two components in the interferometer configuration, with a given length and index of refraction.

There can be many spaces in a model which are not of much interest and do not need to be referred to. For example, the link command will create spaces between components without giving an explicit name, just specifying a distance between them.

All Space elements are added to the Model’s .spaces namespace so they can all easily be iterated over. You can also find spaces which had no name specified and thus have an autogenerated name. User specified Space’s with names will be put in the main Model namespace so that they can be accessed like any other element in the model.

Parameters

namestr, optional

Name of newly created space. If not specified, a name is automatically generated.

portA, portBPort

Ports to connect.

Lfloat, optional

Geometric length of newly created Space instance; defaults to 0.

nrfloat, optional

Index of refraction of newly created Space instance; defaults to 1.0.

user_gouy_x, user_gouy_yfloat, optional

User-defined gouy phase to override the calculated value.

ABCD(from_node, to_node, direction='x', symbolic=False, copy=True, retboth=False, allow_reverse=False)[source]

Returns the ABCD matrix of the space for the specified coupling.

../_images/abcd_spacet.svg

This is given by,

\[M = \begin{pmatrix} 1 & \frac{L}{n_r} \\ 0 & 1 \end{pmatrix}, \]

where \(L\) is the length of the space and \(n_r\) is the index of refraction.

See Connector.ABCD() for descriptions of parameters, return values and possible exceptions.

property L

L : float, optional Geometric length of newly created Space instance; defaults to 0.

property abcd[source]

Numeric ABCD matrix.

Equivalent to any of space.ABCD(1, 2, "x"), space.ABCD(2, 1, "x"), space.ABCD(1, 2, "y"), space.ABCD(2, 1, "y").

Getter:

Returns a copy of the (numeric) ABCD matrix (read-only).

connect(portA, portB)[source]

Sets the ports of this Space.

Parameters

portAPort, optional

Port to connect

portBPort, optional

Port to connect

gouy(q1, q2)[source]

Computes the Gouy phase in degrees from beam parameters.

Parameters

q1complex, BeamParam

Starting beam parameter

q2complex, BeamParam

Ending beam parameter

Returns

outfloat

Gouy phase (in degrees)

property gouy_x[source]
property gouy_y[source]
property nr

nr : float, optional Index of refraction of newly created Space instance; defaults to 1.0.

property portA[source]
property portB[source]
replace(*args, **kwargs) str[source]

Unparse the model of this Connector and replace the Connector with a new section of katscript. Returns the katscript for the model with component replaced.

Parameters

substr

New section of katscript that will replace the katscript line defining the component to replace.

componentstr | None, optional

Replacement string for any references of the component name, by default None

optical_portsNone | list[str], optional

Replacement ports for any references of the component optical ports, by default None

mechanical_portsNone | list[str], optional

Replacement ports for any references of the component mechanical ports, by default None

electrical_portsNone | list[str], optional

Replacement ports for any references of the component electrical ports, by default None

verbosebool, optional
Whether to print a diff between the current and new KatScript,

by default False

Returns

str

KatScript with the component replaced.

Raises

FinesseException

When the component to replace is not of type Connector.

property user_gouy_x

Gouy phase (x)

property user_gouy_y

Gouy phase (y)