Get backend information with Qiskit
이 페이지는 아직 한국어로 번역되지 않았습니다. 영어 원본을 보고 있습니다.
Package versions
The code on this page was developed using the following requirements. We recommend using these versions or newer.
qiskit-ibm-runtime~=0.43.1
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, or you can use the QiskitRuntimeService.backends() method. This method returns a list of IBMBackend instances:
- If you are logged in to a specific instance or region, or if you initialized the service with a specific instance or region by using
QiskitRuntimeService(), only the backends available to you on that instance or region are returned. Otherwise, all backends available to you on any instance and in any region are returned. - The list of backends returned might not be the same as those shown on the IBM Quantum Platform Compute resources page. The list on the Compute resources page is always filtered by the region selected at the top of the page.
To run the following code, be sure you have already authenticated to the service. See Set up your IBM Cloud account for more details.
# Added by doQumentation — required packages for this notebook
!pip install -q qiskit-ibm-runtime
# Initialize your account
from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService()
service.backends()
[<IBMBackend('ibm_pittsburgh')>,
<IBMBackend('ibm_boston')>,
<IBMBackend('ibm_fez')>,
<IBMBackend('ibm_miami')>,
<IBMBackend('ibm_marrakesh')>,
<IBMBackend('ibm_torino')>,
<IBMBackend('ibm_kingston')>]
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:
service.backend("ibm_fez")
<IBMBackend('ibm_fez')>
Filter backends
You can also filter the available backends by their properties. For more general filters, set the filters argument to a function that accepts a backend object and returns True if it meets your criteria. Refer to the API documentation for more details.
The following code returns only backends that fit these criteria and are available to you on your currently selected instance:
- Are real quantum devices (
simulator=False) - Are currently operational (
operational=True) - Have at least 5 qubits (
min_num_qubits=5)
# Optionally pass in an instance, region, or both, to
# further filter the backends.
service = QiskitRuntimeService()
service.backends(simulator=False, operational=True, min_num_qubits=5)
[<IBMBackend('ibm_pittsburgh')>,
<IBMBackend('ibm_boston')>,
<IBMBackend('ibm_fez')>,
<IBMBackend('ibm_miami')>,
<IBMBackend('ibm_marrakesh')>,
<IBMBackend('ibm_torino')>,
<IBMBackend('ibm_kingston')>]
Use these keyword arguments to filter by any attribute in backend configuration (JSON schema) or status (JSON schema). 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:
service.least_busy(operational=True, min_num_qubits=5)
<IBMBackend('ibm_torino')>
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.
backend = service.backend("ibm_fez")
print(
f"Name: {backend.name}\n"
f"Version: {backend.version}\n"
f"No. of qubits: {backend.num_qubits}\n"
)
Name: ibm_fez
Version: 2
No. of qubits: 156
For a full list of attributes, see the IBMBackend API documentation.
Native gates and operations
Each processor family has a native gate set. By default, the QPUs in each family only support running the gates and operations in the native gate set. Thus, every gate in the circuit must be translated (by the transpiler) to the elements of this set.
You can view the native gates and operations for a QPU either with Qiskit, or on the IBM Quantum® Platform Compute resources page.
from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService()
for backend in service.backends():
config = backend.configuration()
if "simulator" in config.backend_name:
continue
print(f"Backend: {config.backend_name}")
print(f" Processor type: {config.processor_type}")
print(f" Supported instructions:")
for instruction in config.supported_instructions:
print(f" {instruction}")
print()
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.properties().qubit_property() returns information about the qubits' physical attributes. It contains a dictionary of various properties of the qubit, each paired with its value and the timestamp of the last calibration.
-
T1 (Relaxation Time): The T1 time represents the average duration a qubit remains in its excited state