CNOT Gate
Two-qubit gate that flips the target qubit only when the control qubit is |1⟩.
Formula
Variables
Example
CNOT|10⟩ = |11⟩; CNOT|00⟩ = |00⟩
How it works
The CNOT gate is a 4×4 matrix that acts on two qubits by leaving the control qubit unchanged while conditionally flipping the target qubit. In the computational basis, the first two basis states (where the control is 0) are unchanged, and the last two basis states are swapped, which is why the matrix has 1s on the diagonal for |00⟩ and |01⟩, and off-diagonal 1s that exchange |10⟩ and |11⟩. This matrix form comes from writing the rule "if control = 1, apply NOT to the target" as a linear transformation on the basis states, then extending it to all superpositions by linearity.
When to use it
Use CNOT whenever you need to model or build controlled two-qubit behavior, especially in quantum circuit design, entanglement generation, and Bell-state preparation. It is also a standard gate when analyzing how multi-qubit states evolve in the computational basis.
Worked example, step by step
Take the input state |01⟩. Write it as a basis vector: |01⟩ = (0, 1, 0, 0)^T. Apply the CNOT matrix: CNOT |01⟩ = \begin{pmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&0&1 \\ 0&0&1&0 \end{pmatrix} \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \\ 0 \\ 0 \end{pmatrix}. So the output is |01⟩, because the control qubit is 0 and the target qubit is not flipped.
Common mistakes to avoid
- Thinking the target flips whenever the second qubit is 1, instead of when the control qubit is 1
- Forgetting that CNOT is a linear operator, so it also acts on superpositions by distribution
- Mixing up the basis order and reading the matrix as if the qubits were ordered differently
Did You Know?
The Hadamard + CNOT combo is the standard recipe for creating entangled Bell states.
Share this formula
More in Quantum Computing
View allQubit Superposition State
IntermediateGeneral state of a single qubit as a superposition of the computational basis states.
Normalisation Constraint
BasicThe squared amplitudes of a qubit must sum to 1, ensuring total probability is 100 %.
Hadamard Gate
IntermediatePuts a qubit into an equal superposition — the most common single-qubit gate.
Pauli-X Gate (Quantum NOT)
BasicFlips |0⟩ to |1⟩ and vice versa — the quantum equivalent of a classical NOT gate.
Bell State (EPR Pair)
IntermediateMaximally entangled two-qubit state — measuring one qubit instantly determines the other.
Born Rule (Measurement Probability)
IntermediateProbability of measuring outcome |k⟩ from a quantum state |ψ⟩.