In computing science, the controlled NOT gate (also C-NOT or CNOT) is a quantum gate that is an essential component in the construction of a quantum computer. It can be used to entangle and disentangle EPR states. Specifically, any quantum circuit can be simulated to an arbitrary degree of accuracy using a combination of CNOT gates and single qubit rotations.

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. CNOT is also a kind of universal gate(in the classical sense of the word). It is easy to see that if the CONTROL is set to '1' the TARGET output is always NOT. So, a NOT GATE can be constructed using CNOT.

When viewed only in the computational basis , the behaviour of the CNOT appears to be like the equivalent classical gate. However, the simplicity of labelling one qubit the control and the other the target does not reflect what happens for most input values of both qubits.

CNOT gate in Hadamard Basis

"consider the Cnot gate in the Hadamard basis ... it is the state of the second qubit that remains unchanged, and the state of the first qubit that is flipped depending on the state of the second bit. 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."[1]

"the key is to notice the symmetric behavior of the CNOT gate. If we switch X and Z and qubits 1 and 2, we get back the original transformation."[2] The observation that both qubits are affected in a CNOT interaction is of importance when considering information flow in entangled quantum systems.[3]

Working through each of the Hadamard basis states,[a] the first qubit flips between and when the second qubit is :

Initial state in Hadamard basis

Equivalent state in computational basis

Apply operator

State in computational basis after CNOT

Equivalent state in Hadamard basis

CNOT

CNOT

CNOT

CNOT

A quantum circuit that performs a Hadamard transform followed by CNOT then another Hadamard transform can be described in terms of matrix operators:

(H1 ⊗ H1)−1 . CNOT . (H1 ⊗ H1)

The single-qubit Hadamard transform, H1, is 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:

H2 . CNOT . H2

When multiplied out, this yields a matrix that swaps the and terms over, while leaving the and terms alone. This is equivalent to a CNOT gate where qubit 2 is the control qubit and qubit 1 is the target qubit:

To construct , the inputs A (control) and B (target) to the CNOT gate are:[b]

and

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 choose the same basis to measure both qubits and compares 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 be viewed as:

and

In the Hadamard view, the control and target qubits have conceptually swapped and qubit A is inverted when qubit B is . The output state after applying the CNOT gate is which can be shown[c] to be exactly the same state as .

^As an example of converting the description of a state from one basis to another, state , which is described in terms of Hadamard basis states, can be converted to a computational basis description by noting that: and therefore:

^, also known as , can be constructed by applying a Hadamard gate to a qubit set to