Circuit identities
When you are dealing with a very complicated quantum circuit, it is good to know some tricks for simplifying things.
Such tricks can not only make it easier to understand what the circuit does but also make the circuit more efficient and thus faster to execute on a quantum computer.
Let us look at a few simple examples of such tricks involving just a single qubit.
Recall from Section 2.4.3 that each single-qubit operation is either a rotation or a reflection.
It is convenient to represent the action of these operations visually by recalling from Section 2.1.2 that qubit states form a circle.
One immediate observation you can make is that if any fixed reflection is applied twice on the same qubit, then you end up back with the original state.
Indeed, this is visually clear since reflecting about the same axis twice restores everything as it was (for example, you can see this in Fig. 2.4 for the operation).
In particular, this is the case for the Hadamard operation , which we know is a reflection because of Eq. 2.35.
Let us verify this geometric intuition by doing a small calculation, and also check that the Hadamard gate lets you convert between the and gates.
(Z and NOT).
Recall from Eq. 2.34 that the Hadamard gate acts as follows:
-
1.
Verify that applying again would get you back to and .
That is, check that
-
2.
Verify that where is defined in Eq. 2.26.
-
3.
Verify that .
Solution.
-
1.
By applying to and we get
|
|
|
|
|
|
|
|
-
2.
To show this identity, we only need to check that acts the same way as on the basis vectors (by linearity, this would mean that they act the same way on all qubit states):
|
|
|
|
|
|
|
|
In both cases inverts the bit, so it is implementing the same operation as .
-
3.
The first part of the exercise shows that applying the Hadamard gate twice does nothing:
.
Thus,
|
|
|
where the last step is by part 2 of the exercise.
Another interesting question to ask if what happens if you apply two arbitrary rotations or reflections consecutively?
We know that what you get should again be either a rotation or a reflection.
But which one is it and what is the new angle?
Two consecutive rotations are simply the same as a single rotation by the sum of the two angles, i.e., .
The following exercise gives you a rule for simplifying two consecutive reflections to a single rotation.
(Reflections and rotations (optional)).
Verify that a product of two reflections is a rotation. That is, show that
for some angle . Can you express the angle in terms of and ?
Hint: Use Eq. 2.33 and use that .
Solution.
-
1.
Using Eq. 2.29,
This holds for any state , implying that where .
This is also clear geometrically: if you first rotate by angle and then by angle , together this amounts to a rotation by angle .
-
2.
Here is an elegant solution. Recall from Eq. 2.33 that we can express a general reflection in two different forms: . If use the first expression for and the second expression for , we get
where we used the fact that doing two consecutive s amounts to doing nothing and that two consecutive rotations amount to a single rotation with the two angles being added, as shown above.
You can work out the remaining two cases that involve one rotation and one reflection on your own, and check that they both result in a reflection , for some angle .