Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Kipu Quantum Hub Service SDK

Installation

The package is published on PyPI and can be installed via pip:

pip install --upgrade qhub-service

Usage

import os
from qhub.service.client import HubServiceClient

service_endpoint = "..."
access_key_id = "..."
secret_access_key = "..."

# Create a new HubServiceClient instance
client = HubServiceClient(service_endpoint, access_key_id, secret_access_key)

# Start a new service execution
service_execution = client.run(request={"values": [2], "shots": 100})

# Wait for the service execution to finish (blocking)
service_execution.wait_for_final_state()

status = service_execution.status
ended_at = service_execution.ended_at
print(f"Service execution finished at '{ended_at}' with status '{status}'")

# Use the client to retrieve a service execution by its ID
service_execution = client.get_service_execution("0030737b-35cb-46a8-88c2-f59d4885484d")

# Get the results of the service execution
result = service_execution.result()

# Get the logs of the service execution
logs = service_execution.logs()

# List the result files
files = service_execution.result_files()

# Download a result file
service_execution.download_result_file(files[0], os.getcwd())

Data Pool Access Grants

Service executions that read from or write to data pools require a short-lived JWT grant. The client can acquire these grants automatically by calling the Hub Platform API on your behalf.

Credentials and the active organization are resolved via the standard DefaultCredentialsProvider and ContextResolver. If you are already logged in through the qhubctl CLI, no parameters need to be supplied (the HubServiceClient constructs its HubPlatformClient automatically):

from qhub.service.client import HubServiceClient
from qhub.service.datapool import DataPoolGrant, DataPoolPermission

client = HubServiceClient(service_endpoint, access_key_id, secret_access_key)

To override the resolved credentials or organization, pass an explicit HubPlatformClient:

from qhub.service.client import HubServiceClient, HubPlatformClient
from qhub.service.datapool import DataPoolGrant, DataPoolPermission

platform_client = HubPlatformClient(api_key="...", organization_id="...")
client = HubServiceClient(service_endpoint, access_key_id, secret_access_key, platform_client=platform_client)

grants = [
    DataPoolGrant(
        name="input_data",
        datapool_id="dp-abc123",
        application_id="app-xyz789",
        permission=DataPoolPermission.VIEW,
    ),
    DataPoolGrant(
        name="output_data",
        datapool_id="dp-def456",
        application_id="app-xyz789",
        permission=DataPoolPermission.MODIFY,
    ),
]

service_execution = client.run(request={"shots": 100}, grants=grants)

For each grant, the client injects a DataPoolReference (with the issued JWT) into the request under the supplied name. Grants are cached per (datapool_id, application_id, permission) until shortly before the JWT expires.

License

Apache-2.0 | Copyright 2026-now Kipu Quantum GmbH

Metadata

Release files for qhub-service 2.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qhub-service 2.0.0rc1
File Size Uploaded
qhub_service-2.0.0rc1.tar.gz 50.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qhub-service 2.0.0rc1
File Interpreter ABI Platform
qhub_service-2.0.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 65.6 kB

Release files / qhub_service-2.0.0rc1.tar.gz

Download URL qhub_service-2.0.0rc1.tar.gz
Size 50.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c36e10e95d7eab1ce8977ef4cdf62a3b3c20758e14c3f2d0c77e84867ff0f360
BLAKE2b-256 checksum
How to use checksums
f3363c15a1854f05e8f4cfe67e8663ee35fc6047d8379b7975b11b17ee8c238a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qhub_service-2.0.0rc1-py3-none-any.whl

Download URL qhub_service-2.0.0rc1-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d40b65711a9eae3c57a82f1541bfa7fef50584f2b30e45fcf8e50611fee5382
BLAKE2b-256 checksum
How to use checksums
f6a68c27e2d3155af59679f51a2b717cbf523f0dab5326bc0425d7c6f21ea8d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.33 {"installer":{"name":"uv","version":"0.11.33","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page