# Is there any way to obtain the number of qubits of a given backend in Qiskit?

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...

The number of qubits is part of the backend configuration:

FakeManhattan().configuration().n_qubits

65


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]

['fake_cambridge',
'fake_cambridge',
'fake_manhattan',
'fake_montreal',
'fake_mumbai',
'fake_paris',
'fake_rochester',
'fake_sydney',
'fake_toronto']