feynlag.invariance

Symmetry and consistency checks for Lagrangian terms.

Strategy (see plan): explicit component transformation.

  • Gauge groups: infinitesimal variation δφ = i α^a T^a φ with constant α^a; the O(α) coefficient of every generator must vanish. For terms written with covariant derivatives this global check is the correct tree-level invariance test. Fermion legs (living inside Bilinear atoms as Indexed components with a flavor index) get a parallel transform that preserves the flavor index — see _fermion_transform().

  • Discrete groups: substitute each finite generator map; the term must be unchanged after expand. Fermion legs get the same finite substitution as bosons, index-preserved via .replace() (no linearization needed — discrete transforms are finite, not infinitesimal) — see _fermion_transform_discrete().

  • Hermiticity: expand(L − L*) = 0 (valid for bosonic sectors; fermion bilinears need Dirac-conjugation identities not yet implemented — see Model.check_invariance, which skips sectors containing Bilinear).

  • Mass dimension: symbolic power counting (renormalizability: ≤ 4). A fermion Bilinear contributes exactly 3 (two spin-½ legs).

Functions

check_discrete_invariance(term, group)

Whether term is invariant under every generator of group.

check_gauge_invariance(term, fields, group)

Whether term is invariant under group at first order.

check_hermiticity(expr)

Whether a bosonic Lagrangian (sector) is hermitian: L = L*.

check_mass_dimension(term, fields[, ...])

Whether every monomial of term has mass dimension ≤ max_dim.

gauge_variation(term, fields, group)

O(α) variation coefficients of term under group, per generator.