From 63a6795155eac401bb0b0e27123afa81e77e07d2 Mon Sep 17 00:00:00 2001 From: Justin Kalloor Date: Fri, 27 Sep 2024 16:01:46 -0700 Subject: [PATCH] Fixing grad --- bqskit/ir/gates/parameterized/diagonal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bqskit/ir/gates/parameterized/diagonal.py b/bqskit/ir/gates/parameterized/diagonal.py index 8518edc9..e83f3006 100644 --- a/bqskit/ir/gates/parameterized/diagonal.py +++ b/bqskit/ir/gates/parameterized/diagonal.py @@ -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