1
$\begingroup$

Tried executing plot_histogram(result.get_counts(circuit)) where result has the job result and circuit is the Quantum circuit

But an attribute error hits every time.

AttributeError: 'function' object has no attribute 'get_counts'

I tried going through the qiskit tutorial documentation, but couldn't help myself with it.

Can somebody point out what's wrong here?

$\endgroup$

1 Answer 1

1
$\begingroup$

It sounds like maybe one of the calls is missed. To get results you need to run

backend = Aer.get_backend('qasm_simulator')
job = execute(circ, backend)
result = job.result()
plot_histogram(result.get_counts(circuit)) 
$\endgroup$
1
  • 1
    $\begingroup$ Hey thanks fella. got it sorted out $\endgroup$ Nov 1, 2019 at 11:15

Your Answer

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

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