Controlled-Z Gate

The controlled-Z gate is the two-qubit gate that does almost nothing — and that "almost" is the whole point. It leaves three of the four computational basis states exactly where they are and stamps a single minus sign on ∣11⟩|11\rangle: in matrix form it is diag(1,1,1,−1)\mathrm{diag}(1,1,1,-1), the most economical entangler in the toolbox. Because Z∣0⟩=∣0⟩Z|0\rangle=|0\rangle and Z∣1⟩=−∣1⟩Z|1\rangle=-|1\rangle, applying ZZ to a target only when the control is ∣1⟩|1\rangle produces precisely that lone sign flip. Diagonal in the computational basis, CZ inherits every convenience a diagonal matrix can offer — it commutes with itself and with all ZZ-type operators, it is Hermitian, and it is its own inverse. Two features make it the gate theorists reach for. The first is symmetry: the phase −1-1 appears exactly when both qubits are excited, a condition blind to which one you call the control. Swap the two wires and the matrix is unchanged, S CZ S=CZS\,\mathrm{CZ}\,S=\mathrm{CZ} — in sharp contrast to CNOT, where control and target play visibly different roles. That symmetry is why CZ is the native edge of cluster and graph states: lay down a qubit at each vertex, a CZ across each edge, and because all the CZ gates commute the order never matters. The second feature is its kinship with CNOT. Conjugating the target by a Hadamard turns one into the other, CNOT=(I⊗H) CZ (I⊗H)\mathrm{CNOT}=(I\otimes H)\,\mathrm{CZ}\,(I\otimes H), on the strength of the single identity HZH=XHZH=X — one of the most-used circuit equivalences in all of quantum computing. And physically CZ is not a paper abstraction: a conditional phase is the native two-qubit interaction of superconducting transmons and of Rydberg neutral atoms, so on much of today's hardware CZ is what the machine actually does, and CNOT is the thing built out of it.

Key takeaways
  • The controlled-Z gate applies a Pauli ZZ to a target conditioned on the control being ∣1⟩|1\rangle; in the computational basis it is diag(1,1,1,−1)\mathrm{diag}(1,1,1,-1) — a single sign flip on ∣11⟩|11\rangle and nothing else.
  • CZ is fully symmetric between its two qubits: there is no real distinction between control and target, so S CZ S=CZS\,\mathrm{CZ}\,S=\mathrm{CZ}, making it the natural entangling edge of cluster states and measurement-based computation.
  • It is Hadamard-conjugated CNOT, CNOT=(I⊗H) CZ (I⊗H)\mathrm{CNOT}=(I\otimes H)\,\mathrm{CZ}\,(I\otimes H), because HZH=XHZH=X; any platform with CZ has CNOT for two extra single-qubit gates.
  • Being diagonal, CZ commutes with all ZZ-type operators and with itself, and it is Hermitian and self-inverse: CZ†=CZ\mathrm{CZ}^\dagger=\mathrm{CZ} and CZ2=I\mathrm{CZ}^2=I.
  • CZ is maximally entangling — CZ ∣+⟩∣+⟩\mathrm{CZ}\,|+\rangle|+\rangle has concurrence 11 — and with single-qubit gates plus a non-Clifford phase it completes a universal gate set.
  • Key idea: CZ is the diagonal gate diag(1,1,1,−1)\mathrm{diag}(1,1,1,-1) — a single sign flip on ∣11⟩|11\rangle — that is symmetric in its two qubits and equals Hadamard-conjugated CNOT, CNOT=(I⊗H) CZ (I⊗H)\mathrm{CNOT}=(I\otimes H)\,\mathrm{CZ}\,(I\otimes H).

Where this lives today

The controlled-Z gate is not a blackboard idealization but a daily workhorse of running quantum hardware. On superconducting processors — the platform behind Google's and IBM's largest machines — a tunable coupler or a flux pulse brings the ∣11⟩|11\rangle level into a brief avoided crossing with the higher ∣02⟩|02\rangle state, so the pair returns having collected a conditional π\pi phase: that is a CZ, executed in tens of nanoseconds, and Google's Sycamore-class devices use exactly this controlled-phase interaction as their entangling gate. Neutral-atom arrays realize CZ through the Rydberg blockade, where exciting one atom shifts its neighbor's levels enough to block a second excitation, imprinting the conditional phase; two-qubit CZ fidelities above 99.5% have been reported in these systems, among the highest for any platform. In the measurement-based paradigm, CZ is the only entangling operation needed: a photonic or atomic cluster state is grown by applying CZ across the edges of a graph, after which the entire computation runs on single-qubit measurements alone — the model that underlies much of photonic quantum computing. And in fault tolerance, CZ-type gates weave the entangling layers of the surface code, whose stabilizer checks are measured by short CZ or CNOT circuits between data and ancilla qubits. The open frontier is fidelity and speed: pushing two-qubit CZ error rates below the surface-code threshold, and suppressing the leakage into ∣02⟩|02\rangle-like states that is the characteristic failure mode of the very avoided crossing that makes the gate work.

The physical picture

Think of CZ as a conditional minus sign. It watches both qubits and does exactly nothing — until it finds both of them in state ∣1⟩|1\rangle, at which moment it multiplies that one amplitude by −1-1. Because −1=eiπ-1=e^{i\pi}, the two qubits acquire a π\pi phase only when they "agree" on being excited, and only then. Every other basis state passes through untouched. The gate's entire content is one entry of a 4×44\times4 diagonal matrix, and the first figure is that content drawn as a table: the phase (−1)ct(-1)^{ct} that each basis state ∣ct⟩|ct\rangle collects, with the lone flipped corner picked out in red.

