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 1.9.1rc1

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 1.9.1rc1
File Size Uploaded
qhub_service-1.9.1rc1.tar.gz 74.6 kB Details

Built distribution (wheel)

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

Total release size: 89.8 kB

Release files / qhub_service-1.9.1rc1.tar.gz

Download URL qhub_service-1.9.1rc1.tar.gz
Size 74.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9f2d76a7ad99776866e815e88b390c62589c1bee00223e65367dc3a991a8a0ff
BLAKE2b-256 checksum
How to use checksums
01b3a35e6c5475e5b98c5f3507a64898e41d74a74266ec9c86ad10fdaf6ac9e0
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-1.9.1rc1-py3-none-any.whl

Download URL qhub_service-1.9.1rc1-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2700d8a07e518d285bfde6dec30a3402f59f393f7c59b21ee04ad7a2658528b6
BLAKE2b-256 checksum
How to use checksums
5a0321c3a39bab06537398f8c99eb21c14b8fe10a202810524101a41599d3058
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