Skip to content

Commit

Permalink
fix: depth pass conversion error
Browse files Browse the repository at this point in the history
revert rust test

isolate test
  • Loading branch information
ss2165 committed Apr 5, 2024
1 parent b42a6fd commit c406c56
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tket2-py/test/test_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit c406c56

Please sign in to comment.