Conventions¶
Every sign, metric, and normalization choice used across the library, each
pinned by at least one test in tests/. This page is included verbatim from
the repository root so there is a single source of truth.
Fixed conventions for the whole library. Every item here has at least one pinned
test in tests/. Adapted from bsm-calc/conventions/ and
proyecto_3hdms3/CONVENTIONS.md.
Metric and Dirac algebra¶
Metric signature (+, −, −, −):
g = diag(1, -1, -1, -1).Clifford algebra:
{γ^μ, γ^ν} = 2 g^{μν} I₄.γ₅ = i γ⁰γ¹γ²γ³.Chiral projectors:
P_L = (1 − γ₅)/2,P_R = (1 + γ₅)/2.
Lagrangian signs (mostly-plus for kinetic terms)¶
Scalar kinetic:
+ (D_μ φ)† (D^μ φ)for a complex field,+ ½ (D_μ φ)(D^μ φ)for a real one (Scalar(real=True); whatkinetic/add_kineticemit).Fermion kinetic:
+ i ψ̄ γ^μ D_μ ψ.Gauge kinetic:
− ¼ F_{μν} F^{μν}.Fermion mass:
− m ψ̄ ψ.Covariant derivative:
D_μ = ∂_μ − i g T^a A^a_μ(all couplings with this sign).Yukawa:
L_Yuk = − Y ψ̄_L Φ ψ_R + h.c.;Φ̃ = i σ₂ Φ*.Bare Majorana mass:
− ½ M Σ_ab B_ab F_aᵀ C P_L F_b + h.c.(majorana_mass; the operatorsuggest_yukawaoffers is½ FᵀB C P_L F, soL = −M·O). The formB = majorana_form(F)is the invariant one: symmetric,TᵀB + BT = 0for every non-abelian generatorTacting onF(δF = iαTF), normalisedB†B = 1so the mass eigenvalue isM, with the phase fixed so the first non-zero diagonal entry (else the first non-zero entry) is+1. It exists only for a real representation and must be U(1)-neutral:B = 1for a gauge singlet,B = δ_abin the adjoint basis (SU(2) triplet, SU(3) octet), and antidiagonal with alternating signs in a spherical (Gelfand–Tsetlin) basis, e.g. SU(2) 5 (components ordered m = 2…−2):B_{m,−m} = (−1)^{2−m}, middle (neutral) entry+1. A pseudo-real (doublet) or complex (SU(3) 3) representation has none; a doublet’s Majorana mass comes from the Weinberg operator.
VEVs and field expansion¶
Neutral complex scalar expands with the explicit 1/√2:
φ⁰ → (v + h + i a)/√2.VEV symbols and physical masses are declared
positive=True.
Feynman rules¶
Vertex =
i × ∂ⁿL/∂φ₁…∂φₙevaluated at zero fields — equivalentlyi × (monomial coefficient) × ∏_f (multiplicity of f)!. Pinned test:L = −λ/4! φ⁴⇒ vertex−iλ.All momenta incoming;
∂_μ φ → −i p_μ φfor an incoming momentum convention withe^{-ip·x}plane waves. feynlag uses∂_μ φ → i p(φ) φmatching the DLRSM1 convention (momenta flowing with the field into the vertex viae^{+ip·x}); the overall convention is fixed by the pinned VSS test and documented inoperators.py.
2→2 scattering kinematics¶
1(k₁) + 2(k₂) → 3(k₃) + 4(k₄), all-incoming/outgoing per the standard external-fermion-line table (not an all-incoming convention): incoming particle / outgoing antiparticle → field (ψ) slot; outgoing particle / incoming antiparticle → bar (ψ̄) slot.Mandelstam invariants
s = (k₁+k₂)² = (k₃+k₄)²,t = (k₁−k₃)² = (k₂−k₄)²;u = m₁²+m₂²+m₃²+m₄² − s − tis always a derived quantity, never an independent free symbol — momentum conservation then holds by construction.sispositive=True;tisreal=True(it is negative throughout the physical region — the “positive dummies undersqrt” rule does not apply to it).External bosons. A boson is named by its particle symbol, the field that annihilates it (
Wpfor a W⁺). An incoming particleBenters a vertex through the fieldB; an outgoing one throughB† = conjugates[B]. A fermion propagator isi(q̸ + m)/(q² − m²)withqalong the fermion arrow (from the field slot towards the bar slot):q = p_in(ψ) + p_in(B)withp_in = +kfor an incoming leg and−kfor an outgoing one.Triple-gauge vertex. For a
VVVvertex with field legs(V₁, V₂, V₃)and couplingc(Model.gauge_vertices,c = −g F₁₂₃), the rule isκ c [g^{μν}(p₁−p₂)^ρ + g^{νρ}(p₂−p₃)^μ + g^{ρμ}(p₃−p₁)^ν]withκ = −1(pheno.boson_vertices.VVV_KAPPA) andp_ithe momentum flowing into the vertex with field legi(physical plane waves,∂_μ → −i p_μ). A leg is attached by its field symbol (the outgoing W⁺ is on theWmleg), so the UFO field→particle relabelling sign ofexport/ufo/legs.pyplays no role inpheno.VSSmomentum tags. AVSScoupling isΣ_φ c_φ p(φ)over its two scalar legs, written with feynlag’s∂_μφ → +i p(φ) φ. In a diagram each tag is replaced byVSS_KAPPA × p_in(φ)^μwithVSS_KAPPA = −1(pheno.boson_vertices) andp_in(φ)the momentum flowing into the vertex on field legφ(physical plane waves,∂_μ → −i p_μ— the same origin asVVV_KAPPA). For a scalar of chargeQthis is the textbooki g Q (p_φ − p_φ†)^μ.Colour. Colour is factorised: a diagram is a colour tensor times the Lorentz amplitude with a colour-stripped coupling. A fermion line
ψ̄_x … ψ_yemitting the colour group’s gauge boson carriesT^a[x, y](xthe bar-slot leg’s colour index,ythe field-slot leg’s,T^ain the field’s rep) and the stripped vertex isi g γ^μ; a colour-singlet mediator carriesδ[x, y].Σ|M|²is summed over all external colours; the initial-state average divides by each incoming leg’s colour dimension. A coloured species is declared as aDiracParticleon one colour component withcolor=N_c.External gluons. An external gluon is the calculator’s single gluon symbol with colour dimension
N²−1. Colour tensors on a quark line with two external bosons:(M_first M_second)[x, y]for a quark exchange (firstat the vertex next to the bar slot;M = T^afor a gluon,1for a colour singlet) andΣ_c T^c[x, y] f^{c a b}for the gluon exchange, with the three-gluon vertex’s legs in the order (mediator, boson 1, boson 2) for bothfand the Lorentz tensor. The strippedgggcoupling is−g(adjoint_vvv), so withVVV_KAPPA = −1the vertex isg f^{abc}[g^{μν}(p₁−p₂)^ρ + cyclic], momenta incoming. Two external gluons are summed over physical polarizations,−g_{μν} + (k_μn_ν + n_μk_ν)/(k·n), each with the other gluon’s momentum as the light-like referencen.Polarization sums.
−g_{μμ'} + k_μk_{μ'}/m²for a massive external vector;−g_{μμ'}for a massless one, used only after the Ward identityk_μM^μ = 0has been checked on that amplitude. Mediators are in unitary gauge.Flux factor
1/(2√λ(s,m₁²,m₂²));dσ/dt = ⟨|M|²⟩/(16πλ(s,m₁²,m₂²)).Squared-amplitude functions/methods return the spin/colour-summed
|M|², never averaged. Averaging over the initial state is declared data (feynlag.pheno.particles.ExternalState.dof()) and applied exactly once, byfeynlag.pheno.scattering.cross_section/differential_cross_section— seedocs/manual/scattering_roadmap.md.
SymPy hygiene¶
Arguments of
sqrtmust be manifestly positive: introduce positive dummy symbols for differences (e.g.p1 = μ₃ − m_μwithp1 > 0), never feed a raw difference tosqrt.Simplification hierarchy, cheapest first:
expand→collect→factor→simplify(last resort).Rotation angles must be verified against
tan(2θ)from the defining off-diagonal condition, not onlysin² + cos² = 1.Results are exposed as functions/lazy properties, never computed at module import time.
Dual verification everywhere: symbolic difference and random-point numeric check (
feynlag.verify.numeric_equal).
UFO export conventions¶
feynlag’s own conventions are the ones above; mapping them onto UFO/MadGraph
adds three factors, all applied at the export boundary in
export/ufo/legs.py (never in the physics layer, so a Vertex coupling is
always in feynlag’s convention):
field → particle leg sign. feynlag’s symbols label fields; a UFO leg labels a particle, and the field
W+creates aW-. Emitting naive names transposes each conjugate pair:VVV1is totally antisymmetric so it picks up the permutation parity;VVS1/VVSS1/SSS1/SSSS1are invariant;VVVVmust be invariant and is checked.VSS1 momentum sign.
VSS1carries one power of momentum and feynlag’sd_mu -> i p_mudiffers from UFO’s by a sign, so a VSS gets-1unconditionally.charged-Goldstone phase. feynlag’s
G±carriesi**(-q)relative to MadGraph’s, so each charged-Goldstone leg contributesi**q. A pure rephasing, so no physics changes — verified by MadGraph agreeing across unitary/Feynman/axial/FD gauge.