Skip to content

AmpliCol matrix elements in mg7 ([amplicol] processes) - #291

Draft
theoheimel wants to merge 22 commits into
feat-multi-step-unweightingfrom
feat-madspace-amplicol
Draft

theoheimel wants to merge 22 commits into
feat-multi-step-unweightingfrom
feat-madspace-amplicol

Conversation

@theoheimel

@theoheimel theoheimel commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

AmpliCol as a second matrix-element backend of the mg7 output: generate p p > j j j [amplicol], alone or mixed with madmatrix processes in one output. Based on #285. It needs pyamplicol with mg5amcnlo/pyamplicol#6.

How it works

  • Output: each [amplicol] process definition goes to SubProcesses/A<n>_<name>/. pyamplicol generates a leading-colour artifact (lc), a full-colour one (full), and the sources of a UMAMI library returning their ratio (reweight). No MG diagrams are generated.
  • Subprocesses: every UMAMI channel (one colour-ordered phase-space pattern) becomes a madspace subprocess. It has the LC matrix element at a fixed channel and a colour-ordered phase-space mapping.
  • Colour accuracy: a weighting step with the ratio library re- or unweights the events to full colour, using the ratio-returning weighting steps of madspace: multi-step re- and unweighting (surrogates, color reweighting) #285.
  • Run card: a new [amplicol] section with color_accuracy (full, lc), mode (reweight, unweight) and the first-pass settings.

madspace

  • MatrixElement with a fixed channel index (no channel input).
  • Integrands sample the discrete choices of the phase-space mapping uniformly, with weight 2^n.
  • LHE completion of subprocesses without diagrams.

Launcher (launch.py)

  • Module split: launch.py is split into modules (common, observables, subprocess_madmatrix, madgraph_process, options, model_widths, postprocess, driver, cli); launch.py re-exports their names. The e+e- j reference cross section is reproduced exactly.
  • Weighting steps per subprocess, and hooks for other matrix-element backends.
  • AmplicolSubprocess:
    • flavour-grouped legs and their MG multiparticle labels;
    • beams that pyamplicol keeps in one order only are integrated as mirrored, as madmatrix does;
    • the libraries of all channels of a process are loaded once.

Interface and output

  • [amplicol] syntax: process definitions are kept without diagrams. Decay chains, explicit orders, s-channel and particle restrictions, polarisations, non 2->n processes and outputs other than mg7 are refused.
  • Coupling orders: MG's default WEIGHTED order becomes pyamplicol coupling-order limits.
  • Separate worker: pyamplicol runs in a worker process (madgraph/iolibs/amplicol_worker.py). Symbolica holds a per-user lock until its process exits, so MadGraph sessions no longer block each other; a worker waits while another one runs.
  • Amplicol-only outputs get no madmatrix files.
  • Refused for [amplicol]: cuts that are not flavour blind, GPUs, gridpacks, dummy matrix elements, and matrix-element re-evaluation in the systematics.

Tests

  • tests/unit_tests/interface/test_amplicol_syntax.py: syntax, export (flavour groups, multiparticles, coupling orders, mirrored beams).
  • tests/acceptance_tests/test_mg7_amplicol.py: cross sections against madmatrix within errors for
    • g g > g g g (reweight and unweight; LC = 9/8 x full);
    • g g > t t~ g;
    • p p > j j j;
    • a mixed [amplicol] + madmatrix output.

All pass with mg5amcnlo/pyamplicol#6.

Known limitations

  • Phase space for two-particle sides: the colour-ordered mapping undersamples colour orders where a side between the beams has exactly two particles, e.g. 0 2 3 1 4 5 in g g > g g g g, so it shows large weights there. Unlike Fortran AmpliCol, such a side is built with a 2->2 peel instead of a 2->3 step against the opposite beam, and composite masses are sampled flat instead of with s^-0.5. Not addressed here, see madspace: colour-ordered mapping undersamples two-particle sides (vs Fortran AmpliCol) #292.
  • Generation time: pyamplicol takes a few minutes for p p > j j j at output, dominated by Python parts of pyamplicol.
  • Concurrent generation: two [amplicol] generations cannot run at the same time while Symbolica takes its restricted thread at import.

