So far, we only know how to create the and states using Quirky.
Quantum computing would not be much fun if those were our only options!
To create more interesting states, we need to come up with other quantum operations.
One natural such operation is to rotate the circle by some fixed angle.
Let us denote the rotation by an angle by .
You can always assume that the angle is in .
Since and , this operation acts on the basis vectors as follows (see Fig.2.5):
(2.27)
We can also write out this definition explicitly in the vector notation:
(2.28)
where we used and .
As before, we will use linearity to extend from the basis vectors to arbitrary qubit states.
In the following exercise, you will show that the resulting operation indeed acts as a rotation on qubit states.
In particular, this means that it sends qubit states to qubit states, so is an allowed operation on qubits!
Use the definition of in Eq.2.5 to verify that, for all angles and ,
(2.29)
This means that acts as a rotation on arbitrary qubit states .
Hint:
The trigonometric angle sum and difference formulas might be useful:
(2.30)
Solution.
1.
acts on an arbitrary state as follows:
2.
Since ,
Note that a rotation by 90 degrees (i.e., ) is not the same as a reflection.
Indeed, while both the operation and the rotation send to , they act differently on :
How can we rotate a quantum bit in Quirky?
Since there are infinitely many rotations operations , we could not add them all to the toolbox.
Instead, you can add your own rotations to the toolbox!
Let’s practice by adding a rotation by 30.
To start, select ‘Make ’ in the menu bar.
A new window appears where you can input an angle:
Enter pi/6, which corresponds to 30, and confirm by pressing the button.
Congratulations! You have successfully added the rotation 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.
By Eq.2.28, any rotation sends to .
In our case , and
Using the quantum measurement rule in Eq.2.7, we conclude that the probability of obtaining outcome is
which is exactly what Quirky told us.
In the following exercise you will use Quirky to similarly test the effect of the rotation on the other basis vector, .
Homework 2.3(Testing the 30 rotation).
1.
Build the following sequence of operations using Quirky:
First prepare the qubit state , then rotate by the same angle , and finally measure the qubit.
2.
Use the probability display in Quirky to determine the probability of the measurement outcomes. Argue that the answer given by Quirky is correct.
3.
Modify your solution to the first question such that the probability of measurement outcome zero is 42 percent.
Hack.
1.
The resulting circuit in Quirky should look like this:
2.
We start in the state , as shown in the circuit above. After applying the NOT operation, the state of the qubit is . We now use Eq.2.28, which tells us that the rotation sends to
Using Eq.2.6, we verify that , which agrees with Quirky’s output.
3.
We will replace the operation by another rotation , such that the probability of measuring becomes . To that end, observe that after applying a rotation by an angle of , the resulting state is:
Hence the probability of measuring is . Equating this to allows us to solve for the angle of rotation :