diff --git a/src/qibo/gates/abstract.py b/src/qibo/gates/abstract.py index 1328f9edcc..6405b10dc3 100644 --- a/src/qibo/gates/abstract.py +++ b/src/qibo/gates/abstract.py @@ -204,8 +204,8 @@ def _find_repeated(qubits: Sequence[int]) -> int: def _check_control_target_overlap(self): """Checks that there are no qubits that are both target and controls.""" - control_target = self._target_qubits + self._control_qubits - common = len(set(control_target)) != len(control_target) + control_and_target = self._control_qubits + self._target_qubits + common = len(set(control_and_target)) != len(control_and_target) if common: raise_error( ValueError,