Skip to main content

aafragpy

Python implementation of the AAFrag secondary particle production model (based on QGSJET-II-04m) with adaptive curve-morphing interpolation. The package provides fast, vectorized reconstruction of differential production cross-sections and spectra from high-energy hadronic interactions while preserving the original tabulated Monte Carlo precision.


Features

  • Secondary Products: Photons (γ), electrons and positrons (e±), neutrinos (ν_e, ν̄_e, ν_μ, ν̄_μ, ν_all), nucleons (p, p̄, n, n̄), and light antinuclei (d̄, ³Hē).
  • Collision Systems: p–p, p–He, He–p, He–He, heavy projectile ions (C, Al, Fe) on proton targets, and antiproton-induced channels (p̄–p, p̄–He).
  • Broad Energy Range: Tabulated interactions from kinematic thresholds (hundreds of MeV / low GeV) up to hundreds of PeV / EeV.
  • Integrated Alternative Models: Built-in parameterizations for p–p interactions from Kamae et al. (2006) and Kafexhiu et al. (2014).

Installation

Install aafragpy via pip:

pip install aafragpy

Interactive Tutorial

A step-by-step walkthrough of the package API and spectral calculations is available in the Jupyter Notebook tutorial.

You can launch and run the interactive tutorial directly in Google Colab:

Open In Colab


Citation Policy

Important Notice on Citations:
If you use aafragpy in your scientific work, please cite both the aafragpy package paper and the corresponding original AAFrag / Monte Carlo data publications. Proper attribution to the original cross-section calculations ensures continued support and development of hadronic interaction models.

1. Python Package Citation

2. Original AAFrag Model & Data Calculations

  • AAfrag 2.0 (v2.02 Data Tables & Antinuclei):
    M. Kachelrieß, S. Ostapchenko, and J. Tjemsland,
    “AAfrag 2.01: Interpolation routines for Monte Carlo results on secondary production including light antinuclei in hadronic interactions,”
    Comput. Phys. Commun. 287, 108698 (2023), arXiv:2206.00998.

  • AAfrag 1.0 (Original QGSJET-II-04m Tabulations):
    M. Kachelrieß, I. V. Moskalenko, and S. Ostapchenko,
    “AAfrag: Interpolation routines for Monte Carlo results on secondary production in proton-proton, proton-nucleus and nucleus-nucleus interactions,”
    Comput. Phys. Commun. 245, 106846 (2019), arXiv:1904.05129.


Additional References for Alternative Models

If you utilize the optional alternative models included in the package, please also cite the respective source papers:

  • Kamae et al. (2006) + Erratum:

    • T. Kamae, N. Karlsson, T. Mizuno, T. Abe, and T. Koi,
      “Parameterization of γ, e±, and Neutrino Spectra Produced by p-p Interaction in Astronomical Environments,”
      Astrophys. J. 647, 692–708 (2006), arXiv:astro-ph/0605581.
    • T. Kamae, N. Karlsson, T. Mizuno, T. Abe, and T. Koi,
      “Erratum: 'Parameterization of γ, e±, and Neutrino Spectra Produced by p-p Interaction in Astronomical Environments',”
      Astrophys. J. 662, 779 (2007).
  • Kafexhiu et al. (2014):
    E. Kafexhiu, F. Aharonian, A. M. Taylor, and G. S. Vila,
    “Parametrization of gamma-ray production cross-sections for p-p interactions in a broad proton energy range from the kinematic threshold to PeV energies,”
    Phys. Rev. D 90, 123014 (2014), arXiv:1406.7369.

Metadata

Release files for aafragpy 2.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aafragpy 2.0.4
File Size Uploaded Provenance Actions
aafragpy-2.0.4.tar.gz 12.5 MB With provenance Details for aafragpy-2.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aafragpy 2.0.4
File Interpreter ABI Platform Actions
aafragpy-2.0.4-py3-none-any.whl Python 3 none any Details for aafragpy-2.0.4-py3-none-any.whl

Total release size: 25.0 MB

Release files / aafragpy-2.0.4.tar.gz

Download URL aafragpy-2.0.4.tar.gz
Size 12.5 MB
Tags Source
SHA-256 checksum
How to use checksums
74d35e53706766af85eab9ce2471cd2f07ecb5689fc2708e5e186db0bf99f180
BLAKE2b-256 checksum
How to use checksums
bcc72652ce73ad691c18e543b0496bb71bfcf0cf9a2071ee7ac7fe250b08ba5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / aafragpy-2.0.4-py3-none-any.whl

Download URL aafragpy-2.0.4-py3-none-any.whl
Size 12.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f60cb3d5b75506a76f37228bb348c39061ae8eda7ceacb6d29c22c087bfe4dda
BLAKE2b-256 checksum
How to use checksums
d4a9cc00dec6337723291cabf7ea999ce1368cefdfe04e4e89b9bb50c07f0d8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Security for aafragpy 2.0.4

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aafragpy-2.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page