Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Add specialized Sampler primitive #60

Merged
merged 10 commits into from
Apr 24, 2023
Merged

Conversation

airwoodix
Copy link
Contributor

@airwoodix airwoodix commented Apr 21, 2023

Summary

This patch adds a specialized version of the Qiskit Sampler primitive that enables the use of Sampler-based algorithms that have parametric circuits.

Depends on #57. The branch will be rebased after #57 is merged.

Details and comments

  • usage of the AQTSampler is mandatory with AQT resources because the custom transpilation passes need to work on parameter-bound circuits.
  • AQTSampler implementation works around that limitation by delaying the application of the custom transpilation passes to after the parameters are bound to the circuit. This way, the partially transpiled circuits can still be cached by the underlying BackendSampler implementation.
  • the offline_simulator_no_noise fixture is reworked to use a new MockSimulator class that encapsulates the specialized-mock post-processing rather than relying on unittest.mock. It is now arguable whether offline_simulator_no_noise should still be a fixture. We could clean this up at a later point if relevant.

@airwoodix airwoodix self-assigned this Apr 21, 2023
@github-actions
Copy link

github-actions bot commented Apr 21, 2023

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1347 1328 99% 97% 🟢

New Files

File Coverage Status
qiskit_aqt_provider/primitives/init.py 100% 🟢
qiskit_aqt_provider/primitives/sampler.py 100% 🟢
TOTAL 100% 🟢

Modified Files

File Coverage Status
qiskit_aqt_provider/aqt_resource.py 100% 🟢
qiskit_aqt_provider/test/fixtures.py 100% 🟢
qiskit_aqt_provider/transpiler_plugin.py 100% 🟢
test/test_primitives.py 100% 🟢
test/test_resource.py 100% 🟢
test/test_transpilation.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 9ae84b0 by action🐍

@airwoodix airwoodix marked this pull request as ready for review April 24, 2023 06:27
@airwoodix airwoodix merged commit 221b90b into master Apr 24, 2023
@airwoodix airwoodix deleted the custom-sampler-primitive branch April 24, 2023 07:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants