From a1d73db47132ef7c161f17d2908b9a59379a53b7 Mon Sep 17 00:00:00 2001 From: Didictateur Date: Thu, 26 Oct 2023 15:42:32 +0200 Subject: [PATCH] add doc string --- QElephant/QuBit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/QElephant/QuBit.py b/QElephant/QuBit.py index d8a0404..adc2b2b 100644 --- a/QElephant/QuBit.py +++ b/QElephant/QuBit.py @@ -100,6 +100,7 @@ class MuBit: self.__SWITCH(k) def __mapply(self, matrix: Matrix, i: int) -> None: + """Can only apply controlled gates""" if type(i) is not int: raise TypeError(f"MuBit indices must be integers, not {type(i)}") if i >= self.__n: @@ -175,8 +176,8 @@ class MuBit: return l def reset(self) -> None: - self.state = [0]*self.__n - self.state[0] = 1 + self.__state = [0]*2**self.__n + self.__state[0] = 1 @staticmethod def intricateThem(*args: "QuBit") -> "MuBit":