Controlled operations
To go beyond product states, we need an operation that allows the two quantum bits to interact.
As before (see Eq. 2.32 for probabilistic bits), we will use a controlled-NOT operation for this, which we define in complete analogy to Eqs. 3.19 and 3.20:
|
|
|
|
(3.63) |
|
|
|
|
|
|
|
|
|
|
|
|
or, more concisely,
|
|
|
(3.64) |
Thus, on basis states, the operation toggles the second qubit controlled on the value of the first qubit.
We can also define an operation which uses the second qubit as the control and the first as the target, i.e.,
|
|
|
(3.65) |
As usual, we extend these formulas by linearity to arbitrary two-qubit states.
In Quirky, you can build a controlled-NOT operation for quantum bits in the same way as you learned for ordinary bits – see Section 3.1.6 in case you don’t remember.
For example, the operation for quantum bits looks just like before:
Many of the things that we proved for probabilistic bits are still true for quantum bits.
E.g., your solution to 3.2 will just as well allow you to swap two quantum bits!
Another example of this is the fact that doing the same controlled-NOT operation twice amounts to doing nothing.
For example, for this is the case because
since for any .
As a consequence, the controlled-NOT operation is the inverse of itself:
(3.66)
where denotes the inverse of operation (see Section 2.4.2).
If you play around a bit with Quirky, you may have noticed that you can combine the with arbitrary single-qubit operations, not just with the NOT operation.
Indeed, we can define a controlled- operation for any single-qubit operation .
They are denoted by and , depending on which qubit is the control and which is the target.
For example, is defined as follows on the four basis states:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
You can quickly verify that for we recover our definition of from before.