0
$\begingroup$

Last night I created an IBM Cloud account. I can run the "sampler':

with Sampler(circuits=qc, service=service, options={"backend": ""}) as sampler:
            result=sampler(circuit_indices=[0], shots=1024)
            print(result)

The results are printed. However, I want to display a histogram of my execution results (just like I do with regular qiskit) and I don't know how to do that.

For example, there is no "result.get_counts()"

$\endgroup$

2 Answers 2

2
$\begingroup$

Qiskit Runtime Sampler returns an instance of SamplerResult. You can use its quasi_dists attribute to get the list of the quasi-probabilities then pass it to plot_histogram function:

plot_histogram(result.quasi_dists)
$\endgroup$
0
$\begingroup$

hist1 = plot_histogram(result.quasi_dists, sort='value_desc')

hist1

$\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.