finesse.components.space module
Space-type objects representing physical distances between components.
- class finesse.components.space.Space(*args, **kwargs)[source]
Bases:
ConnectorRepresents 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
linkcommand 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
.spacesnamespace 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, portB
Port Ports to connect.
- Lfloat, optional
Geometric length of newly created
Spaceinstance; defaults to 0.- nrfloat, optional
Index of refraction of newly created
Spaceinstance; 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.
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 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).
- gouy(q1, q2)[source]
Computes the Gouy phase in degrees from beam parameters.
Parameters
Returns
- outfloat
Gouy phase (in degrees)
- property nr
nr : float, optional Index of refraction of newly created
Spaceinstance; defaults to 1.0.
- 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)