Skip to content

Commit 5534fa2

Browse files
dabaconrht
authored andcommitted
Use more accurate complex128 for testing non-public method (quantumlib#5616)
And loosen the atol for the test.
1 parent 348beb4 commit 5534fa2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cirq-core/cirq/transformers/analytical_decompositions/two_qubit_to_cz_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ def test_kak_decomposition_depth_partial_cz():
254254
@pytest.mark.parametrize(
255255
"v",
256256
[
257-
cirq.unitary(random_two_qubit_circuit_with_czs(3)),
258-
cirq.unitary(random_two_qubit_circuit_with_czs(2)),
257+
random_two_qubit_circuit_with_czs(3).unitary(dtype=np.complex128),
258+
random_two_qubit_circuit_with_czs(2).unitary(dtype=np.complex128),
259259
np.diag(np.exp(1j * np.pi * np.random.random(4))),
260260
],
261261
)
@@ -265,4 +265,4 @@ def test_decompose_to_diagonal_and_circuit(v):
265265
assert cirq.is_diagonal(diagonal)
266266
combined_circuit = cirq.Circuit(cirq.MatrixGate(diagonal)(b, c), ops)
267267
circuit_unitary = combined_circuit.unitary(qubits_that_should_be_present=[b, c])
268-
cirq.testing.assert_allclose_up_to_global_phase(circuit_unitary, v, atol=1e-5)
268+
cirq.testing.assert_allclose_up_to_global_phase(circuit_unitary, v, atol=5e-5)

0 commit comments

Comments
 (0)