finesse.model.Model.connect

Model.connect(A, B, L=0, nr=1, gain=1, *, delay=None, name=None, verbose=False, 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.

As connect will try to be somewhat smart in guessing what the user is trying to connect, use verbose=True to print what is actually getting connected.

Parameters
AConnector or Port

Component to connect

BConnector or Port

Other component to connect

Lfloat, optional

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

nrfloat, optional

Index of refraction of newly created Space.

gainfloat, symbol, optional

Gain of a wire connection for simply scaling between two signals

delayfloat, optional

Delay time for electrical connections.

namestr, optional

Name of newly created Space or Wire instance.

verbosebool, optional

When True, the actual connections being made will be printed.

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).