finesse.model.Model.link¶
- Model.link(*args, verbose=False)[source]¶
Connect multiple components together in one quick command. In many models a collection of components just need to be connected together without having to specify each port exactly. This command accepts multiple components as arguments, each is connected to the next. Interally the link command is creating spaces and wires between components but giving them automatically generated names. Therefore, the link command is useful when you are not interested in what the spaces or wires are called, which is often the case in readout paths or signal feedback loops.
This command will try to connect components in the “obvious” way. For example, a collection of two-port optical components will be connected one after another, the second port of the first item connected to the first port of the second component, etc.
Explicit ports can also be provided if exact connections are required. For example, at a beamsplitter, if you want to link through on transmission then use …, BS.p1, BS.p3, …. Using just BS here would result in using the first and second ports, a reflection.
Links can contain a mix of optical and signal nodes. When going from optical to signal nodes they must be specified verbosely. For example, a DC readout component PD, you would need to specify …, PD, PD.DC, ….
- Parameters:
- *args[Components | float | Port]
Separate arguments of either components or ports. A float value will create a space or wire with the provided length or time delay.
- verbosebool, optional
Print out what the link command is doing
Examples
Here we make a linear optical cavity
>>> model = finesse.Model() >>> model.parse(''' ... l l1 ... m ITM T=0.014 R=1-ITM.T ... m ETM T=50u R=1-ETM.T ... bs BS R=0.5 T=0.5 ... # A local readout on tranmission of the cavity ... l lo ... readout_dc TRANS ... fsig(1) ... link(l1, ITM, 4000, ETM, BS.p1, BS.p2, TRANS, verbose=True) ... link(lo, BS.p4) ... ''')
Flagging the verbose argument will result in the linking process being printed for further clarification of what it is doing. Multiple links can be done to specify separate paths as is done above for the connection between lo and BS.
The auto-generated spaces can be seen with:
>>> print(list(model.spaces.items())) [('l1_p1__ITM_p1', <'l1_p1__ITM_p1' @ 0x7f98da6ab760 (Space)>), ('ITM_p2__ETM_p1', <'ITM_p2__ETM_p1' @ 0x7f98da6b8ac0 (Space)>), ('ETM_p2__BS_p1', <'ETM_p2__BS_p1' @ 0x7f98da6b8a90 (Space)>), ('BS_p2__TRANS_p1', <'BS_p2__TRANS_p1' @ 0x7f98db1f37c0 (Space)>), ('lo_p1__BS_p4', <'lo_p1__BS_p4' @ 0x7f98da6ab4c0 (Space)>)]
Links can also be used to do quick feedback loops and connections. For example, the small signal DC output of the readout above could be connected to the laser amplitude modulation using:
>>> link(l1, ITM, 4000, ETM, BS, TRANS, TRANS.DC, l1.amp)
Similarly, the auto-generated wires can be seen with:
>>> print(list(model.wires.items())) [('TRANS_DC__l1_amp', <'TRANS_DC__l1_amp' @ 0x7f98da6d8ac0 (Wire)>)]