I'm testing out a program in different IBMQ mock backends, and I want the program to use the maximum number of qubits in each case. Is there any function/method to extract the number of qubits of a given backend, so that I don't have to manually look it up every time?

Extra: Is there any way to automate the process of selecting each of these mock backends? My plan is to create an array

fake_servers = [FakeAlmaden(), FakeAthens(), FakeBelem(), FakeBoeblingen()]

etc, but if there's a more straightforward way, I'd like to know about it...


1 Answer 1


The number of qubits is part of the backend configuration:


If you need to filter the list of mocked backends based on the amount of qubits:

from qiskit.test.mock import FakeProvider
provider = FakeProvider()
[ b.name() for b in provider.backends() if b.configuration().n_qubits > 20]

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.