3
votes
$\begingroup$

Reproduced from Exercise 2.2 of Nielsen & Chuang's Quantum Computation and Quantum Information (10th Anniversary Edition):

Suppose $V$ is a vector space with basis vectors $|0\rangle$ and $|1\rangle$, and $A$ is a linear operator from $V$ to $V$ such that $A|0\rangle = |1\rangle$ and $A|1\rangle = |0\rangle$. Give a matrix representation for $A$, with respect to the input basis $|0\rangle, |1\rangle$, and the output basis $|0\rangle, |1\rangle$. Find input and output bases which give rise to a different matrix representation of $A$.

Note: This question is part of a series attempting to provide worked solutions to the exercises provided in the above book.

$\endgroup$
5
votes
$\begingroup$

Immediately, we can see that $$ A = |1\rangle\langle0| + |0\rangle\langle1|. $$ If the input and out bases are $\{|0\rangle, |1\rangle\}$, then $$ |0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad |1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix} \quad\textrm{and}\quad \langle0| = \begin{pmatrix} 1 & 0 \end{pmatrix}, \quad \langle1| = \begin{pmatrix} 0 & 1 \end{pmatrix}, $$ so we can write the first equation as $$ \begin{align} A &= \begin{pmatrix} 1 \\ 0 \end{pmatrix} \otimes \begin{pmatrix} 0 & 1 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix} \otimes \begin{pmatrix} 1 & 0 \end{pmatrix} \\ &= \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} + \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix}\\ &= \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \end{align} $$ to solve the first question. Note that in this case, $A$ is the equal to the bitflip or Pauli $X$ operation.

Secondly, for fun, let us choose to write $A$ in input basis $\{|+\rangle, |-\rangle\}$, where $$ |+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) \quad\textrm{and}\quad |-\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle) $$ and output basis $\{|L\rangle, |R\rangle\}$, where $$ |L\rangle = \frac{1}{\sqrt{2}}(|0\rangle + i|1\rangle) \quad\textrm{and}\quad |R\rangle = \frac{1}{\sqrt{2}}(|0\rangle - i|1\rangle). $$ Rewriting our original $\{|0\rangle, |1\rangle\}$ bases vectors in terms of the above bases, we find $$ \begin{align} |0\rangle &= \frac{1}{\sqrt{2}}(|+\rangle + |-\rangle) = \frac{1}{\sqrt{2}}(|L\rangle + |R\rangle) \quad \textrm{and}\\ |1\rangle &= \frac{1}{\sqrt{2}}(|+\rangle - |-\rangle) = \frac{i}{\sqrt{2}}(|R\rangle - |L\rangle), \end{align} $$ with $\langle0| = (|0\rangle)^\dagger$ and $\langle1| = (|1\rangle)^\dagger$.

From this we can rewrite $A$ as $$ \begin{align} A &= \frac{i}{2}(|R\rangle - |L\rangle)(\langle+| + \langle-|) + \frac{1}{2}(|L\rangle + |R\rangle)(\langle+| - \langle-|) \\ &= \frac{1}{2}\big[ (1+i)|R\rangle\langle+| + (1-i)|L\rangle\langle+| + (-1+i)|R\rangle\langle-| + (-1-i)|L\rangle\langle-|\big] \\ &= \frac{1+i}{2}(|R\rangle\langle+| - i|L\rangle\langle+| + i|R\rangle\langle-| - |L\rangle\langle-|) \end{align} $$ To get $A$ in the desired matrix form, we then set $$ |L\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad |R\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix} \quad\textrm{and}\quad \langle+| = \begin{pmatrix} 1 & 0 \end{pmatrix}, \quad \langle-| = \begin{pmatrix} 0 & 1 \end{pmatrix}, $$ such that $$ A = \frac{1+i}{2} \begin{pmatrix} -i & -1 \\ 1 & i \end{pmatrix}. $$

$\endgroup$
  • $\begingroup$ How do you know that $\left|0\right> = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad \left|1\right> = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$ ? Do the vectors always have these components? $\endgroup$ – Turkhan Badalov Aug 15 '18 at 20:20
  • 1
    $\begingroup$ Ultimately, 0 and 1 are just labels for the two basis states (1,0) and (0,1). You could also set them the other way around, but you would also have to update the matrices acting on them to reflect this. $\endgroup$ – SLesslyTall Aug 15 '18 at 22:32
  • $\begingroup$ Just wondering, if $\left|0\right> = \begin{pmatrix} 1 \\ 0 \end{pmatrix}$, why is it that you can also set $\left|L\right> = \begin{pmatrix} 1 \\ 0 \end{pmatrix}$? $\endgroup$ – wei2912 Nov 4 '18 at 8:28
  • $\begingroup$ It's because we have changed the basis. For example in 2D coordinates the standard choice of basis is defined along the x and y-axis, represented by unit vectors i = (1, 0), j = (0, 1). However, we could have chosen to pick our basis as the diagonal and antidiagonal with unit vectors d = 1/sqrt(2) (i + j) = 1/sqrt(2) (1,1) and a = 1/sqrt(2) (i - j) (1, -1) when written in the (i, j) basis. But of course in the (d, a) basis, d = (1, 0), a = (0, 1). This is what is happening above. If this still doesn't make sense to you is recommend reading up about changes of basis in a linear algebra textbook $\endgroup$ – SLesslyTall Nov 4 '18 at 16:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.