Skip to main content

Build Status Coverage Status

parton – a Python package for parton distributions and parton luminosities

parton is a Python package providing parton distribution functions and parton luminosities. It uses the PDF data files provided by the LHAPDF project. Its API is partially compatible to LHAPDF's Python API, even though only a subset of its features are implemented.

parton is written in pure Python, i.e. it runs on Linux, Mac OS, and Windows.

Installation

To install the package without administrator privileges, run

python3 -m pip install parton --user

Command-line interface

parton provides a command-line interface that mimicks (and is partially compatible to) LHAPDF's lhapdf command. In particular, it can be used to install PDF grid files. It is accessed by running the package as a script,

python3 -m parton

For instance, to install a specific PDF set, run

python3 -m parton update
python3 -m parton install 'CT10'

If you already have a directory with PDF sets (e.g. from LHAPDF), that can be used as well.

Python usage

The API for numerically evaluating PDFs is modeled after LHAPDF's Python API:

from parton import mkPDF
pdf = mkPDF('CT10', 0)
# up quark PDF at x=0.1, Q=1000 GeV
pdf.xfxQ(2, 0.1, 1000)

If the PDF sets are in a non-default location (on Linux, the default location is ~/.local/share/parton/), this directory can be changed through mkPDF's pdfdir argument.

Parton luminosities are accessed similarly through the PLumi class, but the factorization scale has to be fixed on instantiation,

from parton import PLumi
# pdf has been defined above
plumi = PLumi(pdf, Q2=1000)
# u-ubar parton luminosity at shat/s=0.1
plumi.L(2, -2, 0.1)

License

parton is released under the MIT license.

Contributors

parton was originally written by David M. Straub (@DavidMStraub)

Other contributors:

  • Peter Stangl (@peterstangl)

Citation info

parton cannot be cited at present. Please do not forget to also acknowledge the LHAPDF project.

Metadata

Release files for parton 0.2.2

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

Source distribution (sdist)

Source distribution for parton 0.2.2
File Size Uploaded
parton-0.2.2.tar.gz 13.5 kB Details

Release files / parton-0.2.2.tar.gz

Download URL parton-0.2.2.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fc14f6f03772a3403082014826a5ab22aba76cae0a650af3c74eea55ccf7da9d
BLAKE2b-256 checksum
How to use checksums
bf5d06d418d1478682d2c2733a30eb10b19a1227467cee5ed9908c7770bb1812
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

0.2.2 This release

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

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