feynlag.pheno.lorentz¶
Covariant Dirac-trace engine for squared amplitudes.
The computation path is manifestly covariant: traces are evaluated with
SymPy’s own Clifford-algebra engine (sympy.physics.hep.gamma_matrices,
which ships with SymPy — no new dependency), producing Lorentz-invariant
contractions that are reduced to on-shell dot products p_i·p_j at the very
end. Explicit 4×4 Dirac matrices are deliberately not on this path; they
appear only as the independent test oracle (tests/test_pheno.py).
SymPy’s engine does not cover three things this module needs, all handled here:
Mass terms.
gamma_tracechokes onp̸ + m: the sum is aTensAddwhose scalar argument has no.sorted_components().dirac_trace()splits the scalar (identity) pieces off and appliesTr[c·I₄] = 4cto them directly.γ₅ / chiral projectors. SymPy has no
G5, soP_L/P_Rcannot be represented at all.reduce_projectors()implements the projector algebra and reduces any chain to a γ₅-free trace times a factor — see that function for the derivation and the precondition it enforces. Which projector a vertex carries is decided upstream byclassify_gamma().Reduction to scalars.
TensExpr.replace_with_arraysraisesValueErroron contracted dummy indices (SymPy 1.14), socontract_to_dots()walks the tensor structure directly.
Functions
|
Reduce a fully contracted tensor expression to a plain scalar. |
|
Trace of a Dirac chain, tolerating scalar (identity) pieces. |
|
A (cached) Lorentz |
|
The (cached) rank-1 |
|
Reduce a chiral chain to a γ₅-free trace times a scalar factor. |
|
|