Papers
Topics
Authors
Recent
Search
2000 character limit reached

SLSim: Lensing Simulation Package

Updated 4 July 2026
  • SLSim is a strong gravitational lens simulation package that generates mock catalogs and pixel-level images under survey-realistic conditions.
  • It integrates astrophysical population models, lensing calculations, and image rendering to reproduce both static and time-variable lensing events.
  • The tool is designed for LSST and Roman survey integration, supporting algorithm benchmarking, selection-function studies, and pipeline validation.

SLSim is a Python package for simulating populations of strong gravitational lenses under survey-realistic observing conditions, with particular emphasis on the Vera C. Rubin Observatory’s Legacy Survey of Space and Time (LSST). It is designed to generate both mock catalogs and pixel-level images for static and time-variable lensing configurations, including galaxy–galaxy lenses, lensed quasars, lensed supernovae, and group or cluster lenses. The package integrates astrophysical population models, lensing calculations, image rendering, and survey-specific injection workflows, and is developed jointly by LSST-DESC and the LSST Strong Lensing Science Collaboration (Khadka et al., 17 Mar 2026).

1. Definition, scope, and acronym usage

In its primary contemporary usage, SLSim denotes a strong-lensing population simulation package intended for large cosmological surveys, especially LSST. The package was introduced to address an anticipated several-orders-of-magnitude increase in the number of observable strong lenses, including both static and transient systems, and to support lens finding, lens modeling, selection-function studies, and end-to-end pipeline validation under realistic observational conditions (Khadka et al., 17 Mar 2026).

The package is explicitly survey-aware. Its stated scope includes realistic lens populations, pixel-level image simulation, time-domain lensing scenarios, and injection into LSST-like backgrounds. It is publicly available at https://github.com/LSST-strong-lensing/slsim and is presented as a community-developed open-source codebase (Khadka et al., 17 Mar 2026).

The acronym has also been used in other research contexts. In cosmological inference, “SLSim” can refer to the sequential application of Linear Simulation-based Inference, or sequential LSBI, a round-based simulation-based inference method built on a local linear-Gaussian likelihood approximation (Mediato-Diaz et al., 7 Jan 2025). In satellite-network research, “SLSim” appears as a broader label for satellite-link or satellite-network simulation, within which the LISL-focused simulator SLASh is positioned (Romine et al., 27 Dec 2025). In current astrophysical usage, however, SLSim most specifically denotes the strong-lensing simulation package (Khadka et al., 17 Mar 2026).

2. Scientific motivation and intended applications

SLSim was developed in response to the rarity and complexity of strong gravitational lenses and the expectation that Rubin/LSST-scale surveys will produce much larger lens samples than previously available. The package is intended to support the analysis of those samples by generating realistic simulated lenses for algorithm development, benchmarking, and bias calibration (Khadka et al., 17 Mar 2026).

The package targets several concrete use cases. These include training and benchmarking machine-learning lens finders, generating large training sets for fast lens modeling, quantifying and correcting selection functions in population analyses, and validating DESC and Strong Lensing Science Collaboration pipelines from image injection through cosmological inference (Khadka et al., 17 Mar 2026). The emphasis on both static and time-variable sources reflects the importance of lensed quasars and lensed supernovae for time-delay cosmography and transient discovery.

A central design choice is the combination of population realism and instrument realism. Existing forecasts often operate at the catalog or cross-section level, whereas pixel-level simulations may be ad hoc or disconnected from survey software. SLSim is presented as filling this gap by combining modular population synthesis with image rendering and LSST-stack integration (Khadka et al., 17 Mar 2026).

3. Software architecture and implementation

SLSim is written in Python and relies heavily on established scientific software. The principal dependencies named in the paper are lenstronomy for lensing calculations and image rendering, skypy for galaxy population synthesis, sncosmo for supernova light curves, colossus for halo mass functions and mass–concentration relations, and a GPU-based microlensing package hosted at github.com/weisluke/microlensing. Standard scientific Python libraries such as NumPy, SciPy, Matplotlib, and Astropy are also used throughout (Khadka et al., 17 Mar 2026).

The architecture is modular and organized into three conceptual layers.

Layer Main role Representative classes/modules
Individual-object layer Single astrophysical objects and a single lens configuration Source, Deflector, Lens
Population layer Sky-area and redshift populations of sources and deflectors Galaxies, PointSources, EllipticalLensGalaxies, ClusterDeflectors, LensPop
Survey / LSST integration layer Injection into LSST-like data products and cadence handling lsst_science_pipeline, OpSim integration

At the individual-object layer, Source has subclasses ExtendedSource, PointSource, and PointPlusExtendedSource. Deflector includes mass–light models such as EPLSersic, NFWHernquist, and NFWCluster. A Lens instance binds a source to a deflector and stores the resulting lens configuration (Khadka et al., 17 Mar 2026).

At the population layer, source populations include Galaxies, PointSources, and PointPlusExtendedSources, while deflector populations include EllipticalLensGalaxies, AllLensGalaxies, CompoundLensHalosGalaxies, and ClusterDeflectors. The top-level population engine is LensPop, which samples deflectors, assigns candidate sources, solves the lens equation, applies detectability cuts, and assembles a lens catalog (Khadka et al., 17 Mar 2026).

