Skip to content

Commit

Permalink
fixed if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
ziofil committed Oct 11, 2024
1 parent 7838f28 commit 68554ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mrmustard/physics/gaussian_integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,17 +406,17 @@ def complex_gaussian_integral_1(
D = math.gather(math.gather(A, idx, axis=-1), not_idx, axis=-2)
R = math.gather(math.gather(A, not_idx, axis=-1), not_idx, axis=-2)
bR = math.gather(b, not_idx, axis=-1)
try:
det_M = math.det(M)
if np.all(math.abs(det_M) > 1e-12):
inv_M = math.inv(M)
det_M = math.det(M)
c_post = (
c
* math.sqrt(math.cast((-1) ** m / det_M, "complex128"))
* math.exp(-0.5 * math.sum(bM * math.solve(M, bM), axes=[-1]))
)
A_post = R - math.einsum("bij,bjk,blk->bil", D, inv_M, D)
b_post = bR - math.einsum("bij,bj->bi", D, math.solve(M, bM))
except math.LinAlgError:
else:
A_post = R - math.einsum("bij,bjk,blk->bil", D, M * np.inf, D)
b_post = bR - math.einsum("bij,bjk,bk->bi", D, M * np.inf, bM)
c_post = math.real(c) * np.inf
Expand Down

0 comments on commit 68554ad

Please sign in to comment.