Skip to content

Commit c0d247d

Browse files
authored
fixed einsum string (#592)
1 parent 2fc674f commit c0d247d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mrmustard/physics/ansatz/polyexp_ansatz.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ def PS(self) -> PolyExpAnsatz:
223223
if self.num_derived_vars == 0:
224224
W = math.conj(math.rotmat(n // 2)) / math.sqrt(settings.HBAR, dtype=math.complex128)
225225

226-
A = math.einsum("ji, ...jk, kl-> ...il", W, self.A, W)
227-
b = math.einsum("ij, ...j-> ...i", W, self.b)
226+
A = math.einsum("ji,...jk,kl->...il", W, self.A, W)
227+
b = math.einsum("ij,...j->...i", W, self.b)
228228
c = self.c / (2 * settings.HBAR) ** (n // 2)
229229
return PolyExpAnsatz(A, b, c, lin_sup=self._lin_sup)
230230

@@ -241,8 +241,8 @@ def PS(self) -> PolyExpAnsatz:
241241

242242
W = math.conj(math.rotmat(n // 2)) / math.sqrt(settings.HBAR, dtype=math.complex128)
243243

244-
A = math.einsum("ji, ...jk, kl-> ...il", W, A_tmp, W)
245-
b = math.einsum("ij, ...j-> ...i", W, b)
244+
A = math.einsum("ji,...jk,kl->...il", W, A_tmp, W)
245+
b = math.einsum("ij,...j->...i", W, b)
246246
c = c / (2 * settings.HBAR)
247247

248248
A_final = A[..., [0, 2, 1, 3], :][..., :, [0, 2, 1, 3]]

0 commit comments

Comments
 (0)