TransWikia.com

Qiskit error on get_backend()

Quantum Computing Asked by Sagiruddin Mondal on February 6, 2021

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?

2 Answers

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')

Answered by kita on February 6, 2021

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.

Answered by Tathagato Bose on February 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP