4
$\begingroup$

I'm currently going through Introduction to Classical and Quantum Computing, by Thomas Wong, and I'm struggling with exercise 2.29 (page 107):

Exercise 2.29. Say $\left| \psi \right> = \alpha\left| 0 \right> + \beta\left| 1 \right>$ is a normalized quantum state, i.e., $|\alpha|^2 + |\beta|^2 = 1$.

(a) Calculate $H\left| \psi \right>$.

Given the two following transformations the Hadamard gate does:

$$\begin{align} H\left| 0 \right> &= \frac{1}{\sqrt{2}}(\left| 0 \right> + \left| 1 \right>)\\ H\left| 1 \right> &= \frac{1}{\sqrt{2}}(\left| 0 \right> - \left| 1 \right>) \end{align}$$

I did the following:

$$\begin{align} H\left| \psi \right> &= \alpha H\left| 0 \right> + \beta H\left| 1 \right>\\ &= \frac{\alpha}{\sqrt{2}}(\left| 0 \right> + \left| 1 \right>) + \frac{\beta}{\sqrt{2}}(\left| 0 \right> - \left| 1 \right>)\\ &= \frac{\alpha}{\sqrt{2}}\left| 0 \right> + \frac{\alpha}{\sqrt{2}}\left| 1 \right> + \frac{\beta}{\sqrt{2}}\left| 0 \right> - \frac{\beta}{\sqrt{2}}\left| 1 \right>\\ &= \frac{\alpha + \beta}{\sqrt{2}}\left| 0 \right> + \frac{\alpha - \beta}{\sqrt{2}}\left| 1 \right> \end{align}$$

Though, the answer given at the back of the book (page 360) is (notice the $+$ sign): $$\begin{align} H\left| \psi \right> &= \frac{\alpha + \beta}{\sqrt{2}}\left| 0 \right> + \frac{\alpha + \beta}{\sqrt{2}}\left| 1 \right> \end{align}$$

Why is that? This is a simple exercise, yet I can't seem to find what I'm doing wrong.

$\endgroup$
4
  • 3
    $\begingroup$ Your result is correct. The answer you quote from the book is wrong and probably a typo. You can quickly check by plugging in $\alpha=0,\beta=1$, in which case that answer results in $H|1\rangle = |+\rangle$. More generally I don't think that is even a valid quantum state. $\endgroup$
    – forky40
    Mar 3 at 21:37
  • $\begingroup$ @forky40 oh, well that explains it... $\endgroup$ Mar 3 at 21:43
  • 2
    $\begingroup$ @forky40 I think you still should write this as an answer, should anyone stumble upon the same problem! $\endgroup$ Mar 3 at 21:45
  • $\begingroup$ Just reached out to the author of the textbook to fix the mistake, hopefully they see my email. $\endgroup$ Mar 3 at 21:49

2 Answers 2

2
$\begingroup$

Your calculation is correct and that is probably a typo in the textbook, as already mentioned in the comments.

Moreover, if you write down your state as $| \psi \rangle = \alpha | 0 \rangle + \beta | 1 \rangle = \begin{bmatrix} \alpha \\ \beta \end{bmatrix}$ and the Hadamard gate as $H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1\\ 1 & -1 \end{bmatrix}$, then computing the result is straightforward: $$ H | \psi \rangle = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1\\ 1 & -1 \end{bmatrix} \begin{bmatrix} \alpha \\ \beta \end{bmatrix} = \frac{1}{\sqrt{2}} \begin{bmatrix} \alpha + \beta \\ \alpha - \beta \end{bmatrix} = \frac{\alpha + \beta}{\sqrt{2}} | 0 \rangle + \frac{\alpha - \beta}{\sqrt{2}} | 1 \rangle $$

$\endgroup$
2
$\begingroup$

Your result is correct. The answer you quote from the book is wrong and probably a typo. You can quickly check by plugging in α=0,β=1, in which case that answer results in $H|1\rangle = |+\rangle$. More generally that is not a valid quantum state - for example, set $\alpha=\beta=1/\sqrt{2}$ and the result will be $\sqrt{2}|+\rangle$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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