4.1.3 The most general quantum operations

What are the most general operations that we can apply to quantum states on nn qubits? In fact, any operation that has the following three properties:

  1. 1.

    it is linear,

  2. 2.

    it sends quantum states to quantum states,

  3. 3.

    it is invertible

is a valid quantum operation!

Exercise 4.4 (Toffoli).

Define the Toffoli operation on three qubits by

T|a,b,c=|a,b,cabT\left|a,b,c\right\rangle=\left|a,b,c\oplus ab\right\rangle

on basis states (abab is the product of the two bits a,b{0,1}a,b\in\{0,1\}, and \oplus was defined in Eq. 3.21), and extend it by linearity to arbitrary three-qubit states. Show that TT sends quantum states to quantum states, and that TT is invertible.

Note: TT inverts the third bit of the basis vector if and only if the first two bits are both set to one – so it is like a ‘doubly controlled’ NOT operation.

Solution. Let
|ψ\displaystyle\left|\psi\right\rangle =ψ000|000+ψ001|001+ψ010|010+ψ011|011\displaystyle=\psi_{000}\left|000\right\rangle+\psi_{001}\left|001\right% \rangle+\psi_{010}\left|010\right\rangle+\psi_{011}\left|011\right\rangle
+ψ100|100+ψ101|101+ψ110|110+ψ111|111\displaystyle+\,\psi_{100}\left|100\right\rangle+\psi_{101}\left|101\right% \rangle+\psi_{110}\left|110\right\rangle+\psi_{111}\left|111\right\rangle
be an arbitrary three-qubit quantum state. The result of applying the Toffoli operation is
|ψ=T|ψ\displaystyle\left|\psi^{\prime}\right\rangle=T\left|\psi\right\rangle =ψ000|000+ψ001|001+ψ010|010+ψ011|011\displaystyle=\psi_{000}\left|000\right\rangle+\psi_{001}\left|001\right% \rangle+\psi_{010}\left|010\right\rangle+\psi_{011}\left|011\right\rangle
+ψ100|100+ψ101|101+ψ110|𝟏𝟏𝟏+ψ111|𝟏𝟏𝟎.\displaystyle+\,\psi_{100}\left|100\right\rangle+\psi_{101}\left|101\right% \rangle+\psi_{110}\mathbf{\left|111\right\rangle}+\psi_{111}\mathbf{\left|110% \right\rangle}.
We highlighted the two basis states that changed in bold. Note that the only change is that the amplitudes of |110\left|110\right\rangle and |111\left|111\right\rangle were swapped. Thus it is clear that if a,b,c=01ψa,b,c2=1\sum_{a,b,c=0}^{1}\psi_{a,b,c}^{2}=1 then also a,b,c=01(ψa,b,c)2=1\sum_{a,b,c=0}^{1}(\psi^{\prime}_{a,b,c})^{2}=1. Thus, TT maps quantum states to quantum states.

4.4 shows that the Toffoli operation is a valid quantum operation of three qubits. Interestingly, it is actually possible to write TT as a sequence of one- and two-qubit operations. In fact, this is possible for any quantum operation of nn qubits – but we will not do it in this class since it takes an experienced quantum composer to understand how this can be done!