The CNOT Gate

Master the controlled-NOT gate—the fundamental two-qubit operation that enables entanglement and quantum power.

About this module

In this module you will:

  • Understand what controlled operations are and why they matter
  • Learn the CNOT truth table and behavior
  • Explore CNOT with superposition states
  • Build circuits combining CNOT with H gates
  • See how CNOT creates correlations between qubits

Prerequisites: Lessons 1-6. Understanding of multiple qubits and quantum gates.

7.1 What is a Controlled Operation?

So far, all gates we've seen operate on a single qubit. The CNOT (Controlled-NOT) gate is our first two-qubit gate. It performs a conditional operation: "flip the target qubit if and only if the control qubit is |1⟩."

This conditional behavior is crucial. It creates correlations between qubits—when you measure one, you instantly know something about the other. This is the foundation of entanglement and quantum algorithms.

Key Concept: CNOT Structure

Control qubit (●): The decision-maker. If it's |1⟩, action happens.
Target qubit (⊕): Gets flipped (X gate) if control is |1⟩.

CNOT|00⟩ = |00⟩ (no flip)
CNOT|01⟩ = |01⟩ (no flip)
CNOT|10⟩ = |11⟩ (flip!)
CNOT|11⟩ = |10⟩ (flip!)

7.2 The CNOT Truth Table

Let's explore all four possible input states and see what CNOT does to each one.

Interactive: CNOT Truth Table Explorer

Select an input state and see the CNOT output. Notice the pattern!

Pattern: Control qubit (top) is never changed. Target qubit (bottom) flips only when control is |1⟩.

7.3 CNOT with Superposition

Here's where it gets quantum: what happens when the control qubit is in superposition? If we apply H to the control qubit first, it's simultaneously |0⟩ and |1⟩. The CNOT then creates a special correlated state!

Starting with |00⟩, apply H to qubit 0, then CNOT: we get (1/√2)(|00⟩ + |11⟩). This is not a product state—it's the Bell state, the simplest entangled state!

Interactive: H + CNOT Circuit

Watch what happens when we combine Hadamard with CNOT.

q₀: |0⟩
H
📊
q₁: |0⟩
📊

Notice: You only measure |00⟩ or |11⟩, never |01⟩ or |10⟩! The qubits are perfectly correlated.

7.4 Building Circuits with CNOT

CNOT is incredibly versatile. Let's experiment with different circuit configurations and see what they produce.

Interactive: CNOT Circuit Builder

Try different gate sequences and observe the measurement results.

Why CNOT Matters

CNOT is the building block of quantum algorithms. Combined with single-qubit gates (H, X, Z), CNOT can implement any quantum computation. It's also the gateway to entanglement—the phenomenon that makes quantum computers fundamentally more powerful than classical ones.

Test Your Understanding

Question 1: What does CNOT do to the input state |10⟩?

Question 2: Which qubit is never changed by CNOT?

Question 3: What does the H + CNOT circuit (starting from |00⟩) create?

Question 4: When is the target qubit flipped?