Stuck on Codercise I.7.1


In order to act as the same as a Hadamard gate, I need to produce 1/sqrt(2), so I think theta = np.pi / 2.
To the phi and omega, I has no idea, so I established equation: RZ(phi)* RX(np.pi / 2)* RZ(omega) = H with unknowns phi and omega, and the final result is phi=2 * np. pi omega=2 * np. pi, but it is still incorrect. How can I get the correct answer?

Hi @boyuzhang1218, welcome to the PennyLane forum!

You’re on the right path but you’ve got the wrong angle for phi and omega. Notice that if phi and omega are 2*pi that’s equivalent to zero so it would mean that you wouldn’t be performing any rotation. Maybe that factor of two shouldn’t be multiplying but instead doing something else… I hope this helps!

Thank you for your help!

No problem!

I hope you’re enjoying the Codebook :grinning: