Library for basic computations on quantum bit circuits. To get started quickly, click on "Binder" badge above to run simple example in Jupyter Notebook online.
Class describing basic circuit operations.
-
X-pauli gate.
x(self, position: int) -> None: """ X-pauli gate, also called not-gate, change |0> to |1> and |1> to |0>. :param position: index of qbit to be reverted :return: None """
-
Z-pauli gate.
z(self, position: int) -> None: """ Z-pauli gate, also called phase-flip-gate, leave |0> unchanged and replaces |1> with -|1>. :param position: index of qbit to be reverted :return: None """
-
H-pauli gate.
h(self, position: int) -> None: """ H-gate, called Hadamard gate, change status from |0> to (|0> + |1>)/sqrt(2) and |1> to (|0> - |1>)/sqrt(2). :param position: index of ubit to be reverted :return: None """
-
Show state of qubit.
show_state(self) -> str: """ Return current string representation of qbit. :return: string representation of qbit """
-
Measure qubit.
measure(self) -> typing.Optional[str]: """ Measure value of superpositioned qbit based on digital random module. :return: integer value 0 or 1 of measured qbits """
Set of functions for plotting quantum circuits.
-
Draw sample qubits on the plane.
draw_qbit() -> None: """Draw sample qbits on the plane."""
-
Draw quantum state of qubit.
draw_quantum_state(coords: typing.List[int], name: str, color: str = "blue") -> None: """ Draw quantum state of qbit. :param coords: coordinates of quantum state on the plane. :param name: name of the quantum state to plot :param color: color of drawn arrow :return: None """
Authors:
- Jakub Dębski
- Bazyli Polednia