The CNOT gate operates on a
quantum register consisting of 2 qubits. The CNOT gate flips the second qubit (the target qubit)
if and only if the first qubit (the control qubit) is |1\rangle. If \{|0\rangle,|1\rangle\} are the only allowed input values for both qubits, then the TARGET output of the CNOT gate corresponds to the result of a classical
XOR gate. Fixing CONTROL as |1\rangle, the TARGET output of the CNOT gate yields the result of a classical
NOT gate. More generally, the inputs are allowed to be a linear superposition of \{|0\rangle,|1\rangle\}. The CNOT gate transforms the
quantum state: a|00\rangle + b|01\rangle + c|10\rangle + d|11\rangle into: a|00\rangle + b|01\rangle + c|11\rangle + d|10\rangle The action of the CNOT gate can be represented by the matrix (
permutation matrix form): : \operatorname{CNOT} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}. The first experimental realization of a CNOT gate was accomplished in 1995. Here, a single
Beryllium ion in a
trap was used. The two qubits were encoded into an optical state and into the vibrational state of the ion within the trap. At the time of the experiment, the reliability of the CNOT-operation was measured to be on the order of 90%. In addition to a regular controlled NOT gate, one could construct a function-controlled NOT gate, which accepts an arbitrary number
n+1 of qubits as input, where
n+1 is greater than or equal to 2 (a
quantum register). This gate flips the last qubit of the register if and only if a built-in function, with the first
n qubits as input, returns a 1. The function-controlled NOT gate is an essential element of the
Deutsch–Jozsa algorithm. == Behaviour in the Hadamard transformed basis ==