"""Check of p:grass-supergauss (Section 3) for a (1|1) supermatrix with odd off-diagonal entries: int exp(-(zeta,chi)^* M (zeta,chi)) dzeta dchi = det(D - C A^{-1} B)/det A.""" import sys, os; sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import sympy as sp from grassmann import G # generators: 1 = chi, 2 = chibar, 3, 4 = auxiliary odd theta1, theta2 s, a, d, b1, b2, c1, c2 = sp.symbols('s a d b1 b2 c1 c2') chi, chib, t1, t2 = G.gen(1), G.gen(2), G.gen(3), G.gen(4) beta = b1 * t1 + b2 * t2 # odd entry B gamma = c1 * t1 + c2 * t2 # odd entry C # zeta-bar * beta * chi + chibar * gamma * zeta: zeta's are even; track zeta and zetabar via symbols zb, z = sp.symbols('zb z') Q = G.const(a * zb * z) + zb * (beta * chi) + chib * gamma * z + d * (chib * chi) # exp(-Q) = exp(-a zb z) * exp(-(nilpotent part)); nilpotent part N Nil = Q - G.const(a * zb * z) E = G.const(1); P = G.const(1) for k in range(1, 6): P = P * (-Nil) * sp.Rational(1, 1) E = E + P * (1 / sp.factorial(k)) # Berezin over chi, chibar: coefficient of chi chibar (generators 1,2) -> keep theta part res = {} for mono, c in E.d.items(): if 1 in mono and 2 in mono: rest = tuple(m for m in mono if m not in (1, 2)) # chi chibar must be leading: sign of moving 1,2 to front # mono is sorted ascending; 1,2 are first already res[rest] = res.get(rest, 0) + c # zeta integral: int (zb z)^k e^{-a zb z} dzeta = k!/a^{k+1} out = {} for mono, c in res.items(): c = sp.expand(c) poly = sp.Poly(c.subs(zb, sp.Symbol('u')).subs(z, 1), sp.Symbol('u')) # zb z -> u val = sum(coef * sp.factorial(k[0]) / a ** (k[0] + 1) for k, coef in poly.terms()) out[mono] = sp.simplify(val) print('integral:', out) # Sdet^{-1} = (d - gamma a^{-1} beta)/a sd = G.const(d / a) - (gamma * beta) * (1 / a**2) print('Sdet^-1 :', {k: sp.simplify(v) for k, v in sd.d.items()})