You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/mnt/wsl/balagan/doubleslicespan_mask_bug.py", line 4, in <module>
span.mask(0)
File "/root/miniforge3/envs/env5/lib/python3.11/site-packages/qiskit_ibm_runtime/execution_span/double_slice_span.py", line 73, in mask
mask.reshape(np.prod(shape[:-1]), shape[-1])[(args_sl, shots_sl)] = True
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'numpy.float64' object cannot be interpreted as an integer
Expected behavior
Suggested solutions
Additional Information
qiskit-ibm-runtime version: 0.34.0
Python version: 3.11.10
Operating system: Linux (Windows + WSL)
The text was updated successfully, but these errors were encountered:
np.prod uses the data type of its argument but in @yaelbh's example shape[:-1] is an empty tuple, so np.prod returns a float rather than an int. Adding dtype=int to the call fixes it, will open a PR.
I suspect the issue is also present in TwirledSliceSpan, will check and fix there as well.
Describe the bug
It crashes in a real-world case, coming from a real execution result.
Steps to reproduce
Output:
Expected behavior
Suggested solutions
Additional Information
The text was updated successfully, but these errors were encountered: