reaction-kinematics
This is a Python library for calculating relativistic two-body nuclear reaction kinematics.
This package is designed for students and researchers working in nuclear and particle physics who need reliable relativistic kinematic calculations for reactions of the form:
projectile + target → ejectile + recoil
Features
This code can do:
- Relativistic two-body kinematics
- Center-of-mass and lab-frame quantities
- Energy, angle, momentum, and velocity calculations
- Support for multi-valued kinematic solutions
Installation
pip install reaction-kinematics
Documentation
https://det-lab.github.io/reaction-kinematics/
Syntax
# or equivalently:
# rxn = Reaction("3H(p,n)3He")
rxn = Reaction("p", "3H", "n", "3He")
rxn.kinematics_at_beam_energy_and_angle(beam_energy, angle_name, angle_value)
Parameters:
beam_energy: Beam kinetic energy (MeV by default)angle_name: Independent variable (e.g."theta3_lab","theta4_lab","theta_cm","cos_theta_cm")angle_value: Value at which to evaluate (degrees for angles by default)angle_unit: Unit forangle_value—"deg"(default),"rad","mrad"energy_unit: Unit forbeam_energy—"keV","MeV"(default),"GeV","TeV"
Example
vals = rxn.kinematics_at_beam_energy_and_angle(1.2, "theta4_lab", 10)
vals is a KinematicsResult — behaves like a dict (vals["energy3_lab"]), plus
a .units dict giving the pint.Unit of each key (vals.units["energy3_lab"]):
{
'cos_theta_cm': [...],
'theta_cm': [...],
'theta3_lab': [...],
'theta4_lab': [...],
'energy3_lab': [0.3448, 0.0364],
'energy4_lab': [...],
'velocity3_lab': [0.027, 0.009],
'velocity4_lab': [...],
'momentum3_lab': [25.5, 8.3],
'momentum4_lab': [...],
'jacobian3_lab': [...],
'jacobian4_lab': [...]
}
Multiple values in each list indicate multiple physical solutions.
jacobian3_lab/jacobian4_lab are dΩ(lab)/dΩ(cm) for the ejectile/recoil —
the factor that converts a lab-frame differential cross section to the cm frame.
Using Explicit Mass Values
rxn = Reaction(
938.272,
11177.928,
938.272,
11177.928,
mass_unit="MeV"
)
Numerical Notes
- Some kinematic variables are multi-valued.
- Near kinematic extrema, solution branches may merge numerically.
- The library automatically removes duplicate solutions within tolerance of 1e-6.
License
GPL-2.0 license
Contact
For questions, issues, or contributions, please open an issue on GitHub.
Project Docs
For how to install uv and Python, see installation.md.
For development workflows, see development.md.
For instructions on publishing to PyPI, see publishing.md.
This project was built from simple-modern-uv.
Metadata
Release files for reaction-kinematics 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reaction_kinematics-2.0.0.tar.gz | 1.2 MB | Without provenance | Details for reaction_kinematics-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reaction_kinematics-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for reaction_kinematics-2.0.0-py3-none-any.whl |
Total release size: 1.2 MB
Release files / reaction_kinematics-2.0.0.tar.gz
| Download URL | reaction_kinematics-2.0.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de47a40d82db8ed2e7677a498f81d38abc4ccbf1dd5bbadb62a3ca5d2a81ac9a
|
|
BLAKE2b-256 checksum How to use checksums |
ae5c5cc5068254463ca0896e9b7ed765bf62c220353ab285967a67f71a8fe0ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.5
|
Release files / reaction_kinematics-2.0.0-py3-none-any.whl
| Download URL | reaction_kinematics-2.0.0-py3-none-any.whl |
|---|---|
| Size | 49.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9a07ada68fe4b470bf075c15357ddde87c3308ff7967ae35af3167211f39a0d
|
|
BLAKE2b-256 checksum How to use checksums |
a05340ae394883c1c9e233af7c522a6987ce0d485a32637b754abb61f92df478
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.5
|
Security for reaction-kinematics 2.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.