Hi, I’m back again a bit deeper in the codebook.
I needed some time to get through 1.7 and get a feeling for the RX/RZ/RY gates but I got through them just now I’m feeling a bit stuck with 1.8.2
It looks like you need a H gate and transform the result with an RX gate for the final configuration, so my answer was qml.H(0) and qml.RX(np.pi/6). Where do I take the wrong turn?
For now, I kinda go with my gut feeling and a bit of research because I didn’t work with cos/sin for some time, so I’m not used to throwing them around anymore. Any suggestions how dissect such a problem more throughly to get consisten answers ?
Small questions to 1.8.1 I found the solution but I’m a bit unsure how the 5/4 gets resolved because after my idea it should still be 1/4 at the end of the transformation
For I.8.1, the hint says to look at just the amplitudes first (i.e., ignore the e^{i5\pi/4}). The amplitudes are 1/\sqrt{2} — an equal superposition! The Hadamard gate is the one to use here . Then, to get e^{i5\pi/4} just on | 1 \rangle you can use an RZ gate with an angle of rotation of 5\pi/4. That’ll get you this:
The problem says you only need to get the correct answer to a global phase. The above ends up being exactly that (up to a global phase of e^{-i5\pi/8}):