Processes
A process request says which external particles you want, as on a MadGraph generate line. pyAmpliCol expands it into concrete processes, generates each one that has an amplitude, and stores them in one artifact (the generated process directory) under stable IDs. At run time you select one of them by its ID or by its expression, in the particle order you want to use. The model the names refer to is chosen on Models.
Process expressions
A process is a list of incoming particles, >, and a list of outgoing particles, with the particle names of the model:
d d~ > Z g g
Names are case-insensitive. A process has one incoming particle (a decay) or two (a scattering). A repeated particle may be written once with a count, g g > 3*g. A trailing bracket, a coupling-order limit or a / veto is read as an MG5_aMC annotation.
One artifact can hold several requests, each with an optional name:
[process]
entries = [
{ expression = "u u~ > Z g", name = "uu_Zg" },
{ expression = "u u~ > Z g g", name = "uu_Zgg" },
]
On the command line, the first process is an argument and each further one an option; each --name, in order, names one process:
pyamplicol generate 'u u~ > Z g' artifacts/uu_z --model built-in-sm \
--process 'u u~ > Z g g' --name uu_Zg --name uu_Zgg
In Python, pass a ProcessSet of ProcessRequest.parse(expression, name=...) (Python).
Process IDs
Every concrete process of an artifact has a stable ID, which is also its name. A named request keeps its name. An unnamed request is named after its expression: ~ becomes bar, > becomes _to_, other punctuation _, so u u~ > g g is u_ubar_to_g_g. A request that expands to several concrete processes names them <name>_1, <name>_2, …, in the order of the expansion.
The readable name drops charge signs, so two unnamed requests can share it. Such requests, and an unnamed request whose readable name is already taken, get the first ten hexadecimal digits of the SHA-256 of their expression appended:
from pyamplicol import Generator, ModelSource, ProcessSet
pair = ProcessSet.from_expressions(["u mu- > u mu-", "u mu+ > u mu+"])
plan = Generator().plan(pair, model=ModelSource.built_in_sm())
print([process.name for process in plan.concrete_processes])
# ['u_mu_to_u_mu_cfd36ea45d', 'u_mu_to_u_mu_ed4e524935']
Give names yourself (name = in the run card, name= in Python) to choose the IDs. An explicit name is never changed; a name that is already taken, by a process or an alias of the artifact or of the artifact an append extends, is refused with a ProcessIdCollisionError before anything is written.
Decays
A request with one incoming particle is a decay, as MadGraph’s t > b w+. Its value is summed over the final-state helicities and colors, averaged over those of the decaying particle only, and divided by the symmetry factor of identical final-state particles. Its momenta may be given in any frame; the rest frame of the decaying particle is the usual one. Multiparticle labels expand as for a scattering (w+ > j j):
pyamplicol generate 'z > e+ e-' artifacts/z_ee --model built-in-sm
Tree-level decays on the shipped UFO models agree with MadGraph standalone with the same parameter card. Decay chains (t > b w+, w+ > e+ ve) are refused with madloop-syntax: request each decay as its own process. One-loop and loop-induced decays (h > g g) are served too; their conventions are on One-loop matrix elements.
Multiparticles
A multiparticle label stands for a list of particles. Define labels in the run card or with --multiparticle; your labels are merged over the model’s defaults:
[process]
entries = [{ expression = "p p > z j j" }]
[process.multiparticles]
p = ["d", "d~", "g"]
j = ["d", "d~", "g"]
pyamplicol generate 'p p > z j j' artifacts/pp_zjj --model built-in-sm \
--multiparticle 'p=d,d~,g' --multiparticle 'j=d,d~,g'
| p_p_to_z_j_j_1 | d d > z d d |
| p_p_to_z_j_j_2 | d d~ > z d d~ |
| p_p_to_z_j_j_3 | d d~ > z g g |
...
| p_p_to_z_j_j_11 | g g > z d d~ |
The expansion keeps the processes that have a tree-level amplitude; here g g > z g g, which is loop-induced, is left out. Processes that are dropped leave a gap in the numbering, so the others keep their IDs.
Two settings bound the expansion:
| Setting | Command line | Meaning |
|---|---|---|
process.max_quark_lines | --max-quark-lines N | drops a concrete process with more than \(N\) external quark lines (every model, tree level and one loop) |
process.flavor_scheme | --flavor-scheme N | the number of active quark flavors of the built-in Standard Model’s catalog (default 5) |
A request that a bound leaves empty is refused with an error that names the setting. On a UFO or JSON model the bound is applied after the expansion, so the IDs do not depend on it; the built-in Standard Model applies it while it enumerates, so changing it can renumber the processes.
Order within a side. On a UFO or JSON model each side of > is expanded as a set of particles, so two concrete processes never differ only by the order of the particles on one side; d g > z d g stands for g d > z d g too (Select a process at run time). The built-in Standard Model keeps its own ordered catalog.
The model-generic all label
Every model supplies the label all: its physical external particles, in the model’s order, without ghosts, Goldstone bosons and auxiliary fields. Your own labels leave it in place; defining all yourself replaces it. all products grow fast with a large model; list them before generating:
pyamplicol model processes 'p p > all all' --model built-in-sm \
--flavor-scheme 1 --max-quark-lines 0
Conserved charges in UFO expansion
On a UFO or JSON model, an expanded process whose incoming and outgoing totals of a conserved charge differ is dropped before any amplitude is built. The conserved charges are derived from the model’s vertex list alone: every additive quantity that each vertex conserves, such as the electric charge and the quark and lepton numbers per generation (with a non-diagonal CKM matrix, the baryon number instead). Such a process has no tree amplitude at any coupling order, so the filter only saves time.
List the processes of a request
pyamplicol model processes lists what a generation of the same request stores, in its order and under its names, without generating:
pyamplicol model processes 'p p > z j j' --model built-in-sm \
--multiparticle 'p=d,d~,g' --multiparticle 'j=d,d~,g'
It runs the generation’s own planning, with the execution mode, color accuracy, selections, coupling orders, grouping and every filter, and refuses what the generation would refuse, with the same error. It prints the counts and the lists; with --json, entries are the processes the artifact stores, served the processes served through a stored one by flavor grouping (Process grouping), and, for a one-loop request, skipped the Born-less processes the request skips. Options of the generation that model processes does not have go in --set, for example --set evaluator.execution_mode=compiled for a UFO model without prepared kernels.
pyamplicol generate --dry-run and Generator.plan plan a generation too. model processes compiles a model that is not compiled yet, as a generation does; generate --dry-run never compiles one.
Coupling orders
Coupling orders are the model’s names for the powers of its couplings (QCD, QED, HIG, …). They limit the amplitudes of a request:
| Setting | Command line | Meaning |
|---|---|---|
process.coupling_order_policy = "minimal" | --coupling-order-policy minimal | default: keep, per process, the amplitudes of the lowest orders by the model’s coupling hierarchy, within each order’s UFO expansion_order |
process.coupling_order_policy = "explicit" | --coupling-order-policy explicit | keep every amplitude within max_coupling_orders |
process.max_coupling_orders = { QCD = 2, QED = 2 } | --max-coupling-order QED=2 | the largest power of each order in one amplitude |
The minimal policy is MadGraph’s default: u u~ > d d~ keeps only the gluon exchange. With the explicit policy and { QCD = 2, QED = 2 } it keeps the photon and Z exchange too, with the interference between the orders. The names come from the model; pyAmpliCol gives no name a fixed meaning.
MG5_aMC process syntax
A process may be written as on an MG5_aMC generate line, in a run card, on the command line or in Python. The annotations are translated into run-card settings:
| MG5_aMC | Setting |
|---|---|
[QCD], [virt=QCD], [all=QCD], [QCD QED] | process.loop_coupling_orders: the virtual correction, the only one-loop part computed |
[noborn=QCD], [sqrvirt=QCD] | process.loop_coupling_orders and process.loop_induced = "only": a loop-induced process |
QED=2, QED<=2 | process.max_coupling_orders (orders of an amplitude) |
QCD^2<=4, QED^2==6, QED^2>2 (also <, >=) | process.squared_coupling_orders (sectors) |
/ Z H | generation.particle_veto, in the model’s own spelling (one-loop requests) |
generate prints the translation:
process u u~ > d d~ QCD^2<=4 QED^2<=6 [QCD QED] -> u u~ > d d~
(loop_coupling_orders QCD, QED; squared_coupling_orders QCD^2<=4,
QED^2<=6; coupling_order_policy explicit)
As in MG5_aMC, naming an order switches the policy to explicit. The bracket comes last. A trailing bracket is an annotation when it holds = or names coupling orders in upper case; otherwise it is a multiparticle label (u u~ > d [d g]).
Refused with madloop-syntax, because only the virtual correction is computed or the construct has no equivalent: [real=QCD], [LOonly=QCD], decay chains, $ and $$ s-channel exclusions, @N tags, and == or > on amplitude orders. A translated setting that the run card, an option or --set gives another value is refused with a ProcessSyntaxConflict naming both. Several process entries must carry the same annotations, since the settings apply to the whole run. A ProcessRequest (ProcessRequest.parse) takes plain expressions only and refuses annotations (madloop-syntax), naming the translation: give an annotated expression to generate as a string, or the setting in the RunConfig.
What a one-loop request returns, and how loop-induced members of a mixed request are served (process.loop_induced), is on One-loop matrix elements.
Squared-order sector selection
process.squared_coupling_orders selects the squared-coupling-order sectors a one-loop request serves. The constraints are MG5_aMC’s, written in the process or in the run card:
[process]
entries = [{ expression = "u u~ > d d~" }]
loop_coupling_orders = ["QCD", "QED"]
coupling_order_policy = "explicit"
squared_coupling_orders = ["QCD^2<=4", "QED^2<=6"]
A sector is served when its power of every named order passes; an order not named has no limit, and a missing order has power 0. Powers count the fundamental couplings \(g_s\) and \(e\), as MG5_aMC does. pyAmpliCol computes the virtual correction only, so the constraints read the sectors of the virtual, as MadLoop’s [virt=...] does:
- a Born-interfered sector, \(2\,\mathrm{Re}\,\langle \mathcal{M}^{(0)} \vert \mathcal{M}^{(1)} \rangle\), has the order of the Born amplitude plus that of the loop amplitude;
- a loop-induced sector, \(\lvert \mathcal{M}^{(1)} \rvert^2\), has the order of the two loop amplitudes.
For u u~ > d d~ QCD^2<=4 QED^2<=6 [QCD QED] the four sectors \(\mathrm{QCD}^6\), \(\mathrm{QCD}^4\mathrm{QED}^2\), \(\mathrm{QCD}^2\mathrm{QED}^4\) and \(\mathrm{QED}^6\) become the last three: the QCD correction to the QCD Born squared is dropped. Only the served sectors are generated, reported and summed, in Python, on the command line and in the native interfaces. A served sector equals the same sector of the unrestricted request. A selection that keeps no sector of a process is refused with squared-order-selection.
MG5_aMC’s full NLO mode applies squared-order constraints to the Born orders; pyAmpliCol follows MadLoop’s reading above.
Tree-level support and omitted candidates
An expanded process without a tree-level amplitude, such as the loop-induced g g > z g g above, is left out with a warning rather than stored as a zero. A request none of whose processes has a tree-level diagram is refused before anything is built: with NoTreeDiagramError when no coupling order gives one, with RequestFilterError when the request’s own limits removed every diagram (the message names the limit). This differs from an unsupported model feature, which the model checks report when the model is loaded (Models).
Select a process at run time
Runtime.load, pyamplicol evaluate, pyamplicol profile and the C, C++, Fortran and Rust interfaces take a process selector: an ID or an expression. An expression may list the particles of each side in any order, and the loaded process then uses that order for everything:
pyamplicol inspect artifacts/pp_zjj --process p_p_to_z_j_j_3
pyamplicol inspect artifacts/pp_zjj --process 'd d~ > g z g' --full-physics
pyamplicol evaluate artifacts/pp_zjj --process 'd d~ > g z g'
pyamplicol inspect without --full-physics reads only the artifact’s inventory: it takes an ID, an alias ID or an expression exactly as stored, and asks for --full-physics otherwise.
from pyamplicol import Runtime
# the artifact generated in "Multiparticles"
runtime = Runtime.load("artifacts/pp_zjj", process="d d~ > g z g")
print(runtime.physics.process_id, runtime.external_permutation)
# p_p_to_z_j_j_3 (0, 1, 3, 2, 4)
print([particle.name for particle in runtime.physics.external_particles])
# ['d', 'd~', 'g', 'z', 'g']
external_permutation maps the stored process onto the order you asked for: stored leg \(r\) takes the momentum of your leg \(\pi(r)\), counted from 0.
How a selector is resolved
A selector is matched in this order, and the first match wins:
- a process ID;
- an alias ID;
- a stored expression, exactly;
- an alias expression, exactly;
- one stored expression up to the order within each side;
- a process-group member that was not generated: its ID, its expression, or its expression up to the order within each side (Process-group members).
Case and spaces do not matter. If several stored processes match at one step, the selection is refused with a ProcessSelectionError listing their IDs: select one by its ID. pyAmpliCol never picks among ambiguous matches.
The side-preserving rule
Particles may change places within the incoming side and within the outgoing side, never across >:
d d~ > Z g g -> d~ d > g Z g the same process
d d~ > Z g g -> d Z > d~ g g a different process
Identical particles are matched in order, first unused first, so the mapping is reproducible.
Aliases
An alias is a second name for a stored process with its legs permuted. It is declared at generation in a ProcessSet; the permutation lists, for each leg of the stored process, the leg of the alias it becomes:
from pyamplicol import ModelSource, ProcessAlias, ProcessRequest, ProcessSet
from pyamplicol import Runtime, generate
with_alias = ProcessSet(
requests=(ProcessRequest.parse("u u~ > z g", name="uu_zg"),),
aliases=(ProcessAlias("ubaru_zg", "uu_zg", (1, 0, 2, 3)),),
)
generate(with_alias, "artifacts/alias_demo", model=ModelSource.built_in_sm(),
mode="replace")
print(Runtime.load("artifacts/alias_demo", process="ubaru_zg").physics.process)
# u~ u > z g
Selection by permuted expression makes aliases unnecessary for ordinary use; declare one when an interface needs a fixed name for a fixed order.
Kinematics follow the requested order
Momenta are given per point and per particle, [E, px, py, pz], in the order of runtime.physics.external_particles, which is the order of the selector. For d d~ > g z g, a point lists the incoming d and d~, then the outgoing g, z and g:
# continues the runtime loaded with process="d d~ > g z g" above
point = [[250.0, 0.0, 0.0, 250.0], [250.0, 0.0, 0.0, -250.0],
[204.406, 204.406, 0.0, 0.0], [91.188, 0.0, 0.0, 0.0],
[204.406, -204.406, 0.0, 0.0]]
print(f"{runtime.evaluate([point])[0].real:.6e}")
# 8.251863e-05
The validation points stored in the artifact, which pyamplicol evaluate uses without a momenta file, are reordered the same way.
Helicity and color selectors follow the requested order
Helicity IDs and leading-color flow IDs name legs in the order of the selector. Read them from the runtime you loaded, not from another order:
helicity = runtime.physics.helicity_ids[0]
flow = runtime.physics.color_flow_ids[0]
print(helicity, flow)
# h:-1,-1,-1,-1,-1 flow:2,3,5,1
selected = runtime.evaluate([point], helicities=[helicity], color_flows=[flow])
The resolved values (evaluate_resolved) carry the same IDs and sum to the value of evaluate. Inside each ID the legs follow the order you requested, but the list runtime.physics.helicity_ids and the components of evaluate_resolved stay in the stored process’s order: select by ID, not by position. Legs in IDs are counted from 1. Color flows can be selected at leading color only; Evaluating matrix elements explains the selectors.
Process-group members
An artifact generated with flavor grouping stores one process per flavor class and records the others as its members. A member is selected like a stored process, by its ID or its expression in any order within each side; it is evaluated through its stored representative, with the member’s particles, legs and IDs, and multiplied by the recorded factor. Process grouping describes what a member returns and the parameters it cannot follow.
Limits
- Tree-level spin and color correlations are served only in the generated order: a permuted expression or an alias is refused with a
CompatibilityError; load the stored expression (Spin and color correlations). One-loop artifacts serve correlations through aliases and permuted expressions too. - A permutation never moves a particle across
>: crossing an incoming particle into the final state is a different process. - An alias of a request names one concrete process. A request with an alias that expands to several concrete processes is refused before anything is written.
inspectalone does not resolve a permuted expression or a group member: give the ID, or add--full-physics.
What an error at selection means, and its remedy, is on Troubleshooting; every refusal key is on Refusals and errors.
See also
- Models: the model the names refer to.
- Process grouping: one generated process for a class of flavors.
- Evaluating matrix elements: momenta, selectors and parameters.
- Run card: every field of
[process]. - Command-line options:
generateandmodel processes.