Sign in
← Atlas
Exact & formalGatesControlled gate

Controlled-Z gate

A diagonal two-qubit entangling gate that applies a -1 phase exactly when both qubits are |1⟩, and is symmetric between the two qubits it acts on.

controlled gateentanglementtwo qubitclifford

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.

CZ is the phase-only sibling of CX: instead of routing information from control to target, it marks the |11⟩ configuration, which makes it the natural entangling gate for graph-state and measurement-based constructions.

Circuit & simulation
|11⟩ phase-flipped100%
|00⟩, |01⟩, |10⟩ unchanged100%
What this takes and returns
Takes2 qubitsWhat joins here

Takes a 2-qubit register and states no assumption about what is on it. That is the whole condition: anything returning 2 qubits can feed it.

16 entries meet this end. Named below.

Returns2 qubitsWhat joins here

Returns a 2-qubit register a next stage can take. This is the end that joins.

11 entries meet this end. Named below.

A unitary. The same register goes in and comes out, and this entry states no assumption about what is on it — which is what lets anything of the same width feed it. See all 29 →

How it works

Definition

CZ=(1000010000100001)\mathrm{CZ} = \begin{pmatrix} 1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&-1 \end{pmatrix}

in the ordered basis {00,01,10,11}\{|00\rangle,|01\rangle,|10\rangle,|11\rangle\}. The matrix is diagonal and, unlike CX\mathrm{CX}, symmetric under exchanging the two qubits: CZ\mathrm{CZ} has no distinguished "control" wire.

Action on basis states

CZc,t=(1)ctc,t\mathrm{CZ}|c,t\rangle = (-1)^{c\cdot t}|c,t\rangle

Only the 11|11\rangle component picks up a sign; all other basis states are untouched. Applied to a product of superpositions it creates entanglement by correlating the relative phase with both qubits simultaneously, e.g. CZ(0+120+12)=12(00+01+1011)\mathrm{CZ}\big(\tfrac{|0\rangle+|1\rangle}{\sqrt2}\otimes\tfrac{|0\rangle+|1\rangle}{\sqrt2}\big) = \tfrac12(|00\rangle+|01\rangle+|10\rangle-|11\rangle).

Key identities

  • CZ=(IH)CX(IH)\mathrm{CZ} = (I\otimes H)\,\mathrm{CX}\,(I\otimes H): conjugating the target of CX\mathrm{CX} by Hadamard converts the bit-flip entangler into the phase-flip entangler and vice versa.
  • CZ2=II\mathrm{CZ}^2 = I\otimes I: CZ\mathrm{CZ} is its own inverse (it is a Clifford involution).
  • CZ\mathrm{CZ} is the λ=π\lambda=\pi special case of the controlled-phase gate CP(λ)\mathrm{CP}(\lambda).
  • Applying CZ\mathrm{CZ} to every edge of a graph on qubits initialized in +|+\rangle prepares the corresponding cluster/graph state, the resource state for measurement-based quantum computation.
Implementation
Native
controlled-z.qasm
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
cz q[0], q[1];
Quantum vs classical

Classical baseline

Use a classical state-vector or matrix simulation at the same width, precision, and measurement objective.

Quantum claim

The quantum record demonstrates a state or operator behavior; it does not make classical simulation or communication costs disappear.

How to compare

Compare fidelity, samples, gate depth, noise, memory, and the cost of preparing and reading the state.

Declared gaps

Nobody has reviewed this record for gaps yet.

Literature & references
Quantum Computation and Quantum Information: 10th Anniversary Edition2010 · Michael A. Nielsen and Isaac L. Chuang

Standard reference for single- and multi-qubit gate matrices, Euler-angle decomposition, and universal gate sets.

doi.org/10.1017/cbo9780511976667