Skip to content

Commit

Permalink
zx test
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Dec 20, 2023
1 parent 08aa7fc commit 028c1d4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/test_qlassf_zxsimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,23 @@

@parameterized_class(("compiler"), ENABLED_COMPILERS)
class TestQlassfZXSimp(unittest.TestCase):
def test_int_const_compare_eq(self):
f = "def test(a: Qint2) -> bool:\n\treturn a == 2"
def test_bool_not(self):
f = "def test(a: bool) -> bool:\n\treturn not a"
qf = qlassf(f, to_compile=COMPILATION_ENABLED, compiler=self.compiler)
qf.circuit().zx_simplify()
compute_and_compare_results(self, qf)

def test_bool_and(self):
f = "def test(a: bool, b: bool) -> bool:\n\treturn not a and b"
qf = qlassf(f, to_compile=COMPILATION_ENABLED, compiler=self.compiler)
qf.circuit().zx_simplify()
compute_and_compare_results(self, qf)

# def test_int_const_compare_eq(self):
# f = "def test(a: Qint2) -> bool:\n\treturn a == 2"
# qf = qlassf(f, to_compile=COMPILATION_ENABLED, compiler=self.compiler)
# qf.circuit().zx_simplify()
# compute_and_compare_results(self, qf)

# def test_const_int_compare_gt(self):
# f = f"def test(a: Qint2) -> bool:\n\treturn a > 2"
Expand Down

0 comments on commit 028c1d4

Please sign in to comment.