Skip to main content

Numerical evaluator of integrals implementing the "Sector Decomposition" method (arXiv:2305.19768, arXiv:2108.10807, arXiv:1703.09692, arXiv:hep-ph/0004013, arXiv:0803.4177).

Project description

pySecDec

Documentation Status

pySecDec is a toolbox for the calculation of dimensionally regulated parameter integrals using the sector decomposition approach.

See 2305.19768, 2108.10807, 1811.11720, and 1703.09692 for description of the implementation; 0803.4177 and hep-ph/0004013 for description of sector decomposition; and 1502.06595 for SecDec, the predecessor of pySecDec.

Installation

pySecDec should work under Python version 3.8 or newer on the usual Unix-like systems.

The latest release can be installed from PyPI by first upgrading pip:

$ python3 -m pip install --user 'pip>=20.1'

and then running:

$ python3 -m pip install --user --upgrade pySecDec

This command will install the prebuild version of pySecDec if it is available; if not, then the dependencies will be compiled from source (this might take a while). One can also force building from source like this:

$ python3 -m pip install --user --upgrade --no-binary :all: pySecDec

Included dependencies

pySecDec and the integration libraries it produces depend on multiple third-party non-Python packages, all of which are contained in pySecDecContrib/ folder and will be automatally built during the normal installation procedure. These packages are:

Basic Usage

You can find the pySecDec manual over at https://secdec.readthedocs.io. Additionally, the development repository contains a folder examples with examples of pySecDec usage.

A simple example of the evaluation of a loop integral with pySecDec is box1L. This example computes a one-loop box with one off-shell leg (with off-shellness s1) and one internal massive line (with mass squared msq).

To run this example change into the box1L directory and run the commands:

$ python3 generate_box1L.py
$ make -C box1L
$ python3 integrate_box1L.py

The file generate_box1L.py defines the loop integral and calls pySecDec to perform the sector decomposition. Once run it produces the directory box1L which contains the code required to numerically evaluate the integral. The make command builds this code and produces a library. The file integrate_box1L.py loads the integral library and evaluates the integral for a specified numerical point.

This will print the result of the integral evaluated with Mandelstam invariants s=4.0, t=-0.75 and s1=1.25, msq=1.0:

eps^-2: -0.142868356275422825 - 1.63596224151119965e-6*I +/- ( 0.00118022544307414272 + 0.000210769456586696187*I )
eps^-1: 0.639405625715768089 + 1.34277036689902802e-6*I +/- ( 0.00650722394065588166 + 0.000971496627153705891*I )
eps^0 : -0.425514350373418893 + 1.86892487760861536*I +/- ( 0.00706834403694714484 + 0.0186497890361357298*I )

Examples

Several examples of pySecDec usage can be found in the source code repository (examples directory). Here are some of them:

  • easy: a simple parametric integral, described in the manual in Section 2.1.
  • box1L: a simple 1-loop, 4-point, 4-propagator integral, described in the manual Section 2.2.
  • triangle2L: a 2-loop, 3-point, 6-propagator diagram, also containing massive propagators.
  • box2L_numerator: a massless planar on-shell 2-loop, 4-point, 7-propagator box with a numerator, either defined as an inverse propagator box2L_invprop.py or in terms of contracted Lorentz vectors box2L_contracted_tensor.py.
  • triangle3L: a 2-loop, 3-point, 7-propagator integral, demonstrates that the symmetry finder can significantly reduce the number of sectors.
  • elliptic2L_euclidean: an integral known to contain elliptic functions, evaluated at a Euclidean phase-space point.
  • elliptic2L_physical: an integral known to contain elliptic functions, evaluated at a physical phase-space point.
  • triangle2L_split: a 2-loop, 3-point, 6-propagator integral without a Euclidean region due to special kinematics.
  • hypergeo5F4: a general dimensionally regulated parameter integral, corresponding to a Hypergeometric function 5F4.
  • 4photon1L_amplitude: calculation of the 4-photon amplitude, showing how to use pySecDec as an integral library in a larger context.
  • two_regulators: an integral involving poles in two different regulators.
  • userdefined_cpp: a collection of examples demonstrating how to combine polynomials to be decomposed with other user-defined functions.

Note that the examples are not installed via the normal installation procedure. They can only be found in the source code repository.

Development

During development instead of full installation it is more convenient to work directly from the checked out repository. To make this work, one needs to install the Python dependencies, build the contributed software, and setup PYTHONPATH to point to the sources; do this by running

$ make dependencies
$ make build
$ export PYTHONPATH=$PWD

Note that make dependencies will install the dependency libraries using python3 binary by default. A different Python binary can be chosen for this by setting the PYTHON argument to it, for example:

$ make dependencies PYTHON=python3.10
$ make build PYTHON=python3.10

The Makefile in the package's root directory also implements other common development tasks. You can list all available targets with the command

$ make help

pySecDec comes with a self test suite written in the python unittest framework. The most convenient way to run all test is using pytest. If pytest is installed (as it would be after make dependencies), type

$ make check