Figure
CZ is diagonal: it stamps a −1 on the single both-excited basis state (the state 11) and leaves the other three alone, so the phase collected by a basis state c t is (−1) raised to the product c·t — and because c·t = t·c the table is unchanged when the two qubits are swapped, which is why either qubit may be called the control
The conditional sign flip: phase = (−1) to the power c·t, nonzero only on |11⟩ target t t = 0 t = 1 control c c = 0 c = 1 |00⟩ +1 |01⟩ +1 |10⟩ +1 |11⟩ −1 CZ |ct⟩ = (−1) to the c·t times |ct⟩ · symmetric under c ⟷ t

Seen from the other side, the same gate is a familiar bit-flip in disguise. Rotate the target's measurement axis with a Hadamard — which sends the ZZ axis onto the XX axis, the algebraic content of HZH=XHZH=X — and the conditional phase flip becomes a conditional bit flip. That is the entire relationship between CZ and CNOT: they are one operation viewed in two frames, interchangeable for the price of a Hadamard on each side of the target. This is more than a curiosity. On hardware where the native interaction produces a conditional phase, CNOT is never built directly; it is always CZ wrapped in Hadamards. The second figure is that identity as a circuit, with the symmetric two-dot CZ symbol on the left and the asymmetric control-and-target CNOT on the right.

Figure
The most-used circuit identity for CZ: conjugating the target of a controlled-Z by Hadamard gates turns it into a controlled-NOT, because H Z H = X — the symmetric two-dot CZ on the left equals the control-and-target CNOT on the right sandwiched by H, so any device with a native CZ has CNOT for two extra single-qubit gates
CNOT = (I ⊗ H) · CZ · (I ⊗ H), from H Z H = X control target CZ symmetric = H H CNOT control ≠ target

Two consequences flow from these pictures and organize the rest of the article. Because CZ is diagonal, a whole network of CZ gates commutes and can be applied in any order — the property that makes cluster-state preparation parallelizable and order-independent. And because a Hadamard on either factor rewrites a phase flip as a bit flip, "which qubit is the control," "phase or bit flip," and "CZ or CNOT" are all frame choices, not physical facts. The same operation looks like a pure phase gate in the computational basis and a genuine flip in the ∣±⟩|\pm\rangle basis.

The core equations

The definition is a single diagonal matrix. Fixing the ordering ∣00⟩,∣01⟩,∣10⟩,∣11⟩|00\rangle,|01\rangle,|10\rangle,|11\rangle for rows and columns turns the abstract "conditional ZZ" into four numbers on the diagonal, three of them +1+1 and one of them −1-1.

CZ=(100001000010000−1)(1)\mathrm{CZ}=\begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&-1\end{pmatrix} \qquad (1)

where: CZ\mathrm{CZ} — the controlled-Z, equivalently the controlled-phase gate at angle π\pi; the diagonal entries — the phases collected by ∣00⟩,∣01⟩,∣10⟩,∣11⟩|00\rangle,|01\rangle,|10\rangle,|11\rangle; the lone −1-1 — the sign flip on ∣11⟩|11\rangle. Read off at once: CZ is diagonal, so it is Hermitian, and squaring the diagonal gives all +1+1, so it is unitary and self-inverse. The same gate written in projector form makes the word "controlled" literal: apply the identity to the target when the control is ∣0⟩|0\rangle, and apply ZZ when the control is ∣1⟩|1\rangle. This is the general controlled-UU template with U=ZU=Z.

CZ=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗Z(2)\mathrm{CZ}=|0\rangle\langle 0|\otimes I+|1\rangle\langle 1|\otimes Z \qquad (2)

where: ∣0⟩⟨0∣, ∣1⟩⟨1∣|0\rangle\langle 0|,\,|1\rangle\langle 1| — projectors onto the two control states; II — identity applied to the target when the control is ∣0⟩|0\rangle; ZZ — Pauli ZZ applied to the target when the control is ∣1⟩|1\rangle. The reading: this is the definitional form, and Derivation A expands it back into equation (1). Applied to a basis state, CZ returns the same state times a phase that is −1-1 exactly when both bits are 11. Written as (−1)ct(-1)^{ct} it wears its symmetry on its sleeve, since ct=tcct=tc.

CZ ∣c⟩∣t⟩=(−1)c t ∣c⟩∣t⟩(3)\mathrm{CZ}\,|c\rangle|t\rangle=(-1)^{c\,t}\,|c\rangle|t\rangle \qquad (3)

where: c,t∈{0,1}c,t\in\{0,1\} — the computational-basis values of control and target; (−1)ct(-1)^{ct} — the collected phase, equal to −1-1 iff c=t=1c=t=1. The reading: the exponent ctct is symmetric in c↔tc\leftrightarrow t, so the "control" and "target" labels are pure convention — the fact drawn in the first figure. Conjugating the target factor by a Hadamard converts the conditional ZZ into a conditional XX, giving the CZ–CNOT equivalence. It is the single most-used circuit identity involving CZ.

CNOT=(I⊗H) CZ (I⊗H)(4)\mathrm{CNOT}=(I\otimes H)\,\mathrm{CZ}\,(I\otimes H) \qquad (4)

where: HH — the Hadamard on the target qubit; CNOT=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗X\mathrm{CNOT}=|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes X — the controlled-NOT with the same control and target. The reading: the whole identity rests on HIH=IHIH=I and HZH=XHZH=X (Derivation B), so the control projectors survive untouched while ZZ becomes XX. Because the only nontrivial eigenvalue is −1-1 and (−1)2=1(-1)^2=1, CZ is at once Hermitian and its own inverse — it undoes itself, so a CZ applied twice is the identity.

CZ†=CZ,CZ2=I(5)\mathrm{CZ}^\dagger=\mathrm{CZ},\qquad \mathrm{CZ}^2=I \qquad (5)

where: †\dagger — conjugate transpose; II — the 4×44\times4 identity. The reading: a diagonal real matrix is Hermitian automatically, and squaring diag(1,1,1,−1)\mathrm{diag}(1,1,1,-1) returns diag(1,1,1,1)\mathrm{diag}(1,1,1,1), so CZ is an involution like every Pauli. CZ is the ϕ=π\phi=\pi member of a continuous one-parameter family, the controlled-phase gate. This family is the diagonal building block of the quantum Fourier transform and interpolates smoothly from the identity to CZ.

CPHASE(ϕ)=diag(1,1,1,eiϕ),CZ=CPHASE(π)(6)\mathrm{CPHASE}(\phi)=\mathrm{diag}(1,1,1,e^{i\phi}),\qquad \mathrm{CZ}=\mathrm{CPHASE}(\pi) \qquad (6)

where: ϕ\phi — the conditional phase; ϕ=0\phi=0 gives II, ϕ=π/2\phi=\pi/2 gives controlled-SS, ϕ=π\phi=\pi gives CZ. The reading: turning ϕ\phi up from 00 continuously "switches on" the entangling power, which is maximal at the endpoint ϕ=π\phi=\pi. Finally CZ can be written as the exponential of an Ising-type generator, the form that connects it to the physical interaction ZZZZ used to realize it on hardware.

CZ=exp⁡ ⁣(iπ4 (I−Z)⊗(I−Z))(7)\mathrm{CZ}=\exp\!\Big(\tfrac{i\pi}{4}\,(I-Z)\otimes(I-Z)\Big) \qquad (7)

where: (I−Z)/2=∣1⟩⟨1∣(I-Z)/2=|1\rangle\langle1| — the excited-state projector, so (I−Z)⊗(I−Z)=4 ∣11⟩⟨11∣(I-Z)\otimes(I-Z)=4\,|11\rangle\langle11| picks out the ∣11⟩|11\rangle subspace; exp⁡\exp — matrix exponential of the diagonal generator. The reading: the exponent equals iπ ∣11⟩⟨11∣i\pi\,|11\rangle\langle11|, and eiπ=−1e^{i\pi}=-1 delivers exactly the one sign flip (Derivation A, closing steps).

Derivation ABuilding the controlled-Z matrix from its prescription

The goal is to start from the plain-English rule "apply ZZ to the target only when the control is ∣1⟩|1\rangle," write it as the operator ∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗Z|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes Z, and grind it into the explicit diagonal matrix diag(1,1,1,−1)\mathrm{diag}(1,1,1,-1) — then read three structural facts straight off the result: the compact phase formula (−1)ct(-1)^{ct}, the manifest symmetry between control and target, and the Ising generator that hardware actually implements. Every later property of CZ is a corollary of this one computation, so it is worth doing by hand once.

Step 1. Take the projector form of equation (2) and evaluate each tensor block using I=diag(1,1)I=\mathrm{diag}(1,1) and Z=diag(1,−1)Z=\mathrm{diag}(1,-1). The first term is ∣0⟩⟨0∣⊗I=diag(1,1,0,0)|0\rangle\langle0|\otimes I=\mathrm{diag}(1,1,0,0) — the top-left 2×22\times2 block, acting when the control is ∣0⟩|0\rangle. Why: a projector onto ∣0⟩|0\rangle zeroes out the lower block, so this term only touches the c=0c=0 sector, where it does nothing.

Step 2. The second term is ∣1⟩⟨1∣⊗Z=diag(0,0,1,−1)|1\rangle\langle1|\otimes Z=\mathrm{diag}(0,0,1,-1) — the bottom-right block, carrying the ZZ that acts when the control is ∣1⟩|1\rangle. Adding the two block-diagonal pieces gives CZ=diag(1,1,1,−1)\mathrm{CZ}=\mathrm{diag}(1,1,1,-1), exactly equation (1). Why: the two control sectors are orthogonal, so the sum simply stacks them, and only the ∣11⟩|11\rangle entry — control ∣1⟩|1\rangle and target ∣1⟩|1\rangle — inherits the −1-1 from ZZ.

Step 3. Read the phase off the diagonal: the entry for ∣ct⟩|ct\rangle is −1-1 iff c=t=1c=t=1, which is compactly (−1)ct(-1)^{ct}, equation (3). Since ct=tcct=tc for bits, the phase is invariant under exchanging the two qubits, so with SS the SWAP operator S CZ S=CZS\,\mathrm{CZ}\,S=\mathrm{CZ}. Why: this is the symmetry that distinguishes CZ from CNOT — there is no distinguished control, and the same figure is drawn whether you enter the table by row or by column.

