Exemplo n.º 1
0
def filtered_backends(provider: AccountProvider, simulator: bool = False):
    if simulator:
        return provider.backends(operational=True,
                                 filters=lambda b: b.configuration().n_qubits
                                 >= 2 and b.configuration().simulator)

    return provider.backends(operational=True,
                             filters=lambda b: b.configuration().n_qubits >= 2
                             and not b.configuration().simulator)
Exemplo n.º 2
0
def most_busy_backend(provider: AccountProvider) -> IBMQBackend:
    """Return the most busy backend for the provider given.

    Return the most busy available backend for those that
    have a `pending_jobs` in their `status`. Backends such as
    local backends that do not have this are not considered.

    Args:
        provider: IBM Quantum Experience account provider.

    Returns:
        The most busy backend.
    """
    backends = provider.backends(simulator=False, operational=True)
    return max([b for b in backends if b.configuration().n_qubits >= 5],
               key=lambda b: b.status().pending_jobs)