1
$\begingroup$

I have found a question for finding the Unitary operator for the following transformation: s

I found the solution as well. But I didn't understand how they got the solution!

s

$\endgroup$
6
  • 2
    $\begingroup$ Welcome to QCSE! For $|a_i\rangle$ orthonormal and $|b_i\rangle$ orthonormal, $U=\sum_i|a_i\rangle\langle b_i|$ is the unitary operator that sends $|b_i\rangle$ to $|a_i\rangle$. $\endgroup$ Commented Feb 11, 2021 at 7:29
  • 2
    $\begingroup$ Hey, if it's a text book, could you please tell me the title? I am always interested in books and exercises. $\endgroup$
    – P_Gate
    Commented Feb 11, 2021 at 17:06
  • 2
    $\begingroup$ @P_Gate Problems and solutions in quantum computing and quantum information by Willi-Hans Steen and Yorick Hardy $\endgroup$
    – Jasmine
    Commented Feb 12, 2021 at 0:30
  • $\begingroup$ @Jasmine Thank you very much, I actually didn't know this one yet! $\endgroup$
    – P_Gate
    Commented Feb 12, 2021 at 7:53
  • 1
    $\begingroup$ @Jasmine the Hadamard gate is one of the base gates in quantum computing and is used in most quantum computing algorithms (famous examples of such algorithms include Deutsch's algorithm, Grover's algorithm, Shor's algorithm etc.). Concerning visualizing it, here's a great post on that topic. $\endgroup$ Commented Feb 14, 2021 at 17:36

2 Answers 2

4
$\begingroup$

Firstly, how rude of them to use the word 'obviously' in their solution! If it was obvious then we wouldn't be trying their exercises in the first place!

But anyway, Adam Zalcman described the solution very elegantly and succinctly! But for those wanting a more in-depth explanation of his answer, here it is:

To understand the textbook solution a bit more, let's define an operator $U$ as "if I act $U$ on an input state $|i_k\rangle$, it produces the output state $|o_k\rangle$", or equivalently $$U|i_k\rangle = |o_k\rangle.$$ Let's now consider as set of orthogonal input states $|i_1\rangle, |i_2\rangle,...,|i_n\rangle$ with their corresponding output states $|o_1\rangle, |o_2\rangle,...,|o_n\rangle$. We can now define the operator $U$ explicitly as $$U=|o_1\rangle\langle i_1| + |o_2\rangle\langle i_2| + ... + |o_n\rangle\langle i_n|.$$ To see this with an example, let us compute $U|i_1\rangle$ which should give us $|o_1\rangle$: $$\begin{align} U|i_1\rangle &= \left(|o_1\rangle\langle i_1| + |o_2\rangle\langle i_2| + ... + |o_n\rangle\langle i_n|\right)|i_1\rangle\\ &=|o_1\rangle\underbrace{\langle i_1|i_1\rangle}_{= 1} + |o_2\rangle\underbrace{\langle i_2|i_1\rangle}_{= 0} + ... + |o_n\rangle\underbrace{\langle i_n|i_1\rangle}_{= 0} \\ &=|o_1\rangle. \end{align}$$ Because $|i_1\rangle$ is orthogonal to every term except the first one, all the terms except the first one go to 0 and we are conveniently left with the desired output state $|o_1\rangle$! This is not a coincidence since we have done this by construction. You can try this calculation with any input state $|i_k\rangle$ and you will see it will give you the desired output state $|o_k\rangle$. So going back to the specific case we are looking at, we have defined $U_H$ as $$U_H|0\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle+|1\rangle\right) \\ U_H|1\rangle = \frac{1}{\sqrt{2}}\left(|0\rangle-|1\rangle\right)$$ So we can use the same formulation as above to get $$U_H = \frac{1}{\sqrt{2}}\left(|0\rangle+|1\rangle\right)\langle 0| + \frac{1}{\sqrt{2}}\left(|0\rangle-|1\rangle\right)\langle 1|$$ which gives us the first line of their solution. The second line of their solution comes from taking the equivalent definiton of $U_H$: $$U_H\frac{1}{\sqrt{2}}\left(|0\rangle+|1\rangle\right) = |0\rangle \\ U_H\frac{1}{\sqrt{2}}\left(|0\rangle-|1\rangle\right) = |1\rangle$$ and performing the same steps as above. (Note the last equivalent definition is specific to $U_H$ and doesn't apply to all operators $U$ because it just so happens that $U_H^{\dagger}=U_H$)

$\endgroup$
2
  • $\begingroup$ Who is Adam Zalcman? Is he written any book? Your explanation is awesome 👏 $\endgroup$
    – Jasmine
    Commented Feb 12, 2021 at 0:31
  • 2
    $\begingroup$ Aw thank you! Adam is the author of the first comment written under the original question above :) $\endgroup$ Commented Feb 12, 2021 at 16:22
3
$\begingroup$

Another way to solution:

Hadamard gate changes $|0\rangle$ to $\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle) = |+\rangle$ and $|1\rangle$ to $\frac{1}{\sqrt{2}}(|0\rangle - |1\rangle) = |-\rangle$.

In vector notatation $$ \begin{pmatrix} 1 \\ 0 \end{pmatrix} \rightarrow \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} $$ and $$ \begin{pmatrix} 0 \\ 1 \end{pmatrix} \rightarrow \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix} $$

Now, put output vectors to matrix: $$ H= \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}. $$ Clearly $H|0\rangle = |+\rangle$ and $H|1\rangle = |-\rangle$, so $H$ is matrix representation of Hadamard gate.

$\endgroup$

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