DAGCircuit.nodes_on_wire

DAGCircuit.nodes_on_wire(wire, only_ops=False)[source]

Iterator for nodes that affect a given wire.

Parameters
  • wire (Bit) – the wire to be looked at.

  • only_ops (bool) – True if only the ops nodes are wanted; otherwise, all nodes are returned.

Yields

DAGNode – the successive ops on the given wire

Raises

DAGCircuitError – if the given wire doesn’t exist in the DAG