Integrals involving highly oscillatory Bessel functions are notoriously challenging to compute using conventional integration techniques. While several methods are available, they predominantly cater to integrals with at most a single Bessel function, resulting in specialised yet highly optimised solutions. Here we present pylevin, a Python package to efficiently compute integrals containing up to three Bessel functions of arbitrary order and arguments. The implementation makes use of Levin's method and allows for accurate and fast integration of these highly oscillatory integrals. In benchmarking pylevin against existing software for single Bessel function integrals, we find its speed comparable, usually within a factor of two, to specialised packages such as FFTLog. Furthermore, when dealing with integrals containing two or three Bessel functions, pylevin delivers performance up to four orders of magnitude faster than standard adaptive quadrature methods, while also exhibiting better stability for large Bessel function arguments. pylevin is available from source via github or directly from PyPi.
翻译:涉及高度振荡贝塞尔函数的积分使用传统积分技术计算时 notoriously 具有挑战性。尽管已有多种方法可用,但它们主要适用于最多包含单个贝塞尔函数的积分,从而形成了专门化但高度优化的解决方案。本文介绍 pylevin,一个用于高效计算包含最多三个任意阶数和参数的贝塞尔函数积分的 Python 软件包。该实现利用了 Levin 方法,能够对这些高度振荡积分进行快速且精确的积分。在将 pylevin 与现有单贝塞尔函数积分软件进行基准测试时,我们发现其速度与 FFTLog 等专门化软件包相当,通常在两倍因子范围内。此外,在处理包含两个或三个贝塞尔函数的积分时,pylevin 的性能比标准自适应求积方法快多达四个数量级,同时对于大贝塞尔函数参数也表现出更好的稳定性。pylevin 可通过 GitHub 从源代码获取,或直接从 PyPi 安装。