ValueError: Weights tensor must have second dimension of length 4; got 2

Hi, @I_love_quantum
thanks for your question!

I will provide some tips that could help. If that works, great! but if it doesn’t, it would be better to provide your code (remember, 100% self-contained — someone can copy-paste exactly what is here and run it to reproduce the behaviour you are observing).

I understand that you are trying to use StronglyEntanglingLayers, and getting an error related to the dimension of the weights tensor. The weights tensor should be of dimension (L, M, 3), where L is the number of layers and M is the number of wires (qubits). You could start by making sure that this is consistent.

A similar question has been asked in the past, it might help to check it out here

I hope this helps. If it doesn’t or you have anymore questions, please let me know. Remember to provide you self-contained code.