我试图在量子计算机上运行一个简单的量子电路('ibmq_oslo'),但在qresorc=provider.get_backend('ibmq_oslo')
处出现错误。
我验证了ibmq_oslo
在我的IBMQuantum帐户的资源列表中。
下面是代码:
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'
2条答案
按热度按时间qxsslcnc1#
后端的名称为
ibm_oslo
(不含q
)。jq6vz3qz2#
显示了可用后端的列表。例如,将视频中的行替换为
将解决此问题。