Logo

10. Quantum Computing

Note: these notes are fairly short and do not comprehensively discuss the background behind quantum computing. This is because I had prior knowledge regarding quantum computing, and wasn't particularly interested in writing a whole essay here about it since I already knew... sorry :(

That said, I do recommend books like Quantum Mechanics: The Theoretical Minimum (Susskind and Friedman) or Quantum Computation and Quantum Information (Nielsen and Chung) for learning the basics (and perhaps even more!)

Quantum Complexity

BQP\mathrm{BQP} is the class of all problems efficiently solvable by a quantum computer. It is believed that PBQP\mathrm{P}\subseteq \mathrm{BQP}, but BQP⊈NP\mathrm{BQP}\not\subseteq \mathrm{NP} and NP⊈BQP\mathrm{NP}\not\subseteq \mathrm{BQP}. In other words, there are problems within BQP\mathrm{BQP} that are not efficiently verifiable (e.g. how do you verify a physics simulation?) and there are problems within NP\mathrm{NP} that are probably not efficiently solvable by a quantum computer.

Elitzur-Vaidman Bomb

Consider a box that may or may not contain a bomb, that interacts as follows with a qubit:

We want to determine a way to distinguish if the box has a bomb or not without causing an explosion if the box has a bomb.

In the classical world, there exists no such algorithm for this. Sending 0\ket{0} does not confirm anything, and sending 1\ket{1} will cause the bomb to explode if it exists. However, in the quantum world, we can create an opportunity to determine if a bomb exists without causing an explosion!

Let x=0\ket{x}=\ket{0} initially. Then, apply a π4\frac{\pi}{4} (45°) rotation to x\ket{x} to produce x=+=12(0+1)\ket{x}=\ket{+}=\frac{1}{\sqrt{ 2 }}(\ket{0}+\ket{1}). Then, we send x\ket{x} through the box.

Finally, we rotate the output of the box by π4\frac{\pi}{4} again and measure x\ket{x}.

Let's walk through the possible outcomes to see why this is the case.

So, if there isn't a bomb, we'll always receive "not sure." After running this test nn times, there is a 112n1-\frac{1}{2^{n}} probability that the box has a bomb.

If there is a bomb, there is a 50% chance that the bomb's measurement results in 1\ket{1}, an explosion. Otherwise, there is an addition 50/50 between returning "bomb" and returning "not sure." Thus, there is a 12\frac{1}{2} chance of an explosion, a 14\frac{1}{4} chance of returning "bomb," and a 14\frac{1}{4} chance of returning "not sure."

However, 12\frac{1}{2} is still a high chance—we can do better!

As before, let x=0\ket{x}=\ket{0} initially. However, our rotation angle now changes to θ=(π2)/N\theta=\left( \frac{\pi}{2} \right)/N, where NN is some chosen parameter. Then, for t=1,,Nt=1,\dots,N, we perform the same procedure.

  1. Rotate x\ket{x} by θ\theta.
  2. Send x\ket{x} through the box. Let x\ket{x} be the value returned by the box.

Then, at the end, measure x\ket{x}. If 0\ket{0}, return "bomb." Otherwise, return "empty."

Note that, in this procedure, the x\ket{x} sent into the box changes between rounds.

Let's analyze the possibilities again.

Empty:
The box will output x\ket{x} each time. After NN iterations, x\ket{x} will have rotated the full Nθ=π2N\cdot\theta=\frac{\pi}{2} radians. Thus, x=1\ket{x}=\ket{1} at the end.

Bomb:
Each time x\ket{x} passes through the box, if the bomb doesn't explode, 0\ket{0} is returned. If there is never an explosion, and x=0\ket{x}=\ket{0} at the end, we know there is a bomb in the box. (Since empty implies x\ket{x} should be 1\ket{1}). But then, what's the probability of the bomb exploding? Well, the probability of the bomb exploding at t=it=i is sin2θ\sin ^{2}\theta. The probability of the bomb exploding at some t{1,,N}t\in \{ 1,\dots,N \} is

P[explosion]=P[explosion at t=1]++P[explosion at t=N]P[\text{explosion}]=P[\text{explosion at }t=1]+\dots +P[\text{explosion at }t=N]

since the events are all disjoint. Thus,

P[explosion]=Nsin2θP[\text{explosion}] = N\sin ^{2}\theta

For small θ\theta, sinθθ\sin\theta \leq\theta, so

P[explosion]Nθ2=N(π/2N)22.5NP[\text{explosion}]\leq N\theta^{2}=N\left( \frac{\pi/2}{N} \right)^{2}\leq \frac{2.5}{N}

Thus, for this algorithm, if the box is empty, it will output "empty" with a probability of 11. If there is a bomb, the box will explode with probability 2.5N\frac{2.5}{N}, and otherwise output "bomb." The time complexity, meanwhile, is O(N)O(N).

NN is known as the safety level—if avoiding an explosion is extremely important (especially if it's an actual bomb...), increasing NN will decrease the explosion probability, but increase the time complexity.