1.4.2 Making your own operations
So far, we only know how to create the and states using Quirky. To create an interesting probability distribution, we can use the reset operation from Section 1.2.2. Since there are infinitely many such operations (one for each choice of ), 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 . To start, select ‘Make ’ in the menu bar. A new window appears where you can input an angle:
Enter 1/2, and confirm by pressing the button. Congratulations! You have successfully added the operation to the toolbox, which now looks as follows:
To test our new rotation, let us build the following computation in Quirky:
Let’s quickly see that this outcome makes sense. We started with the state. The NOT operation flips the bit into the state. By Eq. 1.27, the operation resets a bit in state with probability , that is, it changes the state to
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.
Build the following sequence of operations using Quirky: First prepare the state , then reset with probability , then reset with probability . Use the probability display in Quirky to determine the probability of the measurement outcomes.
-
2.
Argue that the answer given by Quirky is correct.