Skip to main content

The Quantum Engineering Platform: statistical testing, cost and execution intelligence, provider-agnostic plugins, spend guards, and observability for quantum programs

Project description

Qontinuum

PyPI CI Python License

The Quantum Engineering Platform โ€” statistical testing, cost & execution intelligence, provider-agnostic plugins, and observability for quantum programs.

๐ŸŒ Website ยท ๐Ÿ“š Docs ยท ๐Ÿ“Š Live demo dashboard ยท ๐Ÿ“– Explainer

qont test and qont cost terminal demo

Quantum programs don't return values โ€” they return probability distributions sampled from noisy hardware. assert result == expected doesn't work, and nothing in the classical CI toolchain knows that. Qontinuum does.

  • qont test โ€” a pytest-style runner for quantum circuits with statistical assertions: total variation distance with shots-aware soundness floors, chi-squared tests, Hellinger fidelity, and snapshot baselines committed as JSON.
  • qont cost โ€” estimates what your suite would cost on real hardware across providers (IonQ, Rigetti, IQM, AQT via Braket; IBM; Azure Quantum) before you spend a cent.
  • qont route โ€” recommends hardware for your workload: estimated success probability ร— price, ranked by --optimize cost|fidelity|value.
  • qont recommend / plan / health โ€” execution intelligence: rank devices under six strategies with a plain-English explanation of every choice, produce a concrete execution plan with fallbacks, and score per-device reliability from calibration + your run history.
  • qont run --on ibm:โ€ฆ --max-cost 5 โ€” executes the suite on real hardware behind an all-or-nothing spend guard (default budget: $0 โ€” it refuses until you authorize).
  • qont ci โ€” one command for CI: run the suite, write a markdown report.
  • qont dashboard โ€” renders run history as a self-contained HTML observability dashboard (status timeline, per-check statistic trends vs thresholds).
  • qont diff / qont hash โ€” semantic, register-name-agnostic circuit diffing and content addressing.
  • GitHub Action โ€” posts a sticky PR comment with regression results and the cost table.
  • Noise-aware testing โ€” simulate against real IBM device calibration data, offline, for free.
  • Plugin ecosystem โ€” providers, simulator backends, and SDKs are plugins; Qiskit, QASM 2/3, Cirq, PennyLane, IBM, and Braket ship built in, and you can add your own via entry points without forking.

โ€ฆand that's just the core. v0.5 (public beta) is the Quantum Engineering Platform โ€” 124 commands translating the DevOps stack to quantum:

qont lint ruff for quantum tests โ€” 9 rules incl. the statistical soundness floor (Q001)
qont noise headroom load-testing for quantum โ€” how much calibration drift survives your test?
qont history bisect git-bisect for physics โ€” which run first crossed the threshold?
qont budget QPU FinOps โ€” monthly/total caps enforced before submission
qont test --cached build caching for simulation โ€” content-addressed seeded results
qont fuzz flakiness hunting โ€” empirical pass rates with Wilson intervals
qont pack reproducibility bundles โ€” verify re-runs and two-sample-compares
qont shots plan shot-count audits โ€” the napkin statistics, mechanized
qont report junit quantum checks rendered natively in Jenkins/GitLab/Buildkite
qont explain failure forensics: which outcomes drove the statistic, and why
qont recommend / plan / health execution intelligence โ€” reason about where to run: fidelity, cost, speed, reliability, with explanations
qont report engineering one engineering report โ€” recommendation, execution plan (risk + confidence), provider & cost analysis, history
qont telemetry opt-in Quantum Intelligence Network โ€” anonymous, privacy-first community intelligence, off by default
qont plugin provider-, backend-, and SDK-agnostic โ€” add hardware or SDKs via plugins, no fork
+ circuit device registry stats bench watch config env doctor init mock schedule โ€ฆ the full plumbing

Install

pip install qontinuum          # core
pip install 'qontinuum[ibm]'   # + IBM calibration noise models

Quick start

Write a quantum test in any file named q_test_*.py:

from qiskit import QuantumCircuit
from qontinuum import qtest, assert_distribution

@qtest(shots=4000)
def bell_pair():
    qc = QuantumCircuit(2)
    qc.h(0)
    qc.cx(0, 1)
    qc.measure_all()
    return qc

@bell_pair.check
def is_maximally_entangled(result):
    assert_distribution(result, {"00": 0.5, "11": 0.5}, tvd_threshold=0.05)
$ qont test
โœ“ q_test_bell.py::bell_pair  aer, 4000 shots, 30 ms
    โœ“ is_maximally_entangled

1 passed, 0 failed, 0 errors

Statistics done right

Sampling noise means even a perfect circuit never reproduces a distribution exactly. Every assertion is shots-aware: if your threshold is below what the shot count can statistically resolve, Qontinuum refuses to run a test that would be flaky by construction โ€” and tells you the shot count that would fix it:

! is_maximally_entangled  tvd_threshold=0.01 is below the sampling noise floor 0.0289
  at 4000 shots: even a perfect result would fail ~1% of the time.
  Use at least 33380 shots or raise the threshold to >= 0.0289.

Test against real hardware noise โ€” offline and free

@qtest(shots=4000, backend="ibm:manila")   # bundled real calibration snapshot
def bell_under_noise(): ...

@qtest(shots=4000, backend="ibm:brisbane@live")  # today's live calibration (free IBM account)
def bell_today(): ...

Snapshot testing for quantum

@qtest(shots=4000, snapshot=True)
def ghz_5(): ...

qont snapshot update records the distribution as a golden baseline (keyed by the circuit's content hash). Later runs are compared with a two-sample homogeneity test โ€” if the circuit changes, the snapshot is flagged stale for review, exactly like Jest.

Know the cost before you run on hardware

$ qont cost
             Estimated hardware cost โ€” 3 test(s), 12000 total shots
โ”ƒ Provider      โ”ƒ Device                โ”ƒ Est. cost โ”ƒ
โ”‚ AWS Braket    โ”‚ Rigetti Cepheus       โ”‚     $6.00 โ”‚
โ”‚ IBM Quantum   โ”‚ Heron (Pay-As-You-Go) โ”‚     $9.61 โ”‚
โ”‚ AWS Braket    โ”‚ IQM Garnet            โ”‚    $18.30 โ”‚
โ”‚ Azure Quantum โ”‚ IonQ Aria 1           โ”‚    $63.29 โ”‚
โ”‚ AWS Braket    โ”‚ IonQ Forte            โ”‚   $960.90 โ”‚
โ”‚ Azure Quantum โ”‚ Quantinuum H2         โ”‚ 137.4 HQC โ”‚

Same suite, $6 or $961, depending on where you run it. That's why this table belongs on every pull request.

Route to the right hardware

$ qont route --optimize value
โ”ƒ # โ”ƒ Provider    โ”ƒ Device          โ”ƒ Est. success/shot โ”ƒ Est. cost โ”ƒ $ / success โ”ƒ
โ”‚ 1 โ”‚ AWS Braket  โ”‚ Rigetti Cepheus โ”‚             71.0% โ”‚    $10.00 โ”‚      $14.08 โ”‚
โ”‚ 2 โ”‚ IBM Quantum โ”‚ Heron (PAYG)    โ”‚             93.3% โ”‚    $16.01 โ”‚      $17.17 โ”‚

Cheap-but-noisy vs pricey-but-clean, resolved with one number.

Run on real hardware โ€” without surprise bills

qont run --on ibm:ibm_brisbane --dry-run --max-cost 5    # estimate only
qont run --on braket:rigetti_cepheus --max-cost 5        # refuses if estimate > $5

The guard is all-or-nothing: the whole suite is priced before the first shot is submitted, and the default budget is $0.

Watch your suite over time

Every run appends to .qontinuum/history.jsonl; qont dashboard turns it into a single-file HTML dashboard โ€” status timeline, each check's statistic trending against its threshold, cost per run. No server, no JavaScript, works as a CI artifact.

Diff circuits, not files

$ qont diff old.qasm new.qasm
- cx q[0, 1]
+ cx q[1, 0]
1 ops added, 1 removed

Register renames and formatting don't show up โ€” only semantic changes do (the same canonicalization that powers snapshot staleness detection).

GitHub Action

# .github/workflows/quantum.yml
on: pull_request
permissions:
  contents: read
  pull-requests: write
jobs:
  quantum:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: XTanishkX/quantum/action@main
        with:
          path: .
          seed: "42"

Every PR gets one sticky comment (updated in place) with pass/fail per check and the hardware cost table โ€” see a live one on PR #1.

Assertions

Assertion What it tests
assert_distribution(result, expected, tvd_threshold=) TVD against an expected distribution, with sampling-floor soundness check
assert_chi_squared(result, expected, alpha=) Pearson goodness-of-fit
assert_fidelity(result, expected, min_fidelity=) Hellinger (classical) fidelity
assert_probability(result, outcome, min_p=, max_p=) Single-outcome probability bounds
assert_matches_baseline(result, counts, alpha=) Two-sample test vs a recorded run

License

Apache-2.0

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

qontinuum-0.5.0.tar.gz (189.9 kB view details)

Uploaded Source

Built Distribution

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

qontinuum-0.5.0-py3-none-any.whl (150.7 kB view details)

Uploaded Python 3

File details

Details for the file qontinuum-0.5.0.tar.gz.

File metadata

  • Download URL: qontinuum-0.5.0.tar.gz
  • Upload date:
  • Size: 189.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qontinuum-0.5.0.tar.gz
Algorithm Hash digest
SHA256 aa4e4498523b33ae3c7f30d5f04a838dbafb4cd1b44d6f6c73eb5794f492632b
MD5 5c0cb7ccf0de3593f9ed23f3b1df13e0
BLAKE2b-256 17b16070b6d3bfd6144e4c802a4690af1c6cc7a329582af6ad68f8b0c3e3880f

See more details on using hashes here.

Provenance

The following attestation bundles were made for qontinuum-0.5.0.tar.gz:

Publisher: release.yml on XTanishkX/quantum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qontinuum-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: qontinuum-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 150.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qontinuum-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 686bd23720aca284997e85dd737e1208d2d3b2bb74ec3b9071623e91386f5ba0
MD5 d689526085a8ef7f69c5ab8aa7dbf184
BLAKE2b-256 058bc0de8e9975dc31309eff77f697f640256bb1d3310ccb7815cd4476fee84f

See more details on using hashes here.

Provenance

The following attestation bundles were made for qontinuum-0.5.0-py3-none-any.whl:

Publisher: release.yml on XTanishkX/quantum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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