Skip to content

Commit

Permalink
test: for rule matcher check out circuits explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
ss2165 committed Oct 10, 2023
1 parent 6d2784d commit 50c1f4b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pyrs/test/test_bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pyrs.pyrs import passes, circuit, pattern

from pytket.circuit import Circuit

# TODO clean up after fixing module structure #169
Rule, RuleMatcher = pattern.Rule, pattern.RuleMatcher
T2Circuit = circuit.T2Circuit
Expand Down Expand Up @@ -47,9 +48,9 @@ def test_cx_rule():

c.apply_match(mtch)

coms = c.finish().get_commands()
print(coms)
assert len(coms) == 1
out = c.finish()

assert out == Circuit(4).CX(0, 2)


def test_multiple_rules():
Expand All @@ -66,9 +67,8 @@ def test_multiple_rules():

assert match_count == 3

coms = circuit.finish().get_commands()
print(coms)
assert len(coms) == 2
out = circuit.finish()
assert out == Circuit(3).CX(0, 1).X(0)


# from dataclasses import dataclass
Expand Down

0 comments on commit 50c1f4b

Please sign in to comment.