Draft: Improve performance of QuantumCircuit.measure_all and QuantumCircuit.barrier by using _append fast path#11008
Draft: Improve performance of QuantumCircuit.measure_all and QuantumCircuit.barrier by using _append fast path#11008eendebakpt wants to merge 2 commits into
Conversation
…barrier by using _append fast path
|
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:
|
jakelishman
left a comment
There was a problem hiding this comment.
When dropping to the lower-level _append primitive, there a quite a lot of additional considerations that must be validated by the caller:
- any control-flow builder scopes must be resolved
- the qubit counts and clbit counts should be known to match the instruction (
Measureis a 1q/1c operation, for example) _appendshould take a singleCircuitInstruction(which comes with its own validation requirements), not three arguments
It's worth looking at end of append's implementation to be sure that all the invariants it enforces are being respected here as well.
Out of curiosity, in what situations is this function even visible in performance benchmarking?
Thanks for the info. The |
Summary
Improve performance of QuantumCircuit.measure_all and QuantumCircuit.barrier by using _append fast path
Details and comments
The register argument are obtained from the QuantumCircuit directly, so do not need to be validated.