DAGCircuit.from_networkx

classmethod DAGCircuit.from_networkx(graph)[source]

Take a networkx MultiDigraph and create a new DAGCircuit.

Parameters

graph (networkx.MultiDiGraph) – The graph to create a DAGCircuit object from. The format of this MultiDiGraph format must be in the same format as returned by to_networkx.

Returns

The dagcircuit object created from the networkx

MultiDiGraph.

Return type

DAGCircuit