diff --git a/src/qibo/gates/gates.py b/src/qibo/gates/gates.py index d7c1286964..8e6801b177 100644 --- a/src/qibo/gates/gates.py +++ b/src/qibo/gates/gates.py @@ -1040,7 +1040,6 @@ def __init__(self, q0, q1): self.control_qubits = (q0,) self.target_qubits = (q1,) self.init_args = [q0, q1] - self.clifford = True self.unitary = True @property @@ -1082,7 +1081,6 @@ def __init__(self, q0, q1): self.control_qubits = (q0,) self.target_qubits = (q1,) self.init_args = [q0, q1] - self.clifford = True self.unitary = True @property @@ -1119,7 +1117,7 @@ def __init__(self, q0, q1, theta, trainable=True): self.parameters = theta self.unitary = True - if isinstance(theta, (float, int)) and (theta % (np.pi / 2)).is_integer(): + if isinstance(theta, (float, int)) and (theta % np.pi).is_integer(): self.clifford = True self.init_args = [q0, q1] @@ -2086,7 +2084,6 @@ def __init__(self, q0, q1, q2): self.control_qubits = (q0, q1) self.target_qubits = (q2,) self.init_args = [q0, q1, q2] - self.clifford = True self.unitary = True @property diff --git a/tests/test_gates_gates.py b/tests/test_gates_gates.py index 4020abc97c..20d3551933 100644 --- a/tests/test_gates_gates.py +++ b/tests/test_gates_gates.py @@ -554,7 +554,7 @@ def test_csx(backend): backend.assert_allclose(final_state_decompose, target_state) assert gates.CSX(0, 1).qasm_label == "csx" - assert gates.CSX(0, 1).clifford + assert not gates.CSX(0, 1).clifford assert gates.CSX(0, 1).unitary @@ -590,7 +590,7 @@ def test_csxdg(backend): backend.assert_allclose(final_state_decompose, target_state) assert gates.CSXDG(0, 1).qasm_label == "csxdg" - assert gates.CSXDG(0, 1).clifford + assert not gates.CSXDG(0, 1).clifford assert gates.CSXDG(0, 1).unitary @@ -624,7 +624,7 @@ def test_cun(backend, name, params): if name in ["CRX", "CRY", "CRZ"]: theta = params["theta"] - if (theta % (np.pi / 2)).is_integer(): + if (theta % np.pi).is_integer(): assert gate.clifford else: assert not gate.clifford @@ -1098,7 +1098,7 @@ def test_toffoli(backend, applyx): backend.assert_allclose(final_state, target_state) assert gatelist[-1].qasm_label == "ccx" - assert gates.TOFFOLI(0, 1, 2).clifford + assert not gates.TOFFOLI(0, 1, 2).clifford assert gates.TOFFOLI(0, 1, 2).unitary