wai-quantum 0.4.2

A deterministic quantum stack in pure Rust: byte-exact circuit simulation (statevector / stabilizer / tensor-network MPS / sparse-Pauli backends), sparse Pauli dynamics at utility scale (arbitrary angles, 1024 qubits), belief-propagation tensor networks on the hardware graph, error mitigation, qLDPC decoding, noise learning, circuit-equivalence proofs, a phasor interference-ML layer, information-theoretic limits, noisy channels and state tomography, and signed energy-accounted receipts. No QPU, no cloud, no system libraries in the default features — identical results native, in the browser, and as a WASI component at the edge; the opt-in WebGPU member reaches the platform's GPU interface.
Documentation
//! The 127-qubit heavy-hex kicked-Ising experiment, on a laptop.
//!
//! `cargo run --release --example utility --features quantum_spd -- [θ_h] [steps] [threshold]`
//!
//! Computes ⟨Z₆₂⟩ after `steps` Trotter steps of `RX(θ_h)` on every qubit and
//! `RZZ(−π/2)` on every edge of the heavy-hex map. Prints the value, the bound
//! on what truncation can have moved it, and the work done.

use std::time::Instant;
use wai_quantum::quantum_spd::{SpdConfig, expect_z, heavy_hex_127, kicked_ising};

fn main() {
    let args: Vec<f64> = std::env::args().skip(1).map(|a| a.parse().expect("a number")).collect();
    let theta_h = args.first().copied().unwrap_or(std::f64::consts::FRAC_PI_4);
    let steps = args.get(1).copied().unwrap_or(20.0) as u32;
    let threshold = args.get(2).copied().unwrap_or(1e-3);

    let circuit = kicked_ising(127, &heavy_hex_127(), theta_h, steps);
    let started = Instant::now();
    let r = expect_z(&circuit, 62, &SpdConfig { threshold, max_weight: None }).expect("a valid circuit");
    let secs = started.elapsed().as_secs_f64();

    println!("theta_h     {theta_h}");
    println!("steps       {steps}");
    println!("threshold   {threshold:e}");
    println!("<Z_62>      {:.6}", r.value);
    println!("bound       {:.3e}  (|exact - value| is at most this)", r.truncation_bound);
    println!("peak terms  {}", r.peak_terms);
    println!("updates     {}", r.term_updates);
    println!("seconds     {secs:.2}");
}