0
$\begingroup$

im trying to plot a histogram of my code but when i run plot_histogram(results.get_counts(circuit)) it gives me a traceback error

This is what i had before calling the histogram function -result = execute(circuit, backend = simulator).result()

and the after when i try to plot it by typing -plot_histogram(results.get_counts(circuit)) it doesnt work

$\endgroup$
  • 2
    $\begingroup$ Welcome to Quantum Computing SE! Do you have a minimal (not-)working example? It can be hard to tell where the error is without more code (unless it's a case of typing results. when your variable is called result, in which case you should be typing plot_histogram(result.get_counts(circuit))? $\endgroup$ – Mithrandir24601 Sep 1 at 8:22
0
$\begingroup$

Looking at the code without the example it looks like you missed an "s" on the result variable. plot_histogram(results.get_counts(circuit)) should work.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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