In computer science, the controlled NOT gate (also C-NOT or CNOT), controlled-X gate, controlled-bit-flip gate, Feynman gate or controlled Pauli-X is a quantum logic gate that is an essential component in the construction of a gate-based quantum computer. It can be used to entangle and disentangle Bell states. Any quantum circuit can be simulated to an arbitrary degree of accuracy using a combination of CNOT gates and single qubit rotations.[1] [2] The gate is sometimes named after Richard Feynman who developed an early notation for quantum gate diagrams in 1986.[3] [4] [5]
The CNOT can be expressed in the Pauli basis as:
CNOT=
| |||||
e |
=
| |||||
e |
.
ei\theta=(\cos\theta)I+(i\sin\theta)U
U
| |||||
=e |
| |||||
=e |
The CNOT gate can be further decomposed as products of rotation operator gates and exactly one two qubit interaction gate, for example
CNOT
| ||||
=e |
R | |
y1 |
(-\pi/2)R | |
x1 |
(-\pi/2)R | |
x2 |
(-\pi/2)Rxx
(\pi/2)R | |
y1 |
(\pi/2).
In general, any single qubit unitary gate can be expressed as
U=eiH
CU=
| |||||
e |
The CNOT gate is also used in classical reversible computing.
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
Before | After | |||||||
---|---|---|---|---|---|---|---|---|
Control | Target | Control | Target | |||||
0\rangle | 0\rangle | 0\rangle | 0\rangle | |||||
0\rangle | 1\rangle | 0\rangle | 1\rangle | |||||
1\rangle | 0\rangle | 1\rangle | 1\rangle | |||||
1\rangle | 1\rangle | 1\rangle | 0\rangle |
If
\{|0\rangle,|1\rangle\}
|1\rangle
More generally, the inputs are allowed to be a linear superposition of
\{|0\rangle,|1\rangle\}
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%.[6]
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.
When viewed only in the computational basis
\{|0\rangle,|1\rangle\}
Insight can be won by expressing the CNOT gate with respect to a Hadamard transformed basis
\{|+\rangle,|-\rangle\}
|+\rangle=
1 | |
\sqrt{2 |
and the corresponding basis of a 2-qubit register is
|++\rangle=|+\rangle ⊗ |+\rangle=
1 | |
2 |
(|0\rangle+|1\rangle) ⊗ (|0\rangle+|1\rangle)=
1 | |
2 |
(|00\rangle+|01\rangle+|10\rangle+|11\rangle)
etc. Viewing CNOT in this basis, the state of the second qubit remains unchanged, and the state of the first qubit is flipped, according to the state of the second bit. (For details see below.) "Thus, in this basis the sense of which bit is the control bit and which the target bit has reversed. But we have not changed the transformation at all, only the way we are thinking about it."[7]
The "computational" basis
\{|0\rangle,|1\rangle\}
\{|+\rangle,|-\rangle\}
The observation that both qubits are (equally) affected in a CNOT interaction is of importance when considering information flow in entangled quantum systems.[9]
We now proceed to give the details of the computation. Working through each of the Hadamard basis states, the results on the right column show that the first qubit flips between
|+\rangle
|-\rangle
|-\rangle
Initial state in Hadamard basis | Equivalent state in computational basis | Apply operator | State in computational basis after CNOT | Equivalent state in Hadamard basis | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
++\rangle |
( | 00\rangle + | 01\rangle + | 10\rangle + | 11\rangle) | CNOT |
( | 00\rangle + | 01\rangle + | 11\rangle + | 10\rangle) | ++\rangle | |||||||||
+-\rangle |
( | 00\rangle - | 01\rangle + | 10\rangle - | 11\rangle) | CNOT |
( | 00\rangle - | 01\rangle + | 11\rangle - | 10\rangle) | --\rangle | |||||||||
-+\rangle |
( | 00\rangle + | 01\rangle - | 10\rangle - | 11\rangle) | CNOT |
( | 00\rangle + | 01\rangle - | 11\rangle - | 10\rangle) | -+\rangle | |||||||||
--\rangle |
( | 00\rangle - | 01\rangle - | 10\rangle + | 11\rangle) | CNOT |
( | 00\rangle - | 01\rangle - | 11\rangle + | 10\rangle) | +-\rangle |
A quantum circuit that performs a Hadamard transform followed by CNOT then another Hadamard transform, can be described as performing the CNOT gate in the Hadamard basis (i.e. a change of basis):
The single-qubit Hadamard transform, H1, is Hermitian and therefore its own inverse. The tensor product of two Hadamard transforms operating (independently) on two qubits is labelled H2. We can therefore write the matrices as:
When multiplied out, this yields a matrix that swaps the
|01\rangle
|11\rangle
|00\rangle
|10\rangle
A common application of the CNOT gate is to maximally entangle two qubits into the
|\Phi+\rangle
To construct
|\Phi+\rangle
1 | |
\sqrt{2 |
|0\rangleB
After applying CNOT, the resulting Bell State has the property that the individual qubits can be measured using any basis and will always present a 50/50 chance of resolving to each state. In effect, the individual qubits are in an undefined state. The correlation between the two qubits is the complete description of the state of the two qubits; if we both choose the same basis to measure both qubits and compare notes, the measurements will perfectly correlate.
When viewed in the computational basis, it appears that qubit A is affecting qubit B. Changing our viewpoint to the Hadamard basis demonstrates that, in a symmetrical way, qubit B is affecting qubit A.
The input state can alternately be viewed as:
|+\rangleA
1 | |
\sqrt{2 |
In the Hadamard view, the control and target qubits have conceptually swapped and qubit A is inverted when qubit B is
|-\rangleB
=
1 | |
\sqrt{2 |
=
1 | |
2\sqrt{2 |
=
1 | |
2\sqrt{2 |
=
1 | |
\sqrt{2 |
The C-ROT gate (controlled Rabi rotation) is equivalent to a C-NOT gate except for a
\pi/2
In May, 2024, Canada implemented export restrictions on the sale of quantum computers containing more than 34 qubits and error rates below a certain CNOT error threshold, along with restrictions for quantum computers with more qubits and higher error rates.[12] The same restrictions quickly popped up in the UK, France, Spain and the Netherlands. They offered few explanations for this action, but all of them are Wassenaar Arrangement states, and the restrictions seem related to national security concerns potentially including quantum cryptography or protection from competition.[13] [14]