IBMBackend¶
- class IBMBackend(configuration, service, api_client, instance=None, calibration_id=None)[source]¶
Bases:
BackendV2Backend class interfacing with an IBM Quantum backend.
Note
You should not instantiate the
IBMBackendclass directly. Instead, use the methods provided by anQiskitRuntimeServiceinstance to retrieve and handle backends.
This class represents an IBM Quantum backend. Its attributes and methods provide information about the backend. For example, the
status()method returns aBackendStatusinstance. The instance contains theoperationalandpending_jobsattributes, which state whether the backend is operational and also the number of jobs in the server queue for the backend, respectively:status = backend.status() is_operational = status.operational jobs_in_queue = status.pending_jobs
Here is list of attributes available on the
IBMBackendclass:name: backend name.
backend_version: backend version in the form X.Y.Z.
num_qubits: number of qubits.
target: A
qiskit.transpiler.Targetobject for the backend.basis_gates: list of basis gates names on the backend.
gates: list of basis gates on the backend.
local: backend is local or remote.
simulator: backend is a simulator.
conditional: backend supports conditional operations.
open_pulse: backend supports open pulse.
memory: backend supports memory.
coupling_map (list): The coupling map for the device
supported_instructions (List[str]): Instructions supported by the backend.
dynamic_reprate_enabled (bool): whether delay between primitives can be set dynamically (ie via
rep_delay). Defaults to False.rep_delay_range (List[float]): 2d list defining supported range of repetition delays for backend in μs. First entry is lower end of the range, second entry is higher end of the range. Optional, but will be specified when
dynamic_reprate_enabled=True.default_rep_delay (float): Value of
rep_delayif not specified by user anddynamic_reprate_enabled=True.n_uchannels: Number of u-channels.
u_channel_lo: U-channel relationship on device los.
meas_levels: Supported measurement levels.
qubit_lo_range: Qubit lo ranges for each qubit with form (min, max) in GHz.
meas_lo_range: Measurement lo ranges for each qubit with form (min, max) in GHz.
dt: Qubit drive channel timestep in nanoseconds.
dtm: Measurement drive channel timestep in nanoseconds.
rep_times: Supported repetition times (program execution time) for backend in μs.
meas_kernels: Supported measurement kernels.
discriminators: Supported discriminators.
hamiltonian: An optional dictionary with fields characterizing the system hamiltonian.
channel_bandwidth (list): Bandwidth of all channels (qubit, measurement, and U)
acquisition_latency (list): Array of dimension n_qubits x n_registers. Latency (in units of dt) to write a measurement result from qubit n into register slot m.
conditional_latency (list): Array of dimension n_channels [d->u->m] x n_registers. Latency (in units of dt) to do a conditional operation on channel n from register slot m
meas_map (list): Grouping of measurement which are multiplexed
sample_name (str): Sample name for the backend
n_registers (int): Number of register slots available for feedback (if conditional is True)
register_map (list): An array of dimension n_qubits X n_registers that specifies whether a qubit can store a measurement in a certain register slot.
configurable (bool): True if the backend is configurable, if the backend is a simulator
credits_required (bool): True if backend requires credits to run a job.
online_date (datetime): The date that the device went online
display_name (str): Alternate name field for the backend
description (str): A description for the backend
tags (list): A list of string tags to describe the backend
version: version of
Backendclass (Ex: 1, 2)channels: An optional dictionary containing information of each channel – their purpose, type, and qubits operated on.
parametric_pulses (list): A list of pulse shapes which are supported on the backend. For example:
['gaussian', 'constant']processor_type (dict): Processor type for this backend. A dictionary of the form
{"family": <str>, "revision": <str>, segment: <str>}such as{"family": "Canary", "revision": "1.0", segment: "A"}.family: Processor family of this backend.
revision: Revision version of this processor.
segment: Segment this processor belongs to within a larger chip.
IBMBackend constructor.
- Parameters:
configuration (QasmBackendConfiguration) – Backend configuration.
service (qiskit_runtime_service.QiskitRuntimeService) – Instance of QiskitRuntimeService.
api_client (RuntimeClient) – IBM client used to communicate with the server.
calibration_id (Optional[str]) – An optional calibration id to use for this backend
instance (Optional[str])
Attributes
- calibration_id¶
The calibration id used for this backend.
- coupling_map¶
Return the
CouplingMapobject
- dt¶
Return the system time resolution of input signals
This is required to be implemented if the backend supports Pulse scheduling.
- Returns:
The input signal timestep in seconds. If the backend doesn’t define
dt,Nonewill be returned.
- dtm¶
Return the system time resolution of output signals
- Returns:
The output signal timestep in seconds.
- Return type:
dtm
- id_warning_issued = False¶
- instruction_durations¶
Return the
InstructionDurationsobject.
- instructions¶
A list of Instruction tuples on the backend of the form
(instruction, (qubits)
- max_circuits¶
This property used to return the max_experiments value from the backend configuration but this value is no longer an accurate representation of backend circuit limits. New fields will be added to indicate new limits.
- meas_map¶
Return the grouping of measurements which are multiplexed
This is required to be implemented if the backend supports Pulse scheduling.
- Returns:
The grouping of measurements which are multiplexed
- Return type:
meas_map
- num_qubits¶
Return the number of qubits the backend has.
- operation_names¶
A list of instruction names that the backend supports.
- operations¶
A list of
Instructioninstances that the backend supports.
- options¶
Return the options for the backend
The options of a backend are the dynamic parameters defining how the backend is used. These are used to control the
run()method.
- provider¶
Return the backend provider.
- Returns:
the provider responsible for the backend.
- Return type:
provider
- service¶
Return the
serviceobject- Returns:
instance of QiskitRuntimeService
- Return type:
service
- target¶
A
qiskit.transpiler.Targetobject for the backend.- Returns:
Target
- version = 2¶
- name¶
Name of the backend.
- description¶
Optional human-readable description.
- online_date¶
Date that the backend came online.
- backend_version¶
Version of the backend being provided. This is not the same as
BackendV2.version, which is the version of theBackendabstract interface.
Methods
- check_faulty(circuit)[source]¶
Check if the input circuit uses faulty qubits or edges.
- Parameters:
circuit (QuantumCircuit) – Circuit to check.
- Raises:
ValueError – If an instruction operating on a faulty qubit or edge is found.
- Return type:
None
- configuration()[source]¶
Return the backend configuration.
Backend configuration contains fixed information about the backend, such as its name, number of qubits, basis gates, coupling map, quantum volume, etc.
The schema for backend configuration can be found in Qiskit/ibm-quantum-schemas/backend_configuration.
More details about backend configuration properties can be found here QasmBackendConfiguration.
- IBM backends may also include the following properties:
supported_features: a list of strings of supported features like “qasm3” for dynamiccircuits support.
parallel_compilation: a boolean of whether or not the backend can process multiplejobs at once. Parts of the classical computation will be parallelized.
- Returns:
The configuration for the backend.
- Return type:
- get_translation_stage_plugin()[source]¶
Return the default translation stage plugin name for IBM backends.
- Return type:
str
- properties(refresh=False, datetime=None)[source]¶
Return the backend properties, subject to optional filtering.
This data describes qubits properties (such as T1 and T2), gates properties (such as gate length and error), and other general properties of the backend.
The schema for backend properties can be found in Qiskit/ibm-quantum-schemas/backend_properties.
- Parameters:
refresh (bool) – If
True, re-query the server for the backend properties. Otherwise, return a cached version.datetime (datetime | None) – By specifying datetime, this function returns an instance of the
BackendPropertieswhose timestamp is closest to, but older than, the specified datetime.
- Returns:
The backend properties or
Noneif the backend properties are not currently available.- Raises:
TypeError – If an input argument is not of the correct type.
NotImplementedError – If datetime is specified when cloud runtime is used.
- Return type:
BackendProperties | None
- qubit_properties(qubit)¶
Return QubitProperties for a given qubit.
If there are no defined or the backend doesn’t support querying these details this method does not need to be implemented.
- Parameters:
qubit (int | List[int]) – The qubit to get the
QubitPropertiesobject for. This can be a single integer for 1 qubit or a list of qubits and a list ofQubitPropertiesobjects will be returned in the same order- Returns:
The
QubitPropertiesobject for the specified qubit. If a list of qubits is provided a list will be returned. If properties are missing for a qubit this can beNone.- Raises:
NotImplementedError – if the backend doesn’t support querying the qubit properties
- Return type:
QubitProperties | List[QubitProperties]
- refresh()[source]¶
Retrieve the newest backend configuration and refresh the current backend target.
- Return type:
None
- run(*args, **kwargs)[source]¶
- Raises:
IBMBackendError – The run() method is no longer supported.
- Return type:
None
- set_options(**fields)¶
Set the options fields for the backend
This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.
- Parameters:
fields – The fields to update the options
- Raises:
AttributeError – If the field passed in is not part of the options
- status()[source]¶
Return the backend status.
Note
If the returned
BackendStatusinstance hasoperational=Truebutstatus_msg="internal", then the backend is accepting jobs but not processing them.- Returns:
The status of the backend.
- Raises:
IBMBackendApiProtocolError – If the status for the backend cannot be formatted properly.
- Return type:
- submit(program, options=None)[source]¶
Submit a quantum program for execution.
- Parameters:
program (QuantumProgram) – The program to execute.
options (ExecutorOptions | None) – Execution options.
- Returns:
A job.
- Return type:
- target_history(datetime=None)[source]¶
A
qiskit.transpiler.Targetobject for the backend.- Returns:
Target with properties found on datetime
- Parameters:
datetime (datetime | None)
- Return type: