Typo in Quantum Codebook I.6.4

I believe that the sign of \sin(\theta/2) should be positive in Exercise I.6.4
image

Hey @AvanishM! Welcome to the forum :sun_with_face:

The equations here are correct :slight_smile:. The X operator flips the qubit state:

X \vert 0 \rangle = \vert 1 \rangle,
X \vert 1 \rangle = \vert 0 \rangle.

So, the \vert 1 \rangle state with the \sin(\theta/2) coefficient flips to \vert 0 \rangle. Let me know if this makes sense!

Yes that makes sense, but I was actually looking at the first step, where we substitute RY(\theta) \vert 0 \rangle!

RY(\theta) \vert 0 \rangle = \cos(\theta/2) \vert 0 \rangle + \sin(\theta/2) \vert 1 \rangle

This example seems to have substituted:

RY(\theta) \vert 0 \rangle = \cos(\theta/2) \vert 0 \rangle - \sin(\theta/2) \vert 1 \rangle

What’s in the codebook is correct :slight_smile:

RY(\theta) \vert 0 \rangle = \begin{pmatrix} \cos(\theta/2) & -\sin(\theta/2) \\ \sin(\theta/2) & \cos(\theta/2) \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} \cos(\theta/2) + 0 \\ \sin(\theta/2) + 0 \end{pmatrix} = \cos(\theta/2)\vert 0 \rangle + \sin(\theta/2)\vert 1 \rangle

There is some typo. @AvanishM is saying that when we apply RY(θ) to |0>, we should get cos(θ/2)|0⟩ + sin(θ/2)|1⟩ but in the codebook it is written cos(θ/2)|0⟩ - sin(θ/2)|1⟩ which seems wrong.

Hi @zennedturnip ,

I agree. The issue seems to be in the second step, where we apply XRY(θ)X to |1>

We’ll fix it in the Codebook, thanks for pointing it out!

1 Like

The fix is now in the Codebook. Thanks for pointing it out @zennedturnip and @AvanishM ! :raised_hands:

1 Like