open-standards/wai/wai-quantum-qpu
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science e7c7b209b4
Some checks failed
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (push) Successful in 15s
WAI operation catalogue / does this change touch it (push) Successful in 28s
wai-audit collector and player integration / does this change touch it (push) Successful in 36s
wai-quantum wasmQ / does this change touch it (push) Successful in 15s
wai-quantum docs, course and locales / does this change touch it (push) Successful in 21s
wai-quantum command line / does this change touch it (push) Successful in 28s
wai-quantum for Python / does this change touch it (push) Successful in 29s
wai-quantum error correction and mitigation / does this change touch it (push) Successful in 28s
wai-quantum resource estimation / does this change touch it (push) Successful in 52s
wai-quantum for JavaScript / does this change touch it (push) Successful in 40s
wai-quantum service / does this change touch it (push) Successful in 34s
wai-quantum extension points / does this change touch it (push) Successful in 28s
wai-quantum verdicts and repairs / does this change touch it (push) Successful in 21s
wai-quantum editors / does this change touch it (push) Successful in 1m18s
wai-quantum OpenQASM reader / does this change touch it (push) Successful in 1m12s
wai-quantum contract / does this change touch it (push) Successful in 1m23s
wai-quantum studio and desktop / does this change touch it (push) Successful in 54s
wai-quantum pulse and dynamics / does this change touch it (push) Successful in 1m12s
wai-quantum other formats / does this change touch it (push) Successful in 1m17s
WAI Studio / does this change touch it (push) Successful in 18s
wai-quantum views in agent hosts / does this change touch it (push) Successful in 25s
wai-quantum variational and algorithm library / does this change touch it (push) Successful in 31s
wai-sink-android native sink library / does this change touch it (push) Successful in 19s
wai-sink-swift native sink package / does this change touch it (push) Successful in 43s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (push) Successful in 4m11s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (push) Successful in 4m14s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (push) Successful in 4m42s
wai-quantum wasmQ / the reference modules rebuild to their modules of record · linux (push) Successful in 43s
wai-quantum service / service energy · linux packages (push) Successful in 3m57s
wai-audit collector and player integration / collector, player integration and the browser end to end · macos (push) Successful in 1m27s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (push) Successful in 2m58s
wai-quantum wasmQ / interpreter and vectors under wasm32-wasip2 (wasmtime) (push) Successful in 2m11s
wai-quantum docs, course and locales / the Studio's words in every locale · linux (push) Successful in 9s
wai-quantum extension points / the registry and the example · linux-arm64 (push) Failing after 4m15s
WAI operation catalogue / the catalogue and every door · linux (push) Failing after 3m20s
wai-audit collector and player integration / collector · linux (push) Successful in 3m30s
wai-quantum wasmQ / profile, engines, reference modules, adversarial, vectors · macos (push) Successful in 2m1s
wai-quantum command line / command line · macos (push) Successful in 2m12s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (push) Successful in 3m41s
wai-quantum for Python / python · macos (push) Successful in 2m33s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (push) Successful in 4m30s
wai-quantum editors / editors · macos (push) Successful in 1m41s
wai-quantum extension points / the registry and the example · linux (push) Failing after 3m33s
wai-quantum pulse and dynamics / the same bits · macos (push) Successful in 1m23s
wai-quantum docs, course and locales / the course and the command line's languages · linux (push) Successful in 7m34s
wai-quantum extension points / the registry under wasm32-wasip2 (wasmtime) (push) Failing after 1m12s
wai-quantum wasmQ / profile, engines, reference modules, adversarial, vectors · linux (push) Successful in 9m17s
wai-quantum studio and desktop / desktop app · macos (push) Successful in 3m27s
wai-quantum verdicts and repairs / the intent set and the verdict under wasm32-wasip2 (wasmtime) (push) Successful in 1m20s
wai-quantum OpenQASM reader / corpus under wasm32-wasip2 (wasmtime) (push) Successful in 1m8s
wai-quantum contract / the policy is linked, and the deprecations page reads (push) Successful in 9s
wai-quantum verdicts and repairs / verdicts, repairs and the intent set · linux (push) Successful in 2m17s
wai-quantum service / service · macos (push) Successful in 6m13s
wai-quantum error correction and mitigation / codes, decoders, texts and mitigation · linux, release (push) Successful in 7m31s
wai-quantum OpenQASM reader / reader and corpus · linux (push) Successful in 2m12s
wai-quantum for JavaScript / javascript · linux (push) Successful in 7m6s
wai-quantum pulse and dynamics / reader, simulator and pulse jobs under wasm32-wasip2 (wasmtime) (push) Successful in 2m17s
wai-quantum editors / editors · linux (push) Successful in 4m56s
wai-quantum other formats / the set under wasm32-wasip2 (wasmtime) (push) Successful in 2m22s
wai-quantum for Python / python · linux (push) Successful in 11m30s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (push) Successful in 1m6s
wai-quantum other formats / readers, writers and the set · linux (push) Successful in 3m50s
wai-quantum pulse and dynamics / reader, simulator and pulse jobs · linux, release (push) Successful in 4m28s
wai-quantum resource estimation / estimation and calibration · linux, release (push) Successful in 11m26s
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (push) Successful in 7m3s
wai-quantum contract / API compatibility · linux (push) Successful in 6m42s
wai-quantum studio and desktop / desktop app · linux (push) Successful in 6m9s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux, release (push) Successful in 4m27s
wai-quantum contract / schemas and the committed tool lists · linux (push) Successful in 7m23s
wai-quantum service / service · linux (push) Failing after 9m49s
WAI Studio / Studio in Chromium and Firefox · macos (push) Successful in 10m52s
wai-quantum views in agent hosts / views · the page and its engine (push) Successful in 4m27s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (push) Successful in 10m46s
wai-quantum views in agent hosts / views · a scripted host (push) Successful in 8m54s
wai-quantum docs, course and locales / every command and snippet in the docs · linux (push) Successful in 27m7s
WAI Studio / Studio in WebKit · linux (push) Successful in 14m1s
wai-quantum command line / command line · linux (push) Successful in 31m36s
wai-quantum studio and desktop / studio · browser (push) Successful in 26m1s
wai-quantum studio and desktop / desktop app · windows (push) Successful in 15m1s
wai-quantum provider protocol: a billing with no price, a provider's own record of the confirmation, and the cancel of a failed job
Three gaps the first independent provider (waiQ's run endpoint) found in
wai.quantum.provider/1, each closed within the version (section 10):

- Section 5.1: describe's billing gains a third form, {"free": false,
  "priced": false}: not free, and no price set. It means an unknown cost
  everywhere: shown as unknown, run only on the person's confirmation, and
  sealed with its estimate unknown. `priced` is in that form only. The
  checker passes it and still refuses {} and {"free": false}. Billing gains
  the variant Unpriced; the conformance vectors gain `billing`, and the
  protocol's schema the third form, held to each other by a test. The
  client's own tests move from billing {} to the new form.
