Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NoureldinYosri committed Feb 2, 2024
1 parent 7d43df8 commit 903e52b
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,17 @@ def test_decompose_to_diagonal_and_circuit(v):


def test_remove_partial_czs_or_fail():
CZ = cirq.CZ(*cirq.LineQubit.range(2))
assert (
cirq.transformers.analytical_decompositions.two_qubit_to_cz._remove_partial_czs_or_fail(
[cirq.CZ(*cirq.LineQubit.range(2)) ** 1e-15], atol=1e-9
[CZ**1e-15], atol=1e-9
)
== []
)
assert cirq.transformers.analytical_decompositions.two_qubit_to_cz._remove_partial_czs_or_fail(
[CZ**-1, CZ], atol=1e-9
) == [CZ, CZ]
with pytest.raises(ValueError):
_ = (
cirq.transformers.analytical_decompositions.two_qubit_to_cz._remove_partial_czs_or_fail(
[cirq.CZ(*cirq.LineQubit.range(2)) ** -0.5], atol=1e-9
)
== []
_ = cirq.transformers.analytical_decompositions.two_qubit_to_cz._remove_partial_czs_or_fail(
[CZ**-0.5], atol=1e-9
)

0 comments on commit 903e52b

Please sign in to comment.