Skip to main contentIBM Quantum Documentation

Get backend information with Qiskit

This page explains how to use Qiskit to find information about your available backends.


List backends

To view the backends you have access to, you can either view a list on the Compute resources page,(opens in a new tab) or you can use the QiskitRuntimeService.backends() method. This method returns a list of IBMBackend instances:

[1] :
# Initialize your account
from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService()
 
service.backends()

Output:

[<IBMBackend('ibm_cairo')>,
 <IBMBackend('ibm_hanoi')>,
 <IBMBackend('ibmq_kolkata')>,
 <IBMBackend('ibm_sherbrooke')>,
 <IBMBackend('ibm_brisbane')>,
 <IBMBackend('ibm_nazca')>,
 <IBMBackend('ibm_cusco')>,
 <IBMBackend('ibm_torino')>,
 <IBMBackend('ibmq_mumbai')>,
 <IBMBackend('ibm_kyoto')>,
 <IBMBackend('ibmq_qasm_simulator')>,
 <IBMBackend('ibm_algiers')>,
 <IBMBackend('ibm_osaka')>]

The QiskitRuntimeService.backend() method (note that this is singular: backend) takes the name of the backend as the input parameter and returns an IBMBackend instance representing that particular backend:

[2] :
service.backend("ibmq_qasm_simulator")

Output:

<IBMBackend('ibmq_qasm_simulator')>

Filter backends

You can also filter the available backends by their properties. For more general filters, you can make advanced functions using a lambda function. Refer to the API documentation for more details.

Let’s try getting only backends that fit these criteria:

  • Are real quantum devices (simulator=False)
  • Are currently operational (operational=True)
  • Have at least 5 qubits (min_num_qubits=5)
[3] :
service.backends(simulator=False, operational=True, min_num_qubits=5)

Output:

[<IBMBackend('ibm_cairo')>,
 <IBMBackend('ibm_hanoi')>,
 <IBMBackend('ibmq_kolkata')>,
 <IBMBackend('ibm_sherbrooke')>,
 <IBMBackend('ibm_brisbane')>,
 <IBMBackend('ibm_nazca')>,
 <IBMBackend('ibm_cusco')>,
 <IBMBackend('ibm_torino')>,
 <IBMBackend('ibmq_mumbai')>,
 <IBMBackend('ibm_kyoto')>,
 <IBMBackend('ibm_algiers')>,
 <IBMBackend('ibm_osaka')>]

A similar method is QiskitRuntimeService.least_busy(), which takes the same filters as backends() but returns the backend that matches the filters and has the least number of jobs pending in the queue:

[4] :
service.least_busy(operational=True, min_num_qubits=5)

Output:

<IBMBackend('ibm_cairo')>

Static backend information

Some information about a backend does not change regularly, such as its name, version, the number of qubits it has, and the types of features it supports. This information is available as attributes of the backend object.

The following cell builds a description of a backend.

[5] :
backend = service.backend("ibm_kyoto")
 
print(
    f"Name: {backend.name}\n"
    f"Version: {backend.version}\n"
    f"No. of qubits: {backend.num_qubits}\n"
)

Output:

Name: ibm_kyoto
Version: 2
No. of qubits: 127

For a full list of attributes, see the IBMBackend API documentation.


Dynamic backend information

Backends can also have properties that change whenever the backed is calibrated, such as qubit frequency and operation error rates. Backends are usually calibrated every 24 hours, and their properties update after the calibration sequence completes. These properties can be used when optimizing quantum circuits or to construct noise models for a classical simulator.

Qubit properties

The backend.qubit_properties method returns information about the qubits' physical attributes. This includes the qubit frequency in GHz and decay times (t1 and t2) in µs.

[6] :
backend.qubit_properties(0)  # properties of qubit 0

Output:

IBMQubitProperties(t1=0.00017890738300219413, t2=2.6687259977252058e-05, frequency=4908622971.84939, anharmonicity=-308028796.19250304)

Instruction properties

The backend.target attribute is a qiskit.transpiler.Target object: an object that contains all the information needed to transpile a circuit for that backend. This includes instruction errors and durations. For example, the following cell gets the properties for an ecr gate acting between qubits 1 and 0.

[7] :
backend.target["ecr"][(1,0)]

Output:

InstructionProperties(duration=6.6e-07, error=0.01598506240188205, calibration=Schedule ecr)

The following cell shows the properties for a measurement operation (including the readout error) on qubit 0.

[8] :
backend.target["measure"][(0,)]

Output:

InstructionProperties(duration=1.4e-06, error=0.16620000000000001, calibration=Schedule measure)

Next steps

Recommendations
Was this page helpful?