Skip to main content

DOI cpc

Tests Documentation Status

VegasFlow

VegasFlow is a Monte Carlo integration library written in Python and based on the TensorFlow framework. It is developed with a focus on speed and efficiency, enabling researchers to perform very expensive calculation as quick and easy as possible.

Some of the key features of VegasFlow are:

  • Integrates efficiently high dimensional functions on single (multi-threading) and multi CPU, single and multi GPU, many GPUs or clusters.

  • Compatible with Python, C, C++ or Fortran.

  • Implementation of different Monte Carlo algorithms.

Documentation

The documentation for VegasFlow is available at vegasflow.readthedocs.io.

Installation

Anaconda-Server Badge AUR

The package can be installed with pip:

python3 -m pip install vegasflow

as well as conda, from the conda-forge channel:

conda install vegasflow -c conda-forge

If you prefer a manual installation you can clone the repository and run:

git clone https://github.com/N3PDF/vegasflow.git
cd vegasflow
python setup.py install

or if you are planning to extend or develop the code just use:

python setup.py develop

Examples

A number of examples (basic integration, cuda, external tools integration) can be found in the examples folder. A more detailed description can be found in the documention.

Below you can find a minimal workflow for using the examples provided with VegasFlow:

Firstly, one can install any extra dependencies required by the examples using:

pip install .[examples]

Minimal Working Example

from vegasflow import vegas_wrapper
import tensorflow as tf

def integrand(x, **kwargs):
    """ Function:
       x_{1} * x_{2} ... * x_{n}
       x: array of dimension (events, n)
    """
    return tf.reduce_prod(x, axis=1)

dimensions = 8
iterations = 5
events_per_iteration = int(1e5)
vegas_wrapper(integrand, dimensions, iterations, events_per_iteration, compilable=True)

Please feel free to open an issue if you would like some specific example or find any problems at all with the code or the documentation.

Citation policy

If you use the package please cite the following paper and zenodo references:

    @article{Carrazza:2020rdn,
        author = "Carrazza, Stefano and Cruz-Martinez, Juan M.",
        title = "{VegasFlow: accelerating Monte Carlo simulation across multiple hardware platforms}",
        eprint = "2002.12921",
        archivePrefix = "arXiv",
        primaryClass = "physics.comp-ph",
        reportNumber = "TIF-UNIMI-2020-8",
        doi = "10.1016/j.cpc.2020.107376",
        journal = "Comput. Phys. Commun.",
        volume = "254",
        pages = "107376",
        year = "2020"
    }


    @software{vegasflow_package,
        author       = {Juan Cruz-Martinez and
                        Stefano Carrazza},
        title        = {N3PDF/vegasflow: vegasflow v1.0},
        month        = feb,
        year         = 2020,
        publisher    = {Zenodo},
        version      = {v1.0},
        doi          = {10.5281/zenodo.3691926},
        url          = {https://doi.org/10.5281/zenodo.3691926}
    }

Metadata

Release files for vegasflow 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vegasflow 1.3.0
File Size Uploaded
vegasflow-1.3.0.tar.gz 32.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vegasflow 1.3.0
File Interpreter ABI Platform
vegasflow-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 67.4 kB

Release files / vegasflow-1.3.0.tar.gz

Download URL vegasflow-1.3.0.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
84bbafb2804dc0b261a8723052057c434d2e03b10d4dc764eab42d17207a4d04
BLAKE2b-256 checksum
How to use checksums
ad9f457c081a11ad4d40c98c62ba814229cc1c8deede03f8fc179eec8d471758
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release files / vegasflow-1.3.0-py3-none-any.whl

Download URL vegasflow-1.3.0-py3-none-any.whl
Size 35.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25136535c7e89eaadf0898d4923ff15f7ad227b679d3ae8876735a4f7277f1eb
BLAKE2b-256 checksum
How to use checksums
2b00823780ad3bb2a268dfa87bbd7d1aa70659b3f6402156f604d85e6a1e5050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.5

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page