Exact loop-model preparation
The preparation of a UFO source for the one-loop engine: exact scalar data, restrictions, the structural model, the prepared counterterm rules and the complex-mass view. The engine itself is described in loop_v2/DESIGN.md.
pyamplicol.loops.model.build_loop_model(raw_sidecar) prepares exact scalar definitions and individual tree/UV/R2 colour × Lorentz × loop-group entries. It consumes the existing raw UFO sidecar, including its exact-source contract; it does not import a second source manifest. Scalar definitions are indexed by (collection, raw_object_id). Vertex display names need not be unique.
parse_exact_ufo uses standard Python AST/tokenization to validate arithmetic syntax and retain numeric lexemes. Fraction converts decimals into exact rationals before the existing UFO parser runs. The parser and Symbolica own complex arithmetic, model-function calls and expression transformations. No Python expression evaluation or binary64 conversion occurs on this path. Unknown model functions retain their raw definitions and remain symbolic; arbitrary Python helper bodies are not interpreted.
ScalarDefinition.value is a LaurentExpression. CT dependencies, including ordinary parameter or coupling aliases containing CT/Laurent definitions, are substituted before requesting a coefficient. The full expression remains available. series(maximum_power) returns Symbolica’s native series and its remainder order; coefficient(power) extracts a native exact coefficient. For example, an O(epsilon) term multiplying a pole is retained in the finite part. Ordinary epsilon-independent parameter definitions remain separate, so input values and formal colour constants are not prematurely substituted.
CovariantKernelCatalogue(ir, structural_model).lower(entry) produces separate native TensorExpression objects for colour and Lorentz structure. The structural input is a native HepKit model or its public normalized JSON mapping. Only species and propagator metadata are reused. Cached numerical scalar values from the normalized model are never used for the entry’s coefficient. Each component is localized by a public HepKit single-vertex diagram with unit scalar coupling and the other tensor domain set to one. Component results are cached. This reuses native UFO index, momentum, gamma and colour lowering directly.
The local momenta are all incoming native q_edge symbols. leg_half_edges identifies the UFO leg order. Each tensor retains its native axis order, which can differ: Metric(1,4)*Metric(2,3) has axes (0,3,1,2). Consumers must use the native slots/index labels and native axis permutation/rebinding operations. The coefficient stays separate from both tensors.
The initial loop_sm controls cover every pure-QCD component, all 57 active four-gluon R2 basis entries, and two-point UV mass insertions. A synthetic one-point UV rule checks native scalar lowering without extending process support. A mixed QCD/QED quark-photon R2 control checks the exact model formula. Run these controls with PYAMPLICOL_NLO_UFO_REFERENCE pointing to loop_sm and a licensed Symbolica runtime. No reference files are changed.
This preparation does not certify a scheme, UV/R2 completeness, arbitrary precision physics, or formal-Nc continuation. Loop-group alternatives and particle counterterm metadata are retained; restrictions, external-field factors and the counterterm program are separate steps. The active four-gluon loop_sm R2 coefficients contain fixed SU(3) constants. Preserving them does not reconstruct their Nc dependence. Formal-Nc identities of colour parameters (CA, CF, TR, …) are never assumed: a model supplies them in its LoopColorDeclaration.parameter_identities. Legacy inconsistent non-QCD Lorentz spin signatures fail when requested.
Exact restrictions and external requests
prepare_loop_restrictions(raw, simplify=True) applies the captured restriction card to a derived raw declaration view and retains the original unchanged. The installed UFO ParamCard parser owns block/LHA addresses. Source-line annotations in comments preserve the original numeric lexemes; its binary64 values are never used. Every source record and address must survive exactly, so duplicate records (including values that round to the same double), malformed headers, scans, continuations, nonfinite literals, scale-dependent blocks and decay tables are rejected; an entry assigned two different values is the typed refusal restriction-card-entries. As in MadGraph’s restriction reader, an entry whose LHA address names no external parameter of the model (for example DECAY 15 in models without a tau width) is ignored and recorded under ignored_entries; names and comments never bind an entry. Signed decimal and Fortran D-exponent literals are exact. Complex parameters require both real and IM blocks; an IM entry only addresses a complex parameter, and partial component updates are explicitly unsupported and cannot erase an omitted component. All restriction cards shipped with loop_sm, loop_qcd_qed_sm and loop_qcd_qed_sm_Gmu load, except Gmu’s restrict_parallel_test.dat, which assigns SMINPUTS 1 twice and which MadGraph 3.7.0 rejects as well.
Nonzero entries replace adjustable defaults. Simplification fixes exactly zero external parameters, including omitted exact-zero defaults, under the existing loader convention. It does not identify equal nonzero parameters. Structural lowering carries these fixed values into scalar binding and rejects contradictory overrides. Without simplification, even a zero-valued adjustable mass retains its structural massive classification. The existing raw restriction metadata holds this result; no additional identity or manifest is introduced.
prepare_loop_external_request(model, incoming, outgoing) resolves particle names or PDGs through the native model. It derives directed scalar/Dirac/vector state kinds, structural helicities, component offsets, initial spin and colour averages, and identical-final factorials. The complete divisor follows the existing physical engine: initial spin × initial colour × identical-final factor, with couplings retained in the local kernels. Ghosts, Goldstones, nonpropagating states, Majorana fermions and unsupported spins/representations are rejected. This is request preparation, not a process capability certificate.
prepare_loop_request_scope may exclude a source basis before native tensor lowering only when an explicitly bounded coupling power proves it cannot occur. Every source coupling first requires declared nonnegative integer order data. Ordinary rules use the conservative coordinatewise union of Born/loop upper bounds; CT rules use loop upper bounds. Missing or unbounded coordinates do not exclude anything, and lower bounds cannot prune local factors. Original basis keys, including CT loop-group indices, and each exceeded-bound witness remain available in the scope. The full raw source and scalar program remain intact.
Scoped structural lowering retains the same raw object, and a source physical call must use the bounds that prepared it. Scoped local CT coverage requires exact equality with every admitted source CT key and no unavailable entries. This covers local bases only: particle field counterterms, graph-derived correction eligibility, tensor conformance, selected Born/loop pairings and the physical scheme remain separate required checks. Unscoped callers retain the complete-source catalogue guard.
loops.compiler.prepare_loop_request_model connects these boundaries without process-name dispatch. It consumes either an existing CompiledModel raw UFO sidecar or an explicit RawLoopModel; normalized binary64 parameter defaults are not used. The returned preparation retains its compiled owner, original and restricted declarations, scope, native structural model, one paired scalar program and the selected complete local CT catalogue.
Native counterterm rules
loops.counterterms.prepare_counterterm_model appends homogeneous CT rules to the ordinary native model with a private insertion order. Exact Laurent scalar expressions remain unevaluated; aliases use the native coupling symbols, including their namespaces. The legacy UFO type UV is classified with MadLoop 3.7’s import rule (models/import_ufo.py): an identical two-particle pair is UVmass, otherwise UVloop. Missing species of a restricted ordinary model remain explicitly recorded as unavailable basis entries. The engine lowers the rules into the tree recursion (loops/v2/ct_recursion.py, DESIGN §6.1).
OrdinaryBasisRepresentative provides a narrow, explicit convention bridge. Its source ordinary basis key, native rule and colour/Lorentz slot identify the representative; its required calibration label records the caller’s prior physical control. Preparation checks identical ordered signed PDGs, spins and colour representations, exact ordinary scalar and coupling order, and exact colour structure. A CT can reuse that representative only when its source Lorentz and colour expressions equal the source ordinary basis exactly. The counterterm’s Laurent coefficient is retained. Native model symbols are used for substitutions, and approximate numeric atoms in representatives are rejected.
This does not infer any Lorentz convention from names or transpose a gamma matrix. The first explicit mapping is the source u~ u A vector current to the bundled native V_132 basis (0,0). Each CT rule records its proven source identity and whether all entries have a representative. Unmatched structures remain uncalibrated; chiral, Sigma and new two/four-point structures acquire no certificate from this mapping. A calibration label alone is not a physical validation result, and the whole-model convention flag remains false.
Native fundamental colour traces
The current HepKit UFO dispatcher does not lower Tr: passing it through would leave a rank-zero scalar with unresolved colour indices. model_color prepares that head through public tensor.trace, TensorExpression.color_t, and typed HepKit UFO indices before native graph localization. The original sidecar colour expression stays unchanged. Both local catalogue lowering and augmented CT model construction use this boundary. Unknown UFO colour function heads fail explicitly.
The initial trace envelope is SU(3) with distinct positive adjoint external-leg indices; negative dummy indices and other representations are unsupported. Native algebra and component tests establish actual adjoint ports, Tr(Ta Tb) = delta_ab/2, cyclic invariance, and the noncommuting three-generator identity Tr(Ta Tb Tc) - Tr(Tb Ta Tc) = i f_abc/2. No private trace or colour algebra is implemented, and this does not establish general-Nc model validity.
tools/loop_reference/ct_tensor_oracle.py independently compares the three loop_sm gluon two-point R2 Lorentz structures with generated ALOHA routines: p^2 g, p_mu p_nu, and g. It checks every polarization basis pair and a complex polarization pair at real and complex off-shell momenta, removing the explicit ALOHA -i*COUP convention. Native arithmetic is exact; ALOHA is binary64. The report records source hashes and 102 comparisons. This local check does not validate CT scalar values, a whole process, chiral tensors or arbitrary-precision physics. It supplies a separate primitive control rather than extrapolating the ordinary FFV convention bridge to new structures.
An independently controlled new primitive may be supplied explicitly through CountertermPrimitiveValidation and prepare_counterterm_model’s primitive_validations argument. The immutable record binds the exact source basis key, colour/Lorentz expressions, ordered PDGs/spins/colour representations and named conformance control. Preparation rejects stale expressions, wrong ports, missing entries, duplicate evidence and empty provenance. It retains the original tensor and exact scalar; it cannot authorize another basis entry by name alone. CountertermRule.has_validated_tensor_basis requires every entry to have either an ordinary correspondence or this independent primitive evidence. The record does not run a comparison, validate scalar renormalization or set whole-model validation flags. Supplying it is an explicit assertion that the named local control has already been performed for precisely these structures and ports.
External-field factors
loops.wavefunction reads particle.counterterm independently of effective vertex insertion. One key contains a power for each coupling order in the UFO’s original registry order, followed by the declared loop-group index. Exactly one unit power selects a one-loop field correction with two additional fundamental coupling powers. Higher-loop entries are skipped. Laurent arithmetic and CT-dependent alias substitution reuse the existing native scalar lowering. Particle-field values currently require exact expression strings or integers; unobserved float/complex attributes fail rather than acquire false exactness.
prepare_external_field_rules returns one record per source factor, with its loop-alternative index. The positive-PDG particle definition is used for the antiparticle too. Each allowed alternative contributes separately, including repeated alternatives; an empty alternative is a wildcard. loops/v2/fields.py inserts the factors on the external legs of the Born.
MadLoop’s import_ufo.py:1355–1383 and loop_diagram_generation.py:1290–1332 define this convention. In loop_sm, tWcft_UV already includes the field factor delta-Z/2: the two external top legs contribute twice that model coefficient to the Born amplitude. No extra half, loop integration factor or loop symmetry factor is applied. Physical contraction then uses the usual 2 Re(Born* CT).
Exact source scalar frontend
loops.scalar_frontend.lower_scalar_program is an explicit preparation entrypoint for the bounded UFO scalar language. It preserves exact numeric tokens, source conditionals and Python and/or operand-return semantics. Source helper bodies are certified at construction, and actual function_library namespace bindings select their record identities. The Gmu model’s final CMS reglog binding therefore replaces its earlier principal-log definition without deleting either raw record. Unknown scope, arbitrary Python syntax and ambiguous argument strings fail.
The resulting ScalarProgram retains a diagnostic beside every value. Saved native evaluators export interleaved (value, diagnostic) outputs; callers must check both for finiteness. The diagnostic follows only active branches, including inside separately serialized source helper bodies. This is necessary because a NaN used directly as a conditional predicate can select a finite value. The fixed native pyamplicol_scalar_v1 truth, equality and real-order predicates use the selected carrier’s comparison operations. They reject nonfinite operands and nonreal ordered comparisons. They are registered before native decoding and cannot be rebound through the Python consumer API; their versioned definitions are fixed for the lifetime of an evaluator cache. Source helper bodies, unlike callback implementations, are included in saved evaluator bytes. Typed component access uses Complex.re/Complex.im directly: arithmetic reconstruction through z +/- conj(z) can overflow finite inputs or erase subnormal components.
CT dependencies are substituted before dependency-owned Laurent extraction. Epsilon-dependent opaque function arguments are explicitly unsupported until native helper expansion is implemented; they never become unspecified formal derivatives. Ordinary parameter definitions remain separate for exact binding. Successful source preparation does not certify counterterm completeness, complex-mass conventions or numerical physics.
Paired scalar ownership in model and counterterm preparation
build_loop_model(raw, scalar_program=program) accepts the exact source scalar program as an additive alternative to the direct lowering. The program must belong to the identical immutable raw source object and contain its complete declaration set. The IR and every kernel retain that owner and the original SourceScalarDefinition objects. KernelBasisEntry.scalar_expression(power) returns the value and active diagnostic together; source helper definitions are kept in the owner’s library rather than expanded or discarded.
An empty outer UFO loop_particles list denotes an unrestricted loop group, matching MadGraph’s import convention. Preparation normalizes this to a wildcard for each declared coupling group while retaining the raw empty source list.
Exact global scalar bindings
prepare_scalar_bindings resolves selected parameter/coupling Laurent outputs with the source-scoped scalar frontend. External parameters remain independent symbols; internal values and diagnostics are substituted together through the source syntax so an inactive conditional dependency stays inactive. A supplied ScalarProgram must belong to the same immutable raw source instance.
NativeScalarBindings computes exact source defaults and selected derived values in double, DoubleFloat or arbitrary precision. Overrides accept decimal strings and complex decimal pairs. They never enter a binary64 parameter map. Real-type input validation rejects even imaginary strings below binary64 range. Defaults are used only for parameters without overrides. Updates validate every selected value and active diagnostic before atomically replacing state; failed updates preserve the previous arguments, values, overrides and revision. The immutable snapshot() exposes those four fields together, and retained native buffers remain valid across later updates. Concurrent writers are serialized; readers take one consistent snapshot. Returned values are native one-row batches suitable for native event broadcasting.
reconstruct_snapshot(source_owner, snapshot) on another carrier binding of the identical plan rebuilds exact defaults and captured overrides without publishing an update. The source owner is checked before numerical work. Its native rounded arguments and values are never used as higher-precision inputs.
ScalarBindingPlan.prepared retains a PreparedScalarBindings record: exact saved paired value/default/type-guard programs, ordered external names/types, selected Laurent output labels and exact fixed values. This frozen record contains no raw source, helper library, symbolic producer or numerical buffer. Binding it in a new carrier reconstructs fresh native evaluators; defaults and captured decimal overrides are evaluated directly in that carrier.
Structural covariant source model
build_covariant_structure prepares a public native ModelJSON model from the lossless raw species and ordinary vertices, independently of the restricted tree importer. It preserves exact source charges, directed ghosts, ordered species and every colour/Lorentz coupling slot. Numeric parameter and coupling caches remain empty. Adjustable external masses keep independent symbols even when their source default is zero. The shared scalar binding preparation resolves mass aliases exactly before native mass classification; the installed Community classifier alone recognizes literal zero but does not resolve a ZERO alias. An unresolved active diagnostic cannot certify a structural zero.
Massive and massless vectors use the dependency’s public custom-propagator interface with the covariant numerator -i Metric(1,2). The ordinary loader’s massive-vector numerator contains the longitudinal Proca term even with its Feynman argument, so that argument is insufficient for this catalogue. Scalars, Dirac fermions and directed ghosts use its existing propagator builder. Optional explicit covariant cut multiplets pass through native model validation; the Gmu control includes the neutral and both charged vector/Goldstone/ghost quartets. This does not identify ghosts merely by taking opposite PDG signs.
The source observer retains Particle.charge arithmetic before Python rounding, including 2/3, and certifies antiparticle negation from the actual observed anti() declaration. Raw runtime charge metadata remains available. Structural preparation independently checks conjugate species, mass, width, colour, electric charge, ghost/lepton numbers and Goldstone/propagating flags.
The explicit gmu_particle_anti compatibility profile recognizes the demonstrated old positional Particle.anti() call against its actual constructor signature and complete charged-Goldstone metadata. It restores only the derived G− Goldstone flag, retaining raw False, derived True and the reason in adapter diagnostics. No source file or antiparticle counterterm is changed. Unknown metadata mismatches fail. The full Gmu structural control contains 43 particles, 163 ordinary vertices, 132 used coupling definitions and 22 local Lorentz spin signatures; it requires 37 independent external bindings.
Unspecified gauge, custom propagators, unapplied restriction cards, Majorana or four-fermion rules, nonpropagating auxiliary species and uncertified chiral hypercharge conventions are rejected.
Explicit fixed source parameters
prepare_scalar_bindings and build_covariant_structure accept fixed_parameters as decimal strings or exact decimal complex pairs. These are constants selected during generation, separate from adjustable runtime parameters. The source model and scalar program remain unchanged. Fixed values are inserted before dependency resolution and native mass classification; 1e-1000 remains structurally nonzero, while an explicit zero can classify a massless particle. Runtime updates to a fixed name fail atomically.
The covariant structure exposes scalar_bindings(outputs) to carry the same fixed map into numerical evaluation. Ordinary source coupling slots disappear only when both the resolved value and its active diagnostic are exactly zero; a vertex disappears only when all its slots do. This removes zero Yukawa vertices without using numerical defaults or discarding invalid active branches. All remaining couplings retain their source definitions. Fixed kinematic masses and independent Yukawa inputs must be specified separately.
This is an explicit specialization interface. It does not parse restriction cards, infer ties between equal parameters, or certify EW counterterm completion. Unapplied source restriction cards continue to reject. Model preparation must pass the same fixed bindings to its subsequent physical consumers.
Complex-mass declarations
model_cms.complex_mass_scheme is a port of MG5_aMC’s Model.change_mass_to_complex_scheme (DESIGN §6.8). It retains the original raw object and one derived immutable raw model (complex_mass_model applies the same decisions to the compiled tree payload), generic in the model: per nonzero width at the card an external mass gets CMASS_M = sqrt(M**2 - i*M*width), real mass and width inputs are kept, dependent internal parameters become complex and read the pole masses, CMSParam is enabled, Yukawa inputs become mass ties, and the restriction card’s parameters of value 1 become constants (MG5_aMC restricts after its transform). Existing exact source name tokens are rewritten without parsing numeric lexemes through binary64.
Pole-mass references cover the complete covariant multiplet, including ghosts whose original width metadata is ZERO. Source Gfbar/GfRedefinitionChoice, recms/crecms, branch logarithms, all CT bases and all helper bindings remain source-defined. No new renormalization formula or denominator-only width insertion is introduced.
complex_mass_scheme takes reglog_convention: "ufo-standard" (the default) reads reglog as the principal logarithm, "source" keeps the model’s own binding. The selected convention is recorded in the declaration metadata, and the original raw model remains unchanged. reglogp, reglogm, other helpers and all CT formulas stay unchanged. The generic UFO importer continues to preserve source semantics.
This choice follows the UFO 2.0 definition, section 5.2: reglog denotes the principal logarithm; reglogp and reglogm explicitly select shifted sheets. The actual MadGraph 3.7 exporter reserves these names, skips their supplied helper bodies, and emits that convention. The legacy Gmu source instead overwrites reglog with reglogm semantics. In the finite eCoup_DGmua0_UV_EW expression, four of 56 reglog call sites already have upper-left arguments at zero widths: -0.5+1.83351678i, -0.5+0.72646643i, -0.06046135+0.99817054i and -0.64287724+0.93405746i. They are away from the cut at the real-mass anchor. Applying the legacy blanket shift changes the complex charge CT by -0.102935557513438i; this does not vanish as the widths approach zero. Its purely imaginary zero-width value was hidden by real Born interference. The principal result 0.03251413826093476+0.01510486664807422i agrees with an independently compiled Recola real-point Delta r/2 scalar.
A complex-mass request on the five-flavour electroweak models with a massive b is refused where its own counterterm content (the rules of its counterterm program and its external field insertions) binds an electroweak counterterm parameter (loops.model_domain, cms-five-flavour-massive-b); a content that reaches a helper without a complex-mass continuation is refused too (cms-model-helper). Generation, the dry run and the live slice decide on the same content (loops.v2.assemble.request_counterterm_content).
Real-mass logarithm sheets
MG5_aMC’s NLOCT helpers reglogm, reglogp and grreglog, and the complex-mass override of reglog that both electroweak UFOs bind, add -/+2 pi i to the principal logarithm in an open quadrant. Whether a real-mass closed form needs that shift depends on how it writes its arguments. The equal-mass B0 below threshold written as 2 + (i beta / 2) reglogp(z^2) needs it near s = 3 m^2. The counterterm closed forms of loop_qcd_qed_sm and loop_qcd_qed_sm_Gmu do not: there the shifts fire for m1^2 + m2^2 < p^2 < (m1 + m2)^2 and make the counterterms jump and be wrong (UFOmodeldb issue 2). An example is the (W, b) parts of the top mass and field counterterms for sqrt(MW^2 + MB^2) < MT < MW + MB.
The scalar library therefore reads these helpers as the principal logarithm (MadLoop’s REGLOG, scalar_frontend.real_mass_logarithm) only for a model with the “principal” reading (loops.shipped_profiles), and only outside the complex-mass scheme. Every lane lowers its helpers through this library, so the reading reaches all of them. The reading is a separate record of the source, not part of [loop.model], so an explicit [loop.model] keeps it. Without a declaration the model’s own contents decide it every time. The sheet certificate (real_mass_sheet_certificate) must be one of REAL_MASS_PRINCIPAL_CERTIFICATES, and no stored digest or metadata entry can authorise the reading. The certificate is the fingerprint of the exact strings the scalar front end executes and the helper rewriter decides on: every record of every collection exactly as written, the helper binding map and its scope, taken on the structurally repaired form (repair_source_declarations, idempotent), as canonical JSON (_internal/declaration_fingerprint.py). Nothing is parsed or normalised, so the invariant is direct: an equal certificate means identical executed strings, hence identical lowering and an identical helper rewrite set. An equivalent spelling, such as 2.0000000000000000000000001 for 2.0 (the same binary64, another exact number) or a helper body in redundant parentheses, is another model and is read as written. The fingerprint is canonical JSON, so it is the same on every interpreter; CI’s compatibility matrix checks it on CPython 3.11, 3.12, 3.13 and 3.14 (tests/unit/test_declaration_fingerprint.py, on the shipped models’ repaired declarations in tests/fixtures/loop/real_mass_sheet). The certificate excludes exactly what a restriction card or a numeric value override rewrites: the value and value_source of an external parameter whose value text is a number. A value text is a number exactly when the scalar front end’s own lowering of it, with no name in scope, gives a finite exact (complex) rational constant (loops.scalar_frontend.external_number); the fingerprint module reads no value text itself, it is handed that decision. So every spelling the interpreter’s parser takes (8_2.0, 0x52, (82.0), complex(82,0,), 0j, a trailing CR or CRLF, a comment) is the number it lowers to, and a text the lowering refuses or that needs a name (12, 082, MW) is none; the lowering reads CR and CRLF as LF, so every interpreter decides alike.
Every derivation of a raw model is listed in loops/shipped_profiles.py. Metadata-only derivations keep the certificate: declarations, preparation, the restriction card text, and the fixed-zero and simplification records. Restriction values and numeric value_overrides of external parameters, in any of those representations, are excluded, so they keep it too. The repairs are certified on the repaired form. The complex-mass derivation is always read as written. Anything else is another model and is read as written, for example a value_overrides of an internal expression, in any spelling. All 18 shipped cards keep the certificate, loaded, restricted with simplification off and on, and repaired. The recorded certificates, one per copy, are those of the shipped copies of the two models, UFOmodeldb 60ee58bb and 6ca4b120, and MG5_aMC’s downloads. When upstream repairs the model text, the certificate changes and the reading no longer applies.
A user model declares the reading with a top-level attribute of its UFO package, read from the loaded package object at capture (getattr, in the directory loader, capture_raw_loop_model and model compilation alike): pyamplicol_real_mass_logarithms = "principal" asserts that the model’s real-mass closed forms take their continuous branch with the principal logarithm, and "source" evaluates the helpers as written, which is also the default without the attribute. When the attribute exists its value must be exactly one of these two strings. Anything else (None, any non-string, a callable or a module, however it was assigned) is the typed refusal real-mass-logarithms-declaration. It is raised at import, and it is the reason a loop request on the model reports. A lowered program is handed over (ScalarFunctionLibrary.rebind) only to a model with the same reading. For these models every counterterm is bit-identical to the source reading wherever no shift fires, which is every point outside the windows and every physical card. At g g > t t~ with QED corrections, MT = 82 and MB = 4.7 (G_mu), the virtual then equals Recola2 and OpenLoops to 1e-14. MadLoop’s REGLOGM, REGLOGP and GRREGLOG keep the shifts, so MadLoop differs inside the windows, except in the G_mu charge counterterm, whose shift comes from reglog. In the complex-mass scheme every helper but reglog (above) is evaluated as shipped; whether the same windows need the principal sheet there is an open upstream question (tests/unit/test_loop_real_mass_log_sheet.py).
Exact semantic colour views of source scalars
prepare_source_color_scalars prepares a cold symbolic view of an existing source scalar program. Callers supply explicit ordinary-parameter identities, for example CA -> Nc and CF -> (Nc**2-1)/(2*Nc). The preparation checks their exact agreement with the original source at Nc=3; agreement only at the default external parameter values is insufficient. No numeric constant is interpreted as a colour invariant. Additional symbols must belong to the source binding layout or to the original exact expression.
The identity is substituted before dependent source declarations are expanded. Its original active diagnostic remains paired with its value, including mutable external-input conditions and inactive branches. Replacing an adjustable external parameter is rejected unless it was explicitly fixed at generation; ordinary native updates then reject changes to that fixed parameter. This avoids silently accepting parameter updates that the colour view would ignore.
SourceColorScalarPlan retains the formal paired plan and an ordinary ScalarBindingPlan containing Nc-independent coefficient outputs. grades and columns map each colour grade back to the original scalar output. The existing output epsilon powers are unchanged. Symbolica and the existing colour projection helpers perform Laurent collection, including Nc-independent runtime conditionals. Nc-dependent diagnostics, unsupported predicates and non-Laurent functional dependence fail explicitly. Every coefficient retains its source diagnostic, including exactly zero coefficients; an all-zero catalogue has a zero grade solely to preserve diagnostic evaluation, not to set a physical leading colour degree.
Explicit four-gluon QCD rational continuation
qcd_r2_color.prepare_qcd_four_gluon_r2 supplies a whole-rule HV continuation from 2007.03713, Eqs. 5.30–5.38, using Tr(Ta Tb)=delta_ab/2. Its scalar coefficients carry formal Nc, while native fundamental/adjoint tensors retain the physical source port frame for the existing SUNColorSpace lift. The library performs tensor construction and contraction; pyAmpliCol declares the published local rule.
Preparation requires an explicit source group, gauge-coupling expression, contribution (gauge or fundamental-dirac) and HV convention. It compares the complete original source tensor at Nc=3, including scalar coefficients. Both source and replacement lie in the checked three-metric-product span; every SU(3) colour component of three independent Lorentz components is compared exactly. The active 57-entry UFO gives 24,576 component agreements. A separate formal-Nc test uses 0903.0356, Fig. 2, a different published decomposition, rather than reusing the implementation.
The immutable record is keyed by original collection, vertex, loop group and order. It retains the original entry objects, including source diagnostics and all loop alternatives. One Dirac fundamental species per alternative and the complete Yang–Mills gauge/ghost contribution are this local rule’s certified domain; the single-species requirement is not a general loop-group capacity limit. No Nf aggregate or per-entry substitution is inferred, and source/model names play no role in conformance. A partial group, incompatible species, changed scalar normalization or unsupported scheme fails explicitly.
Source-owned continuation
SourceColorContinuation is explicit prepared-model data: the actual source model, formal Nc, exact parameter identities, declared source kernel and particle-field keys, and the existing complete scheme declaration. It does not infer colour semantics from a model name or numerical constants. Missing continuation for a selected kernel/field names that exact key and fails the projection request. Whole rules whose numerical SU(3) coefficients do not define their continuation still need independently checked replacements.
SourceColorContinuation checks the identity of every actually applied whole-rule input against the declaration. Scheme parameter ties use the existing shared fixed_parameters mechanism: a required value must hold symbolically over the entire runtime input domain. An external scheme parameter must therefore be fixed during preparation, and an attempted update is rejected atomically. An internal expression must reduce to the required value with the same fixed map. Scheme declarations alone cannot establish these ties.
The public contract of the declared data is in Source colour data in model bundles.