Skip to main content

pyAmpliCol

PyPI Python versions Tests License: 0BSD

Fast color-ordered scattering amplitudes from Python and native APIs.

pyAmpliCol generates and evaluates color-ordered scattering amplitudes from built-in, JSON, or UFO models. It provides a typed Python API and CLI, fast Rust-backed execution, runtime helicity and color-flow selection, and generated Python, C11, C++17, Fortran 2008, and Rust 2021 interfaces.

Release status

Version 0.1.2 is available from PyPI and is tagged as an immutable archival source snapshot. The validated release-artifacts workflow produces one source distribution and three cp311-abi3 wheels; publication uses a successful run whose head SHA is the intended release source:

  • macOS 11 or newer on Apple silicon;
  • macOS 11 or newer on x86-64;
  • manylinux 2.28 x86-64.

Each wheel completed the full installed Python, C11, C++17, Fortran 2008, and Rust 2021 API deployment on CPython 3.11. CPython 3.14 received a focused abi3 installation, import, metadata, and direct-runtime smoke test. The release workflow did not run the separate performance campaigns.

See the release status for build, validation, and publication details.

Installation

Install the release from PyPI:

python -m venv .venv
. .venv/bin/activate
python -m pip install pyamplicol

The binary wheels include the Rust runtime and native SDK; wheel users do not need a Rust compiler. pyAmpliCol has no LHAPDF dependency.

To build the tagged source snapshot:

git clone --branch v0.1.2 --depth 1 https://github.com/mg5amcnlo/pyamplicol.git
cd pyamplicol
python -m pip install .

A source build requires Python 3.11 or newer, Rust 1.89 or newer, and a C/C++ toolchain. A Fortran compiler is required only for Fortran consumers.

Contributor setup uses pinned source dependencies and produces explicitly non-publishable candidate builds:

nix develop  # optional on Nix/NixOS
just dev-install
PYTHON=.venv/bin/python just dev-test

The first just dev-install native build can take several minutes. Repeated installs reuse the workspace-local Cargo cache and are substantially faster.

Full installation details are in the installation guide.

Quick start

Copy the installed examples into an editable workspace:

pyamplicol examples copy ./pyamplicol-examples --force
cd pyamplicol-examples

Keep the Python environment containing pyAmpliCol activated while using the top-level CLI and Python examples, or invoke its executables by explicit path. For a copy below a source checkout prepared by just dev-install, generated artifact Python and native API drivers also find the nearest checkout .venv automatically; explicit SDK overrides and an active environment take precedence.

The primary example generates a multiprocess p p > Z j j artifact from the packaged serialized Standard Model, then evaluates and profiles one concrete subprocess. Its 19 ordered candidates collapse to eight side-permutation classes; it stores the seven tree-level representatives and reports the omitted loop-induced g g > Z g g class. The card inherits the portable JIT O2 default, so its process artifact can be moved between supported 64-bit little-endian macOS arm64, macOS x86_64, and Linux x86_64 hosts:

pyamplicol generate_pp_zjj_from_ufo_sm.toml
pyamplicol evaluate_total.toml
pyamplicol evaluate_resolved.toml
pyamplicol benchmark.toml

For direct CLI use:

pyamplicol generate "d d~ > z g" ./artifacts/builtin_ddbar_to_zg \
  --model built-in-sm

pyamplicol inspect ./artifacts/builtin_ddbar_to_zg

Process generation can also be steered directly from Python:

from pyamplicol import GenerationConfig, Generator

generator = Generator(GenerationConfig(workers=4))
plan = generator.plan("d d~ > z g")  # Resolve without writing an artifact.
result = generator.generate(
    "d d~ > z g",
    "artifacts/builtin_ddbar_to_zg",
    mode="replace",
)
print(result.output)

The same runtime is available from Python:

import json
from pathlib import Path

from pyamplicol import Runtime

momenta = json.loads(Path("data/pp_zjj_momenta.json").read_text())
runtime = Runtime.load("artifacts/pp_zjj", process="d d~ > g z g")
total = runtime.evaluate(momenta)
resolved = runtime.evaluate_resolved(momenta)
assert resolved.total() == total

Concrete process expressions may reorder particles within the incoming side or within the outgoing side. Rusticol maps momenta, helicities, color flows, and resolved metadata to that requested order; particles never cross the > boundary. Stable process IDs remain available when more than one generated representative could match an expression.

See the examples guide for complete cards, parameter updates, selector examples, and generated API drivers.

Models and execution

pyAmpliCol supports:

  • the packaged built-in Standard Model;
  • packaged serialized JSON and trusted UFO examples;
  • user-supplied JSON or trusted UFO model paths;
  • leading-color, contracted next-to-leading-color, and contracted full-color calculations;
  • recurrence, compiled-DAG, and eager execution modes;
  • JIT, C++, and assembly evaluator backends where supported;
  • binary64 execution without importing Symbolica, plus precision-controlled Python evaluation when exact expressions are retained.

