finesse.model.Model.connect

Model.connect(A, B, L=0, nr=1, *, delay=None, name=None, connector=None)[source]

Connects two ports in a model together. The ports should be of the same type, e.g. both optical ports.

This method will also accept components from the user, in such cases it will loop through the ports and use the first one in .ports that is currently unconnected.

Parameters

A : Connector or Port

Index of compA port to connect from.

B : Connector or Port

Second component to connect (target).

name : str, optional

Name of newly created Space or Wire instance.

L : float, optional

Length of newly created Space or Wire instance. If connecting electronics, L will be treated as a delay in seconds

nr : float, optional

Index of refraction of newly created Space.

connector : Space or Wire, optional

Existing component to use for connection. If this is None, a connecting Space or Wire will be created.

delay : float, optional

Delay time for Wires,

Raises

Exception

If matrix has already been built, either of compA or compB are not present in the model, either of portA or portB are already connected or either of portA or portB are not valid options at the specified component(s).