The spookiness of Controlled Gates

In Quantum Computing, by far the most popular example of controlled gate is the control-not gate. Most, if not all, the textbooks start with an example of control-not and afterwards, expands to the more generalized concept of controlled gates. It is indeed an effective way to gently introduce the topic, making a smooth connection between the existing classical gate - XOR - and the quantum control-not gate - CNOT. But simplicity is not always synonym of completeness. Controlled gates are a little spookier than initially presented by the textbooks. You will see here that there is more to the controlled gates than shown in the first chapters of quantum computing textbooks.

Firstly, a quick recap on the control-not gate.  The control-not gate is a quantum gate with 2 input qubits: the first qubit is the 'control' qubit and the second one the 'target'. The control qubit controls the NOT operation to be applied in the target qubit - if the control qubit is in state |1>, the NOT operation is applied to the target qubit. The diagram representing the control-not and the table representing the input and output of the gate follow.

CNOT gate

Input
$|q_{t}q_{c}\rangle $
Output
$|q_{t}q_{c}\rangle $
00 00
01 11
10 10
11 01

Truth table for CNOT gate

The truth table above shows the output for the control and target qubit. Observing the values of the target qubit ($|q_t\rangle$) one can see the values are exactly the same produced by the classical XOR operation. The control qubit ($|q_c\rangle$) does not change but "controls" the output of the target. All clear and consistent so far.

Now, here is where the spookiness comes to the picture. The invariability of the control qubit is just a "partial" truth... and we see why next!

Let's now set the state of the target bit $|q_t\rangle$ to $|-\rangle $ and the state of the control $|q_c\rangle$ to $|+\rangle $. The overall state vector is given by:

$ |q_tq_c\rangle = |-\rangle \otimes |+\rangle = \frac {1} {\sqrt{2}} (|0\rangle - |1\rangle) \otimes \frac {1} {\sqrt{2}} (|0\rangle + |1\rangle) \quad (I) $

$ |q_tq_c\rangle = \frac {1} {2} (|00\rangle + |01\rangle - |10\rangle - |11\rangle) $

Now, let's apply the CNOT to each of the terms of the state vector above...

$CNOT |q_tq_c\rangle = \frac {1} {2} (CNOT|00\rangle + CNOT|01\rangle - CNOT|10\rangle - CNOT|11\rangle) \quad (II) $

$ CNOT|00\rangle = |00\rangle $ (control bit is 0, target remains as is: 0)

$ CNOT|01\rangle = |11\rangle $ (control bit is 1, target flips from 0 to1)

$ CNOT|10\rangle = |10\rangle $ (control bit is 0, target remains as is: 1)

$ CNOT|11\rangle = |01\rangle $ (control bit is 1,target flips from 1 to 0)

and finally, replacing each of the four terms above in the equation $(II)$, gives:

$CNOT |q_tq_c\rangle = \frac {1} {2} (|00\rangle + |11\rangle - |10\rangle - |01\rangle) $

...which, after reordering, gives...

$CNOT |q_tq_c\rangle = \frac {1} {2} (|00\rangle - |01\rangle - |10\rangle  + |11\rangle ) $

... and this can be re-written as...

 $CNOT |q_tq_c\rangle = \frac {1} {\sqrt{2}} (|0\rangle - |1\rangle) \otimes \frac {1} {\sqrt{2}} (|0\rangle - |1\rangle) = |-\rangle \otimes |-\rangle $

Ooooops... if we refer back to the equation (I), we started with the state $ |q_tq_c\rangle = |-\rangle \otimes |+\rangle $ and, after applying the controlled not gate, ended up with $ |q_tq_c\rangle = |-\rangle \otimes |-\rangle $ !!! But isn't the control qubit meant to control the NOT operation on the target gate?

What is going on?!?!?

What is happening here is that the NOT operation kicks back to the control qubit and alters it (instead of altering the target one). This is one example of phase kickback. This occurs when the controlled gate is used in conjunction with input states in superposition $|-+\rangle$.

This pattern is in fact quite important in quantum computer, and it is extensively used by many quantum algorithms, like the Deutsch's or Grove ones.

So, a quick recap...

  • Controlled gates are not always acting on the target qubit based on the control qubit.
  • Using superposition of states one can 'force' the controlled operation to kick back to the control qubit.
  • The pattern is widely used in many quantum algorithms.

References and Further Readings

  1. Nielsen, M., & Chuang, I. (2010). Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge: Cambridge University Press. doi:10.1017/CBO9780511976667
  2. https://qiskit.org/textbook/ch-gates/phase-kickback.html

 


 

 

 

Comments

Popular posts from this blog

The simplest quantum binary classifier

A View on the Deutsch Algorithm

IBM Qiskit Exam: my four weeks preparation