laddu

laddu logo

Project

laddu

A library for analysis of particle physics data, written in Rust with bindings to Python.

  • Rust
  • Python
  • Amplitude analysis

laddu (/ˈlʌduː/) is a library for analysis of particle physics data. It is intended to be a simple and efficient alternative to some of the other tools out there. laddu is written in Rust with bindings to Python via PyO3 and maturin and is the spiritual successor to rustitude, one of my first Rust projects. The goal of this project is to allow users to perform complex amplitude analyses (like partial-wave analyses) without complex code or configuration files.

A small amplitude-analysis idea

When resonances overlap

Illustrative Breit–Wigner amplitudes—not a live laddu calculation.

Two resonances can contribute to the same mass spectrum. Their amplitudes add before the intensity is calculated, so the observed distribution is not necessarily just the two shapes stacked together.

  • Resonance 1 1.30 GeV · Γ = 0.12 GeV
  • Resonance 2 1.48 GeV · Γ = 0.20 GeV
  • Coherent total
Calculated intensity

I(m) = | c₁ BW₁(m) + e c₂ BW₂(m) |2

Mass distribution of two overlapping resonancesThe individual resonance distributions and their coherent sum with interference enabled.

With interference on, the total includes the cross term between the two amplitudes.

laddu grew out of my frustration with the way amplitude analyses were being done within the GlueX collaboration. Everyone had these messy configuration files which would need to be duplicated and modified, usually by one-off scripts, to produce fit results which would then have to be collected by yet another set of scripts. I got tired of the constant file management, I was spending more time debugging config files than actually doing physics! Since my original foray into Rust in March 2024, I have learned a lot about what is required to distribute a project like this via Python. There are tons of small optimizations that can be made, and I’d imagine there are still quite a few to go. This project has taught me everything from memory management to the intricacies of floating-point numbers to quite a lot about parallel processing. I believe the project is still in an exploratory state, but it is certainly usable enough to do some actual research now. Since I’m actively using it while I develop it, I quickly discover new sharp corners and quality-of-life features to implement, and there’s always little chores to do like documentation and testing.