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

chore: Remove TODO in test #536

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions tket2/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,8 @@ fn update_signature(
#[cfg(test)]
mod tests {
use cool_asserts::assert_matches;
use hugr::std_extensions::arithmetic::float_types::ConstF64;
use hugr::CircuitUnit;
use rstest::{fixture, rstest};

use hugr::types::Signature;
Expand Down Expand Up @@ -627,22 +629,17 @@ mod tests {
.unwrap()
}

/// 2-qubit circuit with a Hadamard, a CNOT, and a X gate.
/// 2-qubit circuit with a Hadamard, a CNOT, and an Rz gate.
#[fixture]
fn simple_circuit() -> Circuit {
build_simple_circuit(2, |circ| {
circ.append(Tk2Op::H, [0])?;
circ.append(Tk2Op::CX, [0, 1])?;
circ.append(Tk2Op::X, [1])?;

// TODO: Replace the `X` with the following once Hugr adds `CircuitBuilder::add_constant`.
// See https://github.com/CQCL/hugr/pull/1168

//let angle = circ.add_constant(ConstF64::new(0.5));
//circ.append_and_consume(
// Tk2Op::RzF64,
// [CircuitUnit::Linear(1), CircuitUnit::Wire(angle)],
//)?;
let angle = circ.add_constant(ConstF64::new(0.5));
circ.append_and_consume(
Tk2Op::RzF64,
[CircuitUnit::Linear(1), CircuitUnit::Wire(angle)],
)?;
Ok(())
})
.unwrap()
Expand Down
Loading