Update for Qiskit 1.0
What
Updates code and examples to work with Qiskit 1.0.
Why
Qiskit 1.0 brings some stability guarantees and performance improvements. Most new users will use Qiskit 1.0 and will expect this project to be compatibile with it.
How
Mostly find/replace of import paths. Also replacing execute with backend.run.
# Old
execute(circuit, backend)
# New
transpile(circuit, backend) # not always needed
backend.run(circuit)
See Qiskit 1.0 feature changes for more information.
Remarks
I re-ran the example notebooks that used Qiskit, with the exception of examples/Full_loop_single_qubit.ipynb which I could not get working (see #244). Since it's not caused by the Qiskit upgrade, I think fixing it is out of scope of this PR. Please advise on how you'd like to handle it.
View de1cde6c84b44f2972065a862c0720cf1b89495d to see only the code changes to examples without the new cell outputs.
Checklist
Please include and complete the following checklist. Your Pull Request is (in most cases) not ready for review until the following have been completed. You can create a draft PR while you are still completing the checklist. Check the Contribution Guidelines for more details. You can mark an item as complete with the - [x] prefix
- [x] Tests - Added unit tests for new code, regression tests for bugs and updated the integration tests if required
- [x] Formatting & Linting -
blackandflake8have been used to ensure styling guidelines are met - [ ] Type Annotations - All new code has been type annotated in the function signatures using type hints
- [ ] Docstrings - Docstrings have been provided for functions in the
numpydocstyle - [ ] Documentation - The tutorial style documentation has been updated to explain changes & new features
- [x] Notebooks - Example notebooks have been updated to incorporate changes and new features
- [x] Changelog - A short note on this PR has been added to the Upcoming Release section
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 76.67%. Comparing base (
48b7917) to head (84b5e2d).
Additional details and impacted files
@@ Coverage Diff @@
## dev #245 +/- ##
=======================================
Coverage 76.67% 76.67%
=======================================
Files 38 38
Lines 5873 5873
=======================================
Hits 4503 4503
Misses 1370 1370
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
CI is failing but I can't reproduce locally; the tests passed and black claimed all .py files were formatted correctly.
CI is failing but I can't reproduce locally; the tests passed and black claimed all
.pyfiles were formatted correctly.
HI Frank, thanks for adding the qiskit 1.0 support and making the PR. I will look into the failing tests.