Open yezhuoyang opened 4 months ago
This is because we should use tq.u2(qdev, [0],[[0.1, 0.2]])
for the computation with bsz>1
Let's fix it to make sure it runs with [0.1, 0.2] also
I think it should be ? if params.dim() == 1: params = params.unsqueeze(0).unsqueeze(-1)
This is the code I use that has some bugs related with parameter initialization(In dev branch):
U2 gate is the rotation gate with two parameters U2 gate in qiskit
Running the above example will generate the following error message:
The error is caused by some strange manipulation on the dimension of the tensor, I don't understand why we have to use some squeeze and unsqueeze here.
It seems that many other gates with more than one parameters have similar issue. We should set the standard of how should user pass the parameters in. And perhaps more code comments in the above part can help developer to understand the convention of tensor dimensions.