-
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
Allow CircuitData
construction from PackedOperation
s and with_capacity
(backport #12943 + part of #12809)
#13038
Conversation
* ``CircuitData::from_packed_operations`` * missing import * remove redundant `to_vec` (cherry picked from commit b1e7ffe)
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 following people are relevant to this code:
|
CircuitData
construction from PackedOperation
s (backport #12943)CircuitData
construction from PackedOperation
s and with_capacity
(backport #12943 + part of #12809)
Pull Request Test Coverage Report for Build 10561424816Details
💛 - Coveralls |
Summary
As the title says 🙂 This allows to construct more general circuits than using just
CircuitData::from_standard_gates
, including e.g. barriers.Details and comments
This is essentially a copy of
CircuitData::from_standard_gates
. Qubits and Clbits are nowVec
, becauseSmallVec
cannot be used as we cannot predict the maximum length&[Qubit]
) turned out to be a bit restrictive as the length must be known at compile-time (but maybe there's some trick to use this in the signature but pass vectors or something?)I didn't yet add a test since it's essentially a copy of the standard gates constructor, and this will be used a bunch by the circuit library refactor. But we could add some
cfg
test that maybe checks this gives the same circuit data as using the standard gates construct -- though not sure how difficult that comparison is 🙂Example usage:
This is an automatic backport of pull request #12943 done by [Mergify](https://mergify.com).