Particle
Particle is a core library within the Scikit-HEP ecosystem, providing a Pythonic interface to the Particle Data Group (PDG) particle data tables and Monte Carlo (MC) identification codes. It offers extended particle information, identification queries via PDGID, and powerful search capabilities for particle properties. The library is under active development and frequently updated with new PDG data releases.
Warnings
- breaking Python 3.7 and 3.8 support has been dropped in recent versions. Python 3.7 support was removed in v0.24.0, and Python 3.8 support was removed in v0.26.0.
- breaking Deprecated methods were removed in version 0.24.0 of the library.
- gotcha The default PDG data table is updated annually with new releases (e.g., v0.26.0 defaults to 2025 data, v0.25.0 to 2024 data). Older superseded data files are removed.
- gotcha When creating user-defined particles, assigning 'random' PDG IDs can result in particles with undefined or incorrect internal quantum numbers and properties.
Install
-
pip install particle
Imports
- Particle
from particle import Particle
- PDGID
from particle import PDGID
- pdgid.literals
import particle.pdgid.literals as pdgid_literals
- literals
import particle.literals as particle_literals
Quickstart
from particle import PDGID, Particle
from hepunits import GeV
# Working with PDG IDs
pid_pion = PDGID(211)
print(f"PDGID 211 is a meson: {pid_pion.is_meson}")
# Getting a Particle object from its PDG ID
pion = Particle.from_pdgid(211)
print(f"Pion mass: {pion.mass / GeV:.3f} GeV")
# Searching for particles by properties
neutral_beauty_hadrons = Particle.findall(lambda p: p.charge == 0 and p.has_bottom and p.mass > 5.2 * GeV and p.mass < 5.3 * GeV)
for p in neutral_beauty_hadrons:
print(f"Found neutral beauty hadron: {p.name} (mass={p.mass / GeV:.3f} GeV)")