-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Improve performance of measure_all by inlining calls to barrier #10949
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:
|
69b8e29
to
4023d88
Compare
Pull Request Test Coverage Report for Build 7045795400
💛 - Coveralls |
5ee1eb3
to
36b3018
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.
This PR has the same considerations as #11008 (and tbh, it might be easier to combine them - they're touching the same code with the same intent).
I've just pushed up b4ff01e to correct the use of the fast path constructors both in normal cases and in the case of control-flow scopes. That also had the effect of inlining the measurements, so it's good for about another ~20% speedup on the timings at the top of this PR comment. Since I pushed up a non-trivial amount of code to the PR, it'll need an alternate reviewer now. |
@jakelishman This PR still needs an update to current main. Do you want me to pick this up? |
It's ok, thanks - it's not a problem that it's not updated to main, because part of our merge train will cause it to get automatically updated. Unfortunately, I've broken the tests with my changes because I didn't test in enough detail, so that's my fault and I'll just fix it up quickly. |
It transpires that the test failure is because of (imo severe) problems with from qiskit.circuit.library import RealAmplitudes, XGate
from qiskit.circuit import CircuitInstruction, ClassicalRegister
qc = RealAmplitudes(num_qubits=2, reps=2)
qc.add_register(ClassicalRegister(2, "meas"))
qc._append(CircuitInstruction(XGate(), (qc.qubits[0],), ()))
qc.draw()
That's a problem with |
d6c07ff
to
723e8b2
Compare
Closing in favor of #11345 |
Summary
Improve performance of measure_all by inlining calls to barrier
Details and comments
Benchmark:
Results: