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 if pentagon_functions_evaluator_python is not found. To attempt this automatic installation pass [with-cpp] to ensure ninja and meson are present

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

import numpy
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.6.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pentagon_functions-0.0.6-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pentagon_functions-0.0.6.tar.gz
  • Upload date:
  • Size: 8.7 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.6.tar.gz
Algorithm Hash digest
SHA256 d95f49aa9ae2d0d2e55174d909758df422fc8d09b74ec8dd7a44a054fd4acce8
MD5 98c1b66438f0abd10b573cdfe6d8816e
BLAKE2b-256 5d392b6a7ff55b56407aa0d068094a22194934249c6169de0e061c6082f873da

See more details on using hashes here.

File details

Details for the file pentagon_functions-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for pentagon_functions-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3738b41fefc31d990d7bf377ed34a305292cd5ef28776a862afd998bf9b7f1da
MD5 c8e5e3b144ebe8332482b72bb03c16a5
BLAKE2b-256 10624e41b2b33f60d37e85fbf1ef76677b283bd3137ea6566f1cd7f572603396

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