//! Re-run a published factoring estimate on a whole machine, and print every //! region, the clock and the totals. //! //! ```text //! cargo run --release --example arch_factoring --features quantum_arch -- [BITS] //! ``` use wai_quantum::quantum_arch::{factoring_estimate, FactoringParams, Machine, PhaseupCount}; fn main() { let bits: u32 = std::env::args().nth(1).map_or(2048, |a| a.parse().expect("modulus bits")); let params = FactoringParams::published(bits).expect("one of 1024, 1536, 2048, 3072, 4096, 6144, 8192"); let machine = Machine::published(); let e = factoring_estimate(¶ms, &machine).expect("estimate"); println!("modulus bits {bits}"); println!("logical qubits {} cold + {} hot (peak {})", e.cold_logical, e.hot_logical, params.peak_logical_qubits()); println!("hot distance {}", e.hot_distance); for (b, k) in &e.cold.blocks { println!("cold block {k} × {}×{} grid at d={} ({} logical, {:.2} qubits each)", b.rows - 1, b.cols - 1, b.distance, b.logical, b.qubits_per_logical()); } println!("physical qubits {} cold + {} hot + {} compute = {}", e.cold_qubits, e.hot_qubits, e.compute_qubits, e.physical_qubits()); println!("T state d1={} error {:.2e} at {:.0} qubit·rounds", e.t_state.d1, e.t_state.error, e.t_state.volume); println!("CCZ {:.1} rounds per factory, error {:.1e}", e.ccz_rounds, e.ccz_error); println!("clock step {:.1} µs ({:?}-bound)", e.timing.step_us(), e.timing.bound()); println!("toffolis per shot {:.4e} (source rule {:.4e}, as stated {:.4e})", e.toffolis_per_shot, params.toffolis_per_shot_source_rule(PhaseupCount::AsCoded), params.toffolis_per_shot_source_rule(PhaseupCount::AsStated)); println!("hours per shot {:.3} at the clock, {:.3} at whole milliseconds", e.hours_per_shot, e.hours_per_shot_rounded); println!("shots {:.3} expected, survival {:.4}", e.expected_shots, e.shot_survival); println!("days {:.3}", e.days); }