DAGCircuit.substitute_node_with_dag

DAGCircuit.substitute_node_with_dag(node, input_dag, wires=None)[source]

Replace one node with dag.

Parameters
  • node (DAGNode) – node to substitute

  • input_dag (DAGCircuit) – circuit that will substitute the node

  • wires (list[Bit]) – gives an order for (qu)bits in the input circuit. This order gets matched to the node wires by qargs first, then cargs, then conditions.

Raises

DAGCircuitError – if met with unexpected predecessor/successors