Add Expr
supprt to DAGCircuit
simple constructors
#10362
Merged
+157
−38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This adds support to the
DAGCircuit
builder methodsapply_operation_front
andapply_operation_back
, and consequently to the convertercircuit_to_dag
. This commit does not directly enhanceDAGCircuit.compose
, which will come later.The principal change is that
_bits_in_condition
is modified to the more general_bits_in_operation
, which now accounts for both acondition
(if set) and any additional fields from atarget
if the operation is a suitableControlFlowOp
. This has the effect of upgrading the converters into theSabreDAG
format as well, but nothing is done to change the Sabre algorithms themselves.Details and comments
Close #10226. Depends on #10358. Changelog to follow as part of #10331.
The change of
_bits_in_condition
to_bits_in_operation
likely does most of the remaining work for #10232 on top of its prerequisites #9419 and #9421 (although a PR for #10232 will still need to add tests).