q-optimize / c3

Toolset for control, calibration and characterization of physical systems
https://c3-toolset.readthedocs.io/
Apache License 2.0
69 stars 35 forks source link

Update for Qiskit 1.0 #245

Open frankharkins opened 9 months ago

frankharkins commented 9 months ago

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

codecov[bot] commented 9 months ago

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 ```diff @@ 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.

frankharkins commented 9 months ago

CI is failing but I can't reproduce locally; the tests passed and black claimed all .py files were formatted correctly.

lazyoracle commented 9 months ago

CI is failing but I can't reproduce locally; the tests passed and black claimed all .py files were formatted correctly.

HI Frank, thanks for adding the qiskit 1.0 support and making the PR. I will look into the failing tests.