3

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?

1 Answers1

9

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.

met927
  • 3,251
  • 1
  • 9
  • 22