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

output of measurement_outcomes should be serializable #228

Open
2 tasks done
vishal-ph opened this issue Apr 20, 2023 · 0 comments
Open
2 tasks done

output of measurement_outcomes should be serializable #228

vishal-ph opened this issue Apr 20, 2023 · 0 comments

Comments

@vishal-ph
Copy link
Collaborator

Prerequisites

Before raising this issue, I have already checked that I am:

  • running the latest version
  • made sure that this issue has not already been filed

Describe the bug

Running a QAOA computation on a QPU and attempting to dump the results fails because some QPUs return their measurement_outcome probabilities as a numpy.float, which is not python serializable. This issue may also happen for statevector simulators, where the measurement_outcomes are wavefunctions which are complex arrays.

To Reproduce

Steps to reproduce the behavior:

  • Run a QAOA computation on a QPU or a statevector simulator
  • Attempt to dump the QAOA results in a JSON file

Expected behavior

OpenQAOA should convert all non-serializable outputs to native python types, so that QPU results including measurement outcomes can be dumped into a JSON

@vishal-ph vishal-ph mentioned this issue Apr 20, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant