What are the quantum operations that we can perform if we have multiple qubits?
For one, we can apply any one-qubit or two-qubit operation discussed in Sections2 and 3 to any chosen qubits of a many-qubit state.
This works as in Section3.2.2.
For example, if is a single-qubit operation, that is, a rotation or a reflection, then we can define a quantum operation, denoted , that corresponds to applying to the first qubit of an -qubit state.
It is defined as follows on the basis states:
Note that the tensor product combines the single-qubit state with the -qubit basis state to form a state of qubits, as we desire.
As usual, we extend by linearity to general quantum states of qubits.
We similarly define the quantum operations , , etc. that correspond to applying to the second, third, etc. qubit.
Exercise 4.2(Applying a single-qubit operation).
Compute the result of applying the Hadamard operation on the second qubit of the three-qubit state .
In other words, compute .
Write your result in the form of Eq.4.1.
Solution.
Let us first expand the given product state in the form of Eq.4.2:
Thus:
where we used Eq.2.34 to compute the action of on the basis states.
We can similarly figure out how a two-qubit operation can be applied to selected two qubits out of .
We will mostly be interested in controlled-NOT operations:
with is the operation that flips the -th qubit (the target qubit) depending on the value of the -th qubit (the control qubit).
Mathematically, its action on basis states is as follows:
and we extend this prescription by linearity to arbitrary -qubit states.
For example, the controlled-NOT operation is defined as follows for four-qubit basis states:
What does all this look like in Quirky?
Let’s go to
and click on “Quest 4” to find out.
Your web browser will look similarly to Fig.4.1.
Hold on, it seems like Quirky looks exactly the same as last week!?
However, as soon as you pick up an operation in the toolbox, a new wire will appear at the bottom – allowing you to act on an additional qubit.
(Of course, we have limited the number of qubits to some reasonable number that your classical computer is happy to simulate!)
Why don’t you try this now and create a operation, as in the following picture?
When quantum operations act on separate qubits, we can perform them in parallel.
As in Section3.2.3, we re-use the tensor product symbol for this.
If is a quantum operation on qubits and a quantum operation on qubits then we can define a quantum operation on qubits which corresponds to performing both operations in parallel.
On basis states,
(4.5)
and we extend this by linearity to arbitrary states.
It follows as a consequence of Eq.4.5 that
but only if is an -qubit state and and -qubit state!
In the following exercise, the two tensor product symbols are not aligned in this way, so you cannot use this rule!
We saw how to prepare in 3.12.
Thus, the following circuit does the job:
2.
Here is the resulting state:
We can use tensor product several times to iteratively build up larger and larger quantum operations.
Here are three examples for various numbers of qubits:
1.
is the same four-qubit operation as ,
2.
is the controlled-NOT operation for five qubits,
3.
is the quantum operation that applies on the first qubit and, in parallel, on the third qubit (we could also write this as either or ).