qiskit.dagcircuit.DAGCircuit.substitute_node_with_dag¶
- DAGCircuit.substitute_node_with_dag(node, input_dag, wires=None, propagate_condition=True)[source]¶
Replace one node with dag.
- Paramètres
node (DAGOpNode) – node to substitute
input_dag (DAGCircuit) – circuit that will substitute the node
wires (list[Bit] | Dict[Bit, Bit]) – gives an order for (qu)bits in the input circuit. If a list, then the bits refer to those in the
input_dag
, and the order gets matched to the node wires by qargs first, then cargs, then conditions. If a dictionary, then a mapping of bits in theinput_dag
to those that thenode
acts on.propagate_condition (bool) – If
True
(default), then anycondition
attribute on the operation withinnode
is propagated to each node in theinput_dag
. IfFalse
, then theinput_dag
is assumed to faithfully implement suitable conditional logic already.
- Renvoie
maps node IDs from input_dag to their new node incarnations in self.
- Type renvoyé
dict
- Lève
DAGCircuitError – if met with unexpected predecessor/successors