1.4.2 Making your own operations

So far, we only know how to create the [0][0] and [1][1] states using Quirky. To create an interesting probability distribution, we can use the reset operation R(r)R(r) from Section 1.2.2. Since there are infinitely many such operations (one for each choice of rr), we could not add them all to the toolbox. Instead, you can add your own reset operations to the toolbox!

Let’s practice by adding an operation that resets with probability r=12=50%r=\frac{1}{2}=50\%. To start, select ‘Make R(r)R(r)’ in the menu bar. A new window appears where you can input an angle:

[Uncaptioned image]

Enter 1/2, and confirm by pressing the button. Congratulations! You have successfully added the R(1/2)R(1/2) operation to the toolbox, which now looks as follows:

[Uncaptioned image]

To test our new rotation, let us build the following computation in Quirky:

[Uncaptioned image]

Let’s quickly see that this outcome makes sense. We started with the [0]=(10)[0]=\bigl{(}\begin{smallmatrix}1\\ 0\end{smallmatrix}\bigr{)} state. The NOT operation flips the bit into the [1]=(01)[1]=\bigl{(}\begin{smallmatrix}0\\ 1\end{smallmatrix}\bigr{)} state. By Eq. 1.27, the operation R(1/2)R(1/2) resets a bit in state [1][1] with probability 12\frac{1}{2}, that is, it changes the state to

R(1/2)[1]=12[0]+12[1]=(1/21/2)=(50%50%).\displaystyle R(1/2)\,[1]=\frac{1}{2}\,[0]+\frac{1}{2}\,[1]=\begin{pmatrix}1/2% \\ 1/2\end{pmatrix}=\begin{pmatrix}50\%\\ 50\%\end{pmatrix}.

This is precisely what Quirky told us.

In the following exercise you will use Quirky to carry out a more complicated experiment.

Homework 1.5 (Resetting twice).
  1. 1.

    Build the following sequence of operations using Quirky: First prepare the state [1][1], then reset with probability 14\frac{1}{4}, then reset with probability 23\frac{2}{3}. Use the probability display in Quirky to determine the probability of the measurement outcomes.

  2. 2.

    Argue that the answer given by Quirky is correct.

Hack.
  1. 1.

    The resulting circuit in Quirky should look like this:

    [Uncaptioned image]

  2. 2.

    Indeed, we start with [0][0]. After the NOT\mathrm{NOT}, the state is [1][1]. Next, we apply R(1/4)R(1/4), so the state becomes

    14[0]+34[1].\displaystyle\frac{1}{4}[0]+\frac{3}{4}[1].

    Finally, we apply R(2/3)R(2/3), so we arrive at

    R(2/3)(14[0]+34[1])\displaystyle R(2/3)\left(\frac{1}{4}[0]+\frac{3}{4}[1]\right) =14R(2/3)[0]+34R(2/3)[1]\displaystyle=\frac{1}{4}R(2/3)[0]+\frac{3}{4}R(2/3)[1]
    =14[0]+34(23[0]+13[1])\displaystyle=\frac{1}{4}[0]+\frac{3}{4}\left(\frac{2}{3}[0]+\frac{1}{3}[1]\right)
    =14[0]+12[0]+14[1]\displaystyle=\frac{1}{4}[0]+\frac{1}{2}[0]+\frac{1}{4}[1]
    =34[0]+14[1],\displaystyle=\frac{3}{4}[0]+\frac{1}{4}[1],

    which agrees with Quirky’s output.