Skip to content

OscarBarreraGithub/pyGPL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyGPL

This repository provides Python bindings for FastGPL, allowing users to evaluate Generalized Polylogarithms (GPLs) in Python without manually compiling C++.

Generalized Polylogarithms (GPLs) are a family of special functions defined by iterated integrals of the form:

$$G(a_1, a_2, \dots, a_n; x) = \int_0^x \frac{dt}{t - a_1} G(a_2, \dots, a_n; t)$$

where the recursion starts with $G($ $;$ $x) = 1$. These functions naturally generalize classical polylogarithms and arise frequently in the evaluation of Feynman integrals.


Installation

1. Conda Required

Conda is required to install pyGPL. If you do not have Conda installed, you must install it first. The recommended way is to install Miniconda. Conda helps manage dependencies like pybind11, cmake, and librhash, ensuring compatibility and preventing version conflicts. This is especially important on macOS, where librhash can cause build failures due to missing or mismatched shared libraries

Once installed, create and activate a new Conda environment:

conda create -n pygpl
conda activate pygpl

2. Clone the Repository

Clone the pyGPL repository from GitHub:

git clone https://github.com/OscarBarreraGithub/pyGPL.git
cd pyGPL

3. Install Dependencies

Install the required dependencies using Conda:

conda install -c conda-forge pybind11 cmake

4. Build and Install pyGPL

Compile and install the package:

mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX ..
make
make install

Return to the main directory and install the Python package:

cd ..
pip install .

5. Potential librhash Issue (macOS)

If you encounter issues with librhash when running CMake, this is most likely due to a conflict in librhash version between Cmake and Conda.

To verify the available librhash shared libraries in your Conda environment, run:

ls -l $CONDA_PREFIX/lib/librhash*.dylib

To check which version CMake is trying to load:

otool -L $(which cmake)

It is possible that CMake is expecting librhash.0.dylib while Conda has updated to librhash.1.dylib. This is fixed by creating a symbolic link:

ln -s $CONDA_PREFIX/lib/librhash.1.dylib $CONDA_PREFIX/lib/librhash.0.dylib

Usage

Once installed, you can import and use pyGPL in Python:

import pyGPL

To evaluate the Generalized Polylogarithm G[1, 4, 2, x] at x = 1.3, use:

pyGPL.GPL([complex(z) for z in [1, 4, 2]], 1.3)

See example usage in pyGPL/Example/.


Acknowledgments

This project is based on FastGPL, developed by:

FastGPL is a C++ library for fast GPL evaluation, and this project provides a Python wrapper using Pybind11.


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published