- Section 8.1: a provider sealing its own record of a run that is not free
  records confirmed true and cost.confirmed_by "submit": it took the
  authenticated submit as the confirmation, which it cannot see. Both
  verifiers report cost_confirmation for a confirmed_by other than "submit"
  (null included) or "submit" beside a confirmed that is not true; a host's
  receipt, with no confirmed_by, is held as before. Four crafted receipts.
- Section 5.6: a job that had already failed answers its cancel with
  failed and its reason. The checker now holds each cancel to how its job
  ended (done, failed with a reason, or unsupported); before, any answer
  passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 21:32:26 -05:00
..
conformance wai-quantum provider protocol: a billing with no price, a provider's own record of the confirmation, and the cancel of a failed job 2026-11-09 21:32:26 -05:00
schemas wai-quantum provider protocol: a billing with no price, a provider's own record of the confirmation, and the cancel of a failed job 2026-11-09 21:32:26 -05:00
src wai-quantum provider protocol: a billing with no price, a provider's own record of the confirmation, and the cancel of a failed job 2026-11-09 21:32:26 -05:00
tests wai-quantum provider protocol: a billing with no price, a provider's own record of the confirmation, and the cancel of a failed job 2026-11-09 21:32:26 -05:00
bring-your-own-quantum.md wai-quantum provider protocol: a billing with no price, a provider's own record of the confirmation, and the cancel of a failed job 2026-11-09 21:32:26 -05:00
Cargo.lock wai-quantum 0.9.0: two breaks since 0.8.1 raise its 0.y, a job is Send again, and every pin the version moves 2026-11-07 12:44:24 -05:00
Cargo.toml wai-quantum 0.9.0: two breaks since 0.8.1 raise its 0.y, a job is Send again, and every pin the version moves 2026-11-07 12:44:24 -05:00
README.md Merge wai/quantum-cloud-tasks into wai/quantum-receipt-fields 2026-11-06 03:20:16 -05:00

