Exercise Description
In the book "Quantum Computation and Quantum Information - 10th Anniversary Edition", there is the following exercise ($H$ being the Hadamard matrix and $x_1$,$x_2$ qubits):
Questions
I think I managed to solve the exercise for the first case (the second one is analogous), but it would be great if someone could check to see if it is indeed correct. (I could not find a solution online.) Concretely:
- Is my solution correct (also with respect to notation)?
- Is there a better / more straightforward approach?
Proposed Solution
The computational basis vectors are $$ |00\rangle = (1,0,0,0)^T\\ |01\rangle = (0,1,0,0)^T\\ |10\rangle = (0,0,1,0)^T\\ |11\rangle = (0,0,0,1)^T $$ and we know that $$ H |0\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}}\\ H |1\rangle = \frac{|0\rangle - |1\rangle}{\sqrt{2}} $$ The idea is to build a (unimodular) $4 \times 4$ matrix $A$ that works as follows: $$ A|00\rangle = |0\rangle\frac{|0\rangle + |1\rangle}{\sqrt{2}} = \frac{|00\rangle}{\sqrt{2}} + \frac{|01\rangle}{\sqrt{2}}\\ A|01\rangle = |0\rangle\frac{|0\rangle - |1\rangle}{\sqrt{2}} = \frac{|00\rangle}{\sqrt{2}} - \frac{|01\rangle}{\sqrt{2}}\\ A|10\rangle = |1\rangle\frac{|0\rangle + |1\rangle}{\sqrt{2}} = \frac{|10\rangle}{\sqrt{2}} + \frac{|11\rangle}{\sqrt{2}}\\ A|11\rangle = |1\rangle\frac{|0\rangle - |1\rangle}{\sqrt{2}} = \frac{|10\rangle}{\sqrt{2}} - \frac{|11\rangle}{\sqrt{2}} $$ We now determine the columns of $A$ using each basis vector and expected result. For $|00\rangle$, this looks as follows: $$ \begin{bmatrix} * & * & * & *\\ * & * & * & *\\ * & * & * & *\\ * & * & * & * \end{bmatrix} \begin{bmatrix} 1\\0\\0\\0 \end{bmatrix} = \begin{bmatrix} 1/\sqrt{2}\\1/\sqrt{2}\\0\\0 \end{bmatrix}, $$ which gives the first column of $A$: $$ \begin{bmatrix} 1/\sqrt{2} & * & * & *\\ 1/\sqrt{2} & * & * & *\\ 0 & * & * & *\\ 0 & * & * & * \end{bmatrix} $$ We can then proceed analogously with the remaining basis vectors to find all columns of $A$. Eventually, we end up with $$ A = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 & 0 & 0\\ 1 & -1 & 0 & 0\\ 0 & 0 & 1 & 1\\ 0 & 0 & 1 & -1 \end{bmatrix} $$ It's easy to verify that $\det A = 1$ (i.e. $A$ is unimodular) and that multiplying $A$ with any of the basis vectors yields the desired result.