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 of all, check this link if you have access to any additional quantum machine.

By default, as a basic user, you would be having access to ibmq_16_melbourne as a 15 qubit machine.

Keep in mind that these real-time machines still have certain error factors which get included due to quantum mechanics limitations.

If you want an error-free simulation(not on actual hardware), use QASM(quantum assembly language) simulator from qiskit Aer.

Talking about your query, it seems like you are using an older syntax of submitting jobs to IBM quantum machines. Check out this link for better understanding.

Just try the following replacing your line:

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

Let me know if you still face any issue.

| improve this answer | |
$\endgroup$
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')
| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ remember to save your account: IBMQ.save_account("your IBMQ credentials") $\endgroup$ – kita Aug 11 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.