-
Notifications
You must be signed in to change notification settings - Fork 163
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
QPY Qiskit 1.0 updates #1365
QPY Qiskit 1.0 updates #1365
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kt474, I see a few 1.0 QPY changes not reflected in this PR, they were last-minute changes so I'm bringing them to your attention in case they had slipped under your radar (if not, feel free to ignore):
Co-authored-by: Elena Peña Tapia <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
There's also: Qiskit/qiskit#11505 |
FWIW, I just opened #1375 to track deleting the fork of the qpy module here. In qiskit 1.0.0 we added the necessary functionality to cover emitting older versions of the QPY format from |
Would this work with pre-1.0 QPY? Because the server is still at 0.* |
Yes, there is specifically overlap in the versions supported by |
@@ -44,7 +48,7 @@ def _write_parameter_vec(file_obj, obj): # type: ignore[no-untyped-def] | |||
formats.PARAMETER_VECTOR_ELEMENT_PACK, | |||
len(name_bytes), | |||
obj._vector._size, | |||
obj._uuid.bytes, | |||
obj.uuid.bytes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mtreinish to be compatible with 0.45
, this is causing an error
AttributeError: 'ParameterVectorElement' object has no attribute 'uuid'
Because uuid is added as an attribute to Parameter here, only in 1.0
How should this be handled here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully porting the qpy changes from qiskit 1.0.0rc1 will inherently be unsound for use with qiskit 0.45.0 or 0.46.0. The internals of the qpy module are updated in lock-step with the QuantumCircuit
class. This is basically the same underlying issue we hit that needed: Qiskit/qiskit-ibm-provider#757
This will also start emitting qpy version 11 which will cause a version mismatch with what the server side can parse until it is upgraded to qiskit 1.0.0. I pushed up: #1377 as an alternative to this which will let you do the upgrade in a manner which is compatible with both versions so you can publish a release that is both 0.45.x/0.46.x and 1.0.0 compatible. It also removes the vendored fork completely as it is not needed anymore (and luckily has never been released either, so there is no backwards compatibility issue).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thank you so much for taking care of this!
I'll close this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create a PR to do the same in qiskit-ibm-provider
(but we can't remove the fork completely yet)
@mtreinish wrote #1377 as an alternative to this PR. 1377 handles QPY in a way that supports qiskit 0.45/0.46 and 1.0. |
Summary
Credit goes to:
Qiskit/qiskit#10902
Qiskit/qiskit#11260
Qiskit/qiskit#11522
Qiskit/qiskit#11403
Qiskit/qiskit#11495
Qiskit/qiskit#11488
Qiskit/qiskit#11647
Qiskit/qiskit#11646
Qiskit/qiskit#11644
Qiskit/qiskit#11505
Details and comments
Fixes #1338