Local operations
If you have two qubits, a local operation acts only on one of them.
Any single-qubit operation can be used as a local operation that acts on one out of two qubits,
just like we did for probabilistic bits in Section 3.1.2.
For example, if you recall the single-bit NOT operation in Eq. 1.17 and how we turned it into local NOT operations in Eqs. 3.6 and 3.7, we can do the exact same thing for the single-qubit NOT.
The resulting local quantum NOT operations are very similar:
|
|
|
|
|
|
The only difference is that we have replaced the bit notation with the qubit notation .
As an application of this, let’s say we want to build all four possible two-qubit basis states out of . This can always be done by some sequence of NOT operations:
|
|
|
Note that in the last case we could have done the two NOT operations in the opposite order since either sequence corresponds to negating both bits.
In other words,
.
To apply a local operation in Quirky, we drop the corresponding box onto eiter the first or the second wire. For example, the following sequence prepares the state and shows the outcome probabilities when measuring both qubits:
This makes sense since the bottom wire in Quirky corresponds to the first qubit.
This is most simple to state using the tensor product notation from Eq. 3.50 and linearity.
If is an arbitrary single-qubit operation then we define as the two-qubit operation that acts on any basis vector , where , as follows:
|
|
|
(3.52) |
Just to be clear, the right-hand side means , i.e., the tensor product of the state and the state .
This is intuitive, as it simply means that we apply to the first quantum bit and leave the second quantum bit alone.
To apply to an arbitrary two-qubit state, we extend this prescription by linearity.
As in the first week, this means that we first expand in the form of Eq. 3.31 and then apply the operation to each basis vector.
That is,
|
|
|
and now we can use Eq. 3.52 for each of the four terms.
We similarly define by
|
|
|
(3.53) |
and extend it by linearity.
This is analogous to the formulas in Eq. 3.27 for ordinary bits.
In addition to the NOT operation, two important quantum operations that we will use all the time are the operation from Eq. 2.26 and the Hadamard operation from Eq. 2.34.
Since they are so important, we gave them their own boxes in Quirky, namely and .
For example, the following sequence of operations applies a on the second (!) qubit, then a Hadamard on the first qubit, and finally a , again on the first qubit:
(3.54)
What is the state that we get in this way?
The mathematical expression for this state is
(3.55)
Note that, in contrast to the graphical depiction (3.54),
the input state in this expression is on the right-hand side.
This causes the order of operations to appear reversed.
However, both (3.54) and Eq. 3.55
describe the same process – the first operation applied to is , then , and finally .
The only difference between (3.54) and Eq. 3.55 is the convention for depicting the direction of time:
it goes from left to right in (3.54)
and from right to left in Eq. 3.55.
Unfortunately these two mismatching conventions are standard in quantum computing so there is nothing we can do about it.
You simply have to be careful when translating Quirky pictures to equations and vice versa!
(Is Quirky right?).
Compute the two-qubit state in Eq. 3.55 (that is, right before the measurement in (3.54)).
Compute the probability of measurement outcomes and compare your result with Quirky.
Solution.
We start with . After the NOT on the second qubit, we get . The Hadamard on the first qubit transforms this into and with the final operation we obtain the following two-qubit state right before the measurement:
|
|
|
Thus, we get either or , with probability 50% each.
Last week, in Section 2.4.3, we dicussed that any operation on a single qubit is either a rotation or a reflection .
Since we can construct arbitrary rotations in Quirky (see Section 2.4.1 of last week’s lecture notes), we can therefore apply arbitrary local operations on either of the qubits using Quirky.
In fact, the rules of Eqs. 3.52 and 3.53 do not only work for basis vectors, but in fact for arbitrary product states.
That is, if and are arbitrary single-qubit states then
|
|
|
|
(3.56) |
|
|
|
|
(3.57) |
(Local operations on product states (optional)).
Solution.
We only show how to verify Eq. 3.56 (the other equation can be derived completely analogously).
For this, let us write and .
Then,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
by Eq. 3.50, the definition of , and linearity.