Step 4. Recover the generator form. Let P=∣1⟩⟨1∣=(I−Z)/2P=|1\rangle\langle1|=(I-Z)/2, so (I−Z)⊗(I−Z)=4 P⊗P=4 ∣11⟩⟨11∣(I-Z)\otimes(I-Z)=4\,P\otimes P=4\,|11\rangle\langle11|; then iπ4⋅4 ∣11⟩⟨11∣=iπ ∣11⟩⟨11∣\tfrac{i\pi}{4}\cdot4\,|11\rangle\langle11|=i\pi\,|11\rangle\langle11|, and exponentiating a diagonal operator exponentiates each entry: exp⁡(iπ ∣11⟩⟨11∣)=diag(1,1,1,eiπ)=diag(1,1,1,−1)\exp(i\pi\,|11\rangle\langle11|)=\mathrm{diag}(1,1,1,e^{i\pi})=\mathrm{diag}(1,1,1,-1). Why: this is CZ as eiπ/4 ZZe^{i\pi/4\,ZZ} up to single-qubit phases, the shape of the physical ZZZZ coupling that superconducting and trapped-ion hardware turn on for a fixed time to realize the gate. *Verified: each basis state returns to itself with phase (−1)ct(-1)^{ct}, reproducing diag(1,1,1,−1)\mathrm{diag}(1,1,1,-1); the generator gives eiπ=−1e^{i\pi}=-1 on ∣11⟩|11\rangle and +1+1 elsewhere, with no residual global phase in this convention.*

Go deeper · Derivation B · 1 minTurning a controlled-Z into a controlled-NOT
Derivation BTurning a controlled-Z into a controlled-NOT

The aim is to prove the workhorse identity CNOT=(I⊗H) CZ (I⊗H)\mathrm{CNOT}=(I\otimes H)\,\mathrm{CZ}\,(I\otimes H) from the ground up, showing that it rests on the single fact HZH=XHZH=X and that the Hadamard only ever touches the target factor, leaving the control projectors alone. This is the reason any hardware whose native gate is a conditional phase can nonetheless run the standard CNOT-based circuits: you never build CNOT directly, you build CZ and dress the target with two Hadamards.

Step 1. Insert the projector form of CZ and let the Hadamards act only on the target tensor factor: (I⊗H)(∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗Z)(I⊗H)=∣0⟩⟨0∣⊗HIH+∣1⟩⟨1∣⊗HZH(I\otimes H)(|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes Z)(I\otimes H)=|0\rangle\langle0|\otimes HIH+|1\rangle\langle1|\otimes HZH. Why: the control projectors live on the first factor, where I⊗HI\otimes H acts as the identity, so they pass through untouched — only the target operators get sandwiched.

Step 2. Evaluate the two sandwiches. Hadamard is involutory, H2=IH^2=I, so HIH=IHIH=I; and Hadamard maps the phase-flip to the bit-flip, HZH=XHZH=X, because HH swaps the ZZ and XX axes on the Bloch sphere. Why: HZH=XHZH=X is the one nontrivial input — geometrically it is a 180∘180^\circ rotation about the diagonal axis that exchanges z^\hat z and x^\hat x, algebraically it is checked by multiplying the three 2×22\times2 matrices.

Step 3. Substitute back: ∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗X|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes X, which is by definition the controlled-NOT. Why: the conditional ZZ has become a conditional XX while the control structure is identical, completing the identity; running it in reverse, CZ=(I⊗H) CNOT (I⊗H)\mathrm{CZ}=(I\otimes H)\,\mathrm{CNOT}\,(I\otimes H), since HH is its own inverse. *Verified: HZH=XHZH=X and HIH=IHIH=I by direct matrix multiplication; the resulting operator is ∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗X=CNOT|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes X=\mathrm{CNOT}, and the identity is symmetric because H=H−1H=H^{-1}.*

Go deeper · Derivation C · 1 minWhy controlled-Z is maximally entangling
Derivation CWhy controlled-Z is maximally entangling

The purpose here is to show quantitatively that CZ, for all its apparent laziness, is a maximally entangling gate: fed the unentangled product ∣+⟩∣+⟩|+\rangle|+\rangle it outputs a state whose two qubits are as entangled as two qubits can be. We compute the output, put it into Schmidt form to expose the entanglement, evaluate the concurrence to get a single number, and trace out one qubit to confirm the leftover is maximally mixed — three independent certificates of the same fact.

Step 1. Expand the input and apply the phase rule. The product ∣+⟩∣+⟩=12(∣00⟩+∣01⟩+∣10⟩+∣11⟩)|+\rangle|+\rangle=\tfrac12(|00\rangle+|01\rangle+|10\rangle+|11\rangle) is a flat superposition over all four basis states; CZ flips the sign of the ∣11⟩|11\rangle term alone, giving ∣ψ⟩=12(∣00⟩+∣01⟩+∣10⟩−∣11⟩)|\psi\rangle=\tfrac12(|00\rangle+|01\rangle+|10\rangle-|11\rangle). Why: only one amplitude changes, yet — as the next steps show — that single sign is enough to destroy every tensor-product factorization the input had.

