0
$\begingroup$

In Qiskit, I have a quantum circuit of 20 qubits. Hence the measurement result I am expecting is a dictionary of size 2^20. However, the quasi_dists from SamplerV1 and the get_counts() from SamplerV2 are much shorter. Is it because they omit the 0?

If I do need the full result dictionary, is there any way I can access it? Also, is there any way to have the quasi_dists in SamplerV2?

What is the more efficient way to manipulate the individual results? Please share some tips.

$\endgroup$
1
  • $\begingroup$ Can you provide your code? $\endgroup$
    – Tristan Nemoz
    Apr 5 at 10:35

1 Answer 1

0
$\begingroup$

The get_counts() function of qiskit return a python dict so I guess the measurement results that are not measured and have for value 0 are not included to save memory space. So if your number of shot is large enough you can just assume other entries are 0.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.