Quantum Lab
Quantum Lab

An interactive quantum mechanics learning platform and cryostat wiring co-design tool. From plain-language intuition to formal mathematics.

contact@quantumcircuitsimulator.com

Product

  • Circuit Lab
  • Learn
  • Hardware Studio
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service

© 2026 Quantum Lab. All rights reserved.

This site, including its original quantum simulations, cryostat reference systems, 3D models, and interface design, contains protected proprietary material.

Home/Quantum Physics/Lessons/CNOT Gate (Controlled-X)
CX

CNOT Gate (Controlled-X)

Entanglement2-qubitentangle

Flips the target when the control is |1⟩.

Intuition

CNOT is the most important two-qubit gate in quantum computing. It connects two qubits: one acts as a control, and the other as a target. If the control is |1⟩, the target gets flipped (X gate). If the control is |0⟩, nothing happens. This sounds classical, but the magic happens when the control is in superposition. Then CNOT does not choose one branch or the other — it creates entanglement, correlating the two qubits into a joint state that cannot be described by looking at each qubit separately.

Matrix representation
​1000​0100​0001​0010​​
Action on states
∣0x⟩→∣0x⟩,∣1x⟩→∣1xˉ⟩
Circuit
Open in simulator →
q0q1HCX
▶ Try it in the simulator
Precise explanation

CNOT is a two-qubit unitary that applies X to the target conditioned on the control being |1⟩. In the computational basis: |00⟩→|00⟩, |01⟩→|01⟩, |10⟩→|11⟩, |11⟩→|10⟩. When the control is in superposition, CNOT creates entanglement: H⊗I followed by CNOT maps |00⟩ to the Bell state |Φ⁺⟩ = (|00⟩ + |11⟩)/√2. CNOT is universal for quantum computation when combined with single-qubit gates.

Observable effect

Joint two-qubit probability structure changes.

Hidden effect

Creates entanglement when the control is in superposition — each qubit alone looks random but the pair is perfectly correlated.

Bloch sphere

Conditional rotation of the target qubit. When the control is in superposition, both qubits move inside the Bloch sphere (they become entangled and individually mixed).

Truth table
|00⟩→|00⟩
|01⟩→|01⟩
|10⟩→|11⟩
|11⟩→|10⟩
Worked example

Creating a Bell state

  1. 1Start with |00⟩.
  2. 2Apply H to qubit 0: state becomes (|0⟩ + |1⟩)/√2 ⊗ |0⟩ = (|00⟩ + |10⟩)/√2.
  3. 3Apply CNOT with qubit 0 as control, qubit 1 as target.
  4. 4The |00⟩ term stays |00⟩. The |10⟩ term flips the target to give |11⟩.
  5. 5Final state: (|00⟩ + |11⟩)/√2 = |Φ⁺⟩, a maximally entangled Bell state.
  6. 6Measuring both qubits always gives 00 or 11, never 01 or 10.
Common use cases
  • Creating Bell pairs and GHZ states for entanglement
  • Quantum teleportation circuits
  • Error correction (syndrome extraction)
  • Oracle implementations in algorithms like Deutsch’s and Grover’s
  • Universal gate set: {H, CNOT} plus any non-Clifford gate
Relation to other gates
  • CNOT = controlled-X; replace X with Z to get CZ
  • (H⊗H) CNOT (H⊗H) = reversed CNOT (control and target swap roles)
  • Three CNOTs can build a SWAP gate
  • CNOT is its own inverse: applying it twice returns to the original state
Common misconception

CNOT is not like a classical if-then. When the control is in superposition, CNOT does not “choose” — it entangles, creating correlations that have no classical analog.

Why this gate matters

CNOT is the bridge between single-qubit operations and multi-qubit quantum computing. Without it, qubits would be independent and no more powerful than parallel classical random bits. Entanglement is what makes quantum computing non-trivial.

Test your understanding

You apply H to qubit 0 then CNOT(0,1) to |00⟩. What state results?

▶ Try it in the simulatorQuick reference →↗ Nielsen and Chuang, Quantum Computation and Quantum Information↗ MIT OCW 8.06: entanglement notes
←
Previous
Hadamard
Next
Toffoli
→
← Back to all lessons