wai-quantum-qpu

Quantum processors as members of the wai-quantum fabric: clients for the services that run circuits on them, and the person's own providers, brought without a client written for them (Bring your own quantum).

For every circuit, a QpuSampler:

  1. reads the device's native gates and connectivity from the service;
  2. compiles the circuit to them exactly, with wai_quantum::quantum_toolchain::native, and checks the program against the circuit by simulation before anything is sent;
  3. submits it, waits for the job, and reads the counts back onto the circuit's qubits: logical qubit i is measured into classical bit i, which is bit i of the counts' index, whatever physical qubit it ended on.

A queue can outlast any wait, so job::start records a job before it is sent (ledger), and job::check, job::follow and job::cancel come back to it by its record, from any process. Running out of patience leaves the job where it is. job::run keeps no record, so it cancels what does not finish within its bound.

QpuSampler::member certifies the device statistically against the exact distribution of every circuit of a corpus, as the fabric certifies any sampler. Its certificates carry the device's provenance: silicon for a processor, a simulator for a service's simulator. Placement ranks a simulator after silicon.

Services

Module Protocol Native gates Angles on the wire
sampler_v2 Sampler V2 jobs: an IAM bearer token, one OpenQASM 3 circuit per job rz, sx, x, cz on physical qubits $p radians
prx_circuits circuit jobs of native instructions on named qubits, one measurement key per classical bit prx, cz radians
native_turns circuit jobs in a native gateset that runs as written; a simulator with device noise models gpi, gpi2, zz turns, so every dyadic angle is exact
cloud_tasks quantum tasks on your own cloud account: OpenQASM 3, a verbatim box on a processor, requests signed with your keys, results in your own bucket a processor's prx cz or gpi gpi2 zz; rz v x cz on a simulator multiples of pi, written exactly

Each module's BASE constant is the endpoint it is written against. Each client is configured from the environment (from_env) or in code. Keys and tokens are held in Secret, which never prints:

Module Variables
sampler_v2 WAI_QPU_SAMPLER_API_KEY, WAI_QPU_SAMPLER_CRN, WAI_QPU_SAMPLER_BACKEND
prx_circuits WAI_QPU_PRX_TOKEN, WAI_QPU_PRX_QC
native_turns WAI_QPU_TURNS_KEY, WAI_QPU_TURNS_BACKEND (default simulator), WAI_QPU_TURNS_NOISE
cloud_tasks the account's usual key variables, WAI_QPU_TASKS_REGION, WAI_QPU_TASKS_DEVICE, WAI_QPU_TASKS_BUCKET, WAI_QPU_TASKS_PREFIX (default wai-quantum), WAI_QPU_TASKS_BASIS (a simulator only: compile to a processor's basis)
use wai_quantum_qpu::{QpuSampler, check_probe, probe_circuit, transport::Curl};
use wai_quantum_qpu::native_turns::NativeTurns;

let sampler = QpuSampler::new(NativeTurns::from_env(Curl::new(120))?)?;
// The first job on any service: an X on qubit 0, whose counts must land on index 1.
let (counts, job) = sampler.run(&probe_circuit(3), 1000)?;
check_probe(&counts, 0.95)?;

Bring your own quantum

A device needs no client written for it here: it speaks the open provider protocol, wai.quantum.provider/1, over HTTP or as a local process, and the person lists it in their registry. Bring your own quantum is the guide.

