sQUlearn / squlearn

scikit-learn interface for quantum algorithms
https://squlearn.github.io
Apache License 2.0
57 stars 18 forks source link

Upgrade to Qiskit Runtime V2 primitives #297

Open samoils opened 3 days ago

samoils commented 3 days ago

Describe the bug Current version of the library does not run on the IBM Quantum service due to the deprecation and removal of support for V1 primitives as of August 15th, 2024. Jobs being run in a session fail with the following error:

The V1 Primitives SamplerV1 and EstimatorV1 are no longer supported. Refer to the migration guide for instructions on migrating to V2 primitives: https://docs.quantum.ibm.com/migration-guides/v2-primitives. -- Use a supported version of the primitive. See the Qiskit Runtime release notes <https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/release-notes>__ to learn what is supported. -- https://ibm.biz/error_codes#1513

See also: https://docs.quantum.ibm.com/migration-guides/v2-primitives

To Reproduce Run a session on IBM Quantum that requires the Estimator or Sampler classes (e.g. the Bayesian optimization example).

Expected behavior Jobs submitted in a session created on the IBM Quantum service should run and complete successfully without the error about the V1 primitive.

Additional context Tested on the latest development branch and the release branch and issue is reproducible in both.

David-Kreplin commented 3 days ago

Hallo samoils, thank you very much for pointing out! Since we have currently fixed qiskits version below 1.1.0, this has not been caputed by our tests. We will fix this ASAP.