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

Jobs fail if shots value comes from NumPy array #743

Closed
nonhermitian opened this issue Oct 1, 2023 · 4 comments · Fixed by #744
Closed

Jobs fail if shots value comes from NumPy array #743

nonhermitian opened this issue Oct 1, 2023 · 4 comments · Fixed by #744
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@nonhermitian
Copy link
Contributor

The below code fails if the cast to int in the shots kwarg is removed:

samples = np.array([100, 250, 500, 1000, 2500, 5000, 10000])

jobs = []
for shots in samples:
    jobs.append(backend.run(trans_qc, shots=int(shots)))

The error is a bit cryptic:

Failed - TypeError: 'dict' object cannot be interpreted as an integer

@nonhermitian nonhermitian added the type: bug Something isn't working label Oct 1, 2023
@nonhermitian
Copy link
Contributor Author

I should mention the above example used to work with the IBMQ provider.

@blakejohnson
Copy link

blakejohnson commented Oct 2, 2023

So, you think another reproducer would be backend.run(trans_qc, shots=np.int64(1000))?

EDIT: I have confirmed this reproducer.

@blakejohnson
Copy link

Seems like we are just missing some kind of cast in the serialization.

@drew-distefano
Copy link
Collaborator

@merav-aharoni please also make the update in qiskit-ibm-runtime

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants