"""Exact check that the vector fields of casimir.py reproduce [A, Q] on all sixteen entries of Q (e:sigma-action), for all sixteen elementary supermatrices A = E_ij (with the auxiliary odd generator for odd E_ij). Same rational substitution as verify_op_exact.py.""" import sys, os; sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import sympy as sp, time from grass import * from casimir import basis, apply_v, B, F, tB, tF from chart import Q from verify_op_exact import ratsub ETA = 5 t0 = time.time(); bad = 0; n = 0 for (ij, p, v) in basis: i, j = ij A = mzero(4) A[i][j] = G.c(1) if p == 0 else G.gen(ETA) dQ = msub(mmul(A, Q), mmul(Q, A)) for k in range(4): for l in range(4): lhs = apply_v(v, Q[k][l]) - dQ[k][l] for mono, c in lhs.d.items(): r = sp.expand(sp.numer(sp.together(ratsub(c)))) if r != 0: bad += 1; print('NONZERO', ij, (k, l), mono, r) n += 1 print('checked', n, 'entries;', bad, 'nonzero coefficients;', round(time.time() - t0, 1), 's')