Gates · Controlled gate
Controlled-phase gate (CP)
A parametrized entangling gate that applies e^{iλ} exactly when both qubits are |1⟩, generalizing CZ and forming the entangling primitive of the quantum Fourier transform.
Exact & formalUpdated
A small worked example, computed in your browser. It is not a result from this record's papers.
CP(θ), the gate the Fourier transform is built from
Two qubits, both put into |+⟩, then a controlled phase of π/2 — a quarter turn, applied only where both qubits are 1.
Step 1 of 3 · H
Probability of each outcome after this step
- 0050%
- 0150%
Qubit 0 into an equal superposition.
Probability spreads from 1 outcome to 2. All 2 are equally likely.
Qubit 1 as well.
Probability spreads from 2 outcomes to 4. All 4 are equally likely.
Turns the phase of the |11⟩ branch by π/2 and leaves the other three where they are. CZ is this gate at θ = π; the QFT is a ladder of these at halving angles, which is where its phases come from.
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 Every outcome keeps the probability it had. The whole content of this gate is the angle it puts on one branch out of four, and that angle is what the inverse QFT later reads back out as a number.
Open in Studio- Steps1
- Wires2
- Qubits2
- Depth1 gate
- Parameterλ (radians)
- Papers2
CP(λ) is what a controlled-P gate looks like once the target's phase gate is promoted to a genuine two-qubit operation — the workhorse of QFT-based algorithms.
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 →
Definition
Like , this matrix is symmetric under exchanging the two qubits, so "control" and "target" are interchangeable labels rather than a physical asymmetry.
Action on basis states
Only the amplitude picks up a phase of ; every other computational-basis input is unaffected.
Key identities
- : the controlled- gate is the special case of the controlled-phase family.
- : controlled phases with the same qubit pair compose additively.
- General controlled- construction (Barenco et al. 1995): any single-qubit controlled- can be built from two CNOTs and three single-qubit gates satisfying and up to phase; is the special case where is already diagonal, so no CNOTs are needed at all — it is native.
- The quantum Fourier transform on qubits applies between qubit pairs at increasing separation , making the single most-used two-qubit gate in QFT-based algorithms (phase estimation, Shor's algorithm, HHL).
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 →
- Qubits
- 2
- Depth
- 1 gate
- Parameter
- λ (radians)
- Matrix
- diag(1, 1, 1, e^{iλ})
- Special case
- CP(π) = CZ
- Role
- Entangling primitive of the QFT
- Gate family
- Non-Clifford (generic λ)
CP(π/2)on 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.
Nobody has reviewed this record for gaps yet.
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
cp(pi/2) q[0], q[1];Related entries
- Controlled-Z gate
Gates
- P phase gate
Gates
- QFT resource screen
Algorithms
- Quantum phase estimation
Algorithms
References
- Elementary gates for quantum computation
Adriano Barenco, Charles H. Bennett, Richard Cleve, David P. DiVincenzo, Norman Margolus, Peter Shor, Tycho Sleator, John A. Smolin, Harald Weinfurter · 1995
Shows that single-qubit U(2) gates plus CNOT are universal and gives explicit decompositions for controlled-U, Toffoli, and Fredkin gates.
- Quantum Computation and Quantum Information: 10th Anniversary Edition
Michael A. Nielsen and Isaac L. Chuang · 2010
Standard reference for single- and multi-qubit gate matrices, Euler-angle decomposition, and universal gate sets.