wai-quantum 0.3.34: ground states of spin chains by DMRG, held to exact answers #159

Merged
dcharlot merged 1 commit from wai-quantum-dmrg into main 2026-10-05 12:53:37 -04:00
Owner

Stacked on #156 (→ #155 → #151). Merge those first; this diff then reduces to the one commit.

What

quantum_dmrg (wai-quantum 0.3.34) finds ground states of 1D spin chains by two-site DMRG and holds the results to exact answers.

  • Chains. Nearest-neighbour spin-½ chains with real terms (XXZ Heisenberg in a field, transverse-field Ising), written as matrix-product operators.
  • The solver.
    • Each two-site step finds the lowest state by Lanczos with full re-orthogonalisation.
    • It truncates using the eigenvectors of the reduced density matrix, with a maximum bond and a weight cutoff.
    • It reports the discarded weight and the entanglement entropy at every bond.
  • An in-crate symmetric eigensolver (tred2/tql2).
  • Exact referees.
    • Full diagonalisation, up to 22 sites.
    • The open transverse-field Ising chain solved as free fermions, at any length.
  • Threads. The heaviest step, applying the two-site Hamiltonian, is split by rows across threads. The result is bit-identical at any thread count.
  • CLI. wai-quantum dmrg …. Example: dmrg_chain.

Checked

  • Eigensolver. It reconstructs random symmetric matrices to 1e-12.
  • Free-fermion formula. It equals exact diagonalisation for n = 4, 7 and 10 at three couplings.
  • DMRG against exact diagonalisation. Energies agree to 1e-8 on Heisenberg and Ising chains of 10–12 sites.
  • Critical Ising chain. Error per site against the exact energy: 1.1e-11 at 100 sites, 1.4e-11 at 200 sites.
  • Heisenberg chain, 100 sites. Converges from above: −44.127739250 at bond 64, −44.127739889 at bond 128.
  • Behaviour. Variational, monotone across sweeps, repeatable.
  • Threading. A direct test of the threaded two-site Hamiltonian fails on a 1e-15 change to one block of rows.
  • Pointer-width bug found and fixed. The cross-platform pin showed the exact-diagonalisation start vector differed on wasm32: it multiplied in usize, which wraps differently there. It now uses u64. All 19 pins hold natively and under wasm32-wasip2, and CLI output is byte-identical between the two.
  • Speed. Profiling led to two changes: a configurable Lanczos tolerance (default 1e-8) and threading the effective Hamiltonian. Together they took the 100-site Heisenberg run at bond 128 from 680 s to 162 s.
  • Lint and tests. Clippy is clean; the eigensolver keeps its published index-loop form under an explicit allow. The prose checks pass. The new tests take 18 s in debug, and all 421 library tests pass.

🤖 Generated with Claude Code

Stacked on #156 (→ #155 → #151). Merge those first; this diff then reduces to the one commit. ## What `quantum_dmrg` (wai-quantum 0.3.34) finds ground states of 1D spin chains by two-site DMRG and holds the results to exact answers. - **Chains.** Nearest-neighbour spin-½ chains with real terms (XXZ Heisenberg in a field, transverse-field Ising), written as matrix-product operators. - **The solver.** - Each two-site step finds the lowest state by Lanczos with full re-orthogonalisation. - It truncates using the eigenvectors of the reduced density matrix, with a maximum bond and a weight cutoff. - It reports the discarded weight and the entanglement entropy at every bond. - **An in-crate symmetric eigensolver** (tred2/tql2). - **Exact referees.** - Full diagonalisation, up to 22 sites. - The open transverse-field Ising chain solved as free fermions, at any length. - **Threads.** The heaviest step, applying the two-site Hamiltonian, is split by rows across threads. The result is bit-identical at any thread count. - **CLI.** `wai-quantum dmrg …`. Example: `dmrg_chain`. ## Checked - **Eigensolver.** It reconstructs random symmetric matrices to 1e-12. - **Free-fermion formula.** It equals exact diagonalisation for n = 4, 7 and 10 at three couplings. - **DMRG against exact diagonalisation.** Energies agree to 1e-8 on Heisenberg and Ising chains of 10–12 sites. - **Critical Ising chain.** Error per site against the exact energy: 1.1e-11 at 100 sites, 1.4e-11 at 200 sites. - **Heisenberg chain, 100 sites.** Converges from above: −44.127739250 at bond 64, −44.127739889 at bond 128. - **Behaviour.** Variational, monotone across sweeps, repeatable. - **Threading.** A direct test of the threaded two-site Hamiltonian fails on a 1e-15 change to one block of rows. - **Pointer-width bug found and fixed.** The cross-platform pin showed the exact-diagonalisation start vector differed on wasm32: it multiplied in `usize`, which wraps differently there. It now uses `u64`. All 19 pins hold natively and under wasm32-wasip2, and CLI output is byte-identical between the two. - **Speed.** Profiling led to two changes: a configurable Lanczos tolerance (default 1e-8) and threading the effective Hamiltonian. Together they took the 100-site Heisenberg run at bond 128 from 680 s to 162 s. - **Lint and tests.** Clippy is clean; the eigensolver keeps its published index-loop form under an explicit allow. The prose checks pass. The new tests take 18 s in debug, and all 421 library tests pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wai-quantum 0.3.31: quantum-inspired optimisation, a re-runnable classical baseline
All checks were successful
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m38s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 8m58s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 4m28s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 12s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m39s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 2m11s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 23s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 42s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m14s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 3m26s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 58s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m2s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m27s
standards workspaces build + test / map-rs (pull_request) Successful in 1m56s
standards workspaces build + test / mesh-rs (pull_request) Successful in 1m11s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 3m52s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 1m44s
standards workspaces build + test / openpay (pull_request) Successful in 7m55s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 6m50s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 51s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 2m12s
standards workspaces build + test / arl-rs (pull_request) Successful in 18m6s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 44m33s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 47m38s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 1h25m12s
standards workspaces build + test / sense-rs (pull_request) Successful in 13m25s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 12m25s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 13m43s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 1m9s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 3m0s
92f9e000cd
Optimisation is the claim made most often for quantum hardware, and each such
claim is a comparison with a classical solver. quantum_qio is that solver,
deterministic and re-checkable:

- Ising problems (sparse symmetric J, fields h) and Max-Cut (J = -w), a G-set
  reader, and the +-1 all-to-all spin glass.
- Simulated bifurcation from its published update rules: symplectic Euler,
  perfectly inelastic walls, ballistic (f = Jx) and discrete (f = J sgn x)
  forces, and both heated (arXiv:2203.08361), with c0 = c1 / (rms(J) sqrt N).
  Fields ride on an extra spin fixed at +1.
- Eight trials advance per pass over the couplings; each trial's arithmetic is
  unchanged, so a batched run leaves the same final positions bit for bit as
  one trial at a time. The test fails on a 1e-15 change to one lane.
- Simulated annealing (single-spin Metropolis, linear beta), single-flip
  descent, an exact Gray-code referee up to 34 spins (threaded), and
  step-to-solution S = N_s ln 0.01 / ln(1 - P).

Checked:
- every variant and annealing reach the exact ground state on 20-spin glasses;
- G-set best-known cuts reached (seed 1): G1 11624 (39% of 2,000-step
  trials), G2 11620, G3 11622, G11 564, G14 3064 (annealing; bifurcation
  stops at 3062), G22 13359, G43 6660; G55 reaches 10292 of 10299;
- the published dense-glass step (1.1) is unstable on sparse Max-Cut graphs:
  the stiffest mode has w^2 = a0(a0 - c0 mu_min) and mu_min = -degree, so G1's
  limit is near 0.88; documented, with the settings that work.

CLI: wai-quantum qio (--gset FILE | --sk N) --method dsb|bsb|hdsb|hbsb|sa|exact
[--descend --target --spins --json]. Example: qio_gset. Pinned bit for bit
natively and under wasm32-wasip2 (16 pins); CLI output byte-identical across
the two, threaded or not, G-set files included.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum 0.3.32: union-find decoding in near-linear time
Some checks failed
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m39s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 4m28s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 12s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 2m10s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 26s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 48s
WAI energy receipts / energy receipts · linux (pull_request) Failing after 57s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m2s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m2s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 3m51s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 1m48s
standards workspaces build + test / aac-rs (pull_request) Has been cancelled
standards workspaces build + test / arl-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-code-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-ui-rs (pull_request) Has been cancelled
standards workspaces build + test / joulecontract-rs (pull_request) Has been cancelled
standards workspaces build + test / jouledesk-rs (pull_request) Has been cancelled
standards workspaces build + test / joulehook-rs (pull_request) Has been cancelled
standards workspaces build + test / map-rs (pull_request) Has been cancelled
standards workspaces build + test / mesh-rs (pull_request) Has been cancelled
standards workspaces build + test / openpay (pull_request) Has been cancelled
standards workspaces build + test / sense-rs (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backends (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · macos (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · macos (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
WAI energy receipts / energy receipts · macos (pull_request) Has been cancelled
standards workspaces build + test / jouleclaw-rs (pull_request) Has been cancelled
e76acbe9e5
A fault-tolerant machine must decode each syndrome round before the next
arrives. Exact matching (quantum_match) is the accuracy reference; quantum_uf
is the fast decoder over the same matching graph:

- Grow: every fired detector starts a cluster; odd clusters (not on the
  boundary) grow all frontier edges at once, on the graph's integer weights,
  an edge between two growing clusters at double speed.
- Merge: a filled edge joins its clusters; a cluster on the boundary stops.
- Peel: each cluster's filled edges as a spanning tree, rooted at the
  boundary when it holds it, peeled leaves-first into a correction.
- Growth is event-driven: each frontier edge carries a fill time, and a merge
  reschedules only the frontier of a side whose growth changed. Fill times
  never run backwards, so events sit in a radix heap at amortised O(1).
  Profiling put 45% of the time in a binary heap before; the radix heap
  halved the time per shot at d = 21. Time now grows linearly with fired
  detectors, about 1.1-1.5 us each from d = 9 to d = 21.
- A reusable workspace resets in time proportional to the last shot.

Checked:
- every single edge of d = 3 and d = 5 graphs is corrected exactly;
- the event-driven schedule agrees with a round-by-round one (kept in the
  tests) on 2,000 shots at each of three distances, up to tie order;
- on the same 20,000 shots, union-find fails 0.92-1.18x as often as exact
  matching (d = 3-9, p = 0.003-0.007), 77x faster at d = 11; its threshold sits
  a little lower (at p = 0.007 its failures stop falling with distance).

CLI: wai-quantum qec --decoder uf|exact. Example: uf_bench. Pinned bit for bit
natively and under wasm32-wasip2 (17 pins); CLI output byte-identical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum 0.3.33: noisy circuits, and where the digital error model is off
Some checks failed
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m40s
standards workspaces build + test / aac-rs (pull_request) Has been cancelled
standards workspaces build + test / arl-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-code-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-ui-rs (pull_request) Has been cancelled
standards workspaces build + test / joulecontract-rs (pull_request) Has been cancelled
standards workspaces build + test / jouledesk-rs (pull_request) Has been cancelled
standards workspaces build + test / joulehook-rs (pull_request) Has been cancelled
standards workspaces build + test / map-rs (pull_request) Has been cancelled
standards workspaces build + test / mesh-rs (pull_request) Has been cancelled
standards workspaces build + test / openpay (pull_request) Has been cancelled
standards workspaces build + test / sense-rs (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backends (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · macos (pull_request) Has been cancelled
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Has been cancelled
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Has been cancelled
WAI conformance / cross-arch byte-equality · macos (pull_request) Has been cancelled
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux (pull_request) Has been cancelled
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Has been cancelled
WAI energy receipts / energy receipts · macos (pull_request) Has been cancelled
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Has been cancelled
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Has been cancelled
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Has been cancelled
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Has been cancelled
standards workspaces build + test / jouleclaw-rs (pull_request) Has been cancelled
WAI conformance / cargo-class corpora · linux (pull_request) Has been cancelled
0d0211af6e
Every quantum-advantage experiment reports a fidelity measured on noisy
hardware. For random-circuit sampling that is a cross-entropy (XEB) estimate,
read against a digital error model: the product of every gate's and
readout's success probability. quantum_noisy checks that arithmetic:

- Trajectories on the state vector: after each gate, one branch of each noise
  channel on the qubits it touched. Pauli channels (depolarizing, dephasing)
  stay unitary; amplitude damping jumps with probability gamma P(1) and is
  renormalised; readout flips each measured bit. Seeded per trajectory and
  reduced in order, so a run is the same bits at any thread count.
- The exact density matrix up to 12 qubits, held as a state on 2n qubits
  (U (x) U* for a gate, the Kraus sum for a channel), on the same kernels.
- linear_xeb (sampled, with a standard error), exact_xeb (the infinite-sample
  value), ideal_xeb (the circuit's own, 1 when fully scrambling) and
  digital_fidelity.

Checked:
- 4,000 trajectories land within four standard errors of the exact
  expectations, every channel on; sampled bitstrings follow the exact
  distribution with readout flips; sampled XEB converges to the exact value.
- The digital model understates the exact (normalised) XEB of 8-qubit
  brickwork circuits by 3.5-4.5% at two-qubit error 0.005 and 7-10% at 0.01,
  and the margin does not grow over 4 to 48 layers: a fixed set of errors
  near the measurement that the model counts as fatal, not a per-gate bias.
  On a circuit that does not scramble the gap is wider (0.71 vs 0.60).

CLI: wai-quantum noisy --file CIRCUIT.jsonl [noise] [--expect] [--xeb]
[--exact] [--json]. Pinned bit for bit natively and under wasm32-wasip2 (18
pins); CLI output byte-identical, threaded or not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
wai-quantum 0.3.32: close the optimisation pin's test function
All checks were successful
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m36s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 4m28s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 13s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 2m11s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 23s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 43s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m22s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 58s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m4s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 3m52s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 1m45s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 9m19s
standards workspaces build + test / aac-rs (pull_request) Successful in 4m15s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 3m39s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 2m6s
standards workspaces build + test / map-rs (pull_request) Successful in 2m37s
standards workspaces build + test / mesh-rs (pull_request) Successful in 1m32s
standards workspaces build + test / openpay (pull_request) Successful in 6m10s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 6m46s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 44s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 2m7s
standards workspaces build + test / arl-rs (pull_request) Successful in 37m41s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 11m41s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 9m54s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 13m55s
standards workspaces build + test / sense-rs (pull_request) Successful in 5m58s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 7m6s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 9m40s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 42s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 2m55s
79dd50d20b
The restack onto 0.3.31 left tests/bit_identity.rs with an unclosed function,
so the integration tests did not compile (the linux energy-receipts job). The
fix was staged after the commit by mistake. Also trims the union-find vs exact
matching comparison to 6,000 shots per distance (about 25 s in debug).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge branch 'wai-quantum-uf' into wai-quantum-noisy
All checks were successful
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m36s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 4m29s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 14s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 2m10s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 23s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 44s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m24s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 59s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m0s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 3m53s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 1m44s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 6m4s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m14s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 3m31s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m33s
standards workspaces build + test / map-rs (pull_request) Successful in 2m2s
standards workspaces build + test / mesh-rs (pull_request) Successful in 1m57s
standards workspaces build + test / openpay (pull_request) Successful in 6m4s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 9m49s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 1m0s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 4m18s
standards workspaces build + test / arl-rs (pull_request) Successful in 2m38s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 2m34s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m31s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 4m8s
standards workspaces build + test / sense-rs (pull_request) Successful in 2m29s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 4m31s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 6m34s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 27s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 2m23s
7211402746
wai-quantum 0.3.34: ground states of spin chains by DMRG, held to exact answers
Some checks failed
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m37s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 4m28s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 12s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 2m9s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 23s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 44s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 1m26s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 58s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m0s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 3m54s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 1m50s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 12m4s
standards workspaces build + test / aac-rs (pull_request) Successful in 3m44s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 2m50s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 2m9s
standards workspaces build + test / map-rs (pull_request) Successful in 1m47s
standards workspaces build + test / mesh-rs (pull_request) Successful in 1m13s
standards workspaces build + test / openpay (pull_request) Successful in 5m39s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 9m48s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 59s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 3m34s
standards workspaces build + test / arl-rs (pull_request) Successful in 2m18s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 4m44s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m40s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 5m50s
standards workspaces build + test / sense-rs (pull_request) Successful in 2m39s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 4m32s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 7m32s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 33s
WAI energy receipts / energy receipts · macos (pull_request) Failing after 11m34s
aa64bcf112
Claims that classical computers cannot simulate a material are claims about
entanglement; in one dimension the density-matrix renormalization group
usually can, with an error it reports. quantum_dmrg:

- Chain: nearest-neighbour spin-1/2 chains with real terms (XXZ Heisenberg in
  a field, transverse-field Ising), written as matrix-product operators (the
  finite-state machine of their terms).
- Two-site DMRG: Lanczos with full re-orthogonalisation for the lowest state
  of the effective Hamiltonian; truncation by the reduced density matrix's
  eigenvectors (max bond, weight cutoff); discarded weight and the
  entanglement entropy at every bond.
- symmetric_eigen: Householder tridiagonalisation and implicit QL
  (tred2/tql2), hypotenuses in-crate.
- Exact referees: Lanczos on the full 2^n space (to 22 sites), and the open
  transverse-field Ising chain as free fermions at any length
  (E0 = -1/2 sum Lambda_k, Lambda_k^2 the eigenvalues of (A-B)(A+B)).
- The effective Hamiltonian runs in blocks of rows across threads, each row in
  the same order: bit-identical at any thread count (a direct test fails on a
  1e-15 change to one block). The Lanczos tolerance is a setting (1e-8 by
  default; the energy error goes as its square).

Checked:
- the eigensolver reconstructs random symmetric matrices to 1e-12;
- the free-fermion energy equals exact diagonalisation (n = 4, 7, 10);
- DMRG equals exact diagonalisation to 1e-8 on Heisenberg and Ising chains;
- critical Ising: 1.1e-11 per site at 100 sites, 1.4e-11 at 200 against the
  exact energy; Heisenberg 100 sites: -44.127739250 at bond 64 and
  -44.127739889 at bond 128, converging from above;
- variational, monotone in sweeps, repeatable.

The cross-platform pin caught a pointer-width bug: the exact-diagonalisation
start vector multiplied in usize, which wraps differently on wasm32; it now
uses u64, and all 19 pins hold natively and under wasm32-wasip2.

CLI: wai-quantum dmrg [--chain ising|heisenberg] [-n] [--j --jz --h] [--bond]
[--sweeps] [--exact] [--json]. Example: dmrg_chain. CLI output byte-identical
natively and under WASI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!159
No description provided.