class mentpy.mbqc.flow.Flow

This class deals with the flow of a given graph state

graph : mp.GraphState

The graph state to find the flow of.

input_nodes : list

The input nodes of the graph state.

output_nodes : list

The output nodes of the graph state.

planes : dict

The measurement planes of the graph state. The keys are the nodes and the values are the planes. If None, the algorithm will assume that the measurement planes are all XY.


Flow(graph, input_nodes, output_nodes, planes=None)

Initializes the flow of a given graph state. Assumes that graph has nodes labeled with numbers from 0 to n-1, where n is the number of nodes in the graph.

String representation


Return repr(self).

Special methods


Call self as a function.


adapt_angle(angle, node, previous_outcomes)
adapt_angles(angles, outcomes)

Returns the correction operator for a given node.


Returns the generator operator for a given node.


Lazily initializes the flow properties when needed.