qiskit
qiskit copied to clipboard
Fully port `GatesInBasis` to Rust.
Summary
Ports GatesInBasis to Rust. The implementation avoids the prior conversion to DAGCircuit for each control flow block, which should help with performance.
Details and comments
Additional changes:
- Adds a
PyInstruction::blocks()for passes which need to get the blocks of a control flow operation as nativeCircuitData. - Adds
NodeType::unwrap_operation()for callers who know that a DAG node is an operation. - Makes
Targetinterface public for use in other crates (needed to accept a&Targetin apyfunction). - Fixes some mutability / visibility concerns in
DAGCircuit, naming makingdag,qubits, andclbitsprivate again.
Includes some changes from #13056, #13013 and ~#13006~ which ought to merge first.
Resolves #12275
One or more of the following people are relevant to this code:
@Qiskit/terra-core@kevinhartman@mtreinish
Pull Request Test Coverage Report for Build 11058624835
Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 89 of 90 (98.89%) changed or added relevant lines in 5 files are covered.
- 173 unchanged lines in 9 files lost coverage.
- Overall coverage increased (+0.05%) to 88.847%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/circuit/src/dag_circuit.rs | 4 | 5 | 80.0% |
| <!-- | Total: | 89 | 90 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| qiskit/transpiler/passes/layout/disjoint_utils.py | 1 | 96.83% |
| qiskit/circuit/instruction.py | 4 | 95.31% |
| crates/qasm2/src/lex.rs | 5 | 92.73% |
| crates/qasm2/src/parse.rs | 6 | 97.61% |
| qiskit/transpiler/passes/basis/basis_translator.py | 8 | 97.45% |
| qiskit/transpiler/preset_passmanagers/builtin_plugins.py | 11 | 96.46% |
| crates/circuit/src/dag_circuit.rs | 17 | 87.84% |
| qiskit/circuit/equivalence.py | 24 | 27.27% |
| qiskit/circuit/quantumcircuit.py | 97 | 93.33% |
| <!-- | Total: | 173 |
| Totals | |
|---|---|
| Change from base Build 10947873036: | 0.05% |
| Covered Lines: | 74015 |
| Relevant Lines: | 83306 |