Skip to content

Commit

Permalink
Fix extension inference in benchmark example
Browse files Browse the repository at this point in the history
  • Loading branch information
aborgna-q committed Feb 24, 2025
1 parent 5f3cdf3 commit 44c6039
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hugr/benches/benchmarks/hugr/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ use hugr::builder::{
HugrBuilder, ModuleBuilder,
};
use hugr::extension::prelude::{bool_t, qb_t, usize_t};
use hugr::extension::ExtensionSet;
use hugr::ops::OpName;
use hugr::std_extensions::arithmetic::float_types::{float64_type, ConstF64};
use hugr::std_extensions::arithmetic::float_types::{self, float64_type, ConstF64};
use hugr::types::Signature;
use hugr::{type_row, CircuitUnit, Extension, Hugr, Node};
use lazy_static::lazy_static;
Expand Down Expand Up @@ -97,7 +98,10 @@ pub fn circuit(layers: usize) -> (Hugr, Vec<CircuitLayer>) {
let cx_gate = QUANTUM_EXT.instantiate_extension_op("CX", []).unwrap();
let rz = QUANTUM_EXT.instantiate_extension_op("Rz", []).unwrap();
let signature =
Signature::new_endo(vec![qb_t(), qb_t()]).with_extension_delta(QUANTUM_EXT.name().clone());
Signature::new_endo(vec![qb_t(), qb_t()]).with_extension_delta(ExtensionSet::from_iter([
QUANTUM_EXT.name().clone(),
float_types::EXTENSION_ID,
]));
let mut module_builder = ModuleBuilder::new();
let mut f_build = module_builder.define_function("main", signature).unwrap();

Expand Down

0 comments on commit 44c6039

Please sign in to comment.