Skip to content

Commit 08a1b2a

Browse files
authored
Update gate_wrapper.py
Bug in U2 gate parameter initialization mit-han-lab#232
1 parent b7f8c36 commit 08a1b2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchquantum/functional/gate_wrapper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def gate_wrapper(
371371
params = params.unsqueeze(0) if params.dim() == 2 else params
372372
else:
373373
if params.dim() == 1:
374-
params = params.unsqueeze(-1)
374+
params = params.unsqueeze(0).unsqueeze(-1)
375375
elif params.dim() == 0:
376376
params = params.unsqueeze(-1).unsqueeze(-1)
377377
# params = params.unsqueeze(-1) if params.dim() == 1 else params

0 commit comments

Comments
 (0)