diff --git a/src/qibo/gates/abstract.py b/src/qibo/gates/abstract.py index 023aaac48f..b829392995 100644 --- a/src/qibo/gates/abstract.py +++ b/src/qibo/gates/abstract.py @@ -123,17 +123,17 @@ def to_json(self): return json.dumps(self.raw) @property - def target_qubits(self) -> Tuple[int]: + def target_qubits(self) -> Tuple[int, ...]: """Tuple with ids of target qubits.""" return self._target_qubits @property - def control_qubits(self) -> Tuple[int]: + def control_qubits(self) -> Tuple[int, ...]: """Tuple with ids of control qubits sorted in increasing order.""" return tuple(sorted(self._control_qubits)) @property - def qubits(self) -> Tuple[int]: + def qubits(self) -> Tuple[int, ...]: """Tuple with ids of all qubits (control and target) that the gate acts.""" return self.control_qubits + self.target_qubits diff --git a/src/qibo/gates/measurements.py b/src/qibo/gates/measurements.py index 50b4c29e78..34e1ca4f1a 100644 --- a/src/qibo/gates/measurements.py +++ b/src/qibo/gates/measurements.py @@ -103,7 +103,9 @@ def __init__( self.basis.append(gate) @staticmethod - def _get_bitflip_tuple(qubits: Tuple[int], probs: "ProbsType") -> Tuple[float]: + def _get_bitflip_tuple( + qubits: Tuple[int, ...], probs: "ProbsType" + ) -> Tuple[float, ...]: if isinstance(probs, float): if probs < 0 or probs > 1: # pragma: no cover raise_error(ValueError, f"Invalid bitflip probability {probs}.")