--- id: mt2 version: "1.3.1" license: MIT license_treatment: permissive maintenance: active --- # mt2 — Stransverse mass computation as a numpy ufunc. License: permissive · Maintenance: active · Downloads: 430.0K/mo ## What it is and what it does mt2 is a specialized physics library that computes the stransverse mass (MT2), a kinematic variable used in high-energy particle physics to infer properties of invisible particles in collision events. It wraps an optimized C++ implementation of the Lester-Nachman bisection algorithm, providing both a standard function and a raw numpy ufunc for flexibility. The package is designed for high-throughput calculations in particle physics analyses. It supports vectorization over numpy arrays, allowing efficient batch computation across grids of parameters—useful for Monte Carlo simulations and parameter scans. The implementation is scale-invariant and reportedly 3x to 4x faster than the original arXiv reference code, with a fallback to the legacy arxiv implementation available for independent verification. Use it for: - Compute MT2 for individual particle collision events in high-energy physics data analysis. - Scan parameter grids of invisible particle masses using vectorized numpy arrays for efficiency. - Cross-check results against the legacy arXiv implementation using mt2_arxiv for validation. - Integrate MT2 calculations into Monte Carlo simulations for physics phenomenology studies. - Use as a numpy ufunc with advanced features like conditional computation via the where argument. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Computes stransverse mass (MT2) for particle physics calculations, supporting both symmetric and asymmetric cases with vectorized numpy array operations. Yes, if you work in particle physics and need MT2 calculations. The package is actively maintained, has no known vulnerabilities, supports modern Python versions (3.9–3.14), and offers significant performance gains over reference implementations. Install friction is moderate due to C++ compilation, but precompiled wheels mitigate this for most platforms. MIT licensing poses no restrictions. ## Install pip install mt2 uv add mt2 poetry add mt2 ## Installing mt2 Before you install: Medium install friction due to compiled C++ components, but precompiled wheels cover Python 3.9–3.14 across macOS, Linux, and Windows. Repository is actively maintained with a recent commit on 2026-08-10 and stable release status. License in practice: Released under MIT (permissive), allowing use in commercial and academic projects with minimal restrictions. Citation of the underlying papers (arXiv:hep-ph/9906349 and arXiv:1411.4312) is requested but not legally required. Quickstart: pip install mt2 from mt2 import mt2 val = mt2( 100, 410, 20, # Visible 1: mass, px, py 150, -210, -300, # Visible 2: mass, px, py -200, 280, # Missing transverse momentum: x, y 100, 100) # Invisible 1 mass, invisible 2 mass print(val) Requires numpy as a runtime dependency; C++ compilation may be needed if building from source rather than using precompiled wheels. Verify before relying: - Whether the 3x to 4x speedup over the arXiv reference implementation holds across all input ranges and precisions. - Scale-invariance claims and their practical implications for very large or very small input magnitudes. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 430.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags stransverse mass calculation, MT2 computation, particle physics mass, bisection algorithm MT2, numpy vectorized physics, transverse mass calculator, high energy physics tools, particle-physics, high-energy-physics, numpy-ufunc [View on SkillFed](https://skillfed.io/packages/mt2) · [View on PyPI](https://pypi.org/project/mt2/)