【问题标题】:I get an errorat at qresorc=provider.get_backend('ibmq_oslo')I get an errorat at qresorc=provider.get_backend(\'ibmq_oslo\')
【发布时间】:2022-12-28 03:01:20
【问题描述】:

I try to run a simple quantum circuit on a quantum computer ('ibmq_oslo') and I get an error at qresorc=provider.get_backend('ibmq_oslo').
I verified that ibmq_oslo is in my resources list from my IBM quantum account.

Here it is the code:

from qiskit import *  
circuit = QuantumCircuit(2, 2)
circuit.h(0)  
circuit.cx(0, 1)  
circuit.draw()  
simulator = Aer.get_backend('qasm_simulator')  
result = execute(circuit, backend=simulator).result()  

from qiskit .tools.visualization import plot_histogram  
plot_histogram(result.get_counts(circuit))  

from qiskit import IBMQ  
provider = IBMQ.get_provider('ibm-q')  
qresorc = provider.get_backend('ibmq_oslo')  
QiskitBackendNotFoundError                Traceback (most recent call last)
Input In [14], in <cell line: 1>()
----> 1 qresorc=provider.get_backend('ibmq_oslo')

File ~\anaconda3\lib\site-packages\qiskit\providers\provider.py:55, in  
ProviderV1.get_backend(self, name, **kwargs)
     53     raise QiskitBackendNotFoundError("More than one backend matches the criteria")
     54 if not backends:
---> 55     raise QiskitBackendNotFoundError("No backend matches the criteria")
     57 return backends[0]

QiskitBackendNotFoundError: 'No backend matches the criteria'

【问题讨论】:

  • Please add the python tag. It will help StackOverflow better sort your question and add syntax highlighting to your question.
  • Thank you Michael I did add the python tag
  • I believe that editing the code by placing a space before and after the equal sign does not fix the error.

标签: python qiskit


【解决方案1】:

The name of the backend is ibm_oslo (without the q).

【讨论】:

    【解决方案2】:

    *The IBM Quantum backend ibmq_16_melbournehas been retired. In order to see the quantum backends you have access to, use the provider.backends() command. For example, for the Open provider

    from qiskit import IBMQ
    IBMQ.load_account()
    provider = IBMQ.get_provider(hub='ibm-q', group='open',
    project='main')
    provider.backends()
    

    shows a list of available backends. For example, replacing the line in the video with

    qcomp = provider.get_backend('ibmq_santiago')
    

    will fix this issue.

    【讨论】:

      猜你喜欢
      • 2022-12-02
      • 2021-01-19
      • 2020-11-08
      • 2022-12-27
      • 2013-01-09
      • 1970-01-01
      • 2022-12-01
      • 1970-01-01
      • 2013-07-10
      相关资源
      最近更新 更多