Skip to main content

Controlled Phase Gate

Definition​

The Controlled Phase gate is a two-qubit gate that adds a phase to the joint quantum state only when a specific control condition is satisfied. In the most common form, the phase is applied when both qubits are in the state ∣11⟩|11\rangle. This gate is also written as CP, CRϕCR_\phi, or in the special case of phase π\pi as the CZ gate.

The Controlled Phase gate is a diagonal gate. That means it does not move probability amplitude from one basis state to another. Instead, it changes the phase of one basis component. This looks small, but phase is exactly what creates interference, and interference is where quantum algorithms get their power.

Effect on qubit​

The Controlled Phase gate keeps the computational basis states in the same position, but it changes the phase of one of them.

For a controlled phase angle ϕ\phi, the action is:

CP(ϕ)∣00⟩=∣00⟩(1)CP(\phi)|00\rangle = |00\rangle \tag{1} CP(ϕ)∣01⟩=∣01⟩(2)CP(\phi)|01\rangle = |01\rangle \tag{2} CP(ϕ)∣10⟩=∣10⟩(3)CP(\phi)|10\rangle = |10\rangle \tag{3} CP(ϕ)∣11⟩=eiϕ∣11⟩(4)CP(\phi)|11\rangle = e^{i\phi}|11\rangle \tag{4}

So the gate only changes the phase of the ∣11⟩|11\rangle component. If there is no amplitude on ∣11⟩|11\rangle, then the gate has no visible effect.

PS: This is why phase gates often look useless on basis states but become very important on superposition states.

Types​

Some common types of controlled phase gates are:

  • CZ gate: Controlled phase with ϕ=π\phi = \pi.
  • CS gate: Controlled phase with ϕ=π/2\phi = \pi/2.
  • CT gate: Controlled phase with ϕ=π/4\phi = \pi/4.
  • General CP gate: Controlled phase with any angle ϕ\phi.

Representation​

Matrix representation​

The general matrix representation of the Controlled Phase gate is:

CP(ϕ)=[100001000010000eiϕ](5)CP(\phi) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{i\phi} \end{bmatrix} \tag{5}

For the special case ϕ=π\phi = \pi, we get the Controlled-Z gate:

CZ=[100001000010000−1](6)CZ = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{bmatrix} \tag{6}

Circuit representation​

The Controlled Phase gate is represented as:

---o---
|
--P(phi)--

For the special case of Controlled-Z, many circuit diagrams represent it as:

---o---
|
---Z---

Example​

Let us see the effect of the Controlled-Z gate on a superposition state. Suppose we first prepare the two-qubit state:

∣ψ⟩=12(∣00⟩+∣01⟩+∣10⟩+∣11⟩)(7)|\psi\rangle = \frac{1}{2}(|00\rangle + |01\rangle + |10\rangle + |11\rangle) \tag{7}

This state can be understood as the equal superposition of all two-qubit basis states.

Now apply the Controlled-Z gate:

CZ∣ψ⟩=CZ12(∣00⟩+∣01⟩+∣10⟩+∣11⟩)(8)CZ|\psi\rangle = CZ\frac{1}{2}(|00\rangle + |01\rangle + |10\rangle + |11\rangle) \tag{8}

Since the Controlled-Z gate only changes the phase of the ∣11⟩|11\rangle term, we get:

CZ∣ψ⟩=12(∣00⟩+∣01⟩+∣10⟩−∣11⟩)(9)CZ|\psi\rangle = \frac{1}{2}(|00\rangle + |01\rangle + |10\rangle - |11\rangle) \tag{9}

Notice carefully what happened. No basis state moved to any other basis state. Only the sign of the last term changed. But that sign change is enough to alter future interference when more gates are applied later.

Now let us take a basis-state example as well. Suppose the input is:

∣q0q1⟩=∣11⟩(10)|q_0q_1\rangle = |11\rangle \tag{10}

Applying the general Controlled Phase gate gives:

CP(ϕ)∣11⟩=eiϕ∣11⟩(11)CP(\phi)|11\rangle = e^{i\phi}|11\rangle \tag{11}

For ϕ=π/2\phi = \pi/2, this becomes:

CP(π/2)∣11⟩=i∣11⟩(12)CP(\pi/2)|11\rangle = i|11\rangle \tag{12}

So the state remains ∣11⟩|11\rangle, but now it has a phase factor of ii.

Properties​

The Controlled Phase gate has the following properties:

  • It is a unitary gate.
  • It is a diagonal gate.
  • It changes phase without swapping amplitudes between basis states.
  • The Controlled-Z gate is a special case of the Controlled Phase gate.
  • Controlled phase gates are heavily used in the Quantum Fourier Transform and phase estimation circuits.

Conjugate Transpose​

The conjugate transpose of the Controlled Phase gate is:

CP(ϕ)†=[100001000010000e−iϕ](13)CP(\phi)^\dagger = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & e^{-i\phi} \end{bmatrix} \tag{13}

Inverse​

The inverse of the Controlled Phase gate is:

CP(ϕ)−1=CP(−ϕ)(14)CP(\phi)^{-1} = CP(-\phi) \tag{14}

That means to undo a phase rotation of ϕ\phi, we apply a phase rotation of −ϕ-\phi.

Dagger​

The dagger of the Controlled Phase gate is:

CP(ϕ)†=CP(−ϕ)(15)CP(\phi)^\dagger = CP(-\phi) \tag{15}

So for this gate, the dagger and the inverse are the same operation.