Skip to content
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

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

aborgna-q
Copy link
Collaborator

@aborgna-q aborgna-q requested a review from lmondada August 31, 2023 14:23
Base automatically changed from feat/circuit-hashing to main August 31, 2023 15:59
Comment on lines 10 to 26
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)
}
Copy link
Contributor

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.

Copy link
Collaborator Author

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?

@aborgna-q aborgna-q force-pushed the feat/hashing-benchmarks branch 2 times, most recently from 00a10de to a8f6ef5 Compare September 1, 2023 15:46
@aborgna-q
Copy link
Collaborator Author

Updated the hugr dependency to include CQCL/hugr#485
(otherwise the benches failed at runtime)

@aborgna-q aborgna-q merged commit 9221885 into main Sep 1, 2023
@aborgna-q aborgna-q deleted the feat/hashing-benchmarks branch September 1, 2023 16:05
ss2165 pushed a commit that referenced this pull request Sep 4, 2023
- Correctly configures benchmarking with criterion.
- Adds a layer-of-cnots circuit generator to bench with.
- Adds benches for the hashing code in #65
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants