Spin and color correlations
A correlation is a matrix element in which color charges are inserted between the amplitude and its conjugate, or in which the polarization of an external vector boson is replaced by a vector you choose. Subtraction schemes and resummation need them in the soft and collinear limits: the dipole \(\langle \mathcal{M} \vert \mathbf{T}_i \cdot \mathbf{T}_j \vert \mathcal{M} \rangle\) multiplies the eikonal factor of a soft gluon, and a spin correlation multiplies the azimuthal part of a collinear gluon splitting.
pyAmpliCol evaluates them for tree-level matrix elements, for virtual corrections and for loop-induced processes, with the same declarations and the same calls. You declare the correlations when you generate the artifact and choose among them when you evaluate. pyAmpliCol supplies the color and spin structure; the kinematic factors, flavor sums and couplings of a subtraction scheme remain yours.
The exact definitions (normalization, charges, the order of the two sides, the color expansions) are on Correlation and color conventions.
What is served
| Process | Color accuracy | Python result | Arithmetic in Python | C, C++, Fortran, Rust |
|---|---|---|---|---|
| Tree level | LC, NLC, full; strict LC and NLC, also split by power of \(N_c\) | a CorrelatedValue per point | arbitrary precision (16 digits by default) or double-double | binary64; Rust also double-double and arbitrary precision |
| Virtual correction | full; LC and NLC for QCD corrections on loop_sm and other models with a symbolic \(N_c\) | a VirtualEvaluation | binary64, double-double, arbitrary precision | the same correlations through the one-loop native interface |
| Loop-induced | full, the only accuracy of loop-induced processes | a VirtualEvaluation | binary64, double-double, arbitrary precision | the same correlations through the one-loop native interface |
A correlated artifact also serves the ordinary evaluate call: it returns the same value as the correlation "born" without spin vectors.
Declare, generate, evaluate
Declare the correlations in a CorrelatorConfig and pass it to generate. This prepares the dipole \(\mathbf{T}_1 \cdot \mathbf{T}_3\) under the name "T13", and allows spin vectors on leg 3 alone and on legs 3 and 4 together:
from pyamplicol import (
ColorConfig, ColorCorrelator, CorrelatorConfig, ModelSource, RunConfig,
Runtime, generate,
)
declarations = CorrelatorConfig(
color_correlations=(ColorCorrelator.dipole("T13", 1, 3),),
spin_correlations=((3,), (3, 4)),
)
full = RunConfig(action="generate", color=ColorConfig(accuracy="full"))
generate("g g > g g", "artifacts/gg_correlated", model=ModelSource.built_in_sm(),
config=full, correlators=declarations, mode="replace")
gg = Runtime.load("artifacts/gg_correlated")
point = [[500, 0, 0, 500], [500, 0, 0, -500],
[500, 300, 0, 400], [500, -300, 0, -400]]
born = gg.evaluate_correlated([point])[0]
dipole = gg.evaluate_correlated([point], color_correlation="T13")[0]
print(born.real, dipole.real)
# 460.2623164082142 -686.6001038726932
The name "born" is always available: it is the ordinary matrix element. Every other name is one you declared. The result has one CorrelatedValue per phase-space point, whose real and imag are Decimal numbers. A correlation with different color insertions on the two sides can be complex: keep its imaginary part until you form the physical combination.
A declaration file in JSON, here saved as correlations.json, holds the same content, for the command line and for CorrelatorConfig.from_json_dict. A dipole \(\mathbf{T}_i \cdot \mathbf{T}_j\) is one step on each side: leg \(i\) emits a gluon on the left ("bra"), leg \(j\) on the right ("ket"), and both emit the same new gluon, labeled -1 (new partons get negative labels):
{
"color_correlations": [
{
"id": "T13",
"bra": [{"kind": "emit-gluon", "emitter": 1, "emitted": -1}],
"ket": [{"kind": "emit-gluon", "emitter": 3, "emitted": -1}]
}
],
"spin_correlations": [[3], [3, 4]]
}
pyamplicol generate "g g > g g" artifacts/gg_correlated_cli \
--model built-in-sm --color-accuracy full --correlators correlations.json
Several correlations and points at once
evaluate_correlated_many evaluates any number of named requests on one batch of points and shares the amplitudes between them. Each CorrelatedRequest names a declared correlation and, optionally, spin vectors:
# continues "Declare, generate, evaluate"
from pyamplicol import CorrelatedRequest
y = (0, 0, 1, 0) # a polarization vector along y
values = gg.evaluate_correlated_many(
[point, point],
{
"born": CorrelatedRequest("born", spin_vectors={}),
"T13": CorrelatedRequest("T13", spin_vectors={}),
"spin 3": CorrelatedRequest("born", spin_vectors={3: y}),
"T13, spin 3": CorrelatedRequest("T13", spin_vectors={3: y}),
},
)
print(values["T13, spin 3"][1].real) # the request, then the point
# -343.3000519363466
The result is a dictionary in the order of your requests; each entry holds one value per point, in the order of the points. Spectator helicities are summed, as in the ordinary matrix element. At tree level, helicities= restricts the sum to the helicity configurations you list, as for evaluate.
The same requests run from the command line with a request file, here saved as requests.json:
{
"born": {"color_correlation": "born", "spin_vectors": {}},
"T13": {"color_correlation": "T13", "spin_vectors": {}},
"T13, spin 3": {
"color_correlation": "T13",
"spin_vectors": {"3": ["0", "0", "1", "0"]}
}
}
With points.json holding the point above, [[[500, 0, 0, 500], [500, 0, 0, -500], [500, 300, 0, 400], [500, -300, 0, -400]]]:
pyamplicol evaluate artifacts/gg_correlated_cli --momenta points.json \
--correlated-requests requests.json
Vector components in the request file may be numbers, strings, or [real, imaginary] pairs. --resolved and --color-flow do not combine with correlated requests.
Spin vectors
A spin vector \(v\) on leg \(i\) replaces the polarization vector of that leg: as given in the amplitude, and complex conjugated in the conjugate amplitude, for incoming and outgoing legs alike. The result is
\[\mathcal{N} \sum_{\text{colors}}\, \sum_{h \setminus h_i} \bigl\lvert v_\mu \, \mathcal{M}^{\mu}_{h} \bigr\rvert^2 ,\]where \(h \setminus h_i\) runs over the helicities of all other legs, the colors are summed, \(\mathcal{N}\) holds the ordinary averages and symmetry factors, and nothing is averaged over \(v\).
- Legs are numbered from 1, incoming legs first, in the order of the process as you loaded it. Components are \((v^0, v^x, v^y, v^z)\), contravariant, with the metric \((+,-,-,-)\); they may be real or complex.
- The set of legs you give must be one of the declared classes, exactly: with
((3,), (3, 4))you may set leg 3, or legs 3 and 4, but not leg 4 alone. Only vector bosons qualify. - At tree level and for virtual corrections the vector is used as given: it is not normalized and not projected. Scaling it by \(z\) scales the result by \(\lvert z \rvert^2\). Choose \(v \cdot p_i = 0\) for a physical polarization.
- Vectors on several legs act together on one amplitude; the result is not a product of one-leg results.
- One vector applies to every point; a list of vectors gives one per point.
# continues "Several correlations and points at once"
gg.set_spin_correlation_vectors({3: [(0, 0, 1, 0), (0, 0, 2j, 0)]})
per_point = gg.evaluate_correlated([point, point])
print(per_point[1].real / per_point[0].real)
# 4
gg.set_spin_correlation_vectors(None) # back to physical polarizations
set_spin_correlation_vectors sets vectors that every later correlated call uses; a request with spin_vectors=None (the default of CorrelatedRequest) inherits them, and spin_vectors={} asks for physical polarizations whatever is set. The ordinary evaluate never uses them.
Replacing the polarization of a massless gauge boson by its own momentum checks the Ward identity; the result vanishes up to rounding:
ward = gg.evaluate_correlated_many(
[point], {"ward": CorrelatedRequest("born", spin_vectors={3: point[2]})})
print(ward["ward"][0].real)
# 1.014614913752136E-89
For a loop-induced process the vector is expanded on the physical polarizations of its leg. Its part along the momentum of a massless leg is removed, so \(v = p_i\) gives zero there by construction and does not test the Ward identity. A part with \(v \cdot p_i \neq 0\) is not used either; when you request stability checks, its size appears in the estimate as the check spin-transverse.
Higher-order color connections
A dipole is the simplest connection. A general one is an ordered list of steps on each side: EmitGluon(emitter, new) attaches a new gluon to a leg, SplitGluon(gluon, quark, antiquark) turns a gluon into a quark-antiquark pair. Born legs have positive labels; give the new partons fresh negative labels. Both sides need the same number of steps and must end with the same partons:
from pyamplicol import (
ColorConfig, ColorCorrelator, CorrelatorConfig, EmitGluon, ModelSource,
RunConfig, SplitGluon, generate,
)
cascade = (EmitGluon(1, -1), SplitGluon(-1, -2, -3))
double = ColorCorrelator(
"double", bra=(EmitGluon(1, -1), EmitGluon(2, -2)),
ket=(EmitGluon(3, -1), EmitGluon(4, -2)),
)
nnlo = CorrelatorConfig(color_correlations=(
double, ColorCorrelator("pair", bra=cascade, ket=cascade),
))
full = RunConfig(action="generate", color=ColorConfig(accuracy="full"))
generate("g g > g g", "artifacts/gg_nnlo", model=ModelSource.built_in_sm(),
config=full, correlators=nnlo, mode="replace")
In JSON a splitting step is {"kind": "split-gluon", "parent": -1, "quark": -2, "antiquark": -3}. Two steps give the color structures of NNLO soft limits, three steps those of N3LO; there is no limit on the number of steps. The new partons are color labels only: do not add momenta for them.
To prepare every connection up to an order instead of choosing, CorrelatorConfig.all_color(through_order=k) registers all compatible pairs of connections with \(1, \dots, k\) steps, plus "born". Read the catalog from the runtime:
# continues the example above
from pyamplicol import Runtime
automatic = CorrelatorConfig.all_color(through_order=1)
generate("g g > g g", "artifacts/gg_all_nlo", model=ModelSource.built_in_sm(),
config=full, correlators=automatic, mode="replace")
catalog = Runtime.load("artifacts/gg_all_nlo").available_color_correlations()
entry = catalog[2]
print(len(catalog), entry.id)
# 17 N1LO/c0/c1
print(entry.bra[0].emitter_label, entry.ket[0].emitter_label)
# 1 2
Automatic names have the form N{r}LO/c{i}/c{j} and are local to the process: read bra and ket to know what an entry is. The catalog grows fast with the order and the number of colored legs: four colored legs give 16 entries at NLO, 816 at NNLO and 90,720 at N3LO. In JSON the option is "all_color_through_order": 2.
One-loop correlations
The same declarations serve a one-loop request. For a virtual correction each requested correlation returns the correlated Born and the correlated virtual correction, both per squared coupling order, the latter as Laurent coefficients in \(\epsilon\):
from math import sqrt
from pyamplicol import (
ColorCorrelator, CorrelatedRequest, CorrelatorConfig, ModelSource, Runtime,
generate,
)
def point_2to2(m, energy=500.0):
p = sqrt(energy**2 - m**2)
return [[energy, 0, 0, energy], [energy, 0, 0, -energy],
[energy, 0.6 * p, 0, 0.8 * p], [energy, -0.6 * p, 0, -0.8 * p]]
loop_sm = ModelSource.from_path("loop_sm", restriction="no_widths")
generate("g g > t t~ [QCD]", "artifacts/loop_correlated", model=loop_sm,
correlators=CorrelatorConfig(
color_correlations=(ColorCorrelator.dipole("T13", 1, 3),),
spin_correlations=((1,),)),
mode="replace")
loop = Runtime.load("artifacts/loop_correlated")
result = loop.evaluate_correlated_many(
[point_2to2(173.0)],
{"born": CorrelatedRequest("born"), "T13": CorrelatedRequest("T13"),
"spin 1": CorrelatedRequest("born", {1: (0, 1, 0, 0)})},
mu_r2=1000**2,
)
t13 = result["T13"]
print(t13.born_values[0][0].real, t13.values[0][0].finite.real)
# -3.223333135571368 -1.0082928250549554
(The no_widths restriction sets the top width to zero, which the default scheme requires for this process; see Widths and the mass scheme.) Each entry is a VirtualEvaluation, the type the ordinary evaluate of a one-loop artifact returns, with complex values. The "born" entry is the ordinary virtual correction. Pole selections (poles=), stability checks (stability_checks=), the arithmetic and the reduction backend work as in evaluate (Numerical stability); a rescue policy does not apply to correlated calls.
A loop-induced process returns the correlated square of the loop amplitude; it has no tree-level currents, so it needs no no_widths restriction:
# continues the example above
generate("g g > h h [noborn=QCD]", "artifacts/li_correlated",
model=ModelSource.from_path("loop_sm"),
correlators=CorrelatorConfig(
color_correlations=(ColorCorrelator.dipole("T12", 1, 2),)),
mode="replace")
induced = Runtime.load("artifacts/li_correlated")
result = induced.evaluate_correlated_many(
[point_2to2(125.0)],
{"total": CorrelatedRequest("born"), "T12": CorrelatedRequest("T12")},
mu_r2=1000**2,
)
print(result["total"].values[0][0].finite.real)
# 3.2293614476584975e-05
print(result["T12"].values[0][0].finite.real)
# -9.688084342975492e-05
A one-loop artifact serves its correlations to every process it serves: side-permuted expressions, aliases and flavor-blind group members included. Give the legs of connections and spin vectors in the order of the process you loaded; pyAmpliCol translates them to the stored process. A connection whose translation was not declared for the stored process is not served.
Precision
Tree-level correlations in Python are evaluated in arbitrary precision and rounded to precision decimal digits (16 by default). arithmetic="double-double" evaluates them in double-double arithmetic, with at most 31 digits. To keep input digits beyond binary64, give momenta and vector components as Decimal, and a complex component as a pair (Decimal(real), Decimal(imaginary)):
# continues "Spin vectors"
from decimal import Decimal
zero = Decimal(0)
component = (Decimal("1.0000000000000000000000001"), Decimal("2e-25"))
gg.set_spin_correlation_vectors({3: (zero, zero, component, zero)})
precise = gg.evaluate_correlated([point], precision=40)[0]
quick = gg.evaluate_correlated([point], arithmetic="double-double",
precision=31)[0]
print(precise.real)
# 230.1311582041071008971264545800873124170
gg.set_spin_correlation_vectors(None)
One-loop correlations take the arithmetic of the one-loop runtime (binary64 by default). The C, C++, Fortran and Rust interfaces evaluate tree-level correlations in binary64; a Rust program built with the symbolica-runtime feature also has double-double and arbitrary precision (C, C++, Fortran and Rust).
Color accuracy
The color accuracy is chosen at generation (color.accuracy, --color-accuracy) and applies to every correlation of the artifact. For a tree, the amplitudes are always computed in full color; LC and NLC truncate the inserted color matrix, so an LC dipole is the leading term of the full dipole, and color conservation holds up to the neglected order. With strict-lc or strict-nlc the whole squared amplitude is expanded in \(1/N_c\) and color conservation holds exactly at every order; evaluate_correlated_graded then returns each correlation split by power of \(N_c\). The expansions, at tree level and at one loop, are defined in Correlation and color conventions.
Limits
- Correlations must be declared at generation; an artifact without them cannot gain them.
- A tree-level correlated artifact is generated in the compiled execution mode, with direct color contraction over every helicity and every color sector. A request for partial coverage (
process.max_color_sectors,process.selected_color_sector_ids,process.selected_source_helicities) or for append mode is refused with aGenerationError. - A one-loop request that declares correlations and selects helicities or color flows is refused with the key
selected-correlators. Generate an inclusive artifact instead. - Forced FFT color contraction does not combine with correlations.
- A tree-level correlated runtime is loaded with the process in its generated order; aliases and permuted expressions serve the ordinary evaluation only.
- Correlated calls take no color-flow selection; one-loop correlated calls take no helicity selection either.
- The split by power of \(N_c\) (
evaluate_correlated_graded) exists for trees only. - Spin vectors are rank one: the same vector on both sides. Independent vectors for the amplitude and its conjugate, and spin-density tensors, are not available. Spins are four-dimensional; no \(d\)-dimensional polarization sums are supplied.
See also
- Correlation and color conventions: the definitions and identities.
- C, C++, Fortran and Rust: correlations from native code.
- Python: the rest of the Python interface.
- The local NLO limit example in
examples/NLO_limitsuses dipoles and spin correlations along the approach to soft and collinear limits.