Skip to main content

A Python interface to PentagonFunctions-cpp

Project description

A Python Interface to PentagonFunctions++

Requirements

The following Python packages are required (automatically installed by pip)

numpy, mpmath, lips, whichcraft

The following C++ library is required, pip will attempt to install it automatically with the option [with-cpp] is provided

PentagonFunctions-cpp

How It Works

The interface communicates using string-based input/output via the terminal. The script pentagon_functions_evaluator_python is searched for in the system path. If it is not found, ~/local/bin/ is checked as an alternative location.

Installation

In this folder do

pip install -e .[with-cpp]

Quick Start

from lips import Particles
from pentagon_functions import evaluate_pentagon_functions, fix_parity_odd

# Phase space point given in 2010.15834, pass it to lips.Particles
oPsBenchmark = Particles(5, real_momenta=True)
oPsBenchmark[1].four_mom = numpy.array([(-0.575 + 0j), (-0.575 + 0j), 0j, 0j])
oPsBenchmark[2].four_mom = numpy.array([(-0.575 + 0j), (0.575 + 0j), 0j, 0j])
oPsBenchmark[3].four_mom = numpy.array([(0.4588582395652173 + 0j), (0.405584802173913 + 0j), (0.20777834301052356 + 0j), (-0.05366574734632376 + 0j)])
oPsBenchmark[4].four_mom = numpy.array([(0.23112940869565216 + 0j), (-0.09707956260869566 + 0j), (0.009377939347234585 + 0j), (-0.20954335193774518 + 0j)])
oPsBenchmark[5].four_mom = numpy.array([(0.46001235173913047 + 0j), (-0.3085052395652174 + 0j), (-0.2171562823577582 + 0j), (0.263209099284069 + 0j)])

numerical_pentagon_dict = evaluate_pentagon_functions(
    ['F[3,25]', 'F[4,347]', 'F[3,22]', 'F[4,115]', 'F[3,1]', 'F[4,122]', 'F[4,365]'],
    oPsBenchmark, precision="d", verbose=False)

# if 'str5' is explicitly given in the basis of pentagon functions skip this step
numerical_pentagon_dict = fix_parity_odd(numerical_pentagon_dict, oPsBenchmark)

print(numerical_pentagon_dict)
>> {'F[3,25]': mpc(real='-1.690898346368268995', imag='2.52880034356816602'), 
    'F[4,347]': mpc(real='29.09482723195550014', imag='110.0170381265092008'), 
    'F[3,22]': mpc(real='-14.08863918406784999', imag='14.47902381510688996'), 
    'F[4,115]': mpc(real='-2.971610560487019992', imag='-15.43365955947793999'), 
    'F[3,1]': ... }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pentagon_functions-0.0.3.tar.gz (7.9 kB view details)

Uploaded Source

File details

Details for the file pentagon_functions-0.0.3.tar.gz.

File metadata

  • Download URL: pentagon_functions-0.0.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for pentagon_functions-0.0.3.tar.gz
Algorithm Hash digest
SHA256 58a8b54a5017c604177b7f26357f76e51322a3de75494e9baf5e79ba872b199e
MD5 5fda5924a7cc1480a6134f6423c6fe82
BLAKE2b-256 28a460f3fcb65f440617dffdd143f2225ee40c6ee2d5b91e1cd4700db4b03c47

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page