User:Pdavis1443/sandbox

Explanation via the Quantum Circuit Model
The experiment can be generalized under the Quantum Circuit Model. Assume that a box which potentially contains a bomb is defined to operate on a single probe qubit in the following way:
 * If there is no bomb, the qubit passes through unaffected.
 * If there is a bomb, the qubit gets measured:
 * If the measurement outcome is $|0\rangle$, the box returns $|0\rangle$.
 * If the measurement outcome is $|1\rangle$, the bomb explodes.

The following quantum circuit can be used to test if a bomb is present:



Where: \begin{pmatrix} \cos{\epsilon} & -\sin{\epsilon} \\ \sin{\epsilon} & \cos{\epsilon} \end{pmatrix} $
 * $B$ is the box/bomb system, which measures the qubit if a bomb is present
 * $R_\epsilon$ is the unitary matrix $
 * $\epsilon$ is some small number
 * $T = \lceil{\frac{\pi}{2\epsilon}}\rceil $

At the end of the circuit, the probe qubit is measured. If the outcome is $|0\rangle$, there is a bomb, and if the outcome is $|1\rangle$, there is no bomb.

Case 1: No bomb
When there is no bomb, the qubit evolves prior to measurement as $R_\epsilon^T |0\rangle = \cos(T\epsilon) |0\rangle + \sin(T\epsilon) |1 \rangle $, which will measure as $|0\rangle$ (the incorrect answer) with probability $ cos^2(T\epsilon) \approx O(\epsilon) $.

Case 2: Bomb
When there is a bomb, the qubit will be transformed into the state $\cos(\epsilon) |0\rangle + \sin(\epsilon) |1 \rangle $, then measured by the box. The probability of measuring as $|1\rangle$ and exploding is $ \sin^2(\epsilon) \approx \epsilon^2 $ by the small-angle approximation. Otherwise, the qubit will collapse to $|0\rangle$ and the circuit will continue iterating. The probability of measuring $|1\rangle$ and detonating the bomb after any of the T iterations is at most approximately $T\epsilon^2\approx O(\epsilon)$ by the union bound. If the bomb doesn't explode, the box will return $|0\rangle$, which will be the final measurement value.

In both cases, the circuit returns the incorrect answer(or detonates the bomb) with arbitrarily low probability, based on the decision of $\epsilon $.