//! 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 = 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!(" {:.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}"); }