open-standards/wai/wai-quantum-js
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science 3c4b10a261
Some checks failed
joule-moq-room room service / joule-moq-room · does this change touch it (pull_request) Successful in 7s
joule-moq-remote host agent / joule-moq-remote · does this change touch it (pull_request) Successful in 9s
joule-moq-web browser client / joule-moq-web · does this change touch it (pull_request) Successful in 8s
wai-app and Create / wai-app · does this change touch it (pull_request) Successful in 9s
joule-code conformance gate / joule-moq-relay, its own energy on a counter (macos) (pull_request) Successful in 1m3s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 1m21s
wai-quantum on every processor / emulated · aarch64-unknown-linux-gnu (pull_request) Successful in 2m30s
joule-moq-remote host agent / joule-moq-remote, every target (macos) (pull_request) Successful in 2m40s
wai-quantum on every processor / emulated · powerpc64-unknown-linux-gnu (pull_request) Successful in 4m2s
wai-quantum on every processor / emulated · armv7-unknown-linux-gnueabihf (pull_request) Successful in 4m36s
wai-app and Create / wai-app · Create, browser end-to-end (macos) (pull_request) Successful in 5m0s
wai-quantum on every processor / emulated · loongarch64-unknown-linux-gnu (pull_request) Successful in 6m58s
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 6s
joule-code conformance gate / joule-moq-relay, every target (pull_request) Successful in 7m57s
wai-quantum on every processor / emulated · powerpc64le-unknown-linux-gnu (pull_request) Successful in 8m5s
joule-code conformance gate / joule-moq-ingest, every target (pull_request) Failing after 8m16s
wai-app and Create / wai-app · tests, clippy, the line language's verifier (linux) (pull_request) Successful in 27s
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 35s
wai-quantum WebGPU member / member · DX12 and Vulkan (cbio-windows) (pull_request) Successful in 12m27s
WAI breaking changes and the conformance runner / WAI breaking · does this change touch WAI (pull_request) Successful in 40s
wai-audit collector and player integration / does this change touch it (pull_request) Successful in 53s
WAI conformance / does this change touch it (pull_request) Successful in 18s
WAI operation catalogue / does this change touch it (pull_request) Successful in 19s
WAI energy receipts / does this change touch it (pull_request) Successful in 22s
WAI examples / WAI examples · does this change touch them (pull_request) Successful in 24s
wai-quantum on every processor / emulated · riscv64gc-unknown-linux-gnu (pull_request) Successful in 8m58s
wai-fleet service / does this change touch it (pull_request) Successful in 20s
WAI JPEG-AI whole decode (pinned inputs, required) / does this change touch it (pull_request) Successful in 25s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m22s
repository checks / lockfiles, advisories, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 10m40s
wai-key-proxy / does this change touch it (pull_request) Successful in 37s
wai-ledger service / does this change touch it (pull_request) Successful in 36s
WAI neural sink gates / does this change touch it (pull_request) Successful in 25s
wai-ops-gpu integer operators on GPUs / does this change touch it (pull_request) Successful in 19s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 31s
wai-quantum on every processor / emulated · sparc64-unknown-linux-gnu (pull_request) Successful in 7m31s
wai-quantum command line / does this change touch it (pull_request) Successful in 36s
wai-quantum contract / does this change touch it (pull_request) Successful in 34s
wai-quantum CUDA member / does this change touch it (pull_request) Successful in 41s
wai-quantum docs, course and locales / does this change touch it (pull_request) Successful in 30s
wai-quantum dataflow member / does this change touch it (pull_request) Successful in 39s
WAI conformance / fast integer kernels, every x86_64 kernel set (AVX-512 silicon) (pull_request) Successful in 3m2s
wai-audit collector and player integration / collector · linux (pull_request) Successful in 1m4s
wai-quantum signal processor / does this change touch it (pull_request) Successful in 31s
wai-quantum editors / does this change touch it (pull_request) Successful in 28s
wai-quantum resource estimation / does this change touch it (pull_request) Successful in 26s
wai-audit collector and player integration / collector, player integration and the browser end to end · macos (pull_request) Successful in 2m54s
wai-quantum other formats / does this change touch it (pull_request) Successful in 28s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 4m58s
wai-quantum FPGA member / does this change touch it (pull_request) Successful in 29s
wai-quantum HIP member / does this change touch it (pull_request) Successful in 31s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 21s
wai-quantum for JavaScript / does this change touch it (pull_request) Successful in 35s
wai-quantum OpenQASM reader / does this change touch it (pull_request) Successful in 34s
wai-quantum Metal member / does this change touch it (pull_request) Successful in 33s
wai-quantum CUDA member / member · CUDA (jetson-hub) (pull_request) Successful in 1m46s
wai-quantum on every processor / emulated · s390x-unknown-linux-gnu (pull_request) Successful in 11m40s
wai-quantum CUDA member / member · CUDA (thor) (pull_request) Successful in 2m6s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 5m56s
wai-quantum HIP member / member · HIP (framework-128gb) (pull_request) Successful in 1m5s
wai-quantum neural-processor member / does this change touch it (pull_request) Successful in 34s
wai-quantum npu-cores member / does this change touch it (pull_request) Successful in 37s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 54s
wai-quantum OpenCL member / does this change touch it (pull_request) Successful in 35s
WAI breaking changes and the conformance runner / WAI breaking · wire, record and API against main · linux (pull_request) Successful in 2m3s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (jetson-hub) (pull_request) Successful in 44s
wai-quantum error correction and mitigation / does this change touch it (pull_request) Successful in 51s
wai-quantum pulse and dynamics / does this change touch it (pull_request) Successful in 51s
wai-quantum for Python / does this change touch it (pull_request) Successful in 54s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (thor) (pull_request) Successful in 57s
wai-quantum-qpu / does this change touch it (pull_request) Successful in 10s
wai-quantum extension points / does this change touch it (pull_request) Successful in 13s
wai-quantum service / does this change touch it (pull_request) Successful in 11s
WAI breaking changes and the conformance runner / WAI breaking and conform · their tests, and the independent verifiers through wai conform · linux (pull_request) Successful in 2m38s
wai-quantum on every processor / emulated · i686-unknown-linux-gnu (pull_request) Successful in 11m10s
wai-quantum matrix-extension member / does this change touch it (pull_request) Successful in 14s
wai-quantum npu-cores member / member · npu-cores, neural processor (framework-128gb silicon) (pull_request) Successful in 1m17s
wai-quantum studio and desktop / does this change touch it (pull_request) Successful in 15s
wai-quantum tensor-engine member / does this change touch it (pull_request) Successful in 14s
wai-quantum portable tensor program / does this change touch it (pull_request) Successful in 14s
wai-quantum variational and algorithm library / does this change touch it (pull_request) Successful in 14s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 31s
wai-quantum CPU vector units / does this change touch it (pull_request) Successful in 13s
wai-quantum OpenCL member / member · OpenCL GPU (framework-128gb) (pull_request) Successful in 25s
wai-quantum portable tensor program / tensor program · integrated GPU (framework-128gb) (pull_request) Successful in 14s
wai-quantum verdicts and repairs / does this change touch it (pull_request) Successful in 26s
wai-quantum views in agent hosts / does this change touch it (pull_request) Successful in 28s
wai-quantum WebGPU member / does this change touch it (pull_request) Successful in 29s
WAI conformance / faces from keypoints under wasm32-wasip2 (wasmtime) (pull_request) Successful in 2m0s
wai-quantum CPU vector units / member · vector units, avx2 and avx512 (framework-128gb silicon) (pull_request) Successful in 18s
wai-sink-android native sink library / does this change touch it (pull_request) Successful in 18s
wai-sink-swift native sink package / does this change touch it (pull_request) Successful in 27s
WAI mbt2018_mean integer decode (regenerated vectors) / does this change touch it (pull_request) Successful in 28s
WAI Studio / does this change touch it (pull_request) Successful in 23s
wai-quantum service / service energy · linux packages (pull_request) Successful in 1m47s
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Successful in 3m27s
wai-web wasm32 / does this change touch it (pull_request) Successful in 23s
wai-quantum portable tensor program / tensor program · GPUs (jetson-hub) (pull_request) Successful in 32s
wai-fleet service / service · linux (pull_request) Successful in 2m4s
wai-key-proxy / proxy · linux (pull_request) Successful in 1m11s
WAI operation catalogue / the catalogue and every door · linux (pull_request) Successful in 4m54s
wai-ledger service / service · linux (pull_request) Successful in 1m29s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 7m17s
wai-fleet service / service · macos (pull_request) Successful in 41s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m50s
wai-ledger service / service · macos (pull_request) Successful in 47s
joule-moq-remote host agent / joule-moq-remote, every target (linux-arm64) (pull_request) Successful in 3m1s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 6m43s
wai-pack / wai-pack · linux (pull_request) Successful in 2m2s
wai-quantum studio and desktop / desktop app · windows (pull_request) Successful in 9m50s
wai-quantum WebGPU member / member · integrated GPU, Vulkan (framework-128gb) (pull_request) Successful in 8m57s
WAI examples / WAI examples · the archive, the readiness check, the browser and Apple · macos (pull_request) Successful in 11m34s
wai-ops-gpu integer operators on GPUs / builds · no adapter is not a pass (linux) (pull_request) Successful in 4m34s
WAI examples / WAI examples · portable · linux (pull_request) Successful in 10m18s
wai-quantum contract / the policy is linked, and the deprecations page reads (pull_request) Successful in 5s
joule-moq-room room service / joule-moq-room, every target (pull_request) Successful in 6m3s
wai-quantum command line / command line · linux (pull_request) Successful in 3m1s
wai-quantum CUDA member / member · CUDA absent (linux) (pull_request) Successful in 1m50s
wai-pack / wai-pack · macos (pull_request) Successful in 2m27s
wai-quantum command line / command line · macos (pull_request) Successful in 1m2s
wai-quantum contract / API compatibility · linux (pull_request) Successful in 5m17s
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Successful in 28s
wai-quantum docs, course and locales / the Studio's words in every locale · linux (pull_request) Successful in 19s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 14m52s
wai-quantum docs, course and locales / the course and the command line's languages · linux (pull_request) Successful in 2m15s
joule-moq-web browser client / joule-moq-web · browser end-to-end (macos) (pull_request) Successful in 30m47s
wai-ops-gpu integer operators on GPUs / Metal GPU and browser WebGPU (macos) (pull_request) Successful in 8m3s
wai-quantum editors / editors · macos (pull_request) Successful in 1m6s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 18m34s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 1m27s
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Successful in 22s
wai-quantum contract / schemas and the committed tool lists · linux (pull_request) Successful in 6m15s
wai-quantum pulse and dynamics / the same bits · macos (pull_request) Successful in 53s
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Successful in 2m54s
wai-quantum editors / editors · linux (pull_request) Successful in 2m32s
wai-quantum resource estimation / estimation and calibration · linux, release (pull_request) Successful in 2m4s
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:b140) (pull_request) Successful in 3m54s
wai-quantum for Python / python · macos (pull_request) Successful in 1m54s
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Successful in 4m21s
wai-quantum FPGA member / member · FPGA simulation absent (linux) (pull_request) Successful in 31s
wai-quantum Metal member / member · Metal (macos) (pull_request) Successful in 2m4s
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:401e) (pull_request) Successful in 5m7s
wai-quantum-qpu / credentials in the keychain (macos) (pull_request) Successful in 31s
wai-quantum portable tensor program / tensor program · Metal and the arm64 CPU (macos) (pull_request) Successful in 22s
wai-quantum other formats / the set under wasm32-wasip2 (wasmtime) (pull_request) Successful in 2m4s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 14s
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Successful in 59s
wai-quantum OpenQASM reader / corpus under wasm32-wasip2 (wasmtime) (pull_request) Successful in 40s
wai-quantum Metal member / member · Metal absent (linux) (pull_request) Successful in 28s
wai-quantum OpenQASM reader / reader and corpus · linux (pull_request) Successful in 2m0s
wai-quantum neural-processor member / member · neural processor absent (linux) (pull_request) Successful in 21s
wai-quantum OpenCL member / member · OpenCL absent (linux) (pull_request) Successful in 25s
wai-quantum other formats / readers, writers and the set · linux (pull_request) Successful in 4m13s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m5s
wai-quantum for JavaScript / javascript · linux (pull_request) Successful in 3m18s
wai-quantum studio and desktop / desktop app · macos (pull_request) Successful in 3m45s
wai-quantum pulse and dynamics / reader, simulator and pulse jobs under wasm32-wasip2 (wasmtime) (pull_request) Successful in 1m6s
wai-quantum pulse and dynamics / reader, simulator and pulse jobs · linux, release (pull_request) Successful in 1m26s
wai-quantum WebGPU member / member · GPU, Vulkan (jetson-hub) (pull_request) Successful in 22m53s
wai-quantum error correction and mitigation / codes, decoders, texts and mitigation · linux, release (pull_request) Successful in 2m34s
wai-quantum-qpu / clients against their contracts (linux) (pull_request) Successful in 1m1s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 4m12s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 15m39s
wai-quantum WebGPU member / member · GPU, Vulkan (thor) (pull_request) Successful in 25m9s
wai-quantum for Python / python · linux (pull_request) Successful in 2m54s
wai-quantum extension points / the registry under wasm32-wasip2 (wasmtime) (pull_request) Successful in 1m15s
wai-quantum service / service · macos (pull_request) Successful in 7m10s
wai-quantum matrix-extension member / member · matrix extension, emulated (aarch64 Linux) (pull_request) Successful in 19s
wai-quantum extension points / the registry and the example · linux (pull_request) Successful in 2m53s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 30m36s
wai-quantum docs, course and locales / every command and snippet in the docs · linux (pull_request) Failing after 16m44s
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Successful in 13m54s
wai-sink-android native sink library / every ABI, the AAR, and the instrumented tests in a headless emulator · macos (pull_request) Successful in 5m29s
wai-quantum portable tensor program / tensor program · CPU, mutants, GPU builds (pull_request) Successful in 44s
wai-quantum CPU vector units / member · vector unit, rvv 1024-bit (riscv64, emulated) (pull_request) Successful in 23s
wai-quantum studio and desktop / studio · browser (pull_request) Failing after 3m5s
wai-quantum CPU vector units / member · vector unit, sve 128-bit (aarch64, emulated) (pull_request) Successful in 30s
wai-quantum CPU vector units / member · vector unit, sve 2048-bit (aarch64, emulated) (pull_request) Successful in 12s
wai-quantum service / service · linux (pull_request) Successful in 4m42s
wai-quantum CPU vector units / member · vector unit, avx2 (x86_64 silicon) (pull_request) Successful in 21s
wai-quantum CPU vector units / member · vector unit, rvv 128-bit (riscv64, emulated) (pull_request) Successful in 35s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux, release (pull_request) Successful in 1m45s
wai-quantum CPU vector units / member · vector unit, sve 512-bit (aarch64, emulated) (pull_request) Successful in 33s
wai-quantum views in agent hosts / views · the page and its engine (pull_request) Failing after 23s
wai-quantum verdicts and repairs / the intent set and the verdict under wasm32-wasip2 (wasmtime) (pull_request) Successful in 1m25s
wai-quantum verdicts and repairs / verdicts, repairs and the intent set · linux (pull_request) Successful in 1m44s
wai-quantum tensor-engine member / member · tensor engine, the kernel toolchain's simulator (linux) (pull_request) Successful in 4m57s
wai-quantum studio and desktop / desktop app · linux (pull_request) Successful in 5m46s
WAI Studio / the catalogue's actions, the unit tests and the core · linux (pull_request) Successful in 1m0s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m7s
wai-quantum views in agent hosts / views · a scripted host (pull_request) Successful in 3m42s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m47s
wai-sink-swift native sink package / libwai slices, desktop tests, simulator tests · macos (pull_request) Successful in 11m42s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 6m0s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 6m45s
WAI Studio / Studio in WebKit · linux (pull_request) Successful in 12m28s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 35m25s
WAI Studio / Studio in Chromium and Firefox · macos (pull_request) Successful in 24m56s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 3m51s
WAI conformance / each feature of the independent verifiers' steps compiles alone (pull_request) Successful in 28m3s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 3m38s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 4m37s
WAI examples / WAI examples · android-app · linux-arm64 (pull_request) Successful in 18m48s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 3m20s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 28m49s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 59s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 2m41s
wai-quantum HIP member / member · HIP absent (linux-arm64) (pull_request) Successful in 1m58s
wai-quantum npu-cores member / member · npu-cores absent (linux-arm64) (pull_request) Successful in 1m12s
wai-quantum pulse and dynamics / the same bits · linux-arm64 (pull_request) Successful in 3m21s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 13m13s
wai-quantum tensor-engine member / member · tensor engine absent (linux-arm64) (pull_request) Successful in 37s
wai-quantum variational and algorithm library / parameters, gradients, optimisers, VQE, QAOA and builders · linux-arm64, release (pull_request) Successful in 3m14s
wai-quantum extension points / the registry and the example · linux-arm64 (pull_request) Successful in 4m38s
wai-sink-android native sink library / the JNI layer and the platform-free half on the host JVM · linux-arm64 (pull_request) Successful in 5m16s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 1h59m52s
wai-quantum 0.8.0, wai-quantum-qpu 0.4.0, wai-quantum-cli 0.2.3, the job service 0.2.1 and the Python and JavaScript packages 0.1.1: the release's versions, its changelog heading, and every lock
The engine moves to its next 0.y, a major bump before 1.0 (VERSIONING.md):
two of the entries it carries change engine::schema::FILES, a public array
whose length is part of its type. wai-quantum-qpu, whose functions take the
engine's types, moves with it to 0.4.0. The command line, the job service,
the Python package and the JavaScript package only gain, so each moves its
last number. Every dependent's requirement names the new versions, both
server.json files and the JavaScript README follow, and the seventeen
lockfiles that resolve any of them move with them, each read with --locked.
The desktop app stays 0.1.0. cargo-semver-checks keeps its baselines at the
versions last published.

The engine's version is among the sealed bytes of a stamped result, so the
page's pinned digests move (the course check's 969b2c1c... to 1a9aa0ad...,
the compile's ac948133... to beffb3cb..., the estimate's 8715e76b... to
db90b147...), the answer set's stored seal is written again
(WAI_ANSWER_BUNDLE_WRITE=1), and the notebooks' stored outputs are stored
again. The job pins strip the engine and schema and do not move.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 09:15:14 -05:00
..
ci wai-quantum for JavaScript: the engine as the npm package @transaction-science/wai-quantum 0.1.0 2026-10-29 08:14:24 -04:00
test wai-quantum for JavaScript: the engine as the npm package @transaction-science/wai-quantum 0.1.0 2026-10-29 08:14:24 -04:00
build.sh wai-quantum for JavaScript: the engine as the npm package @transaction-science/wai-quantum 0.1.0 2026-10-29 08:14:24 -04:00
package.json wai-quantum 0.8.0, wai-quantum-qpu 0.4.0, wai-quantum-cli 0.2.3, the job service 0.2.1 and the Python and JavaScript packages 0.1.1: the release's versions, its changelog heading, and every lock 2026-11-01 09:15:14 -05:00
README.md wai-quantum 0.8.0, wai-quantum-qpu 0.4.0, wai-quantum-cli 0.2.3, the job service 0.2.1 and the Python and JavaScript packages 0.1.1: the release's versions, its changelog heading, and every lock 2026-11-01 09:15:14 -05:00

@transaction-science/wai-quantum

The WAI quantum job service's engine in WebAssembly, for a page or for Node. A job is planned, run and sealed here exactly as the service plans, runs and seals it. The answer is the service's JSON, signed with a key you hold, and any job's receipt, the service's included, is checked here. Programs are linted, drawn and critiqued before they run.

This is version 0.1.1 of the package. It carries the engine of wai-quantum 0.8.0, built from wai-web with its quantum_engine feature. The package keeps its own version line, as the Python package does. The module also holds the rest of wai-web's browser surface (reading WAI envelopes among it); this page is about the quantum engine.

Install

npm install @transaction-science/wai-quantum

It is an ES module with its TypeScript declarations, and has no dependencies.

In a page

init() fetches wai_quantum_bg.wasm from beside the module. With a bundler that does not serve it there, pass its URL: init({ module_or_path: url }).

import init, { QuantumEngine, engine_verify } from '@transaction-science/wai-quantum';

await init();
const engine = new QuantumEngine(crypto.getRandomValues(new Uint8Array(32)), 256);
const job = JSON.parse(engine.run(JSON.stringify({
  qasm: 'OPENQASM 3.0; qubit[2] q; bit[2] c; h q[0]; cx q[0], q[1]; c = measure q;',
  shots: 1000,
})));
console.log(job.method, job.result.counts);
console.log(JSON.parse(engine_verify(JSON.stringify(job))).valid); // true

In Node

Node is given the WebAssembly's bytes:

import init, { QuantumEngine, engine_verify } from '@transaction-science/wai-quantum';
import { readFile } from 'node:fs/promises';
import { createRequire } from 'node:module';
import { randomBytes } from 'node:crypto';

const wasm = createRequire(import.meta.url).resolve('@transaction-science/wai-quantum/wai_quantum_bg.wasm');
await init({ module_or_path: await readFile(wasm) });
const engine = new QuantumEngine(randomBytes(32), 256);
const job = JSON.parse(engine.run(JSON.stringify({ qasm: 'OPENQASM 3.0; qubit[1] q; bit[1] c; h q[0]; c = measure q;', shots: 100 })));
console.log(job.result.counts, JSON.parse(engine_verify(JSON.stringify(job))).signer);

What it offers

Requests and answers are JSON strings, the job service's own. A call that cannot be answered returns {"error": …}; a program the engine refuses also gives its diagnostic code (such as Q310) and its meaning.

new QuantumEngine(seed, memory_mb): an engine that signs with the Ed25519 key whose 32-byte seed is seed, and admits a job of at most memory_mb MiB. Keep the seed to keep the key.

  • signer_did(): the key the receipts name, as a did:key.
  • run(request): a job run and sealed. The answer holds status, method, why, request and result, with the result's receipt. The request is the service's (qasm, shots, seed, method, observables, amplitudes, noise, intent, verdict, target, compile, mitigate and more).
  • plan(request): the method a job would run on and why, its memory and work, without running it.
  • compile(request): a program compiled ({"qasm", "epsilon", "level", "basis"}), with a certificate of every pass, sealed.
  • estimate(request): what a fault-tolerant machine would need to run a program, each estimate sealed.
  • qec(op, args): error correction (code, decode or threshold), the answer sealed.
  • methods(): each method, its accuracy, and the most qubits it holds here.

Functions:

  • engine_verify(job): whether a job's receipt seals its request and result: {"valid", "key", "signer"}. Any change to either after sealing makes it false.
  • engine_verdict(job, intent, memory_mb): a job's verdict against its intent (or the one given).
  • engine_estimate_verify(answer): an estimate's seal, its receipts, and its request re-run to the same figures.
  • engine_lint(src): a program read as the engine reads it: {"ok": true, "qubits", "gates", …}, or {"ok": false, "error", "line", "code"}.
  • engine_draw(src, width): the circuit as text ({"text"}); engine_layout(src) gives it as data for a page to draw.
  • engine_critique(src): what the engine can say about a program before it runs: its measures and its smells, each with its lines.
  • engine_equivalent(a, b): whether two programs apply the same gates up to a global phase, and how that was decided.
  • engine_repair(src, options): a program repaired on the lines its diagnostics flag.
  • engine_shortcuts(src, thorough): every exact classical route to simulating a program, with its cost.
  • engine_diagnostic_codes(): every diagnostic code the reader uses, with its meaning.
  • engine_course(locale), and the course's lessons, checks and hints: the circuits course, checked by the engine.

The declarations (wai_quantum.d.ts) list every export.

A run in a page or in Node does not meter its energy, and its result says so.

Elsewhere

The same engine runs as the command line (wai-quantum), as the Python package wai-quantum, and as the job service, and a job's receipt verifies in each. The source, its schemas and the versioning policy are at https://git.transaction.science/Transaction-Science/open-standards under wai/; Quantum Studio, an editor built on this package, is at https://wai.transaction.science/quantum-studio/.

Licence

Apache-2.0.