A non-negative channel passed to MatrixElement is given to the UMAMI
channel input as a constant, which is then not an external input. Integrands
and weighting steps can so evaluate one channel of a matrix element that
treats its channels as independent processes.
The discrete two-solution choices of a color-ordered mapping were never passed
to it by the integrand. They are now sampled uniformly.
A subprocess whose matrix element has no diagrams, like a color-ordered
one, has no propagators to insert. Its events carry the diagram index -1.
launch.py stays the entry point and re-exports what the launcher modules
define. The code is moved without changes: common (madspace import, logging,
helpers), observables, subprocess_madmatrix, madgraph_process, options,
model_widths, postprocess, driver and cli. model_widths does not import
madspace, so the run interface loads the model without it.
The subprocess returns its weighting steps, so the weighting groups do not
depend on how a subprocess builds them. A [surrogate] subprocess returns its
second pass with the full matrix element, as before.
'generate p p > j j j [amplicol]' keeps the process definition for the mg7
output, which computes its matrix elements with AmpliCol, instead of
generating MG diagrams. Such processes can be mixed with ordinary ones, and are
refused by the other outputs and for decay chains, coupling orders, s-channel
or particle restrictions and polarizations.
Each [amplicol] process gets a SubProcesses/A<n>_<name> directory with the
leading- and full-colour pyamplicol artifacts, the sources of their ratio
library and a makefile building both libraries into lib/. Every colour ordering
becomes its own entry of subprocesses.json, with backend 'amplicol', and is
never merged with other subprocesses.
A fixed channel is not an external input of a matrix element. The check that
the random inputs of a step are passed in now only looks at them.
An output without MG diagrams skips their export. The [amplicol] processes
stand in for them where the output needs MG processes: the run card defaults,
proc_characteristics and the model reference.
The colour accuracy of the [amplicol] events, lc or full, whether the
leading-colour events are re- or unweighted to it, and the settings of the
leading-colour unweighting.
The matrix elements of a subprocess are loaded by load_matrix_elements, and
those of its integrand built by integrand_matrix_elements, which a subprocess
of another backend overrides. A flavor can carry its own factor.
Every colour ordering of an [amplicol] process is integrated at leading
colour with the colour-ordered phase-space mapping of its UMAMI channel, and
its events are re- or unweighted to full colour with the ratio library. The
parameters of the param card are passed to the AmpliCol libraries, which the
launcher builds when they are missing. GPUs, gridpacks and dummy matrix
elements are refused.
MG replaces the light quarks and leptons of a process definition by flavour
groups, which pyamplicol does not know: the export passes the original
flavours of a leg, or the members of its groups. The directory is named with
the multiparticle labels of the definition.
pyamplicol gets the largest orders of the couplings that MG selects by
default, the minimal WEIGHTED order of the process definition, instead of its
minimal orders per process, which differ for the processes of a multiparticle
definition. The power of alpha_s follows from them. pyamplicol runs with one
worker, as Symbolica's restricted mode allows a single thread.
The flavours of an AmpliCol channel share its momenta and its cuts, built for
the first flavour, so every cut has to select the same particles for all of
them.
gg > ggg in both colour modes and at leading colour, p p > j j j, and an
output mixing madmatrix and [amplicol] processes.
The LHE completion takes the masses of antiparticles too. A model without an
alpha_s parameter can be used with a fixed renormalization scale, at the
alpha_s of the model. The p p > j j j test is skipped until pyamplicol drops
the processes without amplitudes from its multiparticle expansion and its UFO
quark processes agree with madmatrix.
Without MG diagrams the output gets no src/, backend/, madmatrix makefiles
or model code, which nothing would build: only the cards, the launcher and
the [amplicol] subprocesses.
Each colour-ordered channel is its own subprocess, and each loaded the same
two libraries again, with an instance per thread that reads the whole
pyamplicol artifact.
pyamplicol keeps one process per unordered initial state, so p p > j j j
had g u > ... but not u g > ..., and its cross section was 21% low. Such
flavours are integrated with the mirrored beams, as madmatrix does, when
the process definition allows the other order.
Symbolica, imported by pyamplicol, holds a per-user lock until its
process exits, so a MadGraph session that had output [amplicol] processes
blocked all others. pyamplicol now only runs in amplicol_worker.py, which
waits while another process holds the lock, and its workers and cores are
left to pyamplicol, licensed through its Symbolica library key.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant