Skip to main content

This library implements Levin's method for integrals containing products of up to three spherical or cylindrical Bessel functions.

Installation

With pip

The library is available via PyPi installation, so you can just install it using

pip install pylevin

which installs the levin package and you are ready to go. Note that you need certain packages which you have to install via conda-forge, in particular you will need the GSL, BOOST and GXX (on some linux servers) to be installed. You can grab them all via

conda install -c conda-forge gsl
conda install -c conda-forge gxx_linux-64
conda install conda-forge::boost

if they are not installed already.

From source

Alternatively you first clone the directory via:

git clone git@github.com:rreischke/levin_bessel.git

Then navigate to the cloned directory

cd levin_bessel
conda env create -f conda_env.yaml
conda activate levin_env
pip install .

On some Linux servers you will have to install gxx_linux-64 by hand and the installation will not work. This usually shows the following error message in the terminal: gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory If this is the case just install it by typing

 conda install -c conda-forge gxx_linux-64

and redo the pip installation.

Testing the installation

You can run ``pytest` to test the installation.

Tutorial: How to use the library

There is a detailed documentation of the code on levin-bessel.readthedocs.io. For a tutorial, there is a detailed python notebook in the tutorial directory

Contributing

If you want other types of oscillatory integrals implemented in pylevin, I am very happy to help navigating the code. Note that these integrals need to satisfy some kind recursion relation for their derivatives (Eq. 9 in the arxiv version of the paper). This relation can technically be numerical but requires very stable derivatives.

Reporting issues and support

If you encounter any issue or need help with the code you can either open an issue directly on github, or drop me a mail to reischke@posteo.net.

Citing pylevin

If you use this code please cite the implementation described in 2502.12142. You can find references to the original method therein.

Metadata

Release files for pylevin 1.1.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 pylevin 1.1.0
File Size Uploaded Provenance
pylevin-1.1.0.tar.gz 13.3 kB Without provenance Details

Release files / pylevin-1.1.0.tar.gz

Download URL pylevin-1.1.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
06fc29d787b3e0e4df0f8ecfdec9d18e77c5ebb66f0f0b4bb23302ac5b201530
BLAKE2b-256 checksum
How to use checksums
9b2391fe4d44d271b2f79e3016dfadffcda20b6539a36d6ae351414ccac735e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.5

Security for pylevin 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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