Skip to main content

DOI arxiv

Documentation Status pytest AUR

PDFFlow

PDFFlow is parton distribution function interpolation library written in Python and based on the TensorFlow framework. It is developed with a focus on speed and efficiency, enabling researchers to perform very expensive calculation as quick and easy as possible.

The key features of PDFFlow is the possibility to query PDF sets on GPU accelerators.

Documentation

The documentation for PDFFlow can be consulted in the readthedocs page: pdfflow.readthedocs.io.

Installation

The package can be installed with pip:

python3 -m pip install pdfflow[MODE]

If you prefer a manual installation just cd in the cloned folder and use:

pip install .[MODE]

or if you are planning to extend or develop code just install the package in editable mode:

pip install -e .[MODE]

PDFFlow assumes that the user has already installed the most optimized version of TensorFlow for his platform. As such, by default, pip will not check it as a requirement.

However, the user can also install it specifying a MODE option in the pip command. The list below summarizes the valid choices for the MODE flag:

  • tf: installs the tensorflow package
  • tf-cpu: installs the tensorflow-cpu package
  • tf-gpu: installs the tensorflow-gpu package
  • tf-amd: installs the tensorflow-rocm package

⚠ Note: Use the latest version of TensorFlow!

TensorFlow is updated frequently and a later version of TensorFlow will often offer better performance in both GPUs and CPUs. Although it can be made to work with earlier versions, PDFFlow is only supported for TensorFlow>2.1.

PDF set management

PDFFlow does not do management of PDF sets, which is left to LHAPDF and so a lhapdf installation is needed. A full lhapdf installation can be obtained by utilizing the lhapdf_management library.

  python3 -m pip install lhapdf_management
  lhapdf_management install NNPDF31_nnlo_as_0118

Minimal Working Example

Below a minimalistic example where PDFFlow is used to generate a 10 values of the PDF for 2 members for three different flavours.

from pdfflow import mkPDFs
import tensorflow as tf

pdf = mkPDFs("NNPDF31_nnlo_as_0118", [0,2])
x = tf.random.uniform([10], dtype=tf.float64)
q2 = tf.random.uniform([10], dtype=tf.float64)*20 + 10
pid = tf.cast([-1,21,1], dtype=tf.int32)

result = pdf.xfxQ2(pid, x, q2)

Note the usage of the dtype keyword inm the TensorFlow calls. This is used to ensure that float64 is being used all across the program. For convenience, we ship two functions, int_me and float_me which are simply wrappers to tf.cast with the right types.

These wrappers can be used over TensorFlow types but also numpy values:

from pdfflow import mkPDFs, int_me, float_me
import tensorflow as tf
import numpy as np

pdf = mkPDFs("NNPDF31_nnlo_as_0118", [0,2])
x = float_me(np.random.rand(10))
q2 = float_me(tf.random.uniform([10])*20 + 10)
pid = int_me([-1,21,1])

result = pdf.xfxQ2(pid, x, q2)

Citation policy

If you use the package pelase cite the following paper and zenodo references:

Metadata

Release files for pdfflow 1.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 pdfflow 1.2.2
File Size Uploaded Provenance
pdfflow-1.2.2.tar.gz 27.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 59.2 kB

Release files / pdfflow-1.2.2.tar.gz

Download URL pdfflow-1.2.2.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c22cd314a491b0975d3965aab839e4445ad926e4d89c78414e329091d1d500fc
BLAKE2b-256 checksum
How to use checksums
54ebffb0749b72c62265ab92a82d465b56b32e0501baa9f230967c546477ece8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / pdfflow-1.2.2-py3-none-any.whl

Download URL pdfflow-1.2.2-py3-none-any.whl
Size 32.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39bc88e79e3842142d9b5334f00c3ef46426b4e7fd18bdfcb0dacece444a11e4
BLAKE2b-256 checksum
How to use checksums
ca7bff00073308efb668d6756824906c39109fac56ab31d534812c9abc356d01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Security for pdfflow 1.2.2

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.

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