From 46bdddf67b951d20296071c2b8b9c63122c573ad Mon Sep 17 00:00:00 2001 From: Alec Edgington <54802828+cqc-alec@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:42:16 +0000 Subject: [PATCH] Compare unitaries up to global phase. (#435) --- tests/backend_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/backend_test.py b/tests/backend_test.py index f9662653..1e1f0e0a 100644 --- a/tests/backend_test.py +++ b/tests/backend_test.py @@ -1052,7 +1052,7 @@ def _verify_single_q_rebase( circ.add_gate(OpType.TK1, [a, b, c], [0]) backend.rebase_pass().apply(circ) u_after = backend.run_circuit(circ).get_unitary() - return np.allclose(u_before, u_after) + return compare_unitaries(u_before, u_after) def test_rebase_phase() -> None: