SLSim: a strong lensing population simulation package

Narayan Khadka, Simon Birrer, Henry J. Best, Paras Sharma, Katsuya T. Abe, Xianzhe Tz Tang, Carly Mistick, Felipe Urcelay, Emrecan M. Sonmez, Nikki Arendse, Sydney Erickson, Jacob Osman Hjortlund, Phil Holloway, Alan Huang, Rahul Karthik, Mia Lamontagne, Vibhore Negi, Justin R. Pierel, Bruno O. Sánchez, Aysu Ece Saricaoglu, Anowar Shajib, Yixuan Shao, Padma T. Venkatraman, Bryce Wedig, Aadya Agrawal, Timo Anguita, Pedro Bessa, Clécio R. Bom, Sofia Castillo, Thomas Collett, Tansu Daylan, Steven Dillmann, Margherita Grespan, Erin E. Hayes, R. Joseph, Richard Kessler, Tian Li, Phil Marshall, Anupreeta More, Veronica Motta, Gautham Narayan, Matt O'Dowd, Masamune Oguri, Aprajita Verma, Giorgos Vernardos, the Strong Lensing Science CollaborationarXiv 2026 · DOI · arXiv

TL;DR

SLSim is a new open-source Python package designed to simulate massive populations of strong gravitational lenses for the next generation of wide-field sky surveys. By integrating advanced astrophysical models with survey-specific noise and point-spread functions, it provides the high-fidelity synthetic data needed to train machine learning classifiers and prepare for the "lensing gold rush" expected from the Vera C. Rubin Observatory.

What Problem Does This Paper Address?

Strong gravitational lensing—where a massive foreground object (the "deflector") warps the light of a background object (the "source") into multiple images or arcs—is a powerful tool for measuring the expansion of the universe and the distribution of dark matter. Historically, these events have been rare "astronomical gems," with only a few hundred known.

However, the upcoming Legacy Survey of Space and Time (LSST) at the Vera C. Rubin Observatory is expected to discover upwards of 100,000 galaxy-galaxy lenses and hundreds of lensed supernovae and quasars. We are moving from a regime of manual inspection to one of automated "big data" pipelines. The challenge is that we lack a unified, modular framework to generate the realistic, survey-adapted training sets required to build these automated search and analysis tools. Existing simulations are often fragmented or lack the "pixel-level" realism needed to test how lenses look through a specific telescope's optics.

Methods

