-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Expr
supprt to DAGCircuit
simple constructors
#10362
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jakelishman
added
the
Changelog: New Feature
Include in the "Added" section of the changelog
label
Jun 29, 2023
One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 5556084548
💛 - Coveralls |
jakelishman
force-pushed
the
expr/dag-converters
branch
2 times, most recently
from
July 3, 2023 17:08
ed65d5d
to
dce6cdd
Compare
This adds support to the `DAGCircuit` builder methods `apply_operation_front` and `apply_operation_back`, and consequently to the converter `circuit_to_dag`. This commit does not directly enhance `DAGCircuit.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 a `condition` (if set) and any additional fields from a `target` if the operation is a suitable `ControlFlowOp`. This has the effect of upgrading the converters into the `SabreDAG` format as well, but nothing is done to change the Sabre algorithms themselves.
jakelishman
force-pushed
the
expr/dag-converters
branch
from
July 14, 2023 16:12
dce6cdd
to
44976ef
Compare
Rebased on top of main. |
mtreinish
approved these changes
Jul 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this seems straightforward enough to support reliably collecting the clbits for all the control flow ops and expressions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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).