2
$\begingroup$

Im trying to use IBM quantum machine instead of qiskit aer simulator with the following command:

backend = IBMQ.get_backend('ibmq_16_melbourne', 'ibm-q')

It's giving me the following error:


AttributeError    Traceback (most recent call last)

 
 <ipython-input-22-39269ac2204d> in <module>
----> 1 backend = IBMQ.get_backend('ibmq_16_melbourne', 'ibm-q')

AttributeError: 'IBMQFactory' object has no attribute 'get_backend'

What syntax I should try to submit the job to designated quantum machine?

$\endgroup$
1
$\begingroup$

First, check the IBM Quantum Services page to see if you have access to any additional systems. Make sure you are logged in with your IBMid to see what your account can access.

By default, basic users have access to the 5 qubit machines, but do not have access to 15 qubit machines like ibmq_16_melbourne.

Also, it looks like the snippet you provided is in an older syntax.

Check the IBM Quantum Provider page on GitHub for information for the modern syntax. The new syntax would look like this:

provider = IBMQ.get_provider('ibm-q')
backend = provider.get_backend('ibmq_16_melbourne')

Keep in mind that you can always use the simulators provided in Aer:

from qiskit import Aer
Aer.backends()    # lists the available simulators
backend = Aer.get_backend('aer_simulator')

More information about Aer's simulators is available in the relevant tutorial.

$\endgroup$
1
2
$\begingroup$

you should get_provider first.

IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q')
backend = provider.get_backend('ibmq_16_melbourne')

or you can simply use simulator:

from qiskit import Aer
simulator = Aer.get_backend('qasm_simulator')
$\endgroup$
1
  • 1
    $\begingroup$ remember to save your account: IBMQ.save_account("your IBMQ credentials") $\endgroup$
    – kita
    Aug 11 '20 at 23:51

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.