-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Configure benchmarking, add hashing benches #67
Conversation
aborgna-q
commented
Aug 31, 2023
- Correctly configures benchmarking with criterion.
- Adds a layer-of-cnots circuit generator to bench with.
- Adds benches for the hashing code in feat: Circuit hashing and some tests #65
benches/benchmarks/generators.rs
Outdated
pub fn build_simple_circuit( | ||
num_qubits: usize, | ||
f: impl FnOnce(&mut CircuitBuilder<DFGBuilder<Hugr>>) -> Result<(), BuildError>, | ||
) -> Result<Hugr, BuildError> { | ||
let qb_row = vec![QB_T; num_qubits]; | ||
let mut h = DFGBuilder::new(FunctionType::new(qb_row.clone(), qb_row))?; | ||
|
||
let qbs = h.input_wires(); | ||
|
||
let mut circ = h.as_circuit(qbs.into_iter().collect()); | ||
|
||
f(&mut circ)?; | ||
|
||
let qbs = circ.finish(); | ||
h.finish_hugr_with_outputs(qbs) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was moved to src/utils.rs
, which I think is a good place for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it's pub(crate)
, so we cannot use it in the benchmarks.
I guess we could make it public. What do you think?
00a10de
to
a8f6ef5
Compare
Updated the hugr dependency to include CQCL/hugr#485 |
- Correctly configures benchmarking with criterion. - Adds a layer-of-cnots circuit generator to bench with. - Adds benches for the hashing code in #65