Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.11k stars 2.34k forks source link

Oxidize `PauliFeatureMap` #13045

Closed Cryoris closed 2 weeks ago

Cryoris commented 1 month ago

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

Some benchmark data for reps=10 and different numbers of qubits n:

-- n = 10, speedup 8.07x
main: 0.008 +- 0.001
this: 0.001 +- 0.000

-- n = 20, speedup 5.38x
main: 0.028 +- 0.004
this: 0.005 +- 0.004

-- n = 50, speedup 6.28x
main: 0.174 +- 0.005
this: 0.028 +- 0.006

-- n = 100, speedup 6.69x
main: 0.743 +- 0.022
this: 0.111 +- 0.007

-- n = 200, speedup 7.14x
main: 3.365 +- 0.144
this: 0.471 +- 0.015
qiskit-bot commented 1 month ago

One or more of the following people are relevant to this code:

coveralls commented 1 month ago

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.

Details


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 97.54% -->
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 Coverage Status
Change from base Build 10794993036: -0.3%
Covered Lines: 73388
Relevant Lines: 82536

💛 - Coveralls