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
<qiskit.primitives.sampler.Sampler object at 0x113c32dc0>
SamplerResult(quasi_dists=[{0: 1.0, 1: 0.0, 2: 0.0, 3: 0.0}], metadata=[{'shots': 100}])
<qiskit_aer.primitives.sampler.Sampler object at 0x113c32e20>
Traceback (most recent call last):
File "/Users/ima/tasks/2_2022/qiskit/aer/tmp/split_cr.py", line 17, in <module>
print(sampler.run(qc, shots=100).result())
File "/Users/ima/envs/dev39/lib/python3.9/site-packages/qiskit/primitives/primitive_job.py", line 50, in result
return self._future.result()
File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/usr/local/Cellar/python@3.9/3.9.15/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/ima/envs/dev39/lib/python3.9/site-packages/qiskit_aer/primitives/sampler.py", line 138, in _call
QuasiDistribution(
File "/Users/ima/envs/dev39/lib/python3.9/site-packages/qiskit/result/distributions/quasi.py", line 71, in __init__
raise ValueError(
ValueError: The input keys are not a valid string format, must either be a hex string prefixed by '0x' or a binary string optionally prefixed with 0b
Steps to reproduce the problem
What is the expected behavior?
No error
Suggested solutions
The main reason is Terra's QuasiDistribution cannot accept bitstrings with whitespaces due to split registers.
There are three opitions.
Informations
What is the current behavior?
#1670 raises an error with a circuit and split registers as follows.
aer 0.11.1
aer 0.11.2
Steps to reproduce the problem
What is the expected behavior?
No error
Suggested solutions
The main reason is Terra's
QuasiDistribution
cannot accept bitstrings with whitespaces due to split registers.There are three opitions.
QuasiDistribution
to accept bitstrings with white spacesqiskit-aer/qiskit_aer/primitives/sampler.py
Line 139 in 0f98dd4
The text was updated successfully, but these errors were encountered: