Skip to content

Commit

Permalink
Add test for capped significant digits
Browse files Browse the repository at this point in the history
  • Loading branch information
pablolh committed Nov 16, 2023
1 parent 72ca63b commit 38c008a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ def test_comment(self):
/* My comment */
cr q[0], q[1], 1.234
""",
)

def test_cap_significant_digits(self):
squirrelAST = SquirrelAST(DefaultGates, 3, "q")

writer = Writer(DefaultGates)

squirrelAST.addGate("cr", 0, 1, 1.6546514861321684321654)

self.assertEqual(
writer.process(squirrelAST),
"""version 3.0
qubit[3] q
cr q[0], q[1], 1.6546515
""",
)

Expand Down

0 comments on commit 38c008a

Please sign in to comment.