quantum_qudit takes d = 4 (roots ±1, ±i, exact) and d = 6 (coordinates ±1/2, ±√3/2, as d = 3's) beside 2 and 3: the dimensions whose roots of unity have degree at most two. Every other dimension is refused. Each irrational constant (√3/2 and the Fourier entries 1/√2, 1/√3, 1/(2√3), 1/√6, 1/(2√6), √2/4) is the nearest multiple of 2^-30, found in whole numbers and proved nearest by a test; the module had called a floor square root "exact", and 1/√3 was a floor of a floor, 1.13 units low. The Fourier gate's entries are ω^m/√d applied with circuit2's arithmetic, so d = 2 is circuit2's H on any state and F_4 is the two-qubit QFT on every basis state; F_6 is F_2 ⊗ F_3 under the CRT relabelling. Each gate's rounding and constants are counted (gate_bound), carried to a 2-norm bound on the state (program_bound) and a total-variation bound on the outcomes (outcomes_bound); the worst measured is 0.79 of the bound. engine::qudit is the job: a program of shift, clock, fourier, csum and phase gates, measured with a seed, sealed in the receipt every job takes (wai.quantum.qudit/1; refusals J090, J091, J092; at most 2^24 amplitudes and 2^32 work, measured at 9.6 s natively and 49.9 s on wasm32). The command line runs it (wai-quantum qudit run, check, example). extensions/quantum-sim.md §9 states all of it; quantum-conformance/qudit/ holds the constants, 29 vectors and 35 refusals, the same bytes on arm64 macOS, x86_64 Linux and wasm32-wasip2 (wai-quantum-qudit.yml), with a second implementation in Python. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2.9 KiB
Qudit jobs: the conformance set
Registers of qudits of 2, 3, 4 or 6 levels and the job that runs them,
wai.quantum.qudit/1 (quantum-sim.md §9).
A conforming host reads each request, runs it and gives each answer here bit for
bit, and refuses each refusal with its code.
vectors.json holds:
| member | what |
|---|---|
limits |
the most amplitudes a register holds, gates a program holds, shots, amplitudes asked for and work a job takes (§9.7, §9.8) |
constants |
for each dimension, its roots of unity ω_d^k and its Fourier entries ω_d^m/√d as the integers they are at 2^30, and their digest (§9.2) |
vectors |
29 requests, each with the answer a conforming host gives: every member of a run's answer but engine, schema, energy and receipt, which a host adds (§9.7). Every gate and every power on every dimension; Bell pairs and both sides of the Weyl relation; F, F² and F†; programs with the bound 0; a column of every Fourier gate, each entry times an amplitude of exactly 1; the least and the largest seed; registers from one qudit to 14 qubits |
refusals |
35 requests a conforming host refuses, each with its code: J090 (does not read), J091 (a dimension with no roots held), J092 (past a limit), in the order §9.7 checks them |
results_blake3 |
BLAKE3 over each vector's request and result as compact JSON (doubles as serde_json writes them), each followed by a newline |
Who checks it
-
The engine, on every host CI runs (
wai/wai-quantum/tests/qudit_conformance.rs, in.github/workflows/wai-quantum-qudit.yml): arm64 macOS, x86_64 Linux, and wasm32-wasip2 under wasmtime, each required to write this file byte for byte.cargo test --locked --release --no-default-features --features quantum_engine,quantum_receipt --test qudit_conformance -
A second implementation, in Python, from §9's text alone (
../tools/qudit_referee.py): the constants by the text's rule in whole numbers, each gate index by index, the sampler shot by shot, the bounds in doubles, the refusals in the text's order, and the results' digest; then it moves each irrational constant by one unit and requires some vector's state to move.python3 -I wai/quantum-conformance/tools/qudit_referee.py wai/quantum-conformance
WAI_QUANTUM_BLESS=1 with the engine's test writes the file again from the cases
in the test. A change to it changes results_blake3, which the test pins.
What it does not cover
- The receipt: a qudit job is sealed as every job is, and
../receipts/holds those receipts' corpus. - The largest registers: the vectors stop at 16384 amplitudes; the limits and their refusals are here, and the measured ceiling is in §9.8.
- Noise, measurement in the middle, and any dimension but 2, 3, 4 and 6, which §9 does not state.