qiskit-documentation/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.least_b...

35 lines
1.2 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_ibm_provider.least_busy
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit_ibm_provider.least_busy
---
<span id="least-busy" />
# least\_busy
<Function id="qiskit_ibm_provider.least_busy" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit-ibm-provider/tree/stable/0.11/qiskit_ibm_provider/__init__.py#L115-L151" signature="least_busy(backends)">
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`](/api/qiskit/qiskit.providers.Backend "(in Qiskit v1.0)")]) The backends to choose from.
**Return type**
[`Backend`](/api/qiskit/qiskit.providers.Backend "(in Qiskit v1.0)")
**Returns**
The backend with the fewest number of pending jobs.
**Raises**
[**IBMError**](qiskit_ibm_provider.IBMError "qiskit_ibm_provider.IBMError") 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>