From c406c569cbf4861060657722d8c28e67e33c15aa Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Tue, 16 Jan 2024 16:36:15 +0000 Subject: [PATCH] fix: depth pass conversion error revert rust test isolate test --- tket2-py/test/test_pass.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tket2-py/test/test_pass.py b/tket2-py/test/test_pass.py index cb3a8369..6022b269 100644 --- a/tket2-py/test/test_pass.py +++ b/tket2-py/test/test_pass.py @@ -64,15 +64,24 @@ def test_depth_optimise(): assert c.depth() == 2 -@given(circ=circuits()) -@settings(print_blob=True, deadline=30) -def test_depth_hyp(circ: Circuit) -> None: +def _depth_impl(circ: Circuit) -> None: new, _ = greedy_depth_reduce(circ) assert circ.n_gates == new.n_gates assert new.depth() <= circ.depth() +@given(circ=circuits()) +@settings(print_blob=True, deadline=30) +def test_depth_hyp(circ: Circuit) -> None: + _depth_impl(circ) + + +def test_depth_bug() -> None: + circ = Circuit(3).H(0).CX(1, 0).H(0).CX(0, 2).H(0).CX(1, 2) + _depth_impl(circ) + + def test_chunks(): c = Circuit(4).CX(0, 2).CX(1, 3).CX(1, 2).CX(0, 3).CX(1, 3)