3
$\begingroup$

when I tried to execute task in "Jupiter notebook" in the IBM Q experience (the browser),

backend=IBMQ.get_backend(name ='ibmqx2')
job4Cal=execute(qc,backend,shots=8192)
job_monitor(job8Cal, monitor_async=True)

Calresult = job4Cal.result()
job8Cal.job_id()

counts=Calresult.get_counts()

and I got the message:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-2bc4021cab83> in <module>
----> 1 backend=IBMQ.get_backend(name ='ibmqx2')
      2 job4Cal=execute(qc,backend,shots=8192)
      3     #job_monitor(job8Cal, monitor_async=True)
      4 
      5 Calresult = job4Cal.result()

AttributeError: 'IBMQFactory' object has no attribute 'get_backend

How to fix this problem\error?

$\endgroup$

1 Answer 1

9
$\begingroup$

The IBMQ provider has been updated so that you now have to retrieve a provider before you can get a backend. This can be done like this :

my_provider = IBMQ.get_provider()
my_backend  = my_provider.get_backend('ibmq_qasm_simulator')

You may also need to update your credentials, which can be done using IBMQ.update_account().

For more information please see the README.

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