### wai-quantum-service 0.1.0: the quantum stack as a public job service

- **What it is** (`wai/wai-quantum-service`): an HTTP job service over wai-quantum. A job is
  an OpenQASM 3 or 2 program and the outputs wanted: measurement counts, Pauli expectation
  values, or amplitudes of named bit strings, optionally under a noise model. The service
  answers with the method that ran, its accuracy, and a receipt. No account and no key.
  The public instance is at `https://wai.transaction.science/quantum-jobs/v1`.
- **The OpenQASM front end** (`src/qasm.rs`) reads:
  - registers, and broadcast over them;
  - user `gate` definitions, inlined with their parameters;
  - angle expressions;
  - the standard gate libraries;
  - every terminal-measurement form.

  Mid-circuit measurement, classical control and gate modifiers are refused, with their
  line. It lowers one circuit three ways, each exact up to a global phase: to matrix gates
  (the dense state vector, tensor networks, noise), to Pauli rotations (sparse Pauli
  dynamics) and to the dyadic gate set (the bit-exact state vector, the stabilizer tableau).
  The tests hold each lowering to the others on every gate.
- **Seven methods, and `auto`:**
  - `exact` (bit-exact, dyadic angles, 26 qubits);
  - `statevector` (exact, any angles, up to the memory a job has: 32 qubits);
  - `stabilizer` (Clifford, 32768 qubits, on the wide tableau below: counts and exact
    expectation values);
  - `pauli` (bounded, 1024 qubits, each value with its truncation bound);
  - `mps` (any angles, 4096 qubits, at bond dimension up to 256: exact when nothing is
    truncated, otherwise heuristic with its fidelity estimate and a warning below 0.9);
  - `tensor_network` (exact amplitudes, with the contraction's cost);
  - `density_matrix` (exact noise, 12 qubits);
  - `trajectories` (noise as an estimate with standard errors).

  `statevector` runs in tiled passes. `trajectories` runs every shot as a branching
  trajectory and reports how many distinct error `histories` ran. `pauli` reports a
  `ladder`: each value and bound at up to three thresholds a decade above the one asked
  for (`"ladder": false` turns it off). `auto` picks the first that takes the job, and the plan says why, and why not the others.
- **A public service on a shared host:**
  - every job is planned before it is queued, and one whose memory estimate is over the
    per-job cap is refused at once;
  - jobs run inside a total memory budget, and a large one waits until the host's free memory
    covers it and a reserve;
  - each job runs in its own child process, at a lower priority than the host's other work,
    watched for its resident memory and its time, and stopped past either;
  - clients get per-client active-job and submission limits, against a bounded queue.

  The limits are stated at `GET /v1`.
- **Receipts:** every finished result is sealed with the service's Ed25519 key over the
  BLAKE3 digest of the request and the result; `POST /v1/verify` checks one.
- **Measured:** 29 tests on Linux and macOS, and `smoke.sh` against local instances and the
  public one. That covers a 40-qubit GHZ by the stabilizer, receipts that verify while a
  changed result does not, a 100-qubit circuit's expectation values by sparse Pauli dynamics
  with their bounds and ladder, 2000 noisy shots of a 14-qubit circuit by branching
  trajectories, refusals with reasons, the per-client limit, and a job stopped when it
  outgrew its memory. CI: `wai-quantum-service` (Linux and the macOS runner).

