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+.

macOS heads-up

The system python3 shipped by Apple's Command Line Tools is Python 3.9.6, which qdevops-io does not support. If you see

ERROR: Could not find a version that satisfies the requirement qdevops-io (from versions: none)
ERROR: No matching distribution found for qdevops-io

…your pip3 is bound to Python 3.9, not "the package is missing." Install a modern Python via Homebrew and use a venv:

brew install python@3.12
python3.12 -m venv .venv
source .venv/bin/activate
pip install qdevops-io

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 == "succeeded":
        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.2",
)

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.2.tar.gz (11.2 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.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qdevops_io-0.1.2.tar.gz
  • Upload date:
  • Size: 11.2 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.2.tar.gz
Algorithm Hash digest
SHA256 4c03d584d3d0ae0128f568830e7d009e29ab56aeea8cdf3469c95e1828dba851
MD5 be386ce74e80b6f451212c2663b8c98d
BLAKE2b-256 45fccaa2d40538710968f3b1213b6ae56732c737936aae807c6e00b75146ded4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qdevops_io-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e63470f95556854ae4fbef3658e8eeab263191e5df2e23f0c4228256859e497
MD5 49228e00d046fcf835bdc2024427eed4
BLAKE2b-256 8aa25186a6e880010a1a6b9f5421306928058e2ac56349942d7b4711229797cb

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