VBMicroLensing: three algorithms for multiple lensing with contour integration

V. Bozza, Vito Saggese, G. Covone, Paolo Rota, J. ZhangarXiv 2024 · DOI · arXiv

TL;DR

The new public code VBMicroLensing introduces three distinct algorithms—Singlepoly, Multipoly, and Nopoly—to solve the complex lens equations required for modeling multi-planet microlensing events. By moving away from traditional single-polynomial solvers, the authors achieve massive speedups (up to $10^3$ compared to existing tools) and significantly higher numerical precision, particularly in "planetary regimes" where small mass ratios typically cause standard solvers to fail.

What Problem Does This Paper Address?

Gravitational microlensing is a premier tool for detecting exoplanets, especially those far from their host stars. However, when a system has multiple planets (or a binary star plus a planet), the math becomes grueling. To calculate the magnification of a background source, researchers must solve the "lens equation" to find the positions of all resulting images.

For $N$ lenses, this requires finding the roots of a polynomial of degree $N^2 + 1$. As $N$ increases, two things happen:

  1. Numerical Noise: When one lens is much smaller than another (like a planet vs. a star), the coefficients of the polynomial span many orders of magnitude, leading to catastrophic rounding errors in standard double-precision floating-point math.
  2. Computational Cost: Solving high-degree polynomials is slow and scales poorly as the number of lenses grows.

Existing workarounds often involve "quadruple precision" math, which slows down calculations by a factor of 10 or more, making large-scale statistical studies of multi-planet systems nearly impossible.

Methods

The authors implement three algorithms within the VBMicroLensing framework, all utilizing contour integration (calculating the area of images by integrating along their boundaries) with advanced parabolic corrections to minimize the number of required points.

  • Singlepoly: An optimized version of the classical approach. It uses a single global polynomial. While fast, it remains vulnerable to numerical precision issues when mass ratios are extreme.
  • Multipoly: A novel "local" approach. Instead of one global polynomial, it re-calculates the polynomial in different reference frames, each centered on a different lens. This isolates the influence of individual planets and drastically reduces numerical truncation errors.
  • Nopoly: A paradigm shift that abandons polynomials entirely. It applies a modified Newton-Raphson method directly to the original complex lens equation. To ensure no images are missed (a common risk with iterative solvers), it uses a sophisticated "seeding" strategy based on the positions of the lenses and known image parities.

Datasets

As a methodology paper, the authors evaluated their algorithms using simulated lens configurations rather than a specific observational dataset. They benchmarked the code against four distinct triple-lens geometries:

  • Linear: Lenses arranged in a line.
  • Equilateral/Isosceles Triangle: Symmetric configurations to test complex caustic structures.
  • Planetary System: A star with two secondary masses (analogous to Earth and Jupiter).

They also compared performance against the existing VBBinaryLensing code and the triplelens package (Kuang et al. 2021).

Key Insights and Ideas

  • The Polynomial Trap: The authors demonstrate that the very act of transforming the lens equation into a polynomial is often what introduces the most numerical error. By working with the original equation (Nopoly), they maintain precision to the limits of machine epsilon ($10^{-15}$).
  • Linear vs. Quadratic Scaling: While polynomial solvers scale quadratically with the number of lenses ($N^2$), the Nopoly approach scales more linearly with the number of images. This makes Nopoly the most efficient choice for systems with five or more lenses.
  • Complementary Strengths: No single algorithm wins in every scenario. Singlepoly is best for simple systems; Multipoly is the "sweet spot" for 3–4 lenses with extreme mass ratios; and Nopoly is the robust choice for high-multiplicity systems.

Key Results

  • Speed: VBMicroLensing is approximately 1,000 times faster than the triplelens code for similar accuracy levels.
  • Robustness: The Multipoly and Nopoly algorithms successfully resolve images in planetary regimes where traditional solvers would require slow quadruple-precision math.
  • Efficiency Crossover: For triple-lens systems, Multipoly is about 5 times faster than Nopoly. However, for systems with $N \ge 5$ lenses, Nopoly becomes the fastest and most reliable method.
  • Public Availability: The code is open-source and integrated into the RTModel platform, making it immediately accessible for the upcoming Nancy Grace Roman Space Telescope era.

Limitations and Future Work

  • The Seeding Challenge: The Nopoly algorithm's success depends on its "seeds" to find all images. While the authors include a "fail-safe random search," there is a theoretical (though practically rare) risk of missing an image if the seeds are poorly placed.
  • Optimization: The authors acknowledge that all three codes will undergo further optimization. Specifically, the Nopoly seeding strategy could be further refined to reduce the number of iterations needed for convergence.
  • Complex Sources: While the code handles limb-darkened stars via concentric annuli, future versions could further optimize the sampling for extremely high-magnification events where source-size effects are dominant.

Summary updated

Abstract

Modeling of microlensing events poses computational challenges for the resolution of the lens equation and the high dimensionality of the parameter space. In particular, numerical noise represents a severe limitation to fast and efficient calculations of microlensing by multiple systems, which are of particular interest in exoplanetary searches. We present a new public code built on our previous experience on binary lenses that introduces three new algorithms for the computation of magnification and astrometry in multiple microlensing. Besides the classical polynomial resolution, we introduce a multi-polynomial approach in which each root is calculated in a frame centered on the closest lens. In addition, we propose a new algorithm based on a modified Newton-Raphson method applied to the original lens equation without any numerical manipulation. These new algorithms are more accurate and robust compared to traditional single-polynomial approaches at a modest computational cost, opening the way to massive studies of multiple lenses. The new algorithms can be used in a complementary way to optimize efficiency and robustness.
BibTeX
@misc{bozza2024vbmicrolensing,
  author = {V. Bozza and Vito Saggese and G. Covone and Paolo Rota and J. Zhang},
  title = {{VBMicroLensing: three algorithms for multiple lensing with contour integration}},
  year = {2024},
  eprint = {2410.13660},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.13660},
}
Figure