Skip to content

Commit

Permalink
use testing assert function for more readable output (#2469)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Oct 31, 2019
1 parent b221c52 commit 0b48318
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cirq/optimizers/decompositions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ def test_single_qubit_matrix_to_gates_tolerance_half_turn_phasing():
def test_single_qubit_op_to_framed_phase_form_output_on_example_case():
u, t, g = cirq.single_qubit_op_to_framed_phase_form(
cirq.unitary(cirq.Y**0.25))
assert cirq.allclose_up_to_global_phase(u, cirq.unitary(cirq.X**0.5))
cirq.testing.assert_allclose_up_to_global_phase(u,
cirq.unitary(cirq.X**0.5),
atol=1e-7)
assert abs(t - (1 + 1j) * math.sqrt(0.5)) < 0.00001
assert abs(g - 1) < 0.00001

Expand Down

0 comments on commit 0b48318

Please sign in to comment.