Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
feynlag
feynlag
  • Getting Started
  • 1. The Pipeline
  • 2. Declaration: Parameters, Fields, Groups
  • 3. Writing the Lagrangian
  • 4. Checking Invariance
  • 5. Spontaneous Symmetry Breaking
  • 6. Mass Matrices
  • 7. Diagonalization and the Physical Basis
  • 8. Extracting Vertices
  • 9. Export
  • 10. Verification Philosophy
  • 11. Suggesting Invariant Terms
  • 12. Gauge-Anomaly Cancellation
  • 13. Electric Charge and the Vertex Checks
  • 14. Quark Flavour Mixing (CKM)
  • 15. Decay Widths
  • 16. Extending the Decay Calculator
  • 17. Extending to 2→2 Scattering
  • Tutorials
    • From a Lagrangian to a lifetime: particle decays, derived and checked
    • From two particles in to two out: cross sections, derived and checked
    • From Pauli matrices to any SU(N): gauge representations, derived and checked
    • Discrete symmetries: representations, characters, and the construction of invariants
    • Feynman rules of the Standard Model with feynlag
    • Vector-like fermions in feynlag: SM + a vector-like lepton doublet
    • Extending the SM by a gauged U(1)\(_X\): a Z′ tutorial in feynlag
    • Model building with feynlag: suggest + anomaly cancellation
    • The type-I seesaw in feynlag: Majorana neutrino masses, step by step
    • 3HDM with S₃ flavor symmetry: forcing the vacuum, not tuning it
    • Tutorial: Feynman rules of the Standard Model with feynlag
  • Examples Gallery
  • Validated against MadGraph
  • Roadmap: Status and Remaining Work
  • Conventions
  • API Reference
    • feynlag.parameters
      • feynlag.parameters.ExternalParameter
      • feynlag.parameters.InternalParameter
      • feynlag.parameters.Parameter
      • feynlag.parameters.ParameterPoint
      • feynlag.parameters.ParameterSet
    • feynlag.fields
      • feynlag.fields.bar_partner
      • feynlag.fields.conjugate_pair
      • feynlag.fields.dag
      • feynlag.fields.hc
      • feynlag.fields.DiracFermion
      • feynlag.fields.Fermion
      • feynlag.fields.Field
      • feynlag.fields.GaugeBoson
      • feynlag.fields.MajoranaFermion
      • feynlag.fields.Scalar
      • feynlag.fields.WeylFermion
    • feynlag.groups.base
      • feynlag.groups.base.GaugeGroup
      • feynlag.groups.base.SymmetryGroup
    • feynlag.groups.gauge
      • feynlag.groups.gauge.SU2
      • feynlag.groups.gauge.SU3
      • feynlag.groups.gauge.SUN
      • feynlag.groups.gauge.U1
    • feynlag.groups.discrete
      • feynlag.groups.discrete.DiscreteSymmetry
      • feynlag.groups.discrete.S3
      • feynlag.groups.discrete.ZN
    • feynlag.lagrangian
      • feynlag.lagrangian.InvarianceReport
      • feynlag.lagrangian.Lagrangian
      • feynlag.lagrangian.LagrangianTerm
      • feynlag.lagrangian.Model
      • feynlag.lagrangian.ModelSummary
      • feynlag.lagrangian.ParameterReport
      • feynlag.lagrangian.ValidationReport
    • feynlag.operators
      • feynlag.operators.D_linear
      • feynlag.operators.Dmu
      • feynlag.operators.expand_derivatives
      • feynlag.operators.to_momentum_space
      • feynlag.operators.PartialMu
    • feynlag.invariance
      • feynlag.invariance.check_discrete_invariance
      • feynlag.invariance.check_gauge_invariance
      • feynlag.invariance.check_global_invariance
      • feynlag.invariance.check_hermiticity
      • feynlag.invariance.check_mass_dimension
      • feynlag.invariance.gauge_variation
      • feynlag.invariance.u1_charge_breakdown
    • feynlag.models
      • feynlag.models.charged_current_rotation
      • feynlag.models.electroweak_gauge
      • feynlag.models.electroweak_inputs
      • feynlag.models.electroweak_scaffold
      • feynlag.models.higgs_doublet
      • feynlag.models.higgs_lagrangian
      • feynlag.models.standard_model
      • feynlag.models.to_physical_basis
      • feynlag.models.weinberg_rotation
      • feynlag.models.ElectroweakInputs
      • feynlag.models.ElectroweakScaffold
      • feynlag.models.PhysicalBasis
      • feynlag.models.StandardModel
    • feynlag.suggest
      • feynlag.suggest.build_lagrangian
      • feynlag.suggest.reynolds_project
      • feynlag.suggest.suggest_kinetic
      • feynlag.suggest.suggest_potential
      • feynlag.suggest.suggest_yukawa
      • feynlag.suggest.SuggestedTerm
    • feynlag.dirac
      • feynlag.dirac.dirac_conjugate
      • feynlag.dirac.gamma_simplify
      • feynlag.dirac.majorana_symmetry_sign
      • feynlag.dirac.minkowski_metric
      • feynlag.dirac.DiracC
      • feynlag.dirac.DiracGamma
      • feynlag.dirac.DiracGammaLower
      • feynlag.dirac.DiracIdentity
      • feynlag.dirac.DiracLatexPrinter
      • feynlag.dirac.DiracZero
      • feynlag.dirac.PL
      • feynlag.dirac.PR
    • feynlag.vacuum.ewsb
      • feynlag.vacuum.ewsb.Vacuum
    • feynlag.vacuum.tadpoles
      • feynlag.vacuum.tadpoles.extract_tadpoles
      • feynlag.vacuum.tadpoles.solve_tadpoles
    • feynlag.vacuum.masses
      • feynlag.vacuum.masses.build_mass_matrix
      • feynlag.vacuum.masses.charged_mass_matrix
      • feynlag.vacuum.masses.gauge_mass_matrix
      • feynlag.vacuum.masses.scalar_mass_matrix
      • feynlag.vacuum.masses.seesaw_light_mass
      • feynlag.vacuum.masses.seesaw_mass_matrix
    • feynlag.vacuum.diagonalize
      • feynlag.vacuum.diagonalize.diagonalize_orthogonal_2x2
      • feynlag.vacuum.diagonalize.diagonalize_svd
      • feynlag.vacuum.diagonalize.diagonalize_svd_2x2
      • feynlag.vacuum.diagonalize.diagonalize_takagi
      • feynlag.vacuum.diagonalize.rotation_2x2
      • feynlag.vacuum.diagonalize.solve_mixing_angle_2x2
      • feynlag.vacuum.diagonalize.MajoranaRotation
      • feynlag.vacuum.diagonalize.Rotation
    • feynlag.vertices.extract
      • feynlag.vertices.extract.extract_interaction_coefficients
      • feynlag.vertices.extract.feynman_rule
      • feynlag.vertices.extract.vertex_multiplicity
    • feynlag.vertices.bilinear
      • feynlag.vertices.bilinear.expand_bilinear
      • feynlag.vertices.bilinear.extract_fermion_vertices
      • feynlag.vertices.bilinear.extract_majorana_vertices
      • feynlag.vertices.bilinear.fermion_feynman_rule
      • feynlag.vertices.bilinear.fermion_gauge_current
      • feynlag.vertices.bilinear.fermion_mass_matrix
      • feynlag.vertices.bilinear.four_fermion_feynman_rule
      • feynlag.vertices.bilinear.majorana_feynman_rule
      • feynlag.vertices.bilinear.majorana_mass_matrix
      • feynlag.vertices.bilinear.Bilinear
      • feynlag.vertices.bilinear.MajoranaBilinear
    • feynlag.vertices.vertex
      • feynlag.vertices.vertex.classify_spins
      • feynlag.vertices.vertex.Vertex
    • feynlag.vertices.yangmills
      • feynlag.vertices.yangmills.cubic_couplings
      • feynlag.vertices.yangmills.quartic_couplings
      • feynlag.vertices.yangmills.structure_constants
    • feynlag.export.latex
      • feynlag.export.latex.latex_feynman_table
    • feynlag.export.ufo.writer
      • feynlag.export.ufo.writer.write_ufo
      • feynlag.export.ufo.writer.UFOParticle
    • feynlag.export.ufo.vvvv
      • feynlag.export.ufo.vvvv.adjoint_vvv
      • feynlag.export.ufo.vvvv.adjoint_vvvv
      • feynlag.export.ufo.vvvv.assemble_vvvv
      • feynlag.export.ufo.vvvv.metric_pair_coefficients
      • feynlag.export.ufo.vvvv.permute_vvvv
      • feynlag.export.ufo.vvvv.structures_from_metric_pairs
    • feynlag.export.ufo.lorentz_map
      • feynlag.export.ufo.lorentz_map.structures_for
    • feynlag.pheno
      • feynlag.pheno.amplitudes
        • feynlag.pheno.amplitudes.amplitude_squared
        • feynlag.pheno.amplitudes.ffs_squared
        • feynlag.pheno.amplitudes.ffv_squared
        • feynlag.pheno.amplitudes.polarization_sum
        • feynlag.pheno.amplitudes.spin_sum
        • feynlag.pheno.amplitudes.sss_squared
        • feynlag.pheno.amplitudes.vvs_squared
      • feynlag.pheno.boson
        • feynlag.pheno.boson.BosonAmplitude
        • feynlag.pheno.boson.BosonTerm
      • feynlag.pheno.boson_vertices
        • feynlag.pheno.boson_vertices.sss_tensor
        • feynlag.pheno.boson_vertices.vss_tensor
        • feynlag.pheno.boson_vertices.vvs_tensor
        • feynlag.pheno.boson_vertices.vvv_tensor
        • feynlag.pheno.boson_vertices.vvvv_tensor
      • feynlag.pheno.calculator
        • feynlag.pheno.calculator.partial_width
        • feynlag.pheno.calculator.DecayCalculator
        • feynlag.pheno.calculator.DecayChannel
      • feynlag.pheno.colour
        • feynlag.pheno.colour.colour_matrix
        • feynlag.pheno.colour.four_boson_colour_tensor
        • feynlag.pheno.colour.four_fermion_colour_tensor
        • feynlag.pheno.colour.line_colour_tensor
      • feynlag.pheno.contraction
        • feynlag.pheno.contraction.contract_tensors
        • feynlag.pheno.contraction.contract_trace
        • feynlag.pheno.contraction.Ix
      • feynlag.pheno.diagrams
        • feynlag.pheno.diagrams.Amplitude
        • feynlag.pheno.diagrams.BosonPropagator
        • feynlag.pheno.diagrams.ChainVertex
        • feynlag.pheno.diagrams.Diagram
        • feynlag.pheno.diagrams.Leg
        • feynlag.pheno.diagrams.SpinorChain
      • feynlag.pheno.engine
      • feynlag.pheno.epsilon
        • feynlag.pheno.epsilon.assert_epsilon_single_vanishes
        • feynlag.pheno.epsilon.epsilon_pair_tensor
        • feynlag.pheno.epsilon.epsilon_product_sign
        • feynlag.pheno.epsilon.gamma5_trace_coefficient
        • feynlag.pheno.epsilon.gram_determinant
        • feynlag.pheno.epsilon.levi_civita_array
      • feynlag.pheno.integrate
        • feynlag.pheno.integrate.dalitz_integral
        • feynlag.pheno.integrate.have_scipy
        • feynlag.pheno.integrate.quad_1d
      • feynlag.pheno.kinematics
        • feynlag.pheno.kinematics.is_allowed
        • feynlag.pheno.kinematics.kallen
        • feynlag.pheno.kinematics.two_body_momentum
        • feynlag.pheno.kinematics.two_body_phase_space
        • feynlag.pheno.kinematics.ThreeBodyKinematics
        • feynlag.pheno.kinematics.TwoBodyKinematics
        • feynlag.pheno.kinematics.TwoToTwoKinematics
      • feynlag.pheno.line
        • feynlag.pheno.line.boson_exchange_terms
        • feynlag.pheno.line.check_ward_identities
        • feynlag.pheno.line.fermion_exchange_term
        • feynlag.pheno.line.fresh_name
        • feynlag.pheno.line.primed
        • feynlag.pheno.line.LineAmplitude
        • feynlag.pheno.line.LineTerm
        • feynlag.pheno.line.VectorLeg
      • feynlag.pheno.loop
        • feynlag.pheno.loop.A_half
        • feynlag.pheno.loop.A_half_zgamma
        • feynlag.pheno.loop.A_one
        • feynlag.pheno.loop.A_one_zgamma
        • feynlag.pheno.loop.f_function
        • feynlag.pheno.loop.g_function
        • feynlag.pheno.loop.higgs_gammagamma_width
        • feynlag.pheno.loop.higgs_gg_width
        • feynlag.pheno.loop.higgs_zgamma_width
      • feynlag.pheno.lorentz
        • feynlag.pheno.lorentz.contract_to_dots
        • feynlag.pheno.lorentz.dirac_trace
        • feynlag.pheno.lorentz.index
        • feynlag.pheno.lorentz.momentum
        • feynlag.pheno.lorentz.reduce_projectors
        • feynlag.pheno.lorentz.slashed
      • feynlag.pheno.names
        • feynlag.pheno.names.ParticleNames
      • feynlag.pheno.offshell
        • feynlag.pheno.offshell.offshell_scalar_vv_width
        • feynlag.pheno.offshell.scalar_offshell_vv_width
        • feynlag.pheno.offshell.scalar_vv_s12_integral
        • feynlag.pheno.offshell.scalar_vv_squared
      • feynlag.pheno.particles
        • feynlag.pheno.particles.expand_particles
        • feynlag.pheno.particles.DiracParticle
        • feynlag.pheno.particles.ExternalState
      • feynlag.pheno.propagator
        • feynlag.pheno.propagator.breit_wigner
        • feynlag.pheno.propagator.fermion_propagator_phase
        • feynlag.pheno.propagator.propagator_denominator
        • feynlag.pheno.propagator.scalar_propagator
        • feynlag.pheno.propagator.vector_propagator
        • feynlag.pheno.propagator.vector_propagator_numerator
      • feynlag.pheno.scattering
        • feynlag.pheno.scattering.average_factor
        • feynlag.pheno.scattering.cross_section
        • feynlag.pheno.scattering.differential_cross_section
        • feynlag.pheno.scattering.ffs_s_channel_squared
        • feynlag.pheno.scattering.ffv_s_channel_squared
        • feynlag.pheno.scattering.forward_backward_asymmetry
      • feynlag.pheno.scattering_calculator
        • feynlag.pheno.scattering_calculator.ScatteringCalculator
        • feynlag.pheno.scattering_calculator.ScatteringProcess
      • feynlag.pheno.setup
        • feynlag.pheno.setup.model_setup
        • feynlag.pheno.setup.resolve_point
      • feynlag.pheno.summary
        • feynlag.pheno.summary.diagram_row
        • feynlag.pheno.summary.DecayRow
        • feynlag.pheno.summary.DecayTable
        • feynlag.pheno.summary.ProcessSummary
      • feynlag.pheno.topology
        • feynlag.pheno.topology.boson_amplitude
        • feynlag.pheno.topology.enumerate_boson_diagrams
        • feynlag.pheno.topology.enumerate_diagrams
        • feynlag.pheno.topology.enumerate_line_diagrams
        • feynlag.pheno.topology.line_amplitude
        • feynlag.pheno.topology.BosonDiagramInfo
        • feynlag.pheno.topology.DiagramInfo
        • feynlag.pheno.topology.ExternalBoson
        • feynlag.pheno.topology.ExternalFermion
        • feynlag.pheno.topology.LineDiagramInfo
      • feynlag.pheno.trace
        • feynlag.pheno.trace.dirac_trace
      • feynlag.pheno.units
        • feynlag.pheno.units.cross_section_in
        • feynlag.pheno.units.energy_in
        • feynlag.pheno.units.eta_acceptance
      • feynlag.pheno.vertices
        • feynlag.pheno.vertices.at_zero_fields
        • feynlag.pheno.vertices.classify_gamma
        • feynlag.pheno.vertices.collect_decay_vertices
        • feynlag.pheno.vertices.fermion_decay_vertices
        • feynlag.pheno.vertices.resolve_leg
        • feynlag.pheno.vertices.DecayVertex
    • feynlag.pheno.engine
    • feynlag.pheno.lorentz
      • feynlag.pheno.lorentz.contract_to_dots
      • feynlag.pheno.lorentz.dirac_trace
      • feynlag.pheno.lorentz.index
      • feynlag.pheno.lorentz.momentum
      • feynlag.pheno.lorentz.reduce_projectors
      • feynlag.pheno.lorentz.slashed
    • feynlag.pheno.kinematics
      • feynlag.pheno.kinematics.is_allowed
      • feynlag.pheno.kinematics.kallen
      • feynlag.pheno.kinematics.two_body_momentum
      • feynlag.pheno.kinematics.two_body_phase_space
      • feynlag.pheno.kinematics.ThreeBodyKinematics
      • feynlag.pheno.kinematics.TwoBodyKinematics
      • feynlag.pheno.kinematics.TwoToTwoKinematics
    • feynlag.pheno.amplitudes
      • feynlag.pheno.amplitudes.amplitude_squared
      • feynlag.pheno.amplitudes.ffs_squared
      • feynlag.pheno.amplitudes.ffv_squared
      • feynlag.pheno.amplitudes.polarization_sum
      • feynlag.pheno.amplitudes.spin_sum
      • feynlag.pheno.amplitudes.sss_squared
      • feynlag.pheno.amplitudes.vvs_squared
    • feynlag.pheno.vertices
      • feynlag.pheno.vertices.at_zero_fields
      • feynlag.pheno.vertices.classify_gamma
      • feynlag.pheno.vertices.collect_decay_vertices
      • feynlag.pheno.vertices.fermion_decay_vertices
      • feynlag.pheno.vertices.resolve_leg
      • feynlag.pheno.vertices.DecayVertex
    • feynlag.pheno.particles
      • feynlag.pheno.particles.expand_particles
      • feynlag.pheno.particles.DiracParticle
      • feynlag.pheno.particles.ExternalState
    • feynlag.pheno.propagator
      • feynlag.pheno.propagator.breit_wigner
      • feynlag.pheno.propagator.fermion_propagator_phase
      • feynlag.pheno.propagator.propagator_denominator
      • feynlag.pheno.propagator.scalar_propagator
      • feynlag.pheno.propagator.vector_propagator
      • feynlag.pheno.propagator.vector_propagator_numerator
    • feynlag.pheno.integrate
      • feynlag.pheno.integrate.dalitz_integral
      • feynlag.pheno.integrate.have_scipy
      • feynlag.pheno.integrate.quad_1d
    • feynlag.pheno.offshell
      • feynlag.pheno.offshell.offshell_scalar_vv_width
      • feynlag.pheno.offshell.scalar_offshell_vv_width
      • feynlag.pheno.offshell.scalar_vv_s12_integral
      • feynlag.pheno.offshell.scalar_vv_squared
    • feynlag.pheno.loop
      • feynlag.pheno.loop.A_half
      • feynlag.pheno.loop.A_half_zgamma
      • feynlag.pheno.loop.A_one
      • feynlag.pheno.loop.A_one_zgamma
      • feynlag.pheno.loop.f_function
      • feynlag.pheno.loop.g_function
      • feynlag.pheno.loop.higgs_gammagamma_width
      • feynlag.pheno.loop.higgs_gg_width
      • feynlag.pheno.loop.higgs_zgamma_width
    • feynlag.pheno.calculator
      • feynlag.pheno.calculator.partial_width
      • feynlag.pheno.calculator.DecayCalculator
      • feynlag.pheno.calculator.DecayChannel
    • feynlag.pheno.epsilon
      • feynlag.pheno.epsilon.assert_epsilon_single_vanishes
      • feynlag.pheno.epsilon.epsilon_pair_tensor
      • feynlag.pheno.epsilon.epsilon_product_sign
      • feynlag.pheno.epsilon.gamma5_trace_coefficient
      • feynlag.pheno.epsilon.gram_determinant
      • feynlag.pheno.epsilon.levi_civita_array
    • feynlag.pheno.diagrams
      • feynlag.pheno.diagrams.Amplitude
      • feynlag.pheno.diagrams.BosonPropagator
      • feynlag.pheno.diagrams.ChainVertex
      • feynlag.pheno.diagrams.Diagram
      • feynlag.pheno.diagrams.Leg
      • feynlag.pheno.diagrams.SpinorChain
    • feynlag.pheno.scattering
      • feynlag.pheno.scattering.average_factor
      • feynlag.pheno.scattering.cross_section
      • feynlag.pheno.scattering.differential_cross_section
      • feynlag.pheno.scattering.ffs_s_channel_squared
      • feynlag.pheno.scattering.ffv_s_channel_squared
      • feynlag.pheno.scattering.forward_backward_asymmetry
    • feynlag.pheno.topology
      • feynlag.pheno.topology.boson_amplitude
      • feynlag.pheno.topology.enumerate_boson_diagrams
      • feynlag.pheno.topology.enumerate_diagrams
      • feynlag.pheno.topology.enumerate_line_diagrams
      • feynlag.pheno.topology.line_amplitude
      • feynlag.pheno.topology.BosonDiagramInfo
      • feynlag.pheno.topology.DiagramInfo
      • feynlag.pheno.topology.ExternalBoson
      • feynlag.pheno.topology.ExternalFermion
      • feynlag.pheno.topology.LineDiagramInfo
    • feynlag.pheno.contraction
      • feynlag.pheno.contraction.contract_tensors
      • feynlag.pheno.contraction.contract_trace
      • feynlag.pheno.contraction.Ix
    • feynlag.pheno.line
      • feynlag.pheno.line.boson_exchange_terms
      • feynlag.pheno.line.check_ward_identities
      • feynlag.pheno.line.fermion_exchange_term
      • feynlag.pheno.line.fresh_name
      • feynlag.pheno.line.primed
      • feynlag.pheno.line.LineAmplitude
      • feynlag.pheno.line.LineTerm
      • feynlag.pheno.line.VectorLeg
    • feynlag.pheno.boson
      • feynlag.pheno.boson.BosonAmplitude
      • feynlag.pheno.boson.BosonTerm
    • feynlag.pheno.boson_vertices
      • feynlag.pheno.boson_vertices.sss_tensor
      • feynlag.pheno.boson_vertices.vss_tensor
      • feynlag.pheno.boson_vertices.vvs_tensor
      • feynlag.pheno.boson_vertices.vvv_tensor
      • feynlag.pheno.boson_vertices.vvvv_tensor
    • feynlag.pheno.colour
      • feynlag.pheno.colour.colour_matrix
      • feynlag.pheno.colour.four_boson_colour_tensor
      • feynlag.pheno.colour.four_fermion_colour_tensor
      • feynlag.pheno.colour.line_colour_tensor
    • feynlag.pheno.scattering_calculator
      • feynlag.pheno.scattering_calculator.ScatteringCalculator
      • feynlag.pheno.scattering_calculator.ScatteringProcess
    • feynlag.pheno.setup
      • feynlag.pheno.setup.model_setup
      • feynlag.pheno.setup.resolve_point
    • feynlag.pheno.names
      • feynlag.pheno.names.ParticleNames
    • feynlag.pheno.summary
      • feynlag.pheno.summary.diagram_row
      • feynlag.pheno.summary.DecayRow
      • feynlag.pheno.summary.DecayTable
      • feynlag.pheno.summary.ProcessSummary
    • feynlag.pheno.units
      • feynlag.pheno.units.cross_section_in
      • feynlag.pheno.units.energy_in
      • feynlag.pheno.units.eta_acceptance
    • feynlag.verify.checks
      • feynlag.verify.checks.check_dimension
      • feynlag.verify.checks.decoupling_limit
      • feynlag.verify.checks.diagonalize_hermitian
      • feynlag.verify.checks.is_hermitian
      • feynlag.verify.checks.is_symmetric
      • feynlag.verify.checks.numeric_equal
      • feynlag.verify.checks.round_trip_reconstruct
      • feynlag.verify.checks.seesaw_light_mass
