graph.py
: Graphing tools¶
Various objects for visually representing quantum networks
- class simba.graph.ConnectionType(value)[source]¶
Represents a connection between two main modes in the setup.
It can either be beamsplitter-like (i.e. ) or non-energy conserving squeezing-style interaction (i.e. ).
- class simba.graph.Connection(index: int, connection_type: simba.graph.ConnectionType)[source]¶
Represents a single connection to the node at given index (starting at zero).
- class simba.graph.Node(internal=Internal.TUNED)[source]¶
Represents a single generalised open oscillator.
self.connections
is a list ofConnection
to other generalised open oscillators, not including the series connectionself.self_connections
is a set ofConnectionType
for connecting this node to itself, for realising the K matrix- get_connections_to(index: int) set [source]¶
Filter for set of
ConnectionType
to theNode
with given index.
- property is_series_connected: bool¶
If the auxiliary mode is not coupled to the main mode, then the main mode is not connected to the series connections, so we can ignore it in the series connections.
- class simba.graph.Nodes(nodes: Optional[List[simba.graph.Node]] = None)[source]¶
List of Nodes connected in series, indexes starting at zero.
- simba.graph.nodes_from_dofs(gs, h_d) simba.graph.Nodes [source]¶
Construct the Node graph for an n degree-of-freedom generalised open oscillator :param gs: list of n 1-dof generalised open oscillators :param h_d: the direct interaction Hamiltonian matrix :return: a
Nodes
instance
- simba.graph.nodes_from_network(network: simba.core.SplitNetwork) simba.graph.Nodes [source]¶
Call
nodes_from_dofs
with contents of network.
- simba.graph.transfer_function_to_graph(tf, filename, *, layout='neato')[source]¶
Directly convert SISO transfer function to graph.
- Examples:
>>>from sympy import symbols >>>s = symbols(‘s’) >>>gamma = symbols(‘gamma’, real=True, positive=True) >>>tf = (s - gamma) / (s + gamma) >>>transfer_function_to_graph(tf, ‘unstable-filter.pdf’)