Step 2. Group by the first qubit to find the Schmidt decomposition: ∣ψ⟩=12(∣0⟩(∣0⟩+∣1⟩)+∣1⟩(∣0⟩−∣1⟩))=12(∣0⟩∣+⟩+∣1⟩∣−⟩)|\psi\rangle=\tfrac12\big(|0\rangle(|0\rangle+|1\rangle)+|1\rangle(|0\rangle-|1\rangle)\big)=\tfrac{1}{\sqrt2}\big(|0\rangle|+\rangle+|1\rangle|-\rangle\big), using ∣0⟩+∣1⟩=2 ∣+⟩|0\rangle+|1\rangle=\sqrt2\,|+\rangle and ∣0⟩−∣1⟩=2 ∣−⟩|0\rangle-|1\rangle=\sqrt2\,|-\rangle. Why: ∣+⟩|+\rangle and ∣−⟩|-\rangle are orthonormal, so this is a genuine Schmidt form with two equal coefficients 1/21/\sqrt2 — equal Schmidt weights are the signature of maximal entanglement.

Step 3. Certify with the concurrence. For ∣ψ⟩=a∣00⟩+b∣01⟩+c∣10⟩+d∣11⟩|\psi\rangle=a|00\rangle+b|01\rangle+c|10\rangle+d|11\rangle the concurrence is C=2∣ad−bc∣C=2|ad-bc|; here a=b=c=12a=b=c=\tfrac12, d=−12d=-\tfrac12, so C=2∣12⋅(−12)−12⋅12∣=2⋅12=1C=2\left|\tfrac12\cdot(-\tfrac12)-\tfrac12\cdot\tfrac12\right|=2\cdot\tfrac12=1. Why: C=1C=1 is the maximum, attained only by Bell-class states, so CZ acting on ∣+⟩∣+⟩|+\rangle|+\rangle is provably maximally entangling — the single sign flip does all the work.

Step 4. Trace out the second qubit. From the Schmidt form the reduced state is ρA=12(∣0⟩⟨0∣+∣1⟩⟨1∣)=I2\rho_A=\tfrac12(|0\rangle\langle0|+|1\rangle\langle1|)=\tfrac{I}{2}, the maximally mixed single-qubit state, with von Neumann entropy S=log⁡22=1S=\log_2 2=1 bit. Why: a maximally mixed marginal is the operational meaning of maximal entanglement — each qubit alone carries zero information, all of it living in the correlations. *Verified: output 12(∣00⟩+∣01⟩+∣10⟩−∣11⟩)\tfrac12(|00\rangle+|01\rangle+|10\rangle-|11\rangle) has unit norm, Schmidt coefficients 1/2,1/21/\sqrt2,1/\sqrt2, concurrence C=1C=1, and reduced state I/2I/2 with S=1S=1 bit — three consistent certificates of maximal entanglement.*

Limiting cases

CZ sits at one endpoint of the continuous controlled-phase family and collapses to simpler objects in special cases; the table collects the ones worth remembering.

CaseResultMeaning
Zero phaseCPHASE(0)=I\mathrm{CPHASE}(0)=Ino conditional phase at all; CZ is the far endpoint ϕ=π\phi=\pi of this family, so the entangling power switches on continuously with ϕ\phi
Controlled-SSCPHASE(π/2)=diag(1,1,1,i)\mathrm{CPHASE}(\pi/2)=\mathrm{diag}(1,1,1,i)the ϕ=π/2\phi=\pi/2 member, the diagonal gate that appears in the quantum Fourier transform between qubit pairs
Self-inverseCZ2=diag(1,1,1,(−1)2)=I\mathrm{CZ}^2=\mathrm{diag}(1,1,1,(-1)^2)=IHermitian and its own inverse, since (−1)2=1(-1)^2=1 on the only nontrivial entry — two CZ gates cancel
Either qubit ∣0⟩|0\rangleCZ ∣a⟩∣0⟩=∣a⟩∣0⟩\mathrm{CZ}\,|a\rangle|0\rangle=|a\rangle|0\rangletrivial on any computational-basis input containing a ∣0⟩|0\rangle; entanglement arises only on superpositions that reach ∣11⟩|11\rangle
Clifford conjugationCZ (X⊗I) CZ=X⊗Z\mathrm{CZ}\,(X\otimes I)\,\mathrm{CZ}=X\otimes ZCZ maps Paulis to Paulis, so it is a Clifford gate — efficiently classically simulable by Gottesman–Knill

Worked examples

1 · Controlled-Z is maximally entangling (fully worked)

Apply CZ to the product state ∣+⟩∣+⟩|+\rangle|+\rangle. Show the output is entangled, and quantify how entangled with the concurrence and the reduced-state entropy.

Step 1. Expand the input over the computational basis: ∣+⟩∣+⟩=12(∣00⟩+∣01⟩+∣10⟩+∣11⟩)|+\rangle|+\rangle=\tfrac12(|00\rangle+|01\rangle+|10\rangle+|11\rangle), an equal superposition with all four amplitudes +12+\tfrac12. Apply CZ, which by equation (3) flips only the ∣11⟩|11\rangle sign: ∣ψ⟩=12(∣00⟩+∣01⟩+∣10⟩−∣11⟩)|\psi\rangle=\tfrac12(|00\rangle+|01\rangle+|10\rangle-|11\rangle).

Step 2. Test separability by attempting to factor. Grouping on the first qubit gives ∣ψ⟩=12(∣0⟩∣+⟩+∣1⟩∣−⟩)|\psi\rangle=\tfrac{1}{\sqrt2}(|0\rangle|+\rangle+|1\rangle|-\rangle): the second qubit is ∣+⟩|+\rangle when the first is ∣0⟩|0\rangle but ∣−⟩|-\rangle when the first is ∣1⟩|1\rangle, so no single product ∣ϕA⟩∣ϕB⟩|\phi_A\rangle|\phi_B\rangle can reproduce it. The state is entangled.

