Skip to content

Commit

Permalink
Fixing grad
Browse files Browse the repository at this point in the history
  • Loading branch information
jkalloor3 committed Sep 27, 2024
1 parent 6c08005 commit 63a6795
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bqskit/ir/gates/parameterized/diagonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_grad(self, params: RealVector = []) -> npt.NDArray[np.complex128]:
)

for i, ind in enumerate(range(1, 2 ** self.num_qudits)):
grad[ind][i][i] = 1j * np.exp(1j * params[ind])
grad[i][ind][ind] = 1j * np.exp(1j * params[i])

return grad

Expand Down

0 comments on commit 63a6795

Please sign in to comment.