Before raising this issue, I have already checked that I am:
[x] running the latest version
[x] 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
Prerequisites
Before raising this issue, I have already checked that I am:
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:
dump
the QAOA results in a JSON fileExpected behavior
OpenQAOA should convert all non-serializable outputs to native python types, so that QPU results including measurement outcomes can be
dump
ed into a JSON