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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qhub_service-1.9.0rc1.tar.gz (74.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qhub_service-1.9.0rc1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file qhub_service-1.9.0rc1.tar.gz.

File metadata

  • Download URL: qhub_service-1.9.0rc1.tar.gz
  • Upload date:
  • Size: 74.6 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for qhub_service-1.9.0rc1.tar.gz
Algorithm Hash digest
SHA256 9c034432e54bad7c7b389e11914e681e6481c2d6f8aaa8de51a2ed4ee65c35e9
MD5 d73f022db78d49cee6b02a294c3205b0
BLAKE2b-256 589a94339c660ec0247b358cafcfcc7a53857be43637217c954406fae6a3de09

See more details on using hashes here.

File details

Details for the file qhub_service-1.9.0rc1-py3-none-any.whl.

File metadata

  • Download URL: qhub_service-1.9.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for qhub_service-1.9.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 606fe57ac4caed107c848e7558c54399a72a1d0be6f9a8e93dc5a60b33944837
MD5 13df96a21840a9565276b473dff8941c
BLAKE2b-256 64c568507b5c0b70c7d0295f27a12d2d159f1aa17d18fc0b1d08f028b0fa8120

See more details on using hashes here.

Release history Release notifications | RSS feed

1.9.0

2 files

This release

1.9.0rc1 This release

2 files

1.8.2

2 files

1.8.1

2 files

1.7.0

2 files

1.6.2

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.2

2 files

1.2.1

2 files

1.1.1

2 files

1.1.0

2 files

1.0.8

2 files

1.0.7

2 files

1.0.5

2 files

1.0.2

2 files

1.0.1

2 files

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