The code in this repository can be installed with
pip install .
or, in development mode:
pip install -e .[tests]
the tests
extra will install several utilities useful for testing and generation of phase space number.
A minimal example with the computation of currents for different numerical types, dimensions and multiplicities are given in the examples
folder in the form of a python script and a Jupyter Notebook.
The script build.py
, which should be run during the installation with pip, tries to automatically compile the cuda kernels.
However it is not guaranteed that it will work (in particular nvcc
needs to be installed in the system).
If it doesn't work, it is possible to install (and hopefully debug) manually the compilation of the kernels which are found in bgtrees/finite_gpufields/cuda_operators/
.
- The dependency
tensorflow[and-cuda]
is a build dependency, but it takes a while to install, so at the moment is commented out. - The
build.py
script is there mainly for future reference, it works, but during development is orders of magnitude faster going into the cuda folderbgtrees/finite_gpufields/cuda_operators/
and running manuallymake
- The
build.py
script is written at the moment to fail silently so that it doesn't interfere with a python-only installation
In addition it is recommended to install tools like black
or isort
to standardize the code.
The FiniteField
type defined in bgtrees/finite_gpufields
powers the hardware agnostic part of this package.
The FiniteField
type is a wrapper of GPU-aware arrays and the prime number p
defining the cardinality of the field.
Operations involving FiniteField
will try to use the GPU whenever possible, with a fallback to CPU when the operation is not possible or not implemented.
If this code has been useful in your research please cite the paper
@article{Cruz-Martinez:2025kwa,
author = "Cruz-Martinez, Juan M. and De Laurentis, Giuseppe and Pellen, Mathieu",
title = "{Accelerating Berends-Giele recursion for gluons in arbitrary dimensions over finite fields}",
eprint = "2502.07060",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
reportNumber = "CERN-TH-2025-017, FR-PHENO-2025-001",
month = "2",
year = "2025"
}
as well as the Zenodo entry