My question really is about both the theory and the code.
At the end of the second theory section, we have a line that goes:
For instance, to relax this specific restriction, we can choose W(a) to be a Z rotation and use X rotations for S(\phi).
I think this is the opposite of what was said earlier (switches X and Z).
Also I’m not sure how to implement the code. I think we should be able to pass in an a parameter, because that W(a) needs. Also we are being asked to get P(a) values, so we should call qml.matrix() and get the real part of the top-left entry? I feel like qsp() doesn’t need to be be a QNode for this, what do we return here?
Hi @maximus ,
What the theory means is that instead of using W and S, we will use Z and X rotations. You can see this in the code template for the Codercise. Note that in this case you can use variables defined outside of the function qsp(). What variables are defined in the codercise right above the definition of the qsp function? How can you use them in the Codercise?
I hope this helps!
Hi @CatalinaAlbornoz thanks for your reply.
The comment in the code expects us to return an array but that is not allowed if qsp() is a QNode. Please can you provide some hints?
No worries, I got it working. Didn’t realize that QNode supports broadcasting. Very useful!
1 Like