Skip to content

Commit

Permalink
Compare unitaries up to global phase. (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-alec authored Dec 13, 2024
1 parent aea4936 commit 46bdddf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/backend_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 46bdddf

Please sign in to comment.