tape_to_graph(tape: pennylane.tape.tape.QuantumTape) → networkx.classes.multidigraph.MultiDiGraph¶
Converts a quantum tape to a directed multigraph.
This operation is designed for use as part of the circuit cutting workflow. Check out the
qml.cut_circuit()transform for more details.
tape (QuantumTape) – tape to be converted into a directed multigraph
a directed multigraph that captures the circuit structure of the input tape
- Return type
Consider the following tape:
with qml.tape.QuantumTape() as tape: qml.RX(0.4, wires=0) qml.RY(0.9, wires=0) qml.CNOT(wires=[0, 1]) qml.expval(qml.PauliZ(1))
Its corresponding circuit graph can be found using
>>> qml.transforms.qcut.tape_to_graph(tape) <networkx.classes.multidigraph.MultiDiGraph at 0x7fe41cbd7210>
- What is PennyLane?
- Quantum circuits
- Gradients and training
- Quantum operators
- Inspecting circuits
- Compiling circuits
- Quantum Chemistry