You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the code I use that has some bugs related with parameter initialization(In dev branch):
importtorchquantumastqimporttorchquantum.functionalastqfqdev=tq.QuantumDevice(n_wires=2, bsz=5, device="cpu", record_op=True) # use device='cuda' for GPU# use tqftq.u2(qdev, [0], [0.1, 0.2])
# print the current state (dynamic computation graph supported)print(qdev)
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: