All checks were successful
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no comparison (pull_request) Successful in 3s
no-vanity-metrics / WAI public text names no company or product (pull_request) Successful in 3s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m57s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m26s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m16s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m17s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m46s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 3m19s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 16s
WAI conformance / independent verifiers · claims, JWP and key discovery (Python) (pull_request) Successful in 2m12s
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 1m4s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m0s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 48s
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 1m33s
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 4m34s
standards workspaces build + test / aac-rs (pull_request) Successful in 2m5s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 2m9s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 1m26s
standards workspaces build + test / map-rs (pull_request) Successful in 1m45s
standards workspaces build + test / mesh-rs (pull_request) Successful in 1m26s
standards workspaces build + test / openpay (pull_request) Successful in 6m16s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 4m24s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 43s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 1m39s
standards workspaces build + test / arl-rs (pull_request) Successful in 2m16s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 2m50s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 2m46s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 2m42s
standards workspaces build + test / sense-rs (pull_request) Successful in 2m45s
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Successful in 3m18s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 4m48s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 29s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 1m38s
quantum_bptn holds a tensor-network state on the hardware's coupling graph: one tensor per qubit, one bond per edge, in Vidal gauge. - A two-qubit gate on an edge is a simple update: QR-reduce both sides, apply the gate, SVD, keep at most χ singular values. - Expectations take each tensor's environment from its bond weights, or from belief propagation run to a fixed point on the norm network. regauge() brings the network into the belief-propagation gauge, and run_gauged() does so after every layer. - Its errors are unrelated to those of sparse Pauli dynamics, so the two can check each other on the same circuit. Measured: - On trees with no truncation it is exact: 3.7e-15 against exact sparse Pauli dynamics, and the same with belief-propagation environments. - 127-qubit heavy-hex, 5 steps, χ = 32: the exactly computed magnetization to within 3.5e-7 at θ_h = kπ/32 for k = 2, 4, 6, 8. - 127-qubit heavy-hex, 20 steps, ⟨Z62⟩: 0.9786 at θ_h = 0.2 and 0.8498 at θ_h = 0.4, the published belief-propagation values (arXiv:2306.14887) at the same angles. - At θ_h = 0.6 it approaches the published value as χ grows (0.696 at χ = 16, 0.676 at χ = 32, against 0.669). edge_layers() partitions a graph's edges into layers of vertex-disjoint edges: Δ layers on a bipartite graph (König), three on heavy-hex. kicked_ising() now applies its RZZ gates a layer at a time, as the device does. For sparse Pauli dynamics this changes no bit, because the gates are commuting exact Cliffords. A layer's gates touch disjoint tensors and bonds, so the tensor network computes them in parallel and commits them in order, bit-identical to applying them one at a time. src/linalg.rs holds the complex type, the Jacobi SVD and a Householder QR, shared with the MPS backend, whose arithmetic is unchanged. The SVD the new backend uses runs to convergence. The original's stopping rule leaves the singular vectors orthonormal only to about 1e-7. That is harmless where a backend keeps U·S·V† whole, as MPS does, and is wrong to 1e-8 where expectations assume orthonormal tensors. Its |γ| is computed from / and √: libm's hypot made the native and WASI results differ in the last bit until it went. tests/bit_identity.rs pins a tensor-network run, confirmed natively and under wasm32-wasip2. tests/utility_reference.rs holds the 5-step values by both methods. `wai-quantum utility --method bptn --chi N` runs it from the CLI, with output byte-identical natively and as a WASI component. Co-Authored-By: Claude Opus 5.5 <[email protected]>
53 lines
2.6 KiB
Rust
53 lines
2.6 KiB
Rust
//! The 127-qubit heavy-hex kicked-Ising experiment against published values.
|
||
//!
|
||
//! - The 5-step magnetization `Mz = (1/127) Σ ⟨Z_q⟩` at `θ_h = kπ/32` was
|
||
//! computed exactly and published as `exact.csv` with arXiv:2308.05077.
|
||
//! With the truncation threshold at 0 this crate reproduces `k = 1` to
|
||
//! 3.5e-7 (0.995131 against 0.995131, 357M terms); here a threshold of
|
||
//! 1e-7 keeps the test fast, and the error is checked against the bound.
|
||
//! - ⟨Z₆₂⟩ after 20 steps at `θ_h = 2π/32`: the converged classical values
|
||
//! published with the same paper (sparse Pauli dynamics, a mixed method,
|
||
//! PEPS, PEPO) span 0.9776–0.9796.
|
||
#![cfg(feature = "quantum_spd")]
|
||
|
||
use wai_quantum::quantum_spd::{Pauli, SpdConfig, expect_z, expectation, heavy_hex_127, kicked_ising};
|
||
|
||
/// The same magnetization by belief-propagation tensor networks at χ = 16, an
|
||
/// independent method: the light cone of five steps fits, and the values are
|
||
/// exact to rounding of the published six decimals.
|
||
#[cfg(feature = "quantum_bptn")]
|
||
#[test]
|
||
fn five_step_magnetization_by_tensor_networks_matches_the_exact_values() {
|
||
use wai_quantum::quantum_bptn::Tns;
|
||
let edges = heavy_hex_127();
|
||
for (k, exact) in [(2, 0.979836), (4, 0.904843)] {
|
||
let mut t = Tns::new(127, &edges, 16).unwrap();
|
||
t.run(&kicked_ising(127, &edges, theta(k), 5)).unwrap();
|
||
let mz: f64 = (0..127).map(|q| t.expect1(q, Pauli::Z).unwrap()).sum::<f64>() / 127.0;
|
||
assert!((mz - exact).abs() < 1e-6, "k = {k}: Mz = {mz} against {exact}");
|
||
}
|
||
}
|
||
|
||
fn theta(k: u32) -> f64 {
|
||
f64::from(k) * std::f64::consts::PI / 32.0
|
||
}
|
||
|
||
#[test]
|
||
fn five_step_magnetization_matches_the_exact_values() {
|
||
let mz: Vec<(f64, Vec<(u32, Pauli)>)> = (0..127).map(|q| (1.0 / 127.0, vec![(q, Pauli::Z)])).collect();
|
||
for (k, exact) in [(1, 0.995131), (2, 0.979836)] {
|
||
let c = kicked_ising(127, &heavy_hex_127(), theta(k), 5);
|
||
let r = expectation(&c, &mz, &[], &SpdConfig { threshold: 1e-7, max_weight: None }).unwrap();
|
||
let err = (r.value - exact).abs();
|
||
// The published values carry six decimals: allow their rounding.
|
||
assert!(err <= r.truncation_bound + 5e-7, "k = {k}: error {err:e} exceeds the bound {:e}", r.truncation_bound);
|
||
assert!(err < 3e-5, "k = {k}: Mz = {} against {exact}", r.value);
|
||
}
|
||
}
|
||
|
||
#[test]
|
||
fn twenty_step_z62_lies_among_the_converged_classical_values() {
|
||
let c = kicked_ising(127, &heavy_hex_127(), theta(2), 20);
|
||
let r = expect_z(&c, 62, &SpdConfig { threshold: 1e-4, max_weight: None }).unwrap();
|
||
assert!((0.9776..=0.9796).contains(&r.value), "⟨Z₆₂⟩ = {}", r.value);
|
||
}
|