Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Dec 17, 2024
1 parent 8b28b83 commit 52c5c1b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_gates_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,9 @@ def test_cun(backend, name, params):

gate = getattr(gates, name)(0, 1, **params)

if name == "CRY":
decomposition = gate.decompose()

assert gate.unitary

if name != "CU2":
Expand All @@ -723,10 +726,10 @@ def test_cun(backend, name, params):
backend.assert_allclose(final_state, target_state, atol=1e-6)

if name == "CRY":
decomposition = Circuit(2)
decomposition.add(gate.decompose())
decomposition = decomposition.unitary(backend=backend)
backend.assert_allclose(decomposition, _matrix)
matrix = Circuit(2)
matrix.add(decomposition)
matrix = matrix.unitary(backend=backend)
backend.assert_allclose(matrix, _matrix)


def test_swap(backend):
Expand Down

0 comments on commit 52c5c1b

Please sign in to comment.