Controlled-phase gate
Multiplies |11⟩ by e^(iθ). The building block of the quantum Fourier transform.
Entangling · 2 qubits · reviewed November 2026
Matrix
[ 1 0 0 0 ] [ 0 1 0 0 ] [ 0 0 1 0 ] [ 0 0 0 e^(iθ) ]
What it does
| |11⟩ | → | e^(iθ)|11⟩ |
In plain words
CP generalises CZ, which is CP at θ = π. The QFT uses a ladder of CP gates with halving angles. This builder exports CP to OpenQASM 2.0 as cu1, the name used by that version.
Identities
- CP(π) = CZ
- CP(θ) is symmetric in its two qubits
Where it is used
- Quantum Fourier transform
- Phase estimation
- Shor’s algorithm
Code
# Qiskit qc.cp(theta, 0, 1) // OpenQASM 2.0 cu1(theta) q[0],q[1];
Qiskit prints qubit 0 on the right of a bitstring. The builder prints it on the left.
See it in an example
Related gates
Questions
Why does QASM use cu1 here?
OpenQASM 2.0 had no cp gate in its core library; cu1 is the same operation.