Skip to content

Update use of classes removed in Qiskit 2.0#2173

Merged
kt474 merged 4 commits intomainfrom
update-import-2.0
Mar 5, 2025
Merged

Update use of classes removed in Qiskit 2.0#2173
kt474 merged 4 commits intomainfrom
update-import-2.0

Conversation

@ElePT
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

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
@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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@kt474 kt474 added backport potential The bug might be minimal and/or important enough to be port to stable Changelog: Bugfix Include in the Fixed section of the changelog labels Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport potential The bug might be minimal and/or important enough to be port to stable Changelog: Bugfix Include in the Fixed section of the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update neko ML tests to use qiskit 2.0

3 participants