qiskit
qiskit copied to clipboard
Oxidize `PauliFeatureMap`
Summary
This PR oxidizes the PauliFeatureMap (and derivatives) and implements a first step in refactoring the circuit library, where structurally fixed circuits are moved to functions. As part of this, PauliFeatureMap & co. are pending deprecation.
Details and comments
- This code is ~8x faster than it's Python equivalent. The most time is spent in parameter multiplication, which could be further improved by caching the expression across the repetitions, or (bigger scale) have the parameter logic in Rust.
- If #12767 is merged, this will be handled in a follow up.
One or more of the following people are relevant to this code:
-
@Cryoris -
@Qiskit/terra-core -
@ajavadia -
@kevinhartman -
@mtreinish
Pull Request Test Coverage Report for Build 10813596822
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
- 277 of 284 (97.54%) changed or added relevant lines in 8 files are covered.
- 677 unchanged lines in 23 files lost coverage.
- Overall coverage decreased (-0.3%) to 88.916%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/accelerate/src/circuit_library/entanglement.rs | 26 | 27 | 96.3% |
| qiskit/circuit/library/data_preparation/pauli_feature_map.py | 23 | 24 | 95.83% |
| crates/accelerate/src/circuit_library/pauli_feature_map.rs | 208 | 210 | 99.05% |
| crates/circuit/src/operations.rs | 12 | 15 | 80.0% |
| <!-- | Total: | 277 | 284 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| qiskit/quantum_info/operators/mixins/multiply.py | 1 | 93.75% |
| crates/accelerate/src/circuit_library/entanglement.rs | 1 | 96.48% |
| qiskit/synthesis/one_qubit/one_qubit_decompose.py | 1 | 70.67% |
| qiskit/quantum_info/operators/mixins/group.py | 1 | 92.59% |
| qiskit/quantum_info/operators/channel/quantum_channel.py | 1 | 72.14% |
| qiskit/quantum_info/operators/mixins/adjoint.py | 1 | 90.0% |
| qiskit/quantum_info/operators/mixins/linear.py | 1 | 88.0% |
| qiskit/visualization/circuit/_utils.py | 2 | 94.25% |
| crates/qasm2/src/lex.rs | 2 | 92.73% |
| qiskit/circuit/classicalfunction/types.py | 3 | 0.0% |
| <!-- | Total: | 677 |
| Totals | |
|---|---|
| Change from base Build 10794993036: | -0.3% |
| Covered Lines: | 73388 |
| Relevant Lines: | 82536 |