The controlled-Z gate (CZ) multiplies the amplitude of ∣11⟩ by −1 and leaves all other
basis states unchanged:
CZ∣00⟩=∣00⟩,CZ∣01⟩=∣01⟩,CZ∣10⟩=∣10⟩,CZ∣11⟩=−∣11⟩.
In matrix form, with the two-qubit computational basis ordered ∣00⟩,∣01⟩,∣10⟩,∣11⟩:
CZ=100001000010000−1.
Symmetry: no control, no target
Look at the matrix — it is diagonal. Because a diagonal matrix is symmetric, swapping the role of
the two qubits gives exactly the same gate. There is no physical difference between calling qubit 0
the "control" and qubit 1 the "target": CZ(q0, q1) = CZ(q1, q0). This symmetry sets CZ
apart from CNOT, which has a definite control and a definite target.
Formally, CZ is the tensor product of Z conditioned on the other qubit being ∣1⟩:
CZ=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗Z,
but because Z also leaves ∣0⟩ unchanged and flips the sign of ∣1⟩, you could equally
write I⊗∣0⟩⟨0∣+Z⊗∣1⟩⟨1∣ — the same matrix.
Phase kicks and relative phases
When CZ acts on a product state ∣+⟩∣1⟩, the phase it introduces is relative, not
global, and therefore physically observable:
∣+⟩∣1⟩=21(∣01⟩+∣11⟩)CZ21(∣01⟩−∣11⟩).
The ∣01⟩ amplitude is untouched (one qubit is ∣0⟩ so CZ does nothing), while the
∣11⟩ amplitude picks up the −1 phase. The resulting state is a superposition with a minus
sign — a different quantum state from the input that a later Hadamard or interference experiment
could distinguish.
Try it
Prepare qubit 0 in ∣+⟩ and qubit 1 in ∣1⟩, then apply CZ. Observe how the sign of
the ∣11⟩ component flips while the ∣01⟩ component is unchanged.
Run your code to see the quantum state.
After running, check the amplitude of ∣11⟩ in the statevector panel: it should be
−21≈−0.707, confirming the phase kick.
Sign in on the full site to ask questions and join the discussion.