Skip to content

Commit

Permalink
bugfix in CZ test
Browse files Browse the repository at this point in the history
  • Loading branch information
arsalan-motamedi committed Nov 7, 2024
1 parent bdecc2f commit ed7a7bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/test_lab_dev/test_transformations/test_czgate.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ def test_init(self):
@pytest.mark.parametrize("s", [0.1, 0.2, 1.5])
def test_application(self, s):
"Tests the application of CZgate"
psi = Coherent([0], 0, 1) >> Coherent([1], 1, 0) >> CZgate([0, 1], 1)
psi = Coherent([0], 0, 1) >> Coherent([1], 1, 0) >> CZgate([0, 1], s)
_, d, _ = psi.phase_space(s=0)
psi = Coherent([0], 0, 1) >> Coherent([1], 1, 0) >> CZgate([0, 1], 1)
d_by_hand = math.astensor([0, math.sqrt(complex(2)), (1 + s) * math.sqrt(complex(2)), 0])
assert math.allclose(d[0], d_by_hand)

0 comments on commit ed7a7bd

Please sign in to comment.