toqito.matrices.cnot
- toqito.matrices.cnot()[source]
Produce the CNOT matrix [WikCNOT].
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
[WikCNOT]Wikipedia: Controlled NOT gate https://en.wikipedia.org/wiki/Controlled_NOT_gate
- Returns:
The CNOT matrix.