The survey-integration layer provides LSST-specific functionality. The lsst_science_pipeline module uses the Rubin Butler to obtain DP0/DC2 cutouts, PSFs, noise, and zeropoints, and then injects simulated lens images into those backgrounds. An OpSim-based interface uses OpSimSummaryV2 to obtain time-ordered visit metadata at sky coordinates for efficient LSST-like cadence simulation without the full overhead of repeated DP0 queries (Khadka et al., 17 Mar 2026).

4. Astrophysical modeling

SLSim builds on standard gravitational lensing theory through lenstronomy rather than re-deriving the underlying formalism. The package uses the usual lens equation,

β=θα(θ),\boldsymbol{\beta} = \boldsymbol{\theta} - \boldsymbol{\alpha}(\boldsymbol{\theta}),

with image positions, separations, and related observables obtained from the chosen deflector mass model and source configuration. Time-delay handling is described as using the standard Fermat-potential form, and magnifications are obtained from the Jacobian of the lens mapping (Khadka et al., 17 Mar 2026).

Deflectors

Galaxy-scale deflectors are modeled using EPLSersic, which combines an elliptical power-law mass profile with Sérsic light, and NFWHernquist, which combines an NFW dark-matter halo with a Hernquist stellar component. Cluster-scale deflectors are represented by NFWCluster, in which the overall cluster halo is NFW and member galaxies are EPLSersic subhalos. Halo-based deflectors can also be generated by CompoundLensHalosGalaxies through the SL-Hammocks pipeline (Khadka et al., 17 Mar 2026).

Velocity dispersions are treated as a central ingredient of the lens cross-sections. SLSim contains a dedicated VelocityDispersion module, including a velocity dispersion function calibrated to SDSS data and a luminosity-based scaling relation

σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},

quoted from Choi et al. (2007), with optional use of Parker et al. (2007). Luminosity evolution is included as a brightening of MrM_*^r by 1.5 mag from z=1z=1 to $0$ (Khadka et al., 17 Mar 2026).

Sources

Extended-source galaxies are generated through SkyPyPipeline, which samples galaxy populations from Schechter luminosity functions. Spiral galaxies are modeled with a single Schechter luminosity function, while ellipticals use a double Schechter form to include both massive and dwarf ellipticals. Missing structural quantities can be inferred or filled with defaults (Khadka et al., 17 Mar 2026).

Quasars are modeled as point sources drawn from a double-power-law luminosity function,

dΦQSOdM=Φ100.4(α+1)(MM)+100.4(β+1)(MM),\frac{d\Phi_{\rm QSO}}{dM} = \frac{\Phi_*}{10^{0.4(\alpha + 1)(M - M_*)} + 10^{0.4(\beta + 1)(M - M_*)}},

with parameters specified in the paper, including Φ=5.34×106h3Mpc3\Phi_* = 5.34 \times 10^{-6} h^3\,\mathrm{Mpc^{-3}}, β=1.45\beta = -1.45, and redshift-dependent α\alpha. The break magnitude evolves according to a specified function f(z)f(z), and simulated luminosity functions are reported to match the analytic model in multiple redshift bins (Khadka et al., 17 Mar 2026).

Supernovae are supported as variable point sources, with Type Ia volumetric rates sampled from the stated star-formation-rate and delay-time prescriptions. Hosts are drawn from blue galaxies generated by SkyPyPipeline, weighted approximately as σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},0 with slope σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},1, and offsets from host centers follow an empirical offset-ratio distribution well fit by a log-normal model with the quoted shape, location, and scale parameters (Khadka et al., 17 Mar 2026).

Variability, line of sight, and microlensing

For quasar variability, SLSim implements a thin-disk plus lamppost reverberation model. A stochastic driving continuum is generated via the Timmer & Koenig method, and transfer functions based on Cackett et al. (2007) are convolved with this continuum to produce multi-band light curves stored in a Variability object (Khadka et al., 17 Mar 2026).

Line-of-sight effects can be incorporated either through a Gaussian mixture model fitted to the distribution in Schmidt et al. (2023), yielding external convergence and shear, or through a more physically grounded approach that combines a GLASS large-scale-structure convergence map with halo rendering along the line of sight. The paper gives the nonlinear correction formulas used to combine observer–deflector, observer–source, and deflector–source contributions (Khadka et al., 17 Mar 2026).

Microlensing support accepts local σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},2, σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},3, and σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},4 at image positions and generates magnification maps using the GPU microlensing code. The currently supported source morphologies are GaussianSourceMorphology and AGNSourceMorphology, and microlensed light curves can be produced for variable sources through the Lens class (Khadka et al., 17 Mar 2026).

5. Simulation workflow and outputs

The central workflow begins by choosing a cosmology, sky area, and redshift range, after which source and deflector populations are generated from internal pipelines or external catalogs. These are wrapped in population classes and passed to LensPop together with cosmology, sky area, line-of-sight configuration, and, where relevant, variability settings (Khadka et al., 17 Mar 2026).

