4
$\begingroup$

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

$\endgroup$

1 Answer 1

6
$\begingroup$

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']
$\endgroup$

Your Answer

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

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