update QuBit.md

This commit is contained in:
Didictateur 2023-10-24 16:12:59 +02:00
parent 9fe2910fc8
commit 99c5185034
2 changed files with 5 additions and 1 deletions

View file

@ -134,7 +134,7 @@ class MuBit:
return prob return prob
def __SWITCH(self, i: int) -> float: def __SWITCH(self, i: int) -> None:
if type(i) is not int: if type(i) is not int:
raise TypeError(f"MuBit indices must be integers, not {type(i)}") raise TypeError(f"MuBit indices must be integers, not {type(i)}")
if i >= self.__n: if i >= self.__n:

View file

@ -52,6 +52,10 @@ MuBit(n: int)
returns the probability to get the i-th QuBit in the state |0>. returns the probability to get the i-th QuBit in the state |0>.
- ```__SWITCH(i: int) -> None```
switches the i-th QuBit with the next one in __state.
- ```observe() -> list[int]``` - ```observe() -> list[int]```
forces the QuBits in a state, where the probabilities are given throught __state. Returns the list of the state of each QuBit. forces the QuBits in a state, where the probabilities are given throught __state. Returns the list of the state of each QuBit.