2.6.1 Interference

One of the most important physical effects used in quantum computing is interference – the interaction between overlapping waves or oscillations. One way you can observe interference is by looking at water waves created by two boats that are passing each other by, or by simultaneously throwing two rocks in a still lake. When the waves amplify each other, we call the interference constructive, and when they cancel each other out, we call it destructive (see Fig. 2.7).

Figure 2.7: Interference of two waves: at every location the amplitudes of the blue and orange wave add to produce the green wave. When both amplitudes have the same sign, the interference is constructive and we get an even larger amplitude. When the interfering amplitudes have different signs, the interference is destructive and we get a much smaller amplitude.

Interference also occurs in other contexts, for example with sound waves. A familiar example might be the destructive interference in noise-cancelling headphones. They operate by capturing the background noise and playing it back to you, but with an opposite direction of oscillation. When this recorded sound overlaps with the original noise, they cancel each other out: 11=01-1=0. If the headphones would not invert the direction of oscillation but instead play the sound back to you as it is, you would hear a much louder noise: 1+1=21+1=2. This would turn your headphones into a hearing aid!

An important way in which quantum computation differs from probabilistic computation is that it can make use of both types of interference – constructive and destructive – while probabilistic computation can use only constructive interference. To illustrate this mathematically, recall the probabilistic flip operation F(1/2)F(1/2) and the Hadamard operation HH from Eqs. 1.28 and 2.34:

F(1/2)[0]=12[0]+12[1],H|0=12|0+12|1,\displaystyle F(1/2)\,[0]=\frac{1}{2}\,[0]+\frac{1}{2}\,[1],\qquad H\left|0% \right\rangle=\frac{1}{\sqrt{2}}\left|0\right\rangle+\frac{1}{\sqrt{2}}\left|1% \right\rangle,
F(1/2)[1]=12[0]+12[1],H|1=12|012|1.\displaystyle F(1/2)\,[1]=\frac{1}{2}\,[0]\color[rgb]{0,0,1}+\frac{1}{2}\,[1],% \qquad H\left|1\right\rangle=\frac{1}{\sqrt{2}}\left|0\right\rangle\color[rgb]% {1,0,0}-\frac{1}{\sqrt{2}}\left|1\right\rangle. (2.38)

Apart from the square roots, the two operations are almost identical. However, notice that F(1/2)[1]F(1/2)\,[1] has a plus sign while H|1H\left|1\right\rangle has a minus sign. This may seem like a small difference but it can have big consequences.

Let us consider the action of these two operations on the uniform distribution 12[0]+12[1]\frac{1}{2}\,[0]+\frac{1}{2}\,[1] and its quantum analogue, the plus state |+=12|0+12|1\left|+\right\rangle=\frac{1}{\sqrt{2}}\left|0\right\rangle+\frac{1}{\sqrt{2}}% \left|1\right\rangle. The probabilistic flip operation F(1/2)F(1/2) acts on the uniform distribution as follows:

F(1/2)(12[0]+12[1])\displaystyle F(1/2)\,\left\lparen\frac{1}{2}\,[0]+\frac{1}{2}\,[1]\right\rparen =12F(1/2)[0]+12F(1/2)[1]\displaystyle=\frac{1}{2}\,F(1/2)\,[0]+\frac{1}{2}\,F(1/2)\,[1]
=12(12[0]+12[1])+12(12[0]+12[1])\displaystyle=\frac{1}{2}\left\lparen\frac{1}{2}\,[0]+\frac{1}{2}\,[1]\right% \rparen+\frac{1}{2}\left\lparen\frac{1}{2}\,[0]\color[rgb]{0,0,1}+\frac{1}{2}% \,[1]\right\rparen
=(1212+1212)[0]+(1212+1212)[1]\displaystyle=\left\lparen\frac{1}{2}\cdot\frac{1}{2}+\frac{1}{2}\cdot\frac{1}% {2}\right\rparen\,[0]+\left\lparen\frac{1}{2}\cdot\frac{1}{2}\color[rgb]{0,0,1% }+\frac{1}{2}\cdot\frac{1}{2}\right\rparen\,[1]
=12[0]+12[1],\displaystyle=\frac{1}{2}\,[0]+\frac{1}{2}\,[1],

where we used linearity, Eq. 2.38, and collected the probabilities at states [0][0] and [1][1]. Note how the probabilities at [1][1] from both terms amplify each other, resulting in the final probability of 1/21/2. This is very intuitive: if you flip a uniformly random bit then it stays uniformly random.

However, consider now the action of the Hadamard operation HH on the plus state |+\left|+\right\rangle:

H(12|0+12|1)\displaystyle H\left\lparen\frac{1}{\sqrt{2}}\left|0\right\rangle+\frac{1}{% \sqrt{2}}\left|1\right\rangle\right\rparen =12H|0+12H|1\displaystyle=\frac{1}{\sqrt{2}}\,H\left|0\right\rangle+\frac{1}{\sqrt{2}}\,H% \left|1\right\rangle
=12(12|0+12|1)+12(12|012|1)\displaystyle=\frac{1}{\sqrt{2}}\left\lparen\frac{1}{\sqrt{2}}\left|0\right% \rangle+\frac{1}{\sqrt{2}}\left|1\right\rangle\right\rparen+\frac{1}{\sqrt{2}}% \left\lparen\frac{1}{\sqrt{2}}\left|0\right\rangle\color[rgb]{1,0,0}-\frac{1}{% \sqrt{2}}\left|1\right\rangle\right\rparen
=(1212+1212)|0+(12121212)|1\displaystyle=\left\lparen\frac{1}{\sqrt{2}}\cdot\frac{1}{\sqrt{2}}+\frac{1}{% \sqrt{2}}\cdot\frac{1}{\sqrt{2}}\right\rparen\left|0\right\rangle+\left\lparen% \frac{1}{\sqrt{2}}\cdot\frac{1}{\sqrt{2}}\color[rgb]{1,0,0}-\frac{1}{\sqrt{2}}% \cdot\frac{1}{\sqrt{2}}\right\rparen\left|1\right\rangle
=|0.\displaystyle=\left|0\right\rangle.

The calculation is almost identical but the outcome is very different – the amplitudes at |1\left|1\right\rangle completely cancel each other and we are left only with |0\left|0\right\rangle. Such destructive interference is impossible with probabilistic bits because probabilities are always positive – they can only amplify each other but can never cancel.

While probabilistic and quantum bits are quite similar, this example illustrates how they can behave differently thanks to destructive interference. Many of the quantum surprises that you will encounter in further weeks are in some way a consequence of this phenomenon. The ability to perform destructive interference is exactly what gives a quantum computer an advantage over classical computers – it allows the quantum computer to output just the right answer, while the wrong answers are cancelled out by destructive interference. As we will see in more detail in Section 5.2, this is often achieved by the Hadamard gate, which therefore plays a central role in many quantum algorithms.