-
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 control flow handling to DenseLayout pass #8742
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
Pull Request Test Coverage Report for Build 3156699536
💛 - Coveralls |
FWIW, I'm not sure how much this is actually needed. The cx count and measurement count are only used as weighting factors when trying to estimate how noisy the qubits in a layout are (in the |
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.
#8763 will automatically upgrade DenseLayout
to recurse into control-flow when counting up the cx
and measure
gates, and that PR is perhaps a bit more logically the right location for such a change. I get the argument that DenseLayout
's heuristics are going to be a bit rubbish for control flow, but I think having the explicit test, and just having them be automatically upgraded is fine - if we want to revisit the heuristic, it's better to do that in a non-control-flow specific PR anyway.
Very little needs to be done for this pass, since the majority of its logic is circuit-independent. There is a heuristic based on the average number of cx gates per qubit, but since `DAGCircuit.count_ops` is now recursive itself, this is trivial to raise. Co-authored-by: Jake Lishman <[email protected]>
bcf30ef
to
90aa68e
Compare
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.
I've rebased this properly over #8763 now that it's merged. The principal remaining change is now mostly the test, and since this is just a simple pass, I think this is fine.
The heuristic here is really pretty meaningless (and clearly intended for backends that have cx as their only 2+q gate), and the |
Summary
Add control flow handling to dense layout pass.
Details and comments
depends on #8763
todo: may still need to update
Target.operation_names_for_qargs
when target object is supplied.