matrices.cnot
CNOT matrix.
Module Contents
Functions
|
Produce the CNOT matrix [1]. |
- matrices.cnot.cnot()
Produce the CNOT matrix [1].
The CNOT matrix is defined as
\[\begin{split}\text{CNOT} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}.\end{split}\]Examples
>>> from toqito.matrices import cnot >>> cnot() [[1 0 0 0] [0 1 0 0] [0 0 0 1] [0 0 1 0]]
References
- Returns:
The CNOT matrix.
- Return type:
numpy.ndarray