The authors present SLSim, a modular Python package built on top of industry-standard astronomical libraries. Its architecture is divided into several key components:

  • Modular Class Structure: It uses dedicated classes for Source (the background object), Deflector (the foreground mass), and Lens (the combined system). This allows users to easily swap out different astrophysical models.
  • Population Management: The LensPop class handles the heavy lifting of generating statistically representative populations over large sky areas. To maintain computational efficiency, it uses a "test area" approach, only performing expensive lensing calculations around potential deflectors based on their Einstein radii.
  • Variable Source Modeling: Unlike many previous tools, SLSim natively supports time-variable sources. It simulates light curves for lensed quasars (using accretion disk models) and supernovae (using sncosmo), even accounting for the complex effects of microlensing caused by individual stars within the deflector galaxy.
  • Survey Integration: A standout feature is the lsst_science_pipeline module. This allows users to "inject" simulated lenses directly into real or simulated survey data (like LSST's Data Preview 0), ensuring the synthetic images include realistic noise, PSF blurring, and detector artifacts.

Datasets

The paper validates SLSim by comparing its outputs against several established benchmarks:

  • SDSS Data: The velocity dispersion and luminosity functions are calibrated against the Sloan Digital Sky Survey to ensure the simulated galaxy populations match the real universe.
  • LSST DP0 (Data Preview 0): The package was tested by injecting lenses into the 300 $deg^2$ of simulated LSST-like exposures generated for the community.
  • Roman-Rubin Simulations: Comparisons were made with joint simulations for the Nancy Grace Roman Space Telescope to ensure cross-facility consistency.

Key Insights and Ideas

  • The "Needle in the Haystack" Optimization: Strong lenses are rare. SLSim avoids wasting CPU cycles by calculating the "average number of sources per unit sky area" and only attempting to pair sources and deflectors when there is a statistical probability of an overlap.
  • Modularity is King: By using lenstronomy as a back-end for the lensing math and skypy for the galaxy populations, SLSim doesn't reinvent the wheel. Instead, it acts as a sophisticated "orchestrator" that connects population synthesis to pixel-level image simulation.
  • Beyond Static Images: The inclusion of time-domain lensing (supernovae and quasars) is a major step forward. These "transient" lenses are crucial for measuring the Hubble constant ($H_0$) via time-delay cosmography, and SLSim provides the first robust way to simulate these populations at scale.

Key Results

  • Statistical Fidelity: The simulated populations successfully reproduce the observed redshift and magnitude distributions of known lens samples.
  • Luminosity Matching: The package’s generated galaxy populations match the Schechter luminosity functions of the DP0 and Roman-Rubin datasets, particularly in the "bright end" where lenses are most likely to be detected.
  • Performance: The pipeline can recover multiband observations from the Rubin Operations Simulator (OpSim) for a long list of sky coordinates in roughly 40 seconds, making it feasible to simulate years of survey "visits" efficiently.

Limitations and Future Work

While comprehensive, the authors note several areas for expansion:

  • Source Diversity: Current supernova simulations focus on Type Ia; future versions will include core-collapse supernovae.
  • Morphological Complexity: While the package supports Sersic profiles, the authors plan to implement more complex galaxy morphologies and variable source structures.
  • Multi-Facility Support: While tailored for Rubin, the authors are actively extending the pipeline to support the Euclid mission and the Roman Space Telescope, aiming for a "multi-facility" strong lensing pipeline.

SLSim is publicly available on GitHub, inviting the community to contribute to what will likely become a foundational tool for 2020s cosmology.

Summary updated

Abstract

Gravitational lensing offers unique insights into cosmology by bending light around massive objects. Strong gravitational lensing, in particular, produces magnified and often multiple images of distant sources, crucial for precise cosmological measurements and understanding the distribution of dark matter in the universe. Current studies are limited by the number of strong gravitational lenses. From upcoming cosmological surveys, we anticipate observing a several orders of magnitude increase in the number of lenses, for both static and transient phenomena. However, detecting and analyzing these events from vast surveys like Vera C. Rubin Observatory Legacy Survey of Space and Time (LSST) presents significant challenges. To prepare for these challenges, we introduce SLSim, a versatile simulation tool tailored for the Vera C. Rubin Observatory. SLSim integrates advanced astrophysical models with computational efficiency to generate synthetic strong lens populations under realistic observational conditions. SLSim simulates static and variable lensing scenarios, essential for cosmological studies, training and testing lens search and data analysis pipelines. This paper details SLSim,'s design and implementation, emphasizing its modularity and capabilities across various astrophysical regimes. Validation against observational data and existing simulations confirms SLSim's accuracy in reproducing observed lensing phenomena. SLSim is publicly available at https://github.com/LSST-strong-lensing/slsim, and we anticipate continued development and expansion of its capabilities. Users are encouraged to check the repository for updates and to contribute to ongoing community efforts in strong lensing simulations.
BibTeX
@misc{khadka2026slsim,
  author = {Narayan Khadka and Simon Birrer and Henry J. Best and Paras Sharma and Katsuya T. Abe and Xianzhe TZ Tang and Carly Mistick and Felipe Urcelay and Emrecan M. Sonmez and Nikki Arendse and Sydney Erickson and Jacob Osman Hjortlund and Phil Holloway and Alan Huang and Rahul Karthik and Mia Lamontagne and Vibhore Negi and Justin R. Pierel and Bruno O. Sánchez and Aysu Ece Saricaoglu and Anowar Shajib and Yixuan Shao and Padma T. Venkatraman and Bryce Wedig and Aadya Agrawal and Timo Anguita and Pedro Bessa and Clécio R. Bom and Sofia Castillo and Thomas Collett and Tansu Daylan and Steven Dillmann and Margherita Grespan and Erin E. Hayes and R. Joseph and Richard Kessler and Tian Li and Phil Marshall and Anupreeta More and Veronica Motta and Gautham Narayan and Matt O'Dowd and Masamune Oguri and Aprajita Verma and Giorgos Vernardos and the Strong Lensing Science Collaboration and the LSST Dark Energy Science Collaboration},
  title = {{SLSim: a strong lensing population simulation package}},
  year = {2026},
  eprint = {2603.17138},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.17138},
}
Figure