Closed mergify[bot] closed 1 month ago
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:
@Qiskit/terra-core
@kevinhartman
@mtreinish
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
crates/circuit/src/circuit_data.rs | 0 | 73 | 0.0% | ||
<!-- | Total: | 0 | 73 | 0.0% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
crates/qasm2/src/expr.rs | 1 | 94.02% | ||
qiskit/transpiler/passes/synthesis/unitary_synthesis.py | 2 | 88.39% | ||
crates/qasm2/src/lex.rs | 6 | 91.73% | ||
crates/qasm2/src/parse.rs | 18 | 96.69% | ||
<!-- | Total: | 27 | --> |
Totals | |
---|---|
Change from base Build 10526731985: | -0.1% |
Covered Lines: | 66804 |
Relevant Lines: | 74458 |
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.