Skip to content

Python SDK Overview

The Open Quantum Python SDK provides programmatic access to the platform. It consists of a core package and two optional framework plugins:

Package Install Use case
Core SDK pip install openquantum-sdk Submit QASM files directly, manage jobs and backends
Qiskit Plugin pip install "openquantum-sdk[qiskit]" Use Open Quantum backends with Qiskit's BackendV2, SamplerV2, EstimatorV2
PennyLane Plugin pip install "openquantum-sdk[pennylane]" Use Open Quantum as a PennyLane device

The plugins include the Core SDK automatically. See the Qiskit Plugin and PennyLane Plugin sections for framework-specific documentation.

New to the SDK? Start with Installation, then Authentication, then the Quick Start.


Core SDK

The openquantum-sdk package provides direct Python access to the Open Quantum platform. It includes two main clients and a high-level job submission interface.

What the Core SDK Provides

Component Description
SchedulerClient Submit jobs, poll status, download results, cancel jobs
ManagementClient List backends, list providers, discover organizations
JobSubmissionConfig High-level configuration for one-call job submission
ClientCredentialsAuth OAuth2 authentication with automatic token refresh

Basic Flow

The typical workflow with the Core SDK is:

  1. Set up authentication
  2. Create a client
  3. Submit a job
  4. Download results
from openquantum_sdk.auth import ClientCredentials, ClientCredentialsAuth
from openquantum_sdk.clients import SchedulerClient, JobSubmissionConfig

# 1. Set up auth
auth = ClientCredentialsAuth(
    creds=ClientCredentials(
        client_id="s_your_client_id",
        client_secret="your_client_secret",
    ),
)

# 2. Create client
scheduler = SchedulerClient(auth=auth)

# 3. Submit a job
config = JobSubmissionConfig(
    backend_class_id="ionq:forte-1",
    name="My Quantum Job",
    job_subcategory_id="oth:oth",
    shots=1024,
)
job = scheduler.submit_job(config, file_path="circuit.qasm")

# 4. Download results
output = scheduler.download_job_output(job)
print(output)

scheduler.close()

SchedulerClient

SchedulerClient handles the full job lifecycle.

from openquantum_sdk.clients import SchedulerClient

scheduler = SchedulerClient(auth=auth)

Key methods:

Method Description
submit_job(config, file_path=..., file_content=...) High-level: upload, prepare, submit, and wait for completion
upload_job_input(file_path=..., file_content=...) Upload a QASM file, returns an upload ID
prepare_job(preparation) Start job preparation (validation + pricing)
get_preparation_result(preparation_id) Poll preparation status and get the pricing quote
create_job(job) Submit a prepared job for execution
get_job(job_id) Check job status
cancel_job(job_id) Cancel a pending job
list_jobs(organization_id=...) List jobs for an organization
get_job_categories(limit=..., cursor=...) List job categories
get_job_subcategories(category_id, limit=..., cursor=...) List subcategories for a category
download_job_output(job) Download and parse job results as JSON
close() Close the underlying HTTP session

ManagementClient

ManagementClient handles backend discovery and platform administration.

from openquantum_sdk.clients import ManagementClient

management = ManagementClient(auth=auth)

Key methods:

Method Description
list_backend_classes(limit=..., cursor=..., provider_id=...) List available backends
list_providers(limit=..., cursor=...) List hardware providers
list_user_organizations(limit=..., cursor=...) List organizations the user belongs to
close() Close the underlying HTTP session

Note

SchedulerClient automatically creates a ManagementClient internally for organization auto-discovery. You only need to create one explicitly if you want to browse backends or providers directly.

Next Steps