Back to top
View this page

Examples Gallery¶

examples/ contains full worked models, used as both documentation and manual smoke tests. Each file is runnable end to end (python examples/<name>.py) and doubles as the “how do I actually write this in feynlag” reference for the corresponding physics.

sm_scalar_gauge.py — the complete Standard Model¶

Higgs sector + electroweak gauge (SU(2)_L × U(1)_Y) + one lepton generation

  • a full 3-generation quark/QCD sector (SU(2) doublet QL, SU(3)_c-triplet singlets uR/dR, flavor-generic Yukawas — no CKM diagonalization, since CKM mixing is orthogonal to SU(3) vertex dynamics). Exercises every stage of the pipeline: gauge invariance, EWSB, tadpoles, the Higgs/Goldstone/gauge mass matrices, the Weinberg rotation, fermion gauge currents and Yukawa mass matrices via the bilinear track, and both LaTeX and UFO export (including real SU(3) color-tensor strings for qqg/ggg/gggg).

sm_vll.py — vector-like lepton doublet¶

Adds a vector-like SU(2) doublet Ψ = (N, E) with a bare Dirac mass to the lepton sector. Demonstrates biunitary 2×2 diagonalization (diagonalize_svd_2x2) of the resulting charged-lepton mass matrix, fermion mass-basis rotations through Indexed fields, and the physics signature of doublet VLL mixing: a right-handed-only Z FCNC, an h-coupling sum rule, and the correct SM-decoupling limit as M → ∞. See Tutorials for the step-by-step notebook.

