wai-quantum: exact gradients, deterministic optimisers, VQE, QAOA and algorithm builders, each answer checked or bounded, on every surface #555
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/quantum-variational"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A variational and algorithm library on every surface. Jobs bind their programs' parameters, gradients are exact, optimisers give the same bytes everywhere, and VQE and QAOA are held to exact answers. Phase estimation, amplitude estimation, an adder and QSVT are built as programs, each checked against a reference built from its definition, not from its gates. Every number that is a double says so and states an a priori bound on its rounding.
What it adds
Parameters (
qasm,engine::catalog)paramsgives eachinput floatandinput angleof its program a value, bound exactly before the program is read. A parameter left without one is refused (Q114,J050).paramsand sweep the others.qasm::tangentsreads a program with every gate's derivative by each parameter, carried forward through arithmetic, the built-in functions, gate definitions, broadcast and loops. What it cannot follow (a modifier, a classical variable, a condition, an index, a loop range, a subroutine, a sized type) is refused on its line (Q129).Gradients (
engine::variational)crx,cry,crzandcu's θ.arithmetic: f64,exact: false, and an a priori rounding bound for the value and for each component.Optimisers
variational::verifychecks the chain and runs the answer again to the same bytes. The answers' digests are pinned and the same on x86_64 Linux, arm64 macOS and wasm32.VQE and QAOA
quantum_vmltrains (a test holds its distribution and gradient to that module's), beside the exact ground energy by diagonalisation up to 8 qubits.Algorithm builders (
engine::algorithms)equiv::against_matrix) and one against a truth table (equiv::against_permutation).Surfaces
gradient,optimize,vqe,qaoaandbuild.run,planandsubmittake--param.verifychecks an optimisation's chain and runs any of these answers again to the same bytes.gradient_qasm,optimize_qasm,vqe_ground_state,qaoa_maxcutandbuild_algorithm, in one wording, and a job'sparamsonrun_quantum_circuit.POST /v1/gradient,/v1/optimize,/v1/vqe,/v1/qaoaand/v1/build, with OpenAPI entries.QuantumEngine.variational(op, args), its gradient the native build's pinned bytes in wasm32.wai.quantum.algorithms/1.J050(parameters),J051(gradient),J052(optimisation, VQE, QAOA),J053(builders), in a decade of their own. None was released before.docs/variational.md, every block run by the documentation check; the engine, CLI and service READMEs with their translations; the feature matrix (what a float or angle input now is); the regenerated agent docs; the changelog.wai-quantum-variational.ymlruns every test of the library by name on x86_64 and arm64 Linux, the byte pins among them, and builds each feature set without warnings. The contract requires the new schema test.Bounds
exact), random product states up to 10 (random, evidence), and the adder's truth table up to 16. A wider program's verdict isunchecked.J031and names the command that runs it on your machine.Checked
engine:: qasm::: 370 passed. The library's tests with--features full: 32 passed. The new workflow's job, replayed step by step: every named test found, three feature sets clean under-D warnings. CLI: 70 passed (bin) and every other target, with and withoutBLESS. Service: 37 passed;mcp::14 passed. wai-web nativequantum_engine::: 27 passed. CLI and service smoke passed. Breaking gate: no unacknowledged break. Repository checks: every line ok.check_schemas.py: 32 schema files, 46 and 26 tools, 43 live answers valid.check_docs.pyon each touched page: every new block passed.mcp::: 14 passed. CLI: 72 passed (bin) and every integration target. Service: 37 + 1. wai-web native: 29 passed. Engine--features full --lib: 1133 passed (engine::variational11,algorithms6,pulse7,formats24,refusal4,schema10). CLI and service smoke: every check held. Breaking gate: no unacknowledged break. Repository checks: all 10 lines ok.check_schemas.py:service-mcp.json's 29 tools valid, and 47 tool answers follow their schemas.de3fce0d3wai-conformance.yml), the receipt ledger's tariff version 3 (#550) and the route record's version 2 (#552). Those are inwai-rs'sreceipt_ledgerandroute_recordmodules,wai-ledger, their specifications and corpora, and the conformance workflow. Every changed line is main's. No crate this PR changes compiles them (wai-web's features reach neither module), so nothing was run again by hand; this PR's CI runs every leg.The rebase onto pulse and the other formats.
engine::schema::FILESfrom 22 to 23, and the rebase took that one change once, which left the array declared 23 long with 24 entries. It is declared 24 (pulse.v1.jsonandalgorithms.v1.json), and the changelog says the schemas grow from 23 to 24.GET /v1took a key for an item. The list is rebuilt from both, in the service's order.The views page. The library changes the engine inside the views page, so the page was rebuilt (
54232be73) withwai/wai-quantum-views/build.shincatthehacker/ubuntu:act-22.04with Rust 1.98.0, as the views workflow rebuilds it.Not done
unchecked.Breaking
api:rust:wai_quantum::engine::schema::FILESgrew from 23 to 24 (algorithms.v1.json). The changelog acknowledges it.🤖 Generated with Claude Code