feynlag.invariance.check_global_invariance

feynlag.invariance.check_global_invariance(term, group)[source]

Whether term is invariant under the global U(1) group.

Every charged scalar component transforms as φ → (1 + iqα)φ (and, through the conjugate, φ* → (1 − iqα)φ*; PartialMu heads alike), every fermion leg ψ_k → (1 + iq_kα)ψ_k with its own flavour’s charge and every bar leg ψ̄_k → (1 − iq_kα)ψ̄_k — applied per sandwich via bilinear_charge(), so a flavour-diagonal ψ̄_i Γ ψ_i with symbolic i is neutral. The O(α) coefficient is i Σ_m Q_m·m over the monomials m of term with total charge Q_m, so its vanishing is exact (finite) U(1) invariance, not just a first-order statement.

Returns:

(ok: bool, violations: list[(0, coefficient)]) — the shape of check_discrete_invariance() (a U(1) has one generator).