Skip to main content

Official Python SDK for the QDevOps quantum reproducibility platform (qdevops.io).

Project description

qdevops-io — Python SDK

Official Python client for the QDevOps quantum reproducibility platform.

The distribution name on PyPI is qdevops-io; the import path is qdevops (same convention as python-dateutildateutil).

  • Submit Bell / GHZ / QFT / Grover / VQE circuits to the simulator, IBM Quantum, or AWS Braket
  • Poll runs to completion, fetch result payloads, diff two runs
  • Export pinned environment lockfiles
  • Publish results to the public benchmark dashboard at qdevops.io/bench

Install

pip install qdevops-io

Requires Python 3.10+.

Authenticate

Mint a personal access token at qdevops.io/account/tokens, then either:

export QDEVOPS_API_TOKEN="qass_pat_..."

…or pass it explicitly:

from qdevops import Client

qd = Client(api_token="qass_pat_...")

Quickstart — run a Bell state on the simulator

from qdevops import Client

with Client() as qd:
    run = qd.submit_run(
        project_id=42,
        circuit="bell",
        backend="simulator",
        params={"shots": 2048},
    )
    print("queued", run.run_id, run.circuit_hash)

    full = qd.wait_for_run(run.run_id, timeout=120)
    if full.status == "SUCCESS":
        print("counts:", full.result.get("counts"))
    else:
        print("failed:", full.failure_reason)

Compare backends

for backend in ("simulator", "ibm", "braket"):
    run = qd.submit_run(project_id=42, circuit="bell", backend=backend)
    finished = qd.wait_for_run(run.run_id)
    print(backend, finished.result.get("expectation"))

Publish a benchmark result

Requires a token with the benchmarks:write scope.

qd.publish_benchmark(
    circuit="bell",
    backend="simulator",
    commit_sha="abc1234",
    fidelity=0.984,
    shots=2048,
    duration_ms=210,
    sdk_version="0.1.0",
)

Errors

All non-2xx responses raise a subclass of qdevops.APIError:

Exception HTTP
AuthenticationError 401
ForbiddenError 403
NotFoundError 404
ConflictError 409
APIError (generic) 4xx/5xx

Client.wait_for_run raises qdevops.errors.TimeoutError if a run does not reach a terminal state within the requested timeout.

Reference

See the OpenAPI spec at api.qdevops.io/docs.

License

Proprietary © QDevOps.io

Project details


Download files

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

Source Distribution

qdevops_io-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

qdevops_io-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file qdevops_io-0.1.0.tar.gz.

File metadata

  • Download URL: qdevops_io-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for qdevops_io-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f9dd8e6e6f39d2d9684fca6e8003e331ed242ac0a38ba3aed9639df97a82553d
MD5 8799e431618e9a2ad1ec96f836a81623
BLAKE2b-256 2e0cb7c5e02f70ac22b0e832a924bc15a83a2f67eddb2c27055082df69bbe640

See more details on using hashes here.

File details

Details for the file qdevops_io-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qdevops_io-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for qdevops_io-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30b37f055e07655021162a4e04e7b30ea58aff1ed85d010c1b1a5d2824d14806
MD5 b894c9ded2cc8de5597d381c7bf78e99
BLAKE2b-256 eff2b5c4a7f551eeba70e894da09bde1d6cf3fcff4d402554cfec3a473d51da0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page