sm_u1x.py — SM × U(1)_X with a Z′¶

Extends the SM by a second abelian factor with symbolic charge assignment X = a·Y + b·(B−L). An X-charged Higgs singlet VEV drives tree-level Z–Z′ mixing through two chained 2×2 rotations (Weinberg, then Z–Z′). Also adds 3 right-handed neutrinos with a Dirac Yukawa via H̃. Demonstrates keeping physics symbolic in an extra charge parameter, Goldstone counting across two broken U(1)s, and multi-stage rotation chaining (Model.physical_lagrangian applies registered rotations in registration order). No UFO export — UFO’s particle table calls float() on charges, incompatible with the symbolic a/b.

thdm.py — softly-broken Z₂ 2HDM¶

The scalar sector of a two-Higgs-doublet model with a softly-broken Z₂ symmetry. Demonstrates the analytic 2×2 orthogonal diagonalization (diagonalize_orthogonal_2x2) and the α mixing angle, cross-checked against the standard Gunion–Haber/Branco expressions.

thdm_s3.py — 3HDM with an S₃ flavor symmetry¶

Three Higgs doublets, (H1, H2) forming an S₃ doublet and HS a singlet. The potential is built entirely from the library’s own S₃ Clebsch–Gordan products (S3.doublet_product) rather than hand-written invariants — a stress test of the discrete-symmetry machinery. The tadpole system is deliberately over-constrained and forces a specific vacuum alignment (v₁ = √3 v₂ in the literature basis). See Tutorials for the step-by-step notebook.

