-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 serialization of ParameterExpression
throws error
#13879
Comments
I checked and this bug is present in the public api for qpy too. Calling |
@mtreinish, that's important. It would have been better if I included an explicit user-level API example in the bug report. I think both things are useful. Showing that a user will encounter the bug, and a minimal example. This came up in code from collaborators. It's a simple machine learning example. I think most of the code is from a tutorial. It works fine on a fake backend. But fails with a real backend because of the qpy serialiazation. On the application side, QNNEstimator has only been supported on real V2 backends for a couple of months. I have not seen any other mention of people running into this problem. |
Ran into this as well. |
I ran in to this when trying to run a pub with Qiskit Runtime's EstimatorV2.
|
Certain
ParameterExpression
s cause QPY serialization v13 to throw. QPY v12 does not throw.Note
After opening this issue I found the following much simpler script for triggering the bug:
There is no error with QPY version 12.
When running the script above, the error,
is thrown here at line 40
qiskit/qiskit/qpy/binary_io/value.py
Lines 39 to 42 in d9b8a18
I tried to track down the problem, which is centered on
_qpy_replay
. But there are no documentation or comments describing_qpy_replay
and several adjacent structures and functions.Note
The following script is not a minimal description of the bug. But it is an example abstracted from using
EstimatorQNN
andNeuralNetworkClassifier
from qiskit-machine-learning on a real IBM device (in this case,ibm_kyiv
). It's unlikely that simple workflows involvingEstimatorQNN
will work when this bug is present.Running this script will trigger the bug:
If I replace
versions=13
withversion=12
, I see no apparent problem.The text was updated successfully, but these errors were encountered: