Error in Codercise V.1.1


Hello all

When trying V.1.1 in the codebook, I get an error saying the expectation value is not correct (as shown in the picture), which seems to me it is not a syntax / technical problem. I have looked through the StronglyEntanglingLayers document but nothing jumps out for the reason.

Any help would be appreciated. Thanks!

Hi @twang150,

It looks like you’re missing something. Look at the first keyword argument in the StronglyEntanglingLayers docs. I hope this helps!

Hello

It is still quite confusing. The only problem I can possibly see is the shape (L,M,3) of the “weights” argument. But in the exercise it is stated that the the params will match the correct shape.
But just to be safe i reshaped it to (params.shape[0], n_bits, 3) which gave the same result. I do not think it is the “wires” keyword that. caused the problem so I am quite lost

Thanks

Hi @twang150 ,

Take a look at the image from the Codebook and the one from the documentation (first layer).
Do they look exactly the same? Or is something different?


If you focus on the two blocks from the documentation image, do they look the same too? Check the documentation in detail to answer this question, and you’ll find the answer to the challenge!
If it helps, you can try coding a small circuit on a separate notebook and drawing it with qml.draw_mpl().

I hope this helps you!

Hello

I had thought the image was just an example and not part of the actual question … that is my fault.

It’s an easy question once that was made obvious, thanks!

Good point @twang150 , it’s not super clear in the description that the images are part of the question. Thanks for pointing it out! I’ll se how we can clarify this in the question.

1 Like

@twang150 we added a note saying “Your implementation should match the images shown above.” I hope this makes it more clear for everyone. Thanks again for helping us improve the Codebook and let us know if you have any further feedback! :raised_hands: