qiskit-community / qiskit-dynamics

Tools for building and solving models of quantum systems in Qiskit
https://qiskit-community.github.io/qiskit-dynamics/
Apache License 2.0
105 stars 61 forks source link

Change level 1 memory result data type to match Qiskit #367

Open wshanks opened 6 days ago

wshanks commented 6 days ago

In Qiskit, it is specified that memory should be a list (https://github.com/Qiskit/qiskit/blob/b9d5c9c6aeb4568b6e9fba8943517ebed300886d/qiskit/result/models.py#L38). While most code can work with either lists or numpy arrays, some can not, including BackendSamplerV2 in Qiskit (see https://github.com/qiskit-community/qiskit-experiments/issues/1487). Here the numpy array data is converted to a nested list using tolist().

CLAassistant commented 6 days ago

CLA assistant check
All committers have signed the CLA.

wshanks commented 6 days ago

I didn't test this yet. Hoping it passes the CI without changes :crossed_fingers: but some tests might assume the array format. This is a little bit of a breaking change potentially but I don't know how much effort to put into backwards compatibility for this (like an option to keep the old format?).