← Atlas

Gates · Controlled 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.

Exact & formalUpdated

View frozen graph

A small worked example, computed in your browser. It is not a result from this record's papers.

CZ entangles without moving any probability

Two qubits, both put into |+⟩, so all four outcomes are equally likely before the gate.

q0q1Step 1 of 3 · HHStep 2 of 3 · HHStep 3 of 3 · CZCZ

Step 1 of 3 · H

Probability of each outcome after this step

  • 0050%
  • 0150%
  1. Qubit 0 into an equal superposition.

    Probability spreads from 1 outcome to 2. All 2 are equally likely.

  2. Qubit 1 as well, so all four two-bit outcomes are equally likely.

    Probability spreads from 2 outcomes to 4. All 4 are equally likely.

  3. Flips the sign of the one branch where both qubits are 1, and leaves the other three alone. Not one outcome changes probability, and the two qubits are entangled afterwards — which is why a bar chart is the wrong instrument for this gate.

    The outcome probabilities do not move at all. What this step changes is phase — 2 distinct relative phases across the state now — which no measurement can see until a later step turns it back into probability. This is the step that entangles the qubits: from here on no single qubit has a state of its own, only the register as a whole does.

Readout All four outcomes stay equally likely, before and after. CZ is symmetric in its two qubits — unlike CX there is no telling which one was the control — and it is the gate that builds graph states and cluster states.

Open in Studio
  • Steps1
  • Wires2
  • Qubits2
  • Depth1 gate
  • Outcomesphase-only, basis-preserving
  • Papers1
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 →

References

Exact & formal
  • Basis-state truth table
  • Unitary / matrix equivalence
  • Textbook / standard citation
Method
Apply CZ to all four computational-basis inputs and confirm the matrix is diagonal and symmetric under control/target exchange.
Result
Pass · CZ|11⟩ = -|11⟩ and all other basis states are unchanged; swapping control and target leaves the gate identical.
OpenQASM 3 standard gate set ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
CC BY 4.0-compatible reference metadata
controlled gateentanglementtwo qubitclifford

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