qiskit/releasenotes/notes/0.25/dag-substitute-node-propaga...

16 lines
768 B
YAML

---
features:
- |
:meth:`.DAGCircuit.substitute_node` gained a ``propagate_condition`` keyword argument that is
analogous to the same argument in :meth:`~.DAGCircuit.substitute_node_with_dag`. Setting this
to ``False`` opts out of the legacy behavior of copying a condition on the ``node`` onto the
new ``op`` that is replacing it.
This option is ignored for general control-flow operations, which will never propagate their
condition, nor accept a condition from another node.
fixes:
- |
:meth:`.DAGCircuit.substitute_node` will no longer silently overwrite an existing condition on
the given replacement ``op``. If ``propagate_condition`` is set to ``True`` (the default), a
:exc:`.DAGCircuitError` will be raised instead.