qiskit-documentation/docs/api/qiskit/0.39/qiskit.providers.ibmq.least...

34 lines
1.5 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: least_busy
description: API reference for qiskit.providers.ibmq.least_busy
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.providers.ibmq.least_busy
---
# qiskit.providers.ibmq.least\_busy
<Function id="qiskit.providers.ibmq.least_busy" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-ibmq-provider/tree/stable/0.19/qiskit/providers/ibmq/__init__.py" signature="least_busy(backends, reservation_lookahead=60)">
Return the least busy backend from a list.
Return the least busy available backend for those that have a `pending_jobs` in their `status`. Note that local backends may not have this attribute.
**Parameters**
* **backends** (`List`\[[`Backend`](qiskit.providers.Backend "qiskit.providers.backend.Backend")]) The backends to choose from.
* **reservation\_lookahead** (`Optional`\[`int`]) A backend is considered unavailable if it has reservations in the next `n` minutes, where `n` is the value of `reservation_lookahead`. If `None`, reservations are not taken into consideration.
**Return type**
[`Backend`](qiskit.providers.Backend "qiskit.providers.backend.Backend")
**Returns**
The backend with the fewest number of pending jobs.
**Raises**
[**IBMQError**](qiskit.providers.ibmq.IBMQError "qiskit.providers.ibmq.IBMQError") If the backends list is empty, or if none of the backends is available, or if a backend in the list does not have the `pending_jobs` attribute in its status.
</Function>