use quizx::circuit::*;
use quizx::extract::*;
use quizx::simplify::*;
use quizx::vec_graph::*;
use std::time::Instant;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let c = Circuit::from_file("circuits/large/hwb10.qasm")?.to_basic_gates();
println!("stats before: {}", c.stats());
let mut g: Graph = c.to_graph();
println!("simplifying...");
let time = Instant::now();
clifford_simp(&mut g);
println!("Done in {:.2?}", time.elapsed());
let time = Instant::now();
println!("extracting...");
let result = g.extractor().gflow().up_to_perm().extract();
match result {
Ok(c1) => {
println!("Done in {:.2?}", time.elapsed());
println!("extracted ok");
println!("stats after: {}", c1.stats());
}
Err(ExtractError(msg, _c, _g)) => {
println!("extract failed: {}", msg);
}
}
Ok(())
}