qiskit-documentation/docs/api/qiskit-ibm-runtime/ibm-backend.mdx

606 lines
22 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: IBMBackend (latest version)
description: API reference for qiskit_ibm_runtime.IBMBackend in the latest version of qiskit-ibm-runtime
in_page_toc_min_heading_level: 1
python_api_type: class
python_api_name: qiskit_ibm_runtime.IBMBackend
---
# IBMBackend
<Class id="qiskit_ibm_runtime.IBMBackend" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L65-L599" signature="IBMBackend(configuration, service, api_client, instance=None)" modifiers="class">
Bases: [`BackendV2`](/api/qiskit/qiskit.providers.BackendV2 "(in Qiskit v1.3)")
Backend class interfacing with an IBM Quantum backend.
<Admonition title="Note" type="note">
* You should not instantiate the `IBMBackend` class directly. Instead, use the methods provided by an [`QiskitRuntimeService`](qiskit-runtime-service "qiskit_ibm_runtime.QiskitRuntimeService") instance to retrieve and handle backends.
</Admonition>
This class represents an IBM Quantum backend. Its attributes and methods provide information about the backend. For example, the [`status()`](#qiskit_ibm_runtime.IBMBackend.status "qiskit_ibm_runtime.IBMBackend.status") method returns a `BackendStatus` instance. The instance contains the `operational` and `pending_jobs` attributes, which state whether the backend is operational and also the number of jobs in the server queue for the backend, respectively:
```python
status = backend.status()
is_operational = status.operational
jobs_in_queue = status.pending_jobs
```
Here is list of attributes available on the `IBMBackend` class:
> * name: backend name.
>
> * backend\_version: backend version in the form X.Y.Z.
>
> * num\_qubits: number of qubits.
>
> * target: A [`qiskit.transpiler.Target`](/api/qiskit/qiskit.transpiler.Target "(in Qiskit v1.3)") object 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.
>
> * max\_shots: maximum number of shots supported.
>
> * 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_delay` if not specified by user and `dynamic_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
>
> * max\_circuits (int): The maximum number of experiments per job
>
> * 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 `Backend` class (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 | PulseBackendConfiguration*) Backend configuration.
* **service** ([*qiskit\_runtime\_service.QiskitRuntimeService*](qiskit-runtime-service "qiskit_ibm_runtime.qiskit_runtime_service.QiskitRuntimeService")) Instance of QiskitRuntimeService.
* **api\_client** (*RuntimeClient*) IBM client used to communicate with the server.
* **instance** (*str | None*)
## Attributes
### coupling\_map
<Attribute id="qiskit_ibm_runtime.IBMBackend.coupling_map">
Return the [`CouplingMap`](/api/qiskit/qiskit.transpiler.CouplingMap "(in Qiskit v1.3)") object
</Attribute>
### dt
<Attribute id="qiskit_ibm_runtime.IBMBackend.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 doesnt define `dt`, `None` will be returned.
</Attribute>
### dtm
<Attribute id="qiskit_ibm_runtime.IBMBackend.dtm">
Return the system time resolution of output signals
**Returns**
The output signal timestep in seconds.
**Return type**
dtm
</Attribute>
### id\_warning\_issued
<Attribute id="qiskit_ibm_runtime.IBMBackend.id_warning_issued" attributeValue="False" />
### instruction\_durations
<Attribute id="qiskit_ibm_runtime.IBMBackend.instruction_durations">
Return the [`InstructionDurations`](/api/qiskit/qiskit.transpiler.InstructionDurations "(in Qiskit v1.3)") object.
</Attribute>
### instruction\_schedule\_map
<Attribute id="qiskit_ibm_runtime.IBMBackend.instruction_schedule_map">
Return the [`InstructionScheduleMap`](/api/qiskit/qiskit.pulse.InstructionScheduleMap "(in Qiskit v1.3)") for the instructions defined in this backends target.
<Admonition title="Deprecated since version 1.3" type="danger">
The property `qiskit.providers.backend.BackendV2.instruction_schedule_map` is deprecated as of Qiskit 1.3. It will be removed in Qiskit 2.0. The entire Qiskit Pulse package is being deprecated and will be moved to the Qiskit Dynamics repository: [https://github.com/qiskit-community/qiskit-dynamics](https://github.com/qiskit-community/qiskit-dynamics). Note that once removed, `qiskit.providers.backend.BackendV2.instruction_schedule_map` will have no alternative in Qiskit.
</Admonition>
</Attribute>
### instructions
<Attribute id="qiskit_ibm_runtime.IBMBackend.instructions">
A list of Instruction tuples on the backend of the form `(instruction, (qubits)`
</Attribute>
### max\_circuits
<Attribute id="qiskit_ibm_runtime.IBMBackend.max_circuits">
The maximum number of circuits
The maximum number of circuits (or Pulse schedules) that can be run in a single job. If there is no limit this will return None.
</Attribute>
### meas\_map
<Attribute id="qiskit_ibm_runtime.IBMBackend.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
</Attribute>
### num\_qubits
<Attribute id="qiskit_ibm_runtime.IBMBackend.num_qubits">
Return the number of qubits the backend has.
</Attribute>
### operation\_names
<Attribute id="qiskit_ibm_runtime.IBMBackend.operation_names">
A list of instruction names that the backend supports.
</Attribute>
### operations
<Attribute id="qiskit_ibm_runtime.IBMBackend.operations">
A list of [`Instruction`](/api/qiskit/qiskit.circuit.Instruction "(in Qiskit v1.3)") instances that the backend supports.
</Attribute>
### options
<Attribute id="qiskit_ibm_runtime.IBMBackend.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()`](#qiskit_ibm_runtime.IBMBackend.run "qiskit_ibm_runtime.IBMBackend.run") method.
</Attribute>
### provider
<Attribute id="qiskit_ibm_runtime.IBMBackend.provider">
Return the backend Provider.
**Returns**
the Provider responsible for the backend.
**Return type**
Provider
</Attribute>
### service
<Attribute id="qiskit_ibm_runtime.IBMBackend.service">
Return the `service` object
**Returns**
instance of QiskitRuntimeService
**Return type**
service
</Attribute>
### target
<Attribute id="qiskit_ibm_runtime.IBMBackend.target">
A [`qiskit.transpiler.Target`](/api/qiskit/qiskit.transpiler.Target "(in Qiskit v1.3)") object for the backend.
**Returns**
Target
</Attribute>
### version
<Attribute id="qiskit_ibm_runtime.IBMBackend.version" attributeValue="2" />
### name
<Attribute id="qiskit_ibm_runtime.IBMBackend.name">
Name of the backend.
</Attribute>
### description
<Attribute id="qiskit_ibm_runtime.IBMBackend.description">
Optional human-readable description.
</Attribute>
### online\_date
<Attribute id="qiskit_ibm_runtime.IBMBackend.online_date">
Date that the backend came online.
</Attribute>
### backend\_version
<Attribute id="qiskit_ibm_runtime.IBMBackend.backend_version">
Version of the backend being provided. This is not the same as `BackendV2.version`, which is the version of the `Backend` abstract interface.
</Attribute>
## Methods
### \_\_call\_\_
<Function id="qiskit_ibm_runtime.IBMBackend.__call__" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L507-L509" signature="__call__()">
Call self as a function.
**Return type**
[*IBMBackend*](#qiskit_ibm_runtime.IBMBackend "qiskit_ibm_runtime.ibm_backend.IBMBackend")
</Function>
### acquire\_channel
<Function id="qiskit_ibm_runtime.IBMBackend.acquire_channel" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L481-L487" signature="acquire_channel(qubit)">
Return the acquisition channel for the given qubit.
**Returns**
The Qubit measurement acquisition line.
**Return type**
AcquireChannel
**Parameters**
**qubit** (*int*)
</Function>
### check\_faulty
<Function id="qiskit_ibm_runtime.IBMBackend.check_faulty" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L531-L563" signature="check_faulty(circuit)">
Check if the input circuit uses faulty qubits or edges.
**Parameters**
**circuit** ([*QuantumCircuit*](/api/qiskit/qiskit.circuit.QuantumCircuit "(in Qiskit v1.3)")) Circuit to check.
**Raises**
**ValueError** If an instruction operating on a faulty qubit or edge is found.
**Return type**
None
</Function>
### configuration
<Function id="qiskit_ibm_runtime.IBMBackend.configuration" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L439-L463" signature="configuration()">
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](https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/backend_configuration_schema.json).
More details about backend configuration properties can be found here [QasmBackendConfiguration](/api/qiskit/qiskit.providers.models.QasmBackendConfiguration).
**IBM backends may also include the following properties:**
* **`supported_features`: a list of strings of supported features like “qasm3” for dynamic**
circuits support.
* **`parallel_compilation`: a boolean of whether or not the backend can process multiple**
jobs at once. Parts of the classical computation will be parallelized.
**Returns**
The configuration for the backend.
**Return type**
*QasmBackendConfiguration* | *PulseBackendConfiguration*
</Function>
### control\_channel
<Function id="qiskit_ibm_runtime.IBMBackend.control_channel" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L489-L502" signature="control_channel(qubits)">
Return the secondary drive channel for the given qubit
This is typically utilized for controlling multiqubit interactions. This channel is derived from other channels.
**Parameters**
**qubits** (*Iterable\[int]*) Tuple or list of qubits of the form `(control_qubit, target_qubit)`.
**Returns**
The Qubit measurement acquisition line.
**Return type**
List\[ControlChannel]
</Function>
### defaults
<Function id="qiskit_ibm_runtime.IBMBackend.defaults" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L416-L437" signature="defaults(refresh=False)">
Return the pulse defaults for the backend.
The schema for default pulse configuration can be found in [Qiskit/ibm-quantum-schemas/default\_pulse\_configuration](https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/default_pulse_configuration_schema.json).
**Parameters**
**refresh** (*bool*) If `True`, re-query the server for the backend pulse defaults. Otherwise, return a cached version.
**Returns**
The backend pulse defaults or `None` if the backend does not support pulse.
**Return type**
*PulseDefaults* | None
</Function>
### drive\_channel
<Function id="qiskit_ibm_runtime.IBMBackend.drive_channel" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L465-L471" signature="drive_channel(qubit)">
Return the drive channel for the given qubit.
**Returns**
The Qubit drive channel
**Return type**
DriveChannel
**Parameters**
**qubit** (*int*)
</Function>
### get\_translation\_stage\_plugin
<Function id="qiskit_ibm_runtime.IBMBackend.get_translation_stage_plugin" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L595-L599" signature="get_translation_stage_plugin()">
Return the default translation stage plugin name for IBM backends.
**Return type**
str
</Function>
### measure\_channel
<Function id="qiskit_ibm_runtime.IBMBackend.measure_channel" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L473-L479" signature="measure_channel(qubit)">
Return the measure stimulus channel for the given qubit.
**Returns**
The Qubit measurement stimulus line
**Return type**
MeasureChannel
**Parameters**
**qubit** (*int*)
</Function>
### properties
<Function id="qiskit_ibm_runtime.IBMBackend.properties" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L337-L390" signature="properties(refresh=False, datetime=None)">
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](https://github.com/Qiskit/ibm-quantum-schemas/blob/main/schemas/backend_properties_schema.json).
**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 `BackendProperties` whose timestamp is closest to, but older than, the specified datetime. Note that this is only supported using `ibm_quantum` runtime.
**Returns**
The backend properties or `None` if 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
</Function>
### qubit\_properties
<Function id="qiskit_ibm_runtime.IBMBackend.qubit_properties" signature="qubit_properties(qubit)">
Return QubitProperties for a given qubit.
If there are no defined or the backend doesnt support querying these details this method does not need to be implemented.
**Parameters**
**qubit** (*int | List\[int]*) The qubit to get the `QubitProperties` object for. This can be a single integer for 1 qubit or a list of qubits and a list of `QubitProperties` objects will be returned in the same order
**Returns**
The `QubitProperties` object 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 be `None`.
**Raises**
**NotImplementedError** if the backend doesnt support querying the qubit properties
**Return type**
[*QubitProperties*](/api/qiskit/qiskit.providers.QubitProperties "(in Qiskit v1.3)") | *List*\[[*QubitProperties*](/api/qiskit/qiskit.providers.QubitProperties "(in Qiskit v1.3)")]
</Function>
### refresh
<Function id="qiskit_ibm_runtime.IBMBackend.refresh" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L325-L335" signature="refresh()">
Retrieve the newest backend configuration and refresh the current backend target.
**Return type**
None
</Function>
### run
<Function id="qiskit_ibm_runtime.IBMBackend.run" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L583-L593" signature="run(*args, **kwargs)">
**Raises**
**IBMBackendError** The run() method is no longer supported.
**Return type**
None
</Function>
### set\_options
<Function id="qiskit_ibm_runtime.IBMBackend.set_options" signature="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
</Function>
### status
<Function id="qiskit_ibm_runtime.IBMBackend.status" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L392-L414" signature="status()">
Return the backend status.
<Admonition title="Note" type="note">
If the returned `BackendStatus` instance has `operational=True` but `status_msg="internal"`, then the backend is accepting jobs but not processing them.
</Admonition>
**Returns**
The status of the backend.
**Raises**
**IBMBackendApiProtocolError** If the status for the backend cannot be formatted properly.
**Return type**
*BackendStatus*
</Function>
### target\_history
<Function id="qiskit_ibm_runtime.IBMBackend.target_history" github="https://github.com/Qiskit/qiskit-ibm-runtime/tree/stable/0.36/qiskit_ibm_runtime/ibm_backend.py#L311-L323" signature="target_history(datetime=None)">
A [`qiskit.transpiler.Target`](/api/qiskit/qiskit.transpiler.Target "(in Qiskit v1.3)") object for the backend.
**Returns**
Target with properties found on datetime
**Parameters**
**datetime** (*datetime | None*)
**Return type**
[*Target*](/api/qiskit/qiskit.transpiler.Target "(in Qiskit v1.3)")
</Function>
</Class>