sm_ckm.py — CKM quark mixing¶

Quark flavour mixing done the FeynRules-SM way, without a symbolic 3×3 Yukawa SVD. The script works in the quark mass basis with diagonal Yukawas and inserts the CKM matrix, built from the exact PDG standard parametrization (flavor.standard_ckm, unitary by construction), into the charged W current only. The neutral Z/γ currents stay flavour-diagonal (the GIM mechanism), so no FCNCs appear. It ends with a UFO export whose nine complex V_ij round-trip numerically.

fermi_theory.py — four-fermion muon decay¶

The dim-6 Fermi operator −(4G_F/√2)(ν̄_μγ^μP_Lμ)(ēγ_μP_Lν_e) + h.c., written below the EW scale with U(1)_em as the only gauge symmetry. Exercises the four-fermion (FFFF) track from end to end: the max_dim=6 invariance check, two-bilinear extraction, and the FFFF* UFO Lorentz structures, exporting both conjugate vertices as MadGraph requires.

sm_weinberg.py — the dim-5 Weinberg operator¶

The unique dimension-5 SM operator (c/Λ)(LᵀCεL)(HᵀεH) + h.c.. Here suggest_yukawa(..., max_dim=5) enumerates it rather than taking it as input. After EWSB it gives a Majorana neutrino mass m_ν = −c v²/Λ, which majorana_mass_matrix + diagonalize_takagi turn into sub-eV masses, plus the ν̄νh coupling. Exercises diracC and MajoranaBilinear.

