use quizx::circuit::*;
use quizx::extract::*;
use quizx::hash_graph::*;
use quizx::simplify::*;
use std::time::Instant;
use std::{thread, time};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let f = "circuits/large/gf2^64_mult.qasm";
let time = Instant::now();
println!("{}", f);
let c =
Circuit::from_file(f).unwrap_or_else(|e| panic!("circuit failed to parse: {}. {}", f, e));
println!("...done reading in {:.2?}", time.elapsed());
println!("Simplifying circuit...");
let time = Instant::now();
let mut g: Graph = c.to_graph();
full_simp(&mut g);
println!("Done simplifying in {:.2?}", time.elapsed());
println!("Extracting circuit...");
let time = Instant::now();
let result = g
.extractor()
.gflow()
.extract();
match result {
Ok(_c1) => {
println!("Done in {:.2?}", time.elapsed());
println!("extracted ok");
}
Err(ExtractError(msg, _c, _g)) => {
println!("extract failed: {}", msg);
}
}
thread::sleep(time::Duration::from_millis(100));
Ok(())
}