Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update use of classes removed in Qiskit 2.0 #2173

Merged
merged 4 commits into from
Mar 5, 2025
Merged

Update use of classes removed in Qiskit 2.0 #2173

merged 4 commits into from
Mar 5, 2025

Conversation

ElePT
Copy link
Collaborator

@ElePT ElePT commented Mar 5, 2025

Summary

Qiskit/qiskit#13793 removes the qobj module. A consequence of this removal is the move of MeasLevel and MeasResult from qiskit.qobj.utils to qiskit.result. This PR allows to import from both paths for compatibility with 1.x and 2.x.

The same PR removes configuration and property errors. Because the BackendConfiguration and BackendProperties classes have been vendored in qiskit-ibm-runtime, the errors should be too.

Details and comments

Fixes #
This PR will allow to fix: Qiskit/qiskit-neko#52

Copy link
Member

@kt474 kt474 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ElePT!

@kt474
Copy link
Member

kt474 commented Mar 5, 2025

Cancelling the integration tests because they shouldn't run in PRs

@kt474 kt474 merged commit b73836c into main Mar 5, 2025
33 of 34 checks passed
@kt474 kt474 deleted the update-import-2.0 branch March 5, 2025 16:27
@kt474 kt474 added this to the 0.37.0 milestone Mar 5, 2025
Comment on lines +58 to +61
if Version(qiskit_version) == "2":
from qiskit.result import MeasLevel, MeasReturnType
else:
from qiskit.qobj.utils import MeasLevel, MeasReturnType
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried this out and it doesn't work for me 😞 Version('2.0.0.dev0+9717823') == "2" is False. Maybe something like Version(qiskit_version).major >= 2?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right, I'll fix that in a separate PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update neko ML tests to use qiskit 2.0
3 participants