fso_switch module

class fso_switch.FSOSwitch(switch_id, ctrl_port, dampening_parameter, ideal=False, herald_ports=['qout0', 'qout1'], visibility=1)[source]

Bases: Node

A Free-Space Optical (FSO) switch component for routing quantum signals.

This routes photonic qubits through lossy fibre channels and connects to a Bell-state measurement (BSM) detector. It applies fibre models for noise and loss.

The connections to and from the switch should be registered using register() to allow for proper switching on a component name basis.

It uses the “fso_logger” logger object, get it with: logging.getLogger("fso_logger")

Parameters:
  • switch_id (int) – Integer ID of the switch, it’s used to create the netsquid.nodes.Node superclass name.

  • ctrl_port (netsquid.components.component.Port) – The port object of the control node, all output commands are sent to it.

  • dampening_parameter (float) – Amplitude dampening parameter for photons passing through the switch. Should be between 0 and 1.

  • ideal (bool) – Specify whether the switch is ideal, i.e. no photon losses and path differences in fibre channels.

  • herald_ports (list[str]) – The entanglement heralding port names which will be connected to the BSM device.

  • visibility (float) – The HOM visibility parameter of the BSM detector attached to the herald ports. Should be between 0 and 1.

Examples

>>> ctrl_node = ControlNode(id=0, network_type="tree")
>>> ctrl_port = ctrl_node.ports["switch_herald"]
>>> fsoswitch_node = FSOSwitch(
...     switch_id=1,
...     ctrl_port=ctrl_port,
...     dampening_parameter=0.15,
...     ideal=False,
...     herald_ports=["qout0", "qout1"],
...     visibility=0.85,
... )
default_switch()[source]

Reset the switch to the initial switching configuration (no deflections) default: {“qin0”: “qout0”, “qin1”: “qout1”, “qin2”: “qout2”}

herald_switch(node_one, node_two)[source]

Change to a routing configuration which routes the input ports connected to the two nodes to the BSM detector node (heralding device).

Parameters:
  • node_one (str) – The first node which must be routed to the heralding device.

  • node_two (str) – The second node which must be routed to the heralding device.

register(node_name, inbound_port)[source]

Register a node that is connected to the switch’s port for later querying.

Parameters:
  • node_name (str) – The name of the node object.

  • inbound_port (str) – The port name to which the node is connected to.

relay_switch(node_in, node_out)[source]

Change the switching configuration to connect node_in to node_out, assuming they have been registered with the node. Remaining paths are connected in no particular order.

Parameters:
  • node_in (str) – The name of the node from which the photon is inbound.

  • node_out (str) – The name of the photon’s destination node, connected to an output port.