Module What it is
open_provider the protocol's client: Http (through curl; a credential only over https or to this machine) and Process (one JSON line each way; the credential in the program's environment, never its command line), and OpenProvider, a Provider over either
reference the reference provider: the protocol around this crate's exact simulator, served over HTTP or standard input and output; the tests run against it, and it is the template to copy
conformance the checker, and its vectors in conformance/provider-v1.json with the reference's counts pinned
registry the person's list of providers (~/.config/wai/quantum-providers.json, holding no credential), and the credential stores: the keychain (the system security tool on macOS, secret-tool on Linux), else a file only its owner reads, labelled so
job the dry run (the exact compile, the check by simulation, the provider's estimate and billing unit), the refusal of a run that is not free until it is confirmed, and the seal of its counts by the engine (wai_quantum::engine::provider), labelled measured from a processor and simulated from a simulator, with the counts' source and the execution each client states from the very request it sends

Provider gains details (the protocol, the calibration snapshot, the billing), estimate, a seeded submit_seeded and cancel, each with a default, so a client that has none keeps working: its cost is then unknown, and a run on it is never taken to be free.

When a provider's describe states its calibration (errors per qubit or per pair), the description is read as a device target, and the program is placed on the qubits and routes most likely to succeed (wai_quantum::engine::targets::layout). It is still in the device's own gates and checked against the circuit before it is sent. The plan and the receipt's compiled.placement say how it was placed, with the target's hash. A description that states no errors keeps the compiler's own layout.

The command line carries it all: wai-quantum providers add|list|remove|describe|test|free|reference and wai-quantum run --provider NAME [--dry-run] [--yes] (its README).

The command

wai-qpu device  <service>                          # the device: qubits, basis, provenance
wai-qpu probe   <service> [--qubits N] [--shots N] [--yes] # the bit-order probe
wai-qpu certify <service> [--shots N] [--cases N] [--report FILE] [--yes]
wai-qpu reference --stdio | --http ADDR [device options]   # the reference provider

<service> is sampler-v2, prx-circuits, native-turns or cloud-tasks, configured from its variables above. A certification runs every circuit of the corpus in both gatesets as a job. On a device whose provenance is silicon, or one the service does not state is free, a job spends the service's quota or the person's money, so a probe and a certification there run only with --yes. --report writes each certificate with its hash, and every job, as JSON.

Transport

transport::Curl runs curl as a program, so the crate carries no TLS stack. Headers, keys and tokens included, go in a curl configuration file that only this user can read, removed when the request ends. The body goes on curl's standard input. Nothing secret appears on a command line. transport::Scripted answers from a function, for tests.

What is checked here, and what only a service can check

The tests run each client against a service that follows that provider's published contract. The fake parses the submitted program in the provider's own format, runs it on the crate's simulator, and answers in the provider's result shape and bit order. A client whose request, units or bit order departs from the contract reads back the wrong distribution, and the tests fail. A probe test shows that a service using the other bit order is caught.

A real service settles its own conventions. The first job on each should be probe_circuit, checked with check_probe, before any other result is trusted.

The open protocol is tested end to end (tests/providers.rs): every operation against the reference provider as a process and over HTTP; the conformance vectors over both, in each basis; the reference's pinned counts; the registry with its credential in a file only its owner reads (and, on macOS, the keychain in a keychain file made for the test); a run that is not free refused until it is confirmed; receipts that verify with the engine's verifier; and no credential in anything a run returns. Nothing there spends money: the priced runs are the reference's.

The work runs at the service, so every run is unmetered here. An energy figure the service reports, such as a per-job estimate, is kept in the job record as the service's figure (JobRecord::service_kwh). It is never recorded as a measurement.

Every circuit a certification runs is a job on the service, and spends that service's quota.

Versions

The open provider protocol is wai.quantum.provider/1 (the extension, section 10); its messages, program and answers are a JSON Schema, schemas/provider.v1.json, which every message the client sends and every answer the reference provider gives is held to. What is stable in this crate and the protocol, and how a change is announced: the policy; what is deprecated: the deprecations.

Licence

Apache-2.0.