sm_seesaw.py — type-I seesaw¶

The SM plus right-handed neutrinos with a Dirac Yukawa and a large Majorana mass M_R. Builds the [[0, m_D], [m_Dᵀ, M_R]] matrix (seesaw_mass_matrix), Takagi-diagonalizes it to a light m_ν ≈ −m_D²/M_R plus a heavy ≈ M_R spectrum, and uses MajoranaRotation to extract the heavy-neutrino W/Z couplings. These are proportional to the mixing V ≈ m_D/M_R and decouple as M_R → ∞. See Tutorials.

sm_decays.py — two-body decay widths¶

Builds the electroweak SM with one lepton generation via the models.py scaffold and runs feynlag.pheno.DecayCalculator over the extracted Feynman rules. Gives symbolic partial widths and branching ratios, plus numbers at the PDG point: Γ(Z→νν̄) = m_Z(g²+g'²)/96π, Γ(Z→ℓ⁺ℓ⁻), Γ(W→ℓν) and Γ(h→ℓ⁺ℓ⁻).

sm_higgs_decays.py — the Higgs branching-ratio table¶

Every open tree-level h → f f̄ channel (ττ, μμ, b̄b, c̄c, s̄s), each declared as one DiracParticle, with running quark masses at m_h. Adds the off-shell h → WW*/ZZ* widths (1→3, checked against Keung–Marciano) and the loop-induced gg/γγ/Zγ from imported one-loop form factors. The result is the canonical BR table, dominated by b̄b. The decays notebook in Tutorials walks this physics by hand.

ee_to_ff.py — 2→2 scattering through the Z¶

e⁺e⁻ → μ⁺μ⁻ through the Z alone, with the Z-lepton coupling extracted from the built Lagrangian rather than typed in. Since the leptons are chiral, the ε (γ₅) forward–backward term is non-zero. The script prints Σ|M|², dσ/dcosθ and A_FB, plus a chiral-vs-vector cross-check and the M_Z → ∞ contact limit. Companion: the scattering notebook in Tutorials.

Each model is described algorithmically, stage by stage, in the 1. The Pipeline; the manual cites which pinned test in tests/ fixes each physical result these examples produce.

Next
Validated against MadGraph
Previous
Tutorial: Feynman rules of the Standard Model with feynlag
Copyright © 2026, Moises Zeleny
Made with Sphinx and @pradyunsg's Furo
On this page
  • Examples Gallery
    • sm_scalar_gauge.py — the complete Standard Model
    • sm_vll.py — vector-like lepton doublet
    • sm_u1x.py — SM × U(1)_X with a Z′
    • thdm.py — softly-broken Z₂ 2HDM
    • thdm_s3.py — 3HDM with an S₃ flavor symmetry
    • sm_ckm.py — CKM quark mixing
    • fermi_theory.py — four-fermion muon decay
    • sm_weinberg.py — the dim-5 Weinberg operator
    • sm_seesaw.py — type-I seesaw
    • sm_decays.py — two-body decay widths
    • sm_higgs_decays.py — the Higgs branching-ratio table
    • ee_to_ff.py — 2→2 scattering through the Z