Generated artifacts preserve complete public helicity and color axes. Runtime calls can select one flow or helicity globally or per phase-space point without regenerating the artifact.

The public C ABI is version 1. Every generated artifact can include standalone Python, C11, C++17, Fortran 2008, and dependency-free Rust 2021 drivers backed by the wheel-owned static Rusticol SDK.

Profiling campaigns

An installed wheel can populate a self-contained campaign workspace:

pyamplicol profiling-campaign copy ./pyamplicol-profiling-campaign --force
cd ./pyamplicol-profiling-campaign
./steer_performance_campaign.py run \
  --workers 1 --table matrix --process-id 1 --multiplicity 1 \
  --color-approximation lc --generation-mode non-union-flow \
  --generation-engine recurrence --model built_in

That deliberately small real campaign measures only the final-state- multiplicity-one d d~ > Z recurrence cell. Broader campaign selections are intended for dedicated profiling hosts, not installation smoke tests.

Each campaign keeps attempts, prepared artifacts, logs, locks, and leases in its visible campaign_artifacts/ directory. Moving or renaming the whole campaign moves that state with it and never consults legacy repository-level .artifacts state. --force resets that local state plus the managed PDF, summary IDs, measurement lineage, and known LaTeX byproducts while preserving unrelated destination files and a previously recorded original-AmpliCol checkout. Stop active campaign processes before resetting their destination.

All pyAmpliCol backends work from installed resources. The optional original AmpliCol reference backend additionally requires --original-amplicol PATH_TO_COMPLETE_CHECKOUT; it is unavailable when that checkout is not supplied. Neither pyAmpliCol nor the supported patched original-AmpliCol comparison checkout requires LHAPDF.

The repository retains only two rendered performance snapshots. Raw JSON, generated tables, attempts, and campaign workspaces stay untracked:

These reports come from separate manual measurement campaigns; they are not release-CI results. The report format is directly reproducible from an installed package: create the workspace with pyamplicol profiling-campaign copy DEST --force, run the desired selection, then execute DEST/steer_performance_campaign.py refresh-pdf.

Documentation

Dependencies and license

Release builds use pinned published dependencies plus SymJIT 2.22.0 from an immutable revision of the official symjit-crate repository. pyAmpliCol does not carry a private SymJIT fork or a local SymJIT patch.

pyAmpliCol is distributed under the 0BSD license. Third-party components and model assets retain their own terms; see THIRD_PARTY_NOTICES.md.

Metadata

Release files for pyamplicol 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyamplicol 0.1.2
File Size Uploaded
pyamplicol-0.1.2.tar.gz 6.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyamplicol 0.1.2
File Interpreter ABI Platform
pyamplicol-0.1.2-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details
pyamplicol-0.1.2-cp311-abi3-macosx_11_0_x86_64.whl CPython 3.11 abi3 macOS 11.0+ x86-64 Details
pyamplicol-0.1.2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details

Total release size: 112.1 MB

Release files / pyamplicol-0.1.2.tar.gz

Download URL pyamplicol-0.1.2.tar.gz
Size 6.0 MB
Tags Source
SHA-256 checksum
How to use checksums
7ec7ea417fbb2f9bf3119da2020d2b30013addde61424826c84c6dcb36fe99c8
BLAKE2b-256 checksum
How to use checksums
a116999e4b77a6d027fb25358669c00d401385fec916b84e7db027ab60d4db58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release files / pyamplicol-0.1.2-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL pyamplicol-0.1.2-cp311-abi3-manylinux_2_28_x86_64.whl
Size 35.9 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
f0062c4adcbdb9f0d95a4436e802a2a8114417642cc75a385c097aca5d30e92d
BLAKE2b-256 checksum
How to use checksums
207eb3d80fab439de510089db5ad1304687db521d8d636767d33614beb62ebf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release files / pyamplicol-0.1.2-cp311-abi3-macosx_11_0_x86_64.whl

Download URL pyamplicol-0.1.2-cp311-abi3-macosx_11_0_x86_64.whl
Size 35.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
e83ac6b6962c80ef6aa44ebd9af656bcbff0caa15b17b91522fd2d595b7313d1
BLAKE2b-256 checksum
How to use checksums
350d8eaa8ad46a7357ba8ea0f5774c5991660fa5189c255cc10ce01a5af08aaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release files / pyamplicol-0.1.2-cp311-abi3-macosx_11_0_arm64.whl

Download URL pyamplicol-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
Size 34.7 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
649c25fa8038fb48e512d770cc39e4869f93cdd528d9f3e1935137b013b9be91
BLAKE2b-256 checksum
How to use checksums
8666390de148fcd75fe0ef24c56cb3977ec9cfdadd3e750ba27080be88991cd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.0

4 release files

0.2.0

4 release files

0.1.4

4 release files

0.1.3

4 release files

This release

0.1.2 This release

4 release files

0.1.1

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page