![]() |
A representation of a Circuit as a directed acyclic graph.
Nodes of the graph are instances of Unique containing each operation of a circuit.
Edges of the graph are tuples of nodes. Each edge specifies a required application order between two operations. The first must be applied before the second.
The graph is maximalist (transitive completion).
Methods
all_operations
all_operations() -> Iterator[cirq.ops.Operation
]
all_qubits
all_qubits()
append
append(
op: "cirq.Operation"
) -> None
disjoint_qubits
disjoint_qubits(
op1: "cirq.Operation",
op2: "cirq.Operation"
) -> bool
Returns true only if the operations have qubits in common.
findall_nodes_until_blocked
findall_nodes_until_blocked(
is_blocker: Callable[[cirq.ops.Operation
], bool]
) -> Iterator[Unique[ops.Operation]]
Finds all nodes before blocking ones.
Args | |
---|---|
is_blocker
|
The predicate that indicates whether or not an operation is blocking. |
from_circuit
@staticmethod
from_circuit( circuit:
cirq.circuits.Circuit
, can_reorder: Callable[['cirq.Operation', 'cirq.Operation'], bool] = cirq.circuits.CircuitDag.disjoint_qubits ) -> "CircuitDag"
from_ops
@staticmethod
from_ops( *operations, can_reorder: Callable[['cirq.Operation', 'cirq.Operation'], bool] = cirq.circuits.CircuitDag.disjoint_qubits, device:
cirq.devices.Device
= cirq.devices.UNCONSTRAINED_DEVICE ) -> "CircuitDag"
make_node
@staticmethod
make_node( op: "cirq.Operation" ) ->
cirq.circuits.Unique
ordered_nodes
ordered_nodes() -> Iterator[Unique[ops.Operation]]
to_circuit
to_circuit() -> cirq.circuits.Circuit
__eq__
__eq__(
other
)
Return self==value.
__ne__
__ne__(
other
)
Return self!=value.