1
$\begingroup$

I am struggling with the QiskitBackendNotFoundError: 'No backend matches the criteria' even though I am able to see the backends available to me.

  available_cloud_backends = provider.backends()
        print(available_cloud_backends)

[<IBMQSimulator('ibmq_qasm_simulator') from IBMQ(hub='ibm-q', group='open', project='main')>, <IBMQSimulator('simulator_statevector') from IBMQ(hub='ibm-q', group='open', project='main')>, <IBMQSimulator('simulator_mps') from IBMQ(hub='ibm-q', group='open', project='main')>, <IBMQSimulator('simulator_extended_stabilizer') from IBMQ(hub='ibm-q', group='open', project='main')>, <IBMQSimulator('simulator_stabilizer') from IBMQ(hub='ibm-q', group='open', project='main')>, <IBMQBackend('ibm_brisbane') from IBMQ(hub='ibm-q', group='open', project='main')>, <IBMQBackend('ibm_kyoto') from IBMQ(hub='ibm-q', group='open', project='main')>, <IBMQBackend('ibm_osaka') from IBMQ(hub='ibm-q', group='open', project='main')>]

When I am using the below code, it works:

# Execute the circuit using the simulator
simulator = Aer.get_backend('qasm_simulator')
# simulator = Aer.get_backend('simulator_mps')
job = execute(circuit, backend=simulator, shots=65536)

#Get the result of the execution
result = job.result()

# Get the counts, the frequency of each answer
counts = result.get_counts(circuit)

# Display the results
plot_histogram(counts)

But, when I try to use, ibmq_qasm_simulator or simulator_statevector or simulator_mps or simulator_extended_stabilizer or simulator_stabilizer or ibm_brisbane or ibm_kyoto or ibm_osaka, I get the below error:

---------------------------------------------------------------------------
QiskitBackendNotFoundError                Traceback (most recent call last)
Cell In[81], line 3
      1 # Execute the circuit using the simulator
      2 # simulator = Aer.get_backend('qasm_simulator')
----> 3 simulator = Aer.get_backend('ibmq_qasm_simulator')
      4 job = execute(circuit, backend=simulator, shots=65536)
      6 #Get the result of the execution

File ~/scratch/study_wong_hhl/lib/python3.9/site-packages/qiskit_aer/aerprovider.py:64, in AerProvider.get_backend(self, name, **kwargs)
     63 def get_backend(self, name=None, **kwargs):
---> 64     return super().get_backend(name=name, **kwargs)

File ~/scratch/study_wong_hhl/lib/python3.9/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'

Really not sure, what I am doing wrong? I think, there is something wrong with IBMQ systems.

$\endgroup$

1 Answer 1

1
$\begingroup$

I seems you are confusing IBM provider and Aer provider. They both provide backends, but not necessarily the same backends.

These are the backends for IBM provider

from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService(instance='ibm-q/open/main')

for backend in service.backends():
    print(backend.name)
simulator_statevector
simulator_stabilizer
ibm_brisbane
ibm_kyoto
ibm_osaka
ibmq_qasm_simulator
simulator_extended_stabilizer
simulator_mps

Some of them are simulators.

Aer is for local simulations, so they are all simulators.

from qiskit_aer import Aer

for backend in Aer.backends():
    print(backend.name)
aer_simulator
qasm_simulator
statevector_simulator
unitary_simulator

Even when some of the might be semantically equivalent, the simulators provided by IBM provider do not have the same name as those provided by the Aer provider.

$\endgroup$
1
  • $\begingroup$ Thank you @luciano for great help. $\endgroup$
    – Manu
    Jan 26 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.