in the source repository to run all tests. Developers should write test cases for ALL functions they implement and make sure that ALL tests pass before uploading a commit.

⚠️ Note: Building pySecDec requires GNU Make (version 4.0 or newer). On some systems (e.g. macOS or BSD), the default make may be incompatible. In such cases, install GNU Make separately and use it instead of the default make.

Building the Documentation

To build the documentation of pySecDec, you need Sphinx. If Sphinx is installed (as it would be after make dependencies), the command

$ make doc

generates the documentation in html and in pdf format. Developers should inline-document python functions and also keep the C++ part up to date. To generate HTML and PDF separately, use

$ make doc-html

and

$ make doc-pdf

Building the documentation in pdf format requires an up-to-date installation of a latex implementation. If you get an error about missing .sty file, do the following:

  1. If you are an administrator on your computer, try to install the missing latex packages with your favorite package manager. The TeXLive or MiKTeX implementations should contain all required packages.

  2. If you are not an administrator, first get the missing packages, e.g. from CTAN. Collect the missing files in one or more directories and set the environment variable TEXINPUTS to these directories in the same way as the PATH variable is typically set.

Making a PyPI release

To create a release on PyPI, first increment the version number of pySecDec in pyproject.toml, and update CHANGELOG.md. Then make sure you have a recent Singularity installed, and run

./build-release.sh

This will create a source distribution file (dist/*.tar.gz) and several prebuild distribution files (dist/*.whl); it will also print the instructions on how to double-check the files with auditwheel and upload them to PyPI using Twine.

Note that an account with PyPI is needed for this. Please see the packaging python projects guide for details.

The reason for using Singularity here is because prebuilt distributions must be built inside one of the manylinux Docker images: this guarantees that the prebuilt libraries and programs will work on a wide range of Linux systems. If it wasn't for this requirement, then making a distribution would be as simple as running

$ make dist

and then uploading the distfiles in dist/:

$ twine upload dist/pySecDec-<version>.tar.gz
$ twine upload dist/pySecDec-<version>-<tag>.whl

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

pysecdec-1.6.6.tar.gz (27.1 MB view details)

Uploaded Source

Built Distributions

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

pysecdec-1.6.6-py3-none-manylinux_2_28_x86_64.whl (48.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

pysecdec-1.6.6-py3-none-manylinux_2_24_x86_64.whl (44.5 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ x86-64

pysecdec-1.6.6-py3-none-manylinux2014_x86_64.whl (49.3 MB view details)

Uploaded Python 3

pysecdec-1.6.6-py3-none-manylinux2010_x86_64.whl (53.3 MB view details)

Uploaded Python 3manylinux: glibc 2.12+ x86-64

File details

Details for the file pysecdec-1.6.6.tar.gz.

File metadata

  • Download URL: pysecdec-1.6.6.tar.gz
  • Upload date:
  • Size: 27.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.5

File hashes

Hashes for pysecdec-1.6.6.tar.gz
Algorithm Hash digest
SHA256 9f47d82327e1a5735518a3faca38000fd566b3f1d20ee094336f8a21f27d53d6
MD5 e6540eb40cd3e98e857ddd9cb04627f1
BLAKE2b-256 37c86f2c0e6560e0e6b76d51eb4d5020a8594c71803e562be59a7803b404ce8c

See more details on using hashes here.

File details

Details for the file pysecdec-1.6.6-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pysecdec-1.6.6-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 830278f7d0be83ab52e6ab8df590b22792570390c0b7bfedbc6ddd7b235d2efb
MD5 97583dbdc63ad4fe34860353a6e8a041
BLAKE2b-256 5fecfeb43b878c2845155334b8f033f0d7572b83c31f4596d709e913ea567d20

See more details on using hashes here.

File details

Details for the file pysecdec-1.6.6-py3-none-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pysecdec-1.6.6-py3-none-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 a9fb3f11cbecb701bb97d7c0080b0b04f5310824f4fa28797a954bdeca8b4dc0
MD5 edff0419bb54345ffbddb54d8de06aec
BLAKE2b-256 5418c531cd55836b7cc69650679182c3c4649c7e5b40163ecd6e7d3869e0a74b

See more details on using hashes here.

File details

Details for the file pysecdec-1.6.6-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysecdec-1.6.6-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 16f12a4d9fce2398feb4a838e416650738f7eb9083794e5cffaf7c4e84d95ca1
MD5 a19fb29a6e0024fecfada873eb2c3b86
BLAKE2b-256 b94cbdd61bc1a6212bb1990d1818216b74f8a53568e4caf830742aa50ea3aa60

See more details on using hashes here.

File details

Details for the file pysecdec-1.6.6-py3-none-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for pysecdec-1.6.6-py3-none-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d1a70f0a7539d9cc45d6dc9be6a79e9605fdbbfbce28101ea19ed1900472f257
MD5 2e1f28c03033afca94505ba41e86d468
BLAKE2b-256 8d719706f8d84febcbffdefcfe94ebc0c932744d2fedd380c67de414fddc4a70

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