cnot
¶
CNOT matrix generates the CNOT operator matrix.
cnot
¶
Produce the CNOT matrix 1.
The CNOT matrix is defined as
\[
\text{CNOT} =
\begin{pmatrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0
\end{pmatrix}.
\]
Returns:
-
ndarray–The CNOT matrix.
Examples:
References
1 Wikipedia. Controlled NOT gate. link.