laddu (/ˈlʌduː/) is a Python library for building, evaluating, generating, and fitting particle-physics amplitude models. Its symbolic interface is backed by a Rust runtime with automatic differentiation, multithreaded CPU execution, JIT compilation, WGPU acceleration, and optional MPI distribution.
Caution
laddu is under active development and its API may change before 1.0. Pin the package version used for production analyses.
laddu requires Python 3.11 or later:
uv add ladduInstall the MPI backend in an environment with a working MPI implementation:
uv add "laddu[mpi]"(or use your favorite package manager)
Published wheels include generated type information. When building a public module directly from an sdist, pass --config-settings="maturin.build-args=--generate-stubs" to pip or uv to generate the same stubs locally.
Models are expression graphs assembled from event data, constants, and parameters:
import laddu as ld
s = ld.scalar("s")
mass = ld.parameter("mass", initial=1.5, bounds=(1.3, 1.7))
width = ld.parameter("width", initial=0.1, bounds=(0.01, 0.3))
amplitude = 1.0 / (mass**2 - s - 1j * mass * width)
model = ld.Model(amplitude.norm_sqr())
print(model.parameter_names)The Python documentation covers reactions, data I/O, common amplitudes, Monte Carlo generation, fitting, cross sections, MPI, and runtime selection. Rust users can find the public crate documentation on docs.rs.
If laddu contributes to published work, cite the software metadata in CITATION.cff and record the exact package version and execution capabilities used by the analysis.
laddu builds on NumPy, PyO3 and Maturin, Ganesh, Apache Arrow and Parquet, oxyroot, wgpu, and the Message Passing Interface. The Wigner-symbol implementation includes code derived from WignerSymbol; its complete license is preserved in THIRD_PARTY_NOTICES.
laddu is available under either the MIT License or the Apache License 2.0, at your option.
