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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wshanks
Copy link
Contributor

@wshanks wshanks commented Nov 15, 2024

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
qiskit-community/qiskit-experiments#1487). Here the numpy array data is converted to a nested list using tolist().

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
qiskit-community/qiskit-experiments#1487).
Here the numpy array data is converted to a nested list using
`tolist()`.
@CLAassistant
Copy link

CLAassistant commented Nov 15, 2024

CLA assistant check
All committers have signed the CLA.

@wshanks
Copy link
Contributor Author

wshanks commented Nov 15, 2024

I didn't test this yet. Hoping it passes the CI without changes 🤞 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?).

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

Successfully merging this pull request may close these issues.

2 participants