For each sampled deflector, LensPop defines a test area scaled to the Einstein radius σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},5 and computes the expected number of sources in that area from the source surface density. Sources are drawn only when the expected number is nonzero. For each deflector–source pair, a Lens object is constructed, the lens equation is solved through lenstronomy, the image multiplicity and observables are computed, and detectability criteria are applied. Detectable configurations are retained in the simulated population (Khadka et al., 17 Mar 2026). The paper characterizes this as importance sampling in impact parameter, intended to avoid wasting computation on pairs incapable of producing strong lensing.

The image-simulation module converts Lens objects into pixel-level images. The main user-facing functions are lens_image(lens, ...), which produces a single image, and lens_image_series(lens, ...), which produces a time series for variable systems. Inputs include filter band, zeropoint magnitude, PSF kernel, WCS, background noise or variance map, observation time, and image size. The backend automatically distinguishes between extended, point-like, and hybrid sources and dispatches the appropriate lenstronomy calls (Khadka et al., 17 Mar 2026).

An image-based signal-to-noise calculation is also included. SLSim simulates a noiseless source-only image and a full composite image, approximates pixelwise SNR as source counts divided by composite noise, groups pixels with SNR σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},6 into connected regions, and then computes cumulative SNR per region. The maximum region SNR is taken as the lens detection SNR (Khadka et al., 17 Mar 2026).

The principal outputs are Lens instances collected by LensPop, together with metadata tables for survey injection workflows. Each Lens stores deflector properties, source properties, lensed observables such as image positions and magnifications, and the mass–light dictionaries used for image rendering. The LSST module returns Astropy Tables containing information such as sky coordinates, tract or patch, visit IDs, and lens IDs (Khadka et al., 17 Mar 2026).

6. Survey integration, validation, and limitations

A major distinguishing feature of SLSim is its explicit integration with Rubin/LSST simulation products. For DP0.2/DC2 data, the package can query coadds or single visits, obtain PSFs, exposure maps, and zeropoints through the Butler or TAP services, make cutouts around chosen coordinates, synthesize a lens under matching observing conditions, and inject it into the background image. For time-domain simulations without repeated DP0 overhead, OpSim metadata can be used to reconstruct visit sequences with times, filters, seeing, sky brightness, and exposure times (Khadka et al., 17 Mar 2026).

The package has also been extended to the Nancy Grace Roman Space Telescope. Roman support uses GalSim for WFI detector effects and STPSF/webPSF for filter- and detector-dependent PSFs, while retaining the same LensPop and image-generation workflow. The paper states that the design is generic enough that adapting to Euclid or other facilities mainly requires the corresponding PSF, noise, and filter models (Khadka et al., 17 Mar 2026).

Validation is described at both image and population levels.

Validation target Comparison basis Reported outcome
Pixel-level galaxy images Reconstruction of DP0.2/DC2 galaxy images using extracted catalog and observing parameters Good agreement in residual maps
Galaxy luminosity functions SDSS-based Montero-Dorta & Prada fits; DP0 and Roman–Rubin catalogs Close agreement at the bright end
Quasar luminosity function Analytic double-power-law model Match across three redshift bins
SN Ia rate density Theoretical volumetric rate Excellent agreement
Velocity-dispersion distributions SDSS velocity-dispersion function Consistent reference behavior

At the image level, the paper reports that a DP0.2/DC2 galaxy reconstructed with SLSim using the same catalog properties and observing conditions shows good agreement in residual maps σv=161(LL)1/2.32kms1,\sigma_v = 161 \left(\frac{L}{L_*}\right)^{1/2.32} \, \mathrm{km\,s^{-1}},7. At the population level, simulated elliptical-galaxy luminosity functions follow the SDSS-based double-Schechter fits of Montero-Dorta & Prada (2009), overall galaxy luminosity functions agree well with DP0 and Roman–Rubin simulations at the bright end, simulated quasar luminosity functions match the analytic double power law, simulated SN Ia redshift distributions match the theoretical rate model, and velocity-dispersion distributions are checked against the SDSS reference function (Khadka et al., 17 Mar 2026).

The paper is also explicit about current limitations. Cosmology is configurable but treated as a fixed background; there is no integrated interface to MontePython or CosmoMC for cosmological parameter scans. Lensing physics is based on relatively simple parametric profiles such as EPL, NFW, and Hernquist. The line-of-sight treatment does not yet implement full multi-plane ray tracing through realistic hydrodynamical density fields. Microlensing presently supports static Gaussian and AGN-disk source morphologies, with supernova microlensing planned but not implemented. DP0-based injection is comparatively slow, and the highest-fidelity configurations still require substantial computational resources (Khadka et al., 17 Mar 2026).

These limitations define the likely direction of future development. The stated goals include stronger support for LSST difference-imaging analysis of lensed transients, calibration of selection functions for population inference, prediction of rare or exotic lensed events, joint Rubin–Roman–Euclid workflows, and ultimately an integrated chain from lens discovery through modeling and population analysis to cosmological inference (Khadka et al., 17 Mar 2026).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to SLSim.