Step 3. Quantify. With amplitudes a=b=c=12a=b=c=\tfrac12, d=−12d=-\tfrac12, the concurrence is C=2∣ad−bc∣=2∣−14−14∣=1C=2|ad-bc|=2\left|-\tfrac14-\tfrac14\right|=\mathbf{1}, the maximum. Tracing out either qubit leaves ρ=I/2\rho=I/2, entropy S=log⁡22=1 bitS=\log_2 2=\mathbf{1\ \text{bit}}. CZ turns a product state into a maximally entangled one: C=1C=1, one bit of entanglement entropy.

2 · A Bell state from controlled-Z (fully worked)

Starting from ∣00⟩|00\rangle, apply H⊗HH\otimes H, then CZ, then a Hadamard on the second qubit. Show you land on the Bell state ∣Φ+⟩=12(∣00⟩+∣11⟩)|\Phi^+\rangle=\tfrac{1}{\sqrt2}(|00\rangle+|11\rangle), and connect the circuit to the CNOT construction.

Step 1. The two Hadamards make a flat superposition: (H⊗H)∣00⟩=∣+⟩∣+⟩=12(∣00⟩+∣01⟩+∣10⟩+∣11⟩)(H\otimes H)|00\rangle=|+\rangle|+\rangle=\tfrac12(|00\rangle+|01\rangle+|10\rangle+|11\rangle).

Step 2. CZ flips the ∣11⟩|11\rangle sign: 12(∣00⟩+∣01⟩+∣10⟩−∣11⟩)\tfrac12(|00\rangle+|01\rangle+|10\rangle-|11\rangle). Regroup on the first qubit as 12(∣0⟩(∣0⟩+∣1⟩)+∣1⟩(∣0⟩−∣1⟩))\tfrac12\big(|0\rangle(|0\rangle+|1\rangle)+|1\rangle(|0\rangle-|1\rangle)\big).

Step 3. Apply I⊗HI\otimes H to the second qubit, using H(∣0⟩+∣1⟩)=2 ∣0⟩H(|0\rangle+|1\rangle)=\sqrt2\,|0\rangle and H(∣0⟩−∣1⟩)=2 ∣1⟩H(|0\rangle-|1\rangle)=\sqrt2\,|1\rangle: the state becomes 12(∣0⟩2∣0⟩+∣1⟩2∣1⟩)=12(∣00⟩+∣11⟩)=∣Φ+⟩\tfrac12\big(|0\rangle\sqrt2|0\rangle+|1\rangle\sqrt2|1\rangle\big)=\tfrac{1}{\sqrt2}(|00\rangle+|11\rangle)=\mathbf{|\Phi^+\rangle}.

Step 4. Sanity-check against CNOT. Since (I⊗H) CZ (I⊗H)=CNOT(I\otimes H)\,\mathrm{CZ}\,(I\otimes H)=\mathrm{CNOT}, the circuit (I⊗H) CZ (H⊗H)(I\otimes H)\,\mathrm{CZ}\,(H\otimes H) equals CNOT (H⊗I)\mathrm{CNOT}\,(H\otimes I) — a Hadamard on the control followed by CNOT, which is exactly the textbook Bell-pair generator. The CZ circuit reproduces ∣Φ+⟩|\Phi^+\rangle and matches the standard CNOT construction, as the conjugation identity guarantees.

3 · Controlled-Z is a Clifford gate

Conjugate the Pauli X⊗IX\otimes I by CZ and show the result is again a Pauli. Explain why this places CZ in the Clifford group.

Step 1. Use the projector form CZ=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗Z\mathrm{CZ}=|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes Z and act on X⊗IX\otimes I. Because XX flips the control, XX commutes past the CZ only at the cost of a ZZ on the target: the direct computation gives CZ (X⊗I) CZ=X⊗Z\mathrm{CZ}\,(X\otimes I)\,\mathrm{CZ}=X\otimes Z.

Step 2. The three natural generators transform as X⊗I↦X⊗ZX\otimes I\mapsto X\otimes Z, I⊗X↦Z⊗XI\otimes X\mapsto Z\otimes X, and Z⊗I↦Z⊗IZ\otimes I\mapsto Z\otimes I, I⊗Z↦I⊗ZI\otimes Z\mapsto I\otimes Z — every Pauli maps to a Pauli. CZ normalizes the Pauli group, so it is a Clifford gate.

Step 3. Consequence: circuits built only from CZ, CNOT, HH, SS, and Pauli gates are stabilizer circuits, efficiently simulable on a classical computer by the Gottesman–Knill theorem. Entangling power alone is not quantum advantage — CZ entangles maximally yet is classically tractable; universality needs a non-Clifford gate such as TT.

Physics of the portrait

The controlled-Z gate has no single inventor and no dramatic discovery story — it emerged, quietly and repeatedly, wherever people asked what the simplest two-qubit gate could be. Its biography is the biography of the two-qubit gate itself: from Deutsch's abstract networks, through the proof that a single entangler suffices for universality, to the day a conditional phase became something a chip in a dilution refrigerator does millions of times a second.

Origins · 2 mincontrolled-Z gate and how this was discovered
CG
controlled-Z gate
the symmetric diagonal entangler diag(1,1,1,−1), equal to Hadamard-conjugated CNOT · the quantum circuit model and one-way quantum computation

