Skip to main content

Controlled-U Gate

Definition​

The Controlled-U gate is a two-qubit gate that applies a unitary gate UU on the target qubit only when the control qubit is in the state ∣1⟩|1\rangle. If the control qubit is in the state ∣0⟩|0\rangle, the target qubit remains unchanged. In simple words, the Controlled-U gate is a generalized version of the CNOT gate because the CNOT gate is just a special case where the unitary gate UU is the Pauli-X gate.

PS: The word "controlled" means there is one qubit which decides whether the operation should happen or not. The word "U" means any valid single-qubit unitary operation can be placed there.

Effect on qubit​

The Controlled-U gate does not change the control qubit. It only checks the value of the control qubit.

  1. If the control qubit is ∣0⟩|0\rangle, nothing happens to the target qubit.
  2. If the control qubit is ∣1⟩|1\rangle, the gate UU is applied to the target qubit.

This is why the Controlled-U gate is extremely useful in quantum algorithms. It allows us to make one quantum operation depend on the state of another qubit. That conditional behavior is one of the main reasons multi-qubit circuits become powerful.

Types​

The Controlled-U gate can have many types because the gate UU can be any unitary single-qubit gate. Some common special cases are:

  • Controlled-X gate: This is the CNOT gate.
  • Controlled-Z gate: This applies the Pauli-Z gate conditionally.
  • Controlled-H gate: This applies the Hadamard gate conditionally.
  • Controlled-S gate: This applies the S gate conditionally.

Representation​

Matrix representation​

Suppose the single-qubit unitary gate is

U=[abcd](1)U = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \tag{1}

Then the matrix representation of the Controlled-U gate is:

CU=[1000010000ab00cd](2)CU = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & a & b \\ 0 & 0 & c & d \end{bmatrix} \tag{2}

By carefully observing this matrix, you can see that the first two basis states ∣00⟩|00\rangle and ∣01⟩|01\rangle remain unchanged. The last two basis states ∣10⟩|10\rangle and ∣11⟩|11\rangle are the states where the control qubit is ∣1⟩|1\rangle, so the gate UU acts there.

Circuit representation​

The Controlled-U gate is represented as:

---o---
|
---U---

Where o represents the control qubit and U represents the unitary operation applied to the target qubit.

Example​

Let us take a simple example where the unitary gate is the Hadamard gate. That means we are applying a Controlled-H gate.

Suppose we have two qubits initially in the state ∣10⟩|10\rangle. The first qubit is the control qubit and the second qubit is the target qubit.

∣q0⟩=∣1⟩(3)|q_0\rangle = |1\rangle \tag{3} ∣q1⟩=∣0⟩(4)|q_1\rangle = |0\rangle \tag{4}

So the combined state is:

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

The Hadamard gate is:

H=12[111−1](6)H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \tag{6}

Therefore, the Controlled-H matrix is:

CH=[100001000012120012−12](7)CH = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ 0 & 0 & \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix} \tag{7}

To apply the Controlled-H gate to the state ∣10⟩|10\rangle, we write the input state vector as:

∣10⟩=[0010](8)|10\rangle = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} \tag{8}

Now perform the matrix multiplication:

CH∣10⟩=[100001000012120012−12][0010](9)CH|10\rangle = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ 0 & 0 & \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} \tag{9}

Simplifying:

CH∣10⟩=[001212](10)CH|10\rangle = \begin{bmatrix} 0 \\ 0 \\ \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} \tag{10}

This means:

CH∣10⟩=12(∣10⟩+∣11⟩)(11)CH|10\rangle = \frac{1}{\sqrt{2}}(|10\rangle + |11\rangle) \tag{11}

Hence, because the control qubit was ∣1⟩|1\rangle, the Hadamard gate got applied to the target qubit.

If instead the input state had been ∣00⟩|00\rangle, then the output would still be ∣00⟩|00\rangle because the control qubit would be ∣0⟩|0\rangle.

Properties​

The properties of the Controlled-U gate are:

  • The Controlled-U gate is unitary if UU is unitary.
  • The control qubit is not changed by the gate.
  • The Controlled-U gate becomes a CNOT gate when U=XU = X.
  • The Controlled-U gate becomes a Controlled-Z gate when U=ZU = Z.
  • The Controlled-U gate is important in phase estimation, quantum Fourier transform based circuits, and many variational quantum circuits.

Conjugate Transpose​

The conjugate transpose of the Controlled-U gate is:

CU†=[1000010000a∗c∗00b∗d∗](12)CU^\dagger = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & a^* & c^* \\ 0 & 0 & b^* & d^* \end{bmatrix} \tag{12}

Here a∗,b∗,c∗,d∗a^*, b^*, c^*, d^* represent the complex conjugates of the corresponding entries.

Inverse​

The inverse of the Controlled-U gate is:

(CU)−1=C(U−1)(13)(CU)^{-1} = C(U^{-1}) \tag{13}

This means the inverse of a Controlled-U gate is simply the controlled version of the inverse of UU.

Dagger​

The dagger of the Controlled-U gate is:

(CU)†=C(U†)(14)(CU)^\dagger = C(U^\dagger) \tag{14}

So if the original gate on the target is replaced by its dagger, we get the dagger of the whole Controlled-U gate.