Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Running vqe runtime program with aux operator fails with serialization error #74

Closed
jyu00 opened this issue Sep 10, 2021 · 0 comments · Fixed by Qiskit/qiskit-ibm-runtime#121
Assignees
Labels
low priority project: runtime Issues related to Qiskit Runtime support type: bug Something isn't working

Comments

@jyu00
Copy link
Collaborator

jyu00 commented Sep 10, 2021

Information

  • Qiskit IBMQ Provider version:
  • Python version:
  • Operating system:

What is the current behavior?

Running the vqe runtime program with aux operator would fail with

raise ValueError("Object arrays cannot be saved when "\n2021-09-09T21:39:52.232793489Z ValueError: Object arrays cannot be saved when allow_pickle=False\n'

Steps to reproduce the problem

Run this tutorial:
https://github.com/Qiskit/qiskit-nature/blob/stable/0.2/docs/tutorials/07_leveraging_qiskit_runtime.ipynb

What is the expected behavior?

The program should work

Suggested solutions

RuntimeEncoder currently use np.save() to save numpy arrays, since it's more efficient than tolist(). save(), however, doesn't support arrays with object types (e.g. dtype=object) when allow_pickle=False is set (we can't use pickle due to security). We can potentially use tolist() if save() doesn't work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
low priority project: runtime Issues related to Qiskit Runtime support type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants