@@ -595,6 +595,8 @@ fn update_signature(
595
595
#[ cfg( test) ]
596
596
mod tests {
597
597
use cool_asserts:: assert_matches;
598
+ use hugr:: std_extensions:: arithmetic:: float_types:: ConstF64 ;
599
+ use hugr:: CircuitUnit ;
598
600
use rstest:: { fixture, rstest} ;
599
601
600
602
use hugr:: types:: Signature ;
@@ -627,22 +629,17 @@ mod tests {
627
629
. unwrap ( )
628
630
}
629
631
630
- /// 2-qubit circuit with a Hadamard, a CNOT, and a X gate.
632
+ /// 2-qubit circuit with a Hadamard, a CNOT, and an Rz gate.
631
633
#[ fixture]
632
634
fn simple_circuit ( ) -> Circuit {
633
635
build_simple_circuit ( 2 , |circ| {
634
636
circ. append ( Tk2Op :: H , [ 0 ] ) ?;
635
637
circ. append ( Tk2Op :: CX , [ 0 , 1 ] ) ?;
636
- circ. append ( Tk2Op :: X , [ 1 ] ) ?;
637
-
638
- // TODO: Replace the `X` with the following once Hugr adds `CircuitBuilder::add_constant`.
639
- // See https://github.com/CQCL/hugr/pull/1168
640
-
641
- //let angle = circ.add_constant(ConstF64::new(0.5));
642
- //circ.append_and_consume(
643
- // Tk2Op::RzF64,
644
- // [CircuitUnit::Linear(1), CircuitUnit::Wire(angle)],
645
- //)?;
638
+ let angle = circ. add_constant ( ConstF64 :: new ( 0.5 ) ) ;
639
+ circ. append_and_consume (
640
+ Tk2Op :: RzF64 ,
641
+ [ CircuitUnit :: Linear ( 1 ) , CircuitUnit :: Wire ( angle) ] ,
642
+ ) ?;
646
643
Ok ( ( ) )
647
644
} )
648
645
. unwrap ( )
0 commit comments