The controlled-Z gate is less a discovery than a convergence. When David Deutsch recast computation as networks of quantum logic gates in 1989, the controlled operations he needed were exactly of this shape — a unitary on a target, switched by the state of a control. In 1995 a landmark paper by Barenco, Bennett, Cleve, DiVincenzo, Margolus, Shor, Sleator, Smolin and Weinfurter proved that any two-qubit entangling gate, together with arbitrary single-qubit gates, is universal for quantum computation, putting CZ and CNOT on equal footing as canonical two-qubit primitives — related, as they emphasized, by nothing more than local Hadamards. The controlled-phase gate then took on a life the CNOT never could: in 2001 Robert Raussendorf and Hans Briegel built the one-way (measurement-based) quantum computer on cluster states, which are made by initializing every qubit in ∣+⟩|+\rangle and firing a CZ across each edge of a lattice — a construction that works because all CZ gates commute and the order is irrelevant, the symmetry that CNOT lacks. Meanwhile experimentalists found that nature prefers the phase. Superconducting qubits acquire a conditional π\pi phase when the ∣11⟩|11\rangle level is tuned near the non-computational ∣02⟩|02\rangle state and back, and neutral atoms acquire one through the Rydberg blockade, so on both platforms CZ (or its tunable cousin CPHASE(ϕ)\mathrm{CPHASE}(\phi)) is the native entangler and CNOT is the derived gate. The 2009 demonstration by DiCarlo and collaborators of a two-qubit superconducting processor running Grover and Deutsch–Jozsa used exactly this controlled-phase interaction. What began as a line in a matrix is now, on much of the world's quantum hardware, the physical thing the machine knows how to do.

History
1985
— Deutsch formulates the universal quantum computer and the notion of quantum gates
1989
— Deutsch casts quantum computation as networks of quantum logic gates, including controlled operations
1995
— Barenco and collaborators prove a single entangling two-qubit gate plus single-qubit gates is universal
2001
— Raussendorf and Briegel build the one-way quantum computer on cluster states whose edges are CZ gates
2009
— DiCarlo and collaborators run two-qubit algorithms on a superconducting chip using the native controlled-phase gate

Going further

Texts. Nielsen & Chuang, Quantum Computation and Quantum Information, §4.3 (controlled operations) and §4.5 (universality) · Preskill, Lecture Notes for Physics 219, Ch. 5–6 · Watrous, The Theory of Quantum Information, Ch. 2 · Wilde, Quantum Information Theory, Ch. 3 · Kitaev, Shen & Vyalyi, Classical and Quantum Computation, §8 · Mermin, Quantum Computer Science, Ch. 2 · Barenco et al., "Elementary gates for quantum computation," Phys. Rev. A 52, 3457 (1995) · Raussendorf & Briegel, "A one-way quantum computer," Phys. Rev. Lett. 86, 5188 (2001).

Provenance. The matrix, projector, and phase forms and the identities CZ=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗Z=diag(1,1,1,−1)\mathrm{CZ}=|0\rangle\langle0|\otimes I+|1\rangle\langle1|\otimes Z=\mathrm{diag}(1,1,1,-1) are standard (Nielsen & Chuang §4.3). A verifier should confirm: (1) the expansion of the controlled-UU form into diag(1,1,1,−1)\mathrm{diag}(1,1,1,-1); (2) HZH=XHZH=X giving CNOT=(I⊗H) CZ (I⊗H)\mathrm{CNOT}=(I\otimes H)\,\mathrm{CZ}\,(I\otimes H); (3) CZ†=CZ\mathrm{CZ}^\dagger=\mathrm{CZ} and CZ2=I\mathrm{CZ}^2=I; (4) the generator form via P⊗P=∣11⟩⟨11∣P\otimes P=|11\rangle\langle11| and eiπ=−1e^{i\pi}=-1; (5) CZ ∣+⟩∣+⟩=12(∣00⟩+∣01⟩+∣10⟩−∣11⟩)\mathrm{CZ}\,|+\rangle|+\rangle=\tfrac12(|00\rangle+|01\rangle+|10\rangle-|11\rangle) with concurrence C=1C=1 and reduced state I/2I/2; (6) the Clifford conjugation CZ (X⊗I) CZ=X⊗Z\mathrm{CZ}\,(X\otimes I)\,\mathrm{CZ}=X\otimes Z; (7) the Bell circuit (I⊗H) CZ (H⊗H)∣00⟩=12(∣00⟩+∣11⟩)(I\otimes H)\,\mathrm{CZ}\,(H\otimes H)|00\rangle=\tfrac{1}{\sqrt2}(|00\rangle+|11\rangle). No empirical or fabricated numbers are used; hardware figures are cited as reported ranges.

Prerequisites. Pauli Gates (X, Y, Z) · Hadamard Gate · Controlled-U Gates · Quantum Circuit Model. Leads to. CNOT Gate · Circuit Identities and Equivalences · Universal Gate Sets · SWAP Gate.

Ask the tutor: ask me to entangle any two-qubit state with CZ, convert between CZ and CNOT circuits, or build a cluster state edge by edge.

Is the controlled-Z gate really symmetric, or is that just a convention?

It is genuinely symmetric, not a convention. The formal statement is S CZ S=CZS\,\mathrm{CZ}\,S=\mathrm{CZ}, where SS is the SWAP that exchanges the two qubits: conjugating CZ by SWAP returns CZ itself. The reason is that the collected phase is (−1)ct(-1)^{ct} and ct=tcct=tc for bits, so the condition "both qubits are ∣1⟩|1\rangle" does not care which qubit is which. This is exactly where CZ differs from CNOT — swapping the qubits of a CNOT gives a different CNOT with control and target reversed. So calling one qubit of a CZ the "control" is a labelling choice with no physical content, which is precisely why CZ is the natural edge in a graph state, where edges are undirected.

If CZ and CNOT are related by Hadamards, why keep both around?

Because different questions and different hardware favour different frames. CNOT reads naturally as classical logic — "flip the target if the control is set" — which is why algorithms and pseudocode are usually written with it. CZ reads naturally as a phase and is symmetric, which makes graph-state and cluster-state constructions far cleaner: you draw an undirected edge, not a directed arrow. On hardware the choice is made for you: superconducting and neutral-atom devices produce a conditional phase natively, so CZ is the real gate and CNOT is CNOT=(I⊗H) CZ (I⊗H)\mathrm{CNOT}=(I\otimes H)\,\mathrm{CZ}\,(I\otimes H), costing two extra single-qubit gates. Since HH is its own inverse the translation runs both ways, so you are free to think in whichever frame is clearer and let the compiler convert.

How can a single sign flip create maximal entanglement?

Because entanglement is about relative phases between the branches of a superposition, not about how many amplitudes you touch. On a computational-basis state CZ does almost nothing, but on ∣+⟩∣+⟩=12(∣00⟩+∣01⟩+∣10⟩+∣11⟩)|+\rangle|+\rangle=\tfrac12(|00\rangle+|01\rangle+|10\rangle+|11\rangle) the lone minus sign it plants on ∣11⟩|11\rangle makes the second qubit's state depend on the first — it is ∣+⟩|+\rangle when the first qubit is ∣0⟩|0\rangle and ∣−⟩|-\rangle when it is ∣1⟩|1\rangle. That correlation cannot be undone by any local operation, and the concurrence works out to exactly 11, the maximum. The lesson is that a well-placed phase is the whole game: you do not need to move probability around to entangle, you need to make the branches disagree about a phase.

What is the controlled-phase gate, and how does CZ fit into it?

The controlled-phase gate is the one-parameter family CPHASE(ϕ)=diag(1,1,1,eiϕ)\mathrm{CPHASE}(\phi)=\mathrm{diag}(1,1,1,e^{i\phi}): it collects a tunable phase ϕ\phi on ∣11⟩|11\rangle instead of a fixed −1-1. At ϕ=0\phi=0 it is the identity (no interaction); at ϕ=π/2\phi=\pi/2 it is the controlled-SS gate used in the quantum Fourier transform; and at ϕ=π\phi=\pi it is CZ, since eiπ=−1e^{i\pi}=-1. So CZ is the maximal-phase endpoint of the family, and the family is exactly what continuously "dials up" the entangling power from zero to maximum. On hardware this is more than notation — the physical interaction usually produces a phase proportional to the time it is left on, so CPHASE(ϕ)\mathrm{CPHASE}(\phi) for arbitrary ϕ\phi is often easier to make than a perfectly calibrated CZ, and CZ is just the setting ϕ=π\phi=\pi.

Is CZ enough to build a universal quantum computer?

Not by itself, and the reason is instructive. CZ together with all single-qubit gates does generate the full two-qubit unitary group, and by the Barenco et al. universality theorem an entangler plus single-qubit gates is universal for unitary computation in principle. But if you restrict the single-qubit gates to the Clifford set (Hadamard and the phase gate SS), then CZ, being itself a Clifford gate, gives you only stabilizer circuits — and the Gottesman–Knill theorem says those are efficiently simulable on a classical computer, so no quantum advantage. To cross into genuinely hard computation you must add a non-Clifford gate, canonically the T=diag(1,eiπ/4)T=\mathrm{diag}(1,e^{i\pi/4}) gate. CZ supplies the entanglement; TT supplies the "magic" that makes the circuit classically intractable.

Why is a conditional phase the native gate on so much hardware?

Because the simplest always-on two-qubit interactions are diagonal energy shifts. When two qubits sit close enough to interact, the most common coupling is an energy penalty (or shift) that depends on whether both are excited — a ZZZZ-type term. Let such a term evolve for a fixed time and the state ∣11⟩|11\rangle accumulates a phase relative to the others: that is precisely CPHASE(ϕ)\mathrm{CPHASE}(\phi), and tuning the time or the coupling to ϕ=π\phi=\pi gives CZ. In transmons this is engineered as a brief avoided crossing between ∣11⟩|11\rangle and a higher level; in Rydberg atoms it is the blockade shift. A bit-flip interaction that would give CNOT directly is comparatively unnatural, which is why the phase gate is primary and the flip gate is derived.

Do the CZ gates in a cluster state really commute, and why does it matter?

Yes — every CZ is diagonal in the computational basis, and diagonal matrices commute, so any two CZ gates (even on overlapping qubits) can be applied in either order with identical result. This matters enormously for building large entangled resource states. To make a cluster state you initialize every qubit in ∣+⟩|+\rangle and apply a CZ across each edge of a graph; because the gates commute, you can fire them all in parallel, in any grouping, without worrying about scheduling — the final state depends only on which edges are present, not on the order they were added. That order-independence is what makes cluster-state preparation robust and parallelizable, and it is a property CNOT-based constructions simply do not have, since CNOTs sharing a qubit generally do not commute.

Before this

Where this leads