diff --git a/QElephant/QuBit.py b/QElephant/QuBit.py index 455510d..58cac2a 100644 --- a/QElephant/QuBit.py +++ b/QElephant/QuBit.py @@ -71,11 +71,11 @@ class MuBit: raise TypeError(f"MuBit indices must be integers, not {type(item)}") if item > self.__n: raise IndexError("MuBit index out of range") - item = item%self.__n + return IQuBit(item, self) - def __apply(self, i: int, matrix: Matrix) -> None: + def __apply(self, matrix: Matrix, i: int) -> None: if type(i) is not int: raise TypeError(f"MuBit indices must be integers, not {type(i)}") if i > self.__n: diff --git a/docs/QuBit/MuBit.md b/docs/QuBit/MuBit.md index b0c586f..774f4fa 100644 --- a/docs/QuBit/MuBit.md +++ b/docs/QuBit/MuBit.md @@ -40,13 +40,13 @@ MuBit(n: int) creates an intricated QuBit corresponding to the item-th QuBit. -- ```__apply(m: Matrix) -> None``` +- ```__apply(matrix: Matrix, i: int) -> None``` - takes a Matrix and modifies the QuBits according the matrix. + takes a Matrix of size (2, 2) and modifies the i-th QuBits according the matrix. -- ```__mapply(m: Matrix, i: int) -> None``` +- ```__mapply(matrix: Matrix, i: int) -> None``` - takes a Matrix and modifies the i-th QuBit according the matrix. + takes a Matrix aof size (4, 4) and modifies the i-th QuBit and le next one together according the matrix. - ```__getProbs(i: int) -> float```