feynlag.pheno.lorentz.dirac_trace¶
- feynlag.pheno.lorentz.dirac_trace(expr)[source]¶
Trace of a Dirac chain, tolerating scalar (identity) pieces.
sympy.physics.hep.gamma_tracehandles only pure gamma products, so a spin-sum factorp̸ + mbreaks it. Here the expression is expanded and each additive term is traced separately: terms carrying gamma matrices go to SymPy, purely scalar terms useTr[c·I₄] = 4c.