Side-by-side comparison
CNOT vs CZ: How the Two Workhorse Entangling Gates Differ
CNOT and CZ both create entanglement from a superposition input, and both are locally equivalent — you can turn one into the other by sandwiching with Hadamards. But they differ in what they do to the computational basis and in how hardware platforms usually implement them. Which one belongs in your circuit depends more on symmetry and compilation than on raw power.
Side by side
| Aspect | CNOT Gate (Controlled-X) | Controlled-Z Gate |
|---|---|---|
| Visible effect | Flips the target qubit when the control is . Leaves it alone when the control is . | Flips the sign of . Leaves every other computational basis state alone. |
| Symmetry between the two qubits | Asymmetric — there is a distinguished control and a distinguished target. | Symmetric — both qubits play the same role. Swap them and the gate is identical. |
| When the input is a product state | Output is still a product state. Only when the control is in superposition does CNOT actually entangle. | Output is still a product state. Only when at least one qubit is in superposition does CZ actually entangle. |
| Relation to each other | CNOT = (I H) · CZ · (I H). Apply Hadamard to the target before and after a CZ to get CNOT. | CZ = (I H) · CNOT · (I H). The basis-change identity runs both ways. |
| Native hardware implementation | Native on many platforms (trapped ions, some superconducting architectures), but on many superconducting-transmon devices CNOT is compiled from CZ or from cross-resonance pulses. | Native on fixed-frequency transmon processors that use tunable-coupler or flux-activated two-qubit interactions. Compilation often prefers CZ because it is symmetric. |
| Where you see it in canonical algorithms | Bell states, quantum teleportation, the Deutsch algorithm oracle, quantum error correction stabilizer measurements. | Phase kickback patterns, cluster states for measurement-based quantum computing, variational ansätze, surface-code stabilizers. |
When to reach for which
- Use CNOT when the circuit has a natural 'control decides, target flips' reading — most conditional-classical-logic translations land here.
- Use CZ when the circuit is symmetric in the two qubits, or when you are building phase-kickback / variational ansatz structures.
- On superconducting hardware, let the compiler choose: if the native gate is CZ, a hand-written CNOT will compile to CZ + Hadamards anyway.
- In error correction, CZ is often preferred because the two-qubit symmetry simplifies stabilizer bookkeeping.
- For teaching or proof-reading circuits, CNOT is easier to reason about by hand — it directly mirrors classical reversible logic.
Common trap
It is tempting to think CNOT entangles and CZ doesn't, because CZ doesn't flip any bits. It looks like nothing happened. But measure the post-CZ state in any non-computational basis and the correlations show up immediately — CZ entangles just as thoroughly as CNOT. The illusion comes from computational-basis measurement hiding the phase.