Skip to content

Backend Discovery

The Core SDK's ManagementClient provides methods to list available backends and hardware providers.

Listing Backends

from openquantum_sdk.auth import ClientCredentials, ClientCredentialsAuth
from openquantum_sdk.clients import ManagementClient

auth = ClientCredentialsAuth(
    creds=ClientCredentials(
        client_id="s_your_client_id",
        client_secret="your_client_secret",
    ),
)

management = ManagementClient(auth=auth)

result = management.list_backend_classes(limit=20)
for backend in result.backend_classes:
    print(f"{backend.short_code}: {backend.name} ({backend.type}) - {backend.status}")

Example output:

ionq:forte-1: IonQ Forte-1 (QPU) - Online
rigetti:cepheus-1: Rigetti Cepheus-1 (QPU) - Online

Backend Properties

Each BackendClassRead object has the following fields:

Property Type Description
id str Unique identifier (UUID)
name str Display name
description str Backend description
type str "QPU"
provider_id str Provider UUID
short_code str Human-readable identifier (e.g., "ionq:forte-1")
queue_depth int Number of jobs currently in the queue
accepting_jobs bool Whether the backend is accepting new jobs
status str "Online" or "Offline"

Filtering by Provider

Pass a provider_id to filter backends by hardware provider:

result = management.list_backend_classes(provider_id="ionq")
for backend in result.backend_classes:
    print(f"{backend.short_code}: {backend.name}")

Listing Providers

result = management.list_providers()
for provider in result.providers:
    print(f"{provider.short_code}: {provider.name} - {provider.description}")

Each ProviderRead object has:

Property Type Description
id str Unique identifier (UUID)
name str Provider name
description str Provider description
short_code str Provider short code

Pagination

Backend and provider listings use cursor-based pagination:

result = management.list_backend_classes(limit=10)
while result.pagination.next_cursor:
    result = management.list_backend_classes(
        limit=10,
        cursor=result.pagination.next_cursor,
    )
    for backend in result.backend_classes:
        print(backend.short_code)