//! Measure again the decoder points the resource estimate calibrates its //! code model from (`engine::estimate::calibration::POINTS`): the rotated //! surface-code memory experiment, `d` rounds, every noise knob at `p`, //! sampled once per point and decoded by exact matching and by union-find on //! the same shots. Prints each point in the table's form. //! //! ```text //! cargo run --release --example estimate_calibration --features full //! ``` use wai_quantum::engine::estimate::calibration::{POINTS, SEED}; use wai_quantum::quantum_frame::{error_model, parse, sample, surface_code_memory}; use wai_quantum::quantum_match::MatchingGraph; use wai_quantum::quantum_uf::UnionFind; fn main() { let mut same = true; for q in &POINTS { let c = parse(&surface_code_memory(q.distance, q.distance, q.p)).expect("the generated circuit parses"); let g = MatchingGraph::from_model(&error_model(&c).expect("deterministic")).expect("graphlike"); let s = sample(&c, q.shots as usize, SEED); let exact = g.failures(&s).expect("decode"); let uf = UnionFind::new(&g).failures(&s).expect("decode"); let mark = if (exact, uf) == (q.exact, q.union_find) { "" } else { " // differs from the table" }; same &= mark.is_empty(); println!(" pt({}, {}, {}, {exact}, {uf}),{mark}", q.distance, q.p, q.shots); } println!("{}", if same { "every point is the table's" } else { "a point differs from the table" }); if !same { std::process::exit(1); } }