betaFeedback

WorksPhysics and Astronomy

Microcaustics: Fast GPU-Accelerated Dynamical Microlensing of Time-Dependent Extended Sources

Abstract

Gravitational microlensing probes unresolved quasar accretion disc structure and compact objects in lens galaxies and is an important systematic in strong-lens time-delay cosmography. Most analyses use static microlensing map simulations because evolving individual microlenses and caustics is computationally prohibitive. We present Microcaustics, a GPU-accelerated Python package built on PyTorch for dynamical microlensing of time-dependent extended sources in strong gravitational lenses. It combines a local-exact/far-field deflection solver, source-directed lens-plane scouting with temporal reuse, and biquadratic inverse polygon mapping (IPM). GPU batching and fused Triton rasterization accelerate the calculation, while binary caustic labels track source-centred crossings. Across three simulated quadruply lensed quasar systems, our package generates a 10-year, 147-frame multiband light curve in an amortized median of 0.68 s (0.88 s with labels) on a consumer GPU with a median light-curve RMSE of 0.35 mmag, while recovering every reference source-centred caustic crossing. At comparable map accuracy, the batched throughput is 780 times higher than that of a recent CUDA IPM implementation and extrapolates to a speedup of millions relative to classic GPU-D. We demonstrate that our IPM converges as Nray−0.84N_{\rm ray}^{-0.84}, approaching the idealized Nray−1N_{\rm ray}^{-1} convergence rate of piecewise-affine IPM and improving upon the Nray−1/2N_{\rm ray}^{-1/2} inverse ray-shooting rate. We also introduce a GPU-resident general relativistic and reverberating quasar source model and demonstrate our method with an evolving supernova source. These advances make fully dynamical stellar fields practical for Bayesian and simulation-based inference.

Introduction

Quasars are luminous active galactic nuclei (AGN) powered by accretion onto supermassive black holes (Salpeter 1964; Zel’dovich 1964). Their ultraviolet and optical continuum originates on scales too small to resolve directly at cosmological distances. Strong gravitational lensing produces multiple macroimages of the same quasar, with different magnifications and arrival times (Shajib et al. 2024). Stars and other compact objects in the foreground galaxy further split each macroimage into unresolved micromages. Their combined magnification depends on the source’s position, size, and spatial structure. Critical curves are lens-plane locations where the lens-mapping Jacobian determinant vanishes. They map to source-plane caustics, where point-source magnification formally diverges and across which the microimage configuration changes. Compact sources can undergo sharp magnification changes near these caustics, whereas extended sources average over the same structure. Microlensing therefore probes quasar structure far below the angular resolution of a telescope (Schneider et al. 1992; Vernardos et al. 2024).

Most quasar microlensing calculations involve a static magnification map with a source profile and extract light curves along trajectories through that map. This freezes the caustic network. Stellar proper motions instead reshape the network and can produce shorter, steeper, and more frequent events than translation across a fixed pattern (Kundić & Wambsganss 1993; Wambsganss & Kundić 1995). Figure 1 illustrates this evolution. Recomputing maps and consistently labelling caustics at every epoch has historically been prohibitively expensive for large simulation sets. Poindexter & Kochanek (2010a,b) included moving stars in Bayesian analyses of Q2237+0305, with complete inference calculations requiring CPU-years of computation. Making such dynamical calculations inexpensive is the main goal of this work.

Six dynamical magnification maps at $t=0$, 2, 4, 6, 8, and 10 yr

Figure 1. Motivation for dynamical magnification maps using the Q2237+0305 image B parameters κ=γ=0.391\kappa=\gamma=0.391, s=0s=0, and ϕγ=141.73∘\phi_\gamma=141.73^\circ. The stellar realization contains 3805 microlenses. The six panels show one macroimage at t=0t=0, 2, 4, 6, 8, and 10 yr using a fixed 9.382 μ\muas square source-plane window, 1024×10241024 \times1024 pixel grid, and shared log⁡10μ\log_{10}\mu normalization.

The scientific applications extend beyond measuring a single source size. Wavelength-dependent microlensing constrains the disc temperature profile, inclination, and spatial structure (Poindexter et al. 2008; Poindexter & Kochanek 2010b; Blackburne et al. 2015; Muñoz et al. 2016b; Morgan et al. 2018; Cornachione & Morgan 2020; Best et al. 2024; Vernardos et al. 2024). Measurements often find ultraviolet–optical discs several times larger than luminosity-based thin-disc predictions, with ensemble studies favouring shallower effective temperature profiles from microlensing (Morgan et al. 2010; Cornachione & Morgan 2020) and reverberation mapping (Mudd et al. 2018; Guo et al. 2022; Jha et al. 2022). A high-magnification event (HME), produced by a caustic crossing or close approach, can scan different disc radii and relativistically brightened regions (Best et al. 2024). Forecasting these events can trigger high-cadence multiwavelength or spectroscopic follow-up (Fagin et al. 2025a).

The source itself also evolves. In lamppost reprocessing models, coronal variability illuminates the disc with position-dependent light-travel delays (Cackett et al. 2007). Microlensing then weights regions with different temperatures, variability amplitudes, and reverberation delays (Vernardos & Tsagkatakis 2019; Millon et al. 2022; Best et al. 2024). It can alter both the observed variability and the inferred delay between macroimages ([18] (Tie & Kochanek 2018a)). Those delays constrain the cosmic expansion rate when combined with deflector and line-of-sight models (Refsdal 1964; Treu & Marshall 2016; Birrer et al. 2024), making microlensing a source of cosmographic systematics as well as a probe of disc structure. Evolving transients, including strongly lensed supernovae, likewise require time-dependent source profiles (Huber et al. 2021).

Microlensing also constrains the foreground lens. Compact-source flux anomalies complicate the use of macroimage flux ratios to measure dark-matter substructure (Mao & Schneider 1998; Dalal & Kochanek 2002; Schechter & Wambsganss 2002; Nierenberg et al. 2024; Gilman et al. 2026). Multi-epoch and multiwavelength observations help separate stellar microlensing from more nearly static substructure (Vernardos et al. 2024). Magnification statistics and event time-scales also depend on the microlens mass spectrum, allowing ensembles to constrain the mean stellar mass and, with additional information, extragalactic stellar initial mass functions (Jiménez-Vicente & Mediavilla 2019). Related applications include compact dark matter (Mediavilla et al. 2017), wandering intermediate-mass black holes ([135]), and extragalactic planets (Dai & Guerreras 2018; Tuntsov et al. 2024). These inferences benefit from forward models that vary source structure, velocities, and microlens masses together.

Large precomputed maps are effective for sampling many trajectories through a static field, but a dynamical library adds time as another dimension. The more than 70,000 static GERLUMPH maps already occupy roughly 25 TB (Vernardos et al. 2014; Vernardos & Fluke 2014). Reusing a few realizations limits training diversity, while on-demand simulation can redraw the stars and source without storing a mostly unused map. A precomputed map also fixes the smallest spatial scales available to subsequent convolution and interpolation, which can limit studies of inner-disc emission and early supernova photospheres unless finer maps are generated. Population studies also commonly adopt a single microlens mass and a circular, often Gaussian source (Vernardos & Tsagkatakis 2019; Neira et al. 2020; Neira et al. 2025; Fagin et al. 2025a). Such profiles can reproduce broad statistics at fixed half-light radius (Mortonson et al. 2005), but discard structure that matters during caustic crossings. Intrinsic variability is often removed approximately through time-delay-corrected difference light curves or modelled as a nuisance process (Sluse & Tewes 2014; Tie & Kochanek 2018b; Paic et al. 2022). A resolved evolving source instead allows intrinsic variability and microlensing to be calculated together (Best et al. 2025).

Inverse ray shooting (IRS) constructs maps by accumulating deflected rays in source pixels (Kayser et al. 1986; Schneider & Weiss 1987), whereas inverse polygon mapping (IPM) distributes mapped cell areas among those pixels (Mediavilla et al. 2006, 2011). Tree and direct GPU methods accelerated IRS (Wambsganss et al. 1990; Bate et al. 2010; Thompson et al. 2010), with GPU-D underpinning GERLUMPH (Vernardos et al. 2014). Later implementations use mesh-based Poisson solvers (Shalyapin et al. 2021), interpolated far fields (Zheng et al. 2022), or fast multipole methods (Greengard & Rokhlin 1987; Jiménez-Vicente & Mediavilla 2022). The open-source GPU implementation of Weisenbach (2025a) combines the fast multipole method with IPM, with a companion code for critical curves and caustics (Weisenbach 2025b). These methods emphasize accurate individual maps and caustic calculations. Together with adaptive spatial selection (Meena et al. 2022), they provide the basis for an end-to-end GPU calculation optimized for evolving stellar fields and extended sources.

The Vera C. Rubin Observatory Legacy Survey of Space and Time (LSST) makes this scale of simulation increasingly important. Forecasts predict more than 8000 lensed quasars, including roughly 3000 with well-measured time delays (Oguri & Marshall 2010). LSST will monitor them in six near-UV to near-IR bands over ten years (Ivezić et al. 2019), with dozens of HMEs expected annually across the monitored lens population (Neira et al. 2020; Neira et al. 2025), alongside lensed supernovae and other transients (Sheng et al. 2022; Arendse et al. 2024). Machine-learning methods for parameter inference, light-curve reconstruction, and HME prediction can require ≳106\gtrsim10^{6} diverse multiband training curves (Vernardos & Tsagkatakis 2019; Fagin et al. 2024; Fagin et al. 2025a,b). Bayesian Monte Carlo analyses likewise require many simulated trajectories to marginalize over lens, source, and velocity parameters (Kochanek 2004; Poindexter & Kochanek 2010b; Morgan et al. 2012; Blackburne et al. 2015; Cornachione & Morgan 2020).

Here we introduce MICROCAUSTICS, a GPU-accelerated Python framework for dynamical microlensing of time-dependent extended sources. It combines a local-exact/far-field deflection solver, source-directed lens-plane scouting, IPM, temporal reuse, and batched source evaluation in PyTorch and Triton (Paszke et al. 2019; Tillet et al. 2019). The simulator returns multiband light curves together with critical curves, caustics, and crossing labels. We compare its accuracy and performance with high-resolution references and existing GPU implementations. We also introduce a GPU-resident relativistic, reverberating quasar disc with an adjustable temperature slope and demonstrate an expanding supernova source. The code is publicly available at https://github.com/JFagin/microcaustics.

Sections 2 and 3 define the physical model and numerical method, Section 4 presents the benchmarks, and Section 5 describes the source models and end-to-end examples. We discuss applications and limitations in Section 6 and present our conclusions in Section 7. Throughout, we assume a flat Λ\LambdaCDM cosmology with H0=70 km s−1 Mpc−1H_0 = 70\ {\rm km\,s^{-1}\,Mpc^{-1}} and Ωm=0.3\Omega_{\rm m} = 0.3, and report AB magnitudes.

Dynamical Microlensing Model and Observables

Microcaustics separates the slowly varying galaxy-scale lens from the stellar-scale perturbations around each macroimage. The former determines the local convergence, shear, parity, and macroimage time delay, and the latter is evolved explicitly and coupled to a time-dependent extended source. This section defines that physical calculation and its observables. The accelerated evaluation of the same equations is described in § 3, and the source models are specified in § 5. The benchmark sample comprises the four macroimages of each of Q2237+0305, RX J1131−1231, and HE 0435−1223, each simulated as a 10-year, microlensing-only light curve at 25-day intervals (147 frames). The mass and velocity prescriptions below define their fiducial calculations, and their adopted lens and source parameters are collected in § 4.1. The simulator also accepts user-supplied microlens masses, positions, and velocities.

Local macroimage and microlens model

We describe a small region around one macroimage using angular image-plane coordinates θ=(θ1,θ2)\boldsymbol{\theta}=(\theta_1,\theta_2) and source-plane coordinates β=(β1,β2)\boldsymbol{\beta}=(\beta_1,\beta_2), both measured relative to the corresponding macroimage solution. A constant deflection is absorbed into the choice of origin. Over the stellar field, the remaining smooth galaxy deflection is well approximated by a local linear field described by convergence and shear, while the compact component is represented by individual point masses (Schneider et al. 1992; Vernardos et al. 2024). The local lens equation is

β(θ,t)=Asθ−∑k=1N⋆θE,k2θ−θk(t)∣θ−θk(t)∣2,As=(1−κs−γ1−γ2−γ21−κs+γ1).(1)\boldsymbol{\beta}(\boldsymbol{\theta},t)=\mathbf{A}_{s}\boldsymbol{\theta}-\sum_{k=1}^{N_\star}\theta_{\mathrm{E},k}^{2}\frac{\boldsymbol{\theta}-\boldsymbol{\theta}_{k}(t)}{\lvert\boldsymbol{\theta}-\boldsymbol{\theta}_{k}(t)\rvert^{2}}, \qquad \mathbf{A}_{s}= \begin{pmatrix} 1-\kappa_s-\gamma_1 & -\gamma_2\\ -\gamma_2 & 1-\kappa_s+\gamma_1 \end{pmatrix}. \tag*{(1)}

Here κs\kappa_s is the smoothly distributed convergence, (γ1,γ2)(\gamma_1,\gamma_2) are the shear components, and θk(t)\boldsymbol{\theta}_k(t) and θE,k\theta_{\mathrm{E},k} are the position and angular Einstein radius of microlens kk (see equation (4)). Differentiating equation (1) away from the microlens positions gives

J≡∂β∂θ=As−∑kθE,k2[Idk2−2dkdkTdk4],(2)\mathbf{J}\equiv\frac{\partial\boldsymbol{\beta}}{\partial\boldsymbol{\theta}}=\mathbf{A}_s-\sum_k\theta_{\mathrm{E},k}^{2}\left[\frac{\mathbf{I}}{d_k^2}-\frac{2\mathbf{d}_k\mathbf{d}_k^{\mathsf{T}}}{d_k^4}\right], \tag*{(2)}

where dk=θ−θk(t)\mathbf{d}_k=\boldsymbol{\theta}-\boldsymbol{\theta}_k(t), dk=∣dk∣d_k=\lvert\mathbf{d}_k\rvert, and I\mathbf{I} is the identity matrix. We write the total convergence as κ=κs+κ⋆\kappa=\kappa_s+\kappa_\star and define the smooth-matter fraction s=κs/κs=\kappa_s/\kappa, so that κ⋆=(1−s)κ\kappa_\star=(1-s)\kappa. With

γ=(γ12+γ22)1/2,ϕγ=12atan2⁡(γ2,γ1),\gamma=(\gamma_1^2+\gamma_2^2)^{1/2}, \qquad \phi_\gamma=\frac{1}{2}\operatorname{atan2}(\gamma_2,\gamma_1),
μmacro=1(1−κ)2−γ2,(3)\mu_{\mathrm{macro}}=\frac{1}{(1-\kappa)^2-\gamma^2}, \tag*{(3)}

the sign of μmacro\mu_{\mathrm{macro}} gives the macroimage parity. Positive-parity images are minima or maxima of the arrival-time surface, whereas negative-parity images are saddles (Schneider et al. 1992; Shajib et al. 2024). For known lens systems, these local quantities can be supplied from an observational macro model. Alternatively, the simulator can solve a complete user-specified macro model, calculate its macroimage positions and relative arrival times, and evaluate the Jacobian at each image to obtain κ\kappa, γ1\gamma_1, γ2\gamma_2, and parity, as demonstrated in § 5.5.1. Each macroimage then defines an independent realization of equation (1).

Dynamical microlens population

For lens and source angular-diameter distances DlD_l and DsD_s and lens–source distance DlsD_{ls}, the angular Einstein radius corresponding to the mean microlens mass is

θE(⟨M⟩)=4G⟨M⟩c2DlsDlDs,θE,k=θE(⟨M⟩)Mk⟨M⟩.(4)\theta_{\mathrm{E}}(\langle M\rangle)=\sqrt{\frac{4G\langle M\rangle}{c^2}\frac{D_{ls}}{D_lD_s}}, \qquad \theta_{\mathrm{E},k}=\theta_{\mathrm{E}}(\langle M\rangle)\sqrt{\frac{M_k}{\langle M\rangle}}. \tag*{(4)}

We draw microlens masses from a truncated power law p(M)∝M−αp(M)\propto M^{-\alpha} for Mmin⁡≤M≤Mmax⁡M_{\min}\le M\le M_{\max}, with the Salpeter slope α=2.35\alpha=2.35 (Salpeter 1955; Kroupa 2001; Kochanek 2004). The distribution is specified by its mean and dynamic range. Every benchmark uses ⟨M⟩=0.3 M⊙\langle M\rangle=0.3\,M_\odot and Mmax⁡/Mmin⁡=100M_{\max}/M_{\min}=100.

Initial microlens positions are uniform within a circular image-plane field. For a diameter L⋆L_\star in Einstein-angle units, the population is N⋆=round⁡(κ⋆L⋆2/4)N_\star=\operatorname{round}(\kappa_\star L_\star^2/4). We size the field using the large-deflection tail criterion (Katz et al. 1986; Weisenbach 2025a), then circumscribe the protected macroimage region with a circle, apply a safety factor ssafe=1.5s_{\mathrm{safe}}=1.5, and pad for coherent motion. With source-field side length ℓsrc=Lsource/θE\ell_{\mathrm{src}}=L_{\mathrm{source}}/\theta_{\mathrm{E}}, mass-moment factor CM=⟨M2⟩/⟨M⟩2C_M=\langle M^2\rangle/\langle M\rangle^2, and nominal tail probability floss=0.01f_{\mathrm{loss}}=0.01, the shear-aligned half-widths and final stellar diameter are

bsrc=ℓsrc2+κ⋆CMfloss,b1=bsrc∣1−κ−γ∣,(5)b_{\mathrm{src}}=\frac{\ell_{\mathrm{src}}}{2}+\sqrt{\frac{\kappa_\star C_M}{f_{\mathrm{loss}}}}, \qquad b_1=\frac{b_{\mathrm{src}}}{\lvert1-\kappa-\gamma\rvert}, \tag*{(5)}
b2=bsrc∣1−κ+γ∣,L⋆=2ssafeb12+b22+∣ωbulk∣T.b_2=\frac{b_{\mathrm{src}}}{\lvert1-\kappa+\gamma\rvert}, \qquad L_\star=2s_{\mathrm{safe}}\sqrt{b_1^2+b_2^2}+\lvert\boldsymbol{\omega}_{\mathrm{bulk}}\rvert T.

Here bsrcb_{\mathrm{src}}, b1b_1, b2b_2, and L⋆L_\star are in Einstein-angle units, ωbulk\boldsymbol{\omega}_{\mathrm{bulk}} is the coherent image-plane motion in those units per observer day, and TT is the duration in observer days. The final term enlarges the stellar field for longer simulations so that the protected source region remains covered along the complete coherent track. The reported physical angular diameter is Llens=θEL⋆L_{\mathrm{lens}} = \theta_{\mathrm{E}}L_{\star}.

We retain the full two-dimensional velocity vectors rather than assigning a single scalar track speed. Let vl\mathbf{v}_{l} and vs\mathbf{v}_{s} be the proper transverse peculiar velocities of the lens and source in their local rest frames, and let vo\mathbf{v}_{o} be the observer velocity projected onto the tangent plane at the lens coordinates. In units of mean-mass Einstein radii per unit observer time, the coherent motion applied to the microlens field is

ωbulk=vl(1+zl)DlθE−vs(1+zs)DsθE−Dlsvo(1+zl)DlDsθE.(6)\boldsymbol{\omega}_{\mathrm{bulk}} = \frac{\mathbf{v}_{l}}{(1+z_{l})D_{l}\theta_{\mathrm{E}}} - \frac{\mathbf{v}_{s}}{(1+z_{s})D_{s}\theta_{\mathrm{E}}} - \frac{D_{ls}\mathbf{v}_{o}}{(1+z_{l})D_{l}D_{s}\theta_{\mathrm{E}}}. \tag*{(6)}

We implement coherent bulk motion in a source-centred frame. Rather than moving the source through the magnification pattern, we hold the source fixed and translate the local lens model by dbulk(t)=θEωbulkt\mathbf{d}_{\mathrm{bulk}}(t) = \theta_{\mathrm{E}}\boldsymbol{\omega}_{\mathrm{bulk}}t. This translation includes both the microlenses and the smooth lens component. Accounting for the latter adds the uniform term (I−As)dbulk(\mathbf{I}-\mathbf{A}_{s})\mathbf{d}_{\mathrm{bulk}} to the lens mapping. With internal stellar motions switched off, this gives

βt(θ)=β0(θ−dbulk)+dbulk.(7)\boldsymbol{\beta}_{t}(\boldsymbol{\theta}) = \boldsymbol{\beta}_{0}(\boldsymbol{\theta}-\mathbf{d}_{\mathrm{bulk}}) +\mathbf{d}_{\mathrm{bulk}}. \tag*{(7)}

The equivalent source moves through the stationary pattern in the opposite direction, with effective velocity

veff(s)=−DsθEωbulk.(8)\mathbf{v}_{\mathrm{eff}}^{(s)} = -D_{s}\theta_{\mathrm{E}}\boldsymbol{\omega}_{\mathrm{bulk}}. \tag*{(8)}

Substituting equation (6) recovers the standard geometrical projection (Kayser et al. 1986; Mosquera & Kochanek 2011). Writing the line-of-sight unit vector as n^\hat{\mathbf{n}}, the code evaluates vo=[I−n^n^T]vCMB\mathbf{v}_{o} = [\mathbf{I}-\hat{\mathbf{n}}\hat{\mathbf{n}}^{\mathsf{T}}]\mathbf{v}_{\mathrm{CMB}} and resolves it into local xx and yy components. We use the measured Solar-system cosmic microwave background (CMB) dipole velocity ∣vCMB∣=369.82 km s−1|\mathbf{v}_{\mathrm{CMB}}| = 369.82\ \mathrm{km\ s}^{-1} toward Galactic coordinates (l,b)=(264.021∘,48.253∘)(l,b) = (264.021^{\circ},48.253^{\circ}) [91]. Thus the observer contribution has a fixed direction for a given lens rather than a newly drawn random orientation.

For j∈{lens,source}j \in\{\mathrm{lens},\mathrm{source}\}, the Cartesian velocity components indexed by a∈{x,y}a \in\{x,y\} are drawn independently with the same dispersion,

vj,a∼N[0,σpec2(zj)],σpec(z)=σ01+zf(z)f(0).(9)v_{j,a} \sim\mathcal{N}\left[0,\sigma_{\mathrm{pec}}^{2}(z_{j})\right], \qquad \sigma_{\mathrm{pec}}(z) = \frac{\sigma_{0}}{\sqrt{1+z}}\frac{f(z)}{f(0)}. \tag*{(9)}

Here f=dln⁡D+/dln⁡af = d\ln D_{+}/d\ln a is the linear growth rate, with cosmological scale factor aa, evaluated using the approximation of Lightman & Schechter (1990); Lahav et al. (1991) as written in equation (5) of Hamilton [43]. The redshift scaling and normalization σ0=235 km s−1\sigma_{0} = 235\ \mathrm{km\ s}^{-1} follow Kochanek (2004).

Finally, internal stellar motions are not absorbed into veff(s)\mathbf{v}_{\mathrm{eff}}^{(s)}. Each internal tangent-plane velocity component is drawn as

δωk,a∼N(0,σω,⋆2),σω,⋆=σ⋆(1+zl)DlθE.(10)\delta\omega_{k,a} \sim\mathcal{N}\left(0,\sigma_{\omega,\star}^{2}\right), \qquad \sigma_{\omega,\star} = \frac{\sigma_{\star}}{(1+z_{l})D_{l}\theta_{\mathrm{E}}}. \tag*{(10)}

Here σ⋆\sigma_{\star} is the one-dimensional stellar velocity dispersion of the lens. We adopt σ⋆=(170,323,222) km s−1\sigma_{\star} = (170, 323, 222)\ \mathrm{km\ s}^{-1} for Q2237+0305, RX J1131−1231, and HE 0435−1223, respectively (Chen et al. 2019; Tuntsov et al. 2024). The Q2237 value is an isothermal-model-based fiducial [121]. Assuming isotropic stellar velocities, the root-mean-square two-dimensional stellar speed is 2σ⋆\sqrt{2}\sigma_{\star}, but our stellar-kinematics calculation draws an independent vector for every star rather than replacing the evolving pattern by one bulk vector of that magnitude, as is commonly done for static-map light-curve generation (e.g., Neira et al. 2020; Neira et al. 2025). Microlens trajectories are advanced with angular velocity θEδωk\theta_{\mathrm{E}}\delta\boldsymbol{\omega}_{k} and specularly reflected within the circular stellar aperture to maintain a stationary finite population. The aperture’s safety and motion padding place this boundary far from the protected source-reaching region, so the reflected trajectories should have negligible influence on the central calculation. Reflection prevents microlenses from diffusing out of the finite aperture, which would otherwise change the stellar centre of mass and affect the local macro parameters. The coherent bulk displacement is then applied to the entire field. The resulting differential motion changes both the locations and topology of the caustic network and is not, in general, equivalent to translating a source through one static map (Wambsganss & Kundic 1995). The relative importance of this deformation is set in part by the ratio of the root-mean-square internal stellar motion to the coherent effective motion, 2σω,⋆/∣ωbulk∣\sqrt{2}\sigma_{\omega,\star}/|\boldsymbol{\omega}_{\mathrm{bulk}}|. Larger ratios produce stronger changes in the caustic pattern relative to its bulk translation. Across the 12 benchmark macroimages, this ratio has a median of 0.80 and an observed 16th–84th percentile range of 0.65–1.2.

Time-dependent finite-source observables

Let Iν,b(β,t)I_{\nu,b}(\boldsymbol{\beta},t) be the observer-frame specific surface brightness of an arbitrary source in band bb. The point-source magnification at source position β\boldsymbol{\beta} is the sum over all of its micromages,

μi(β,t)=∑q1∣det⁡Ji(θq,t)∣.(11)\mu_{i}(\boldsymbol{\beta},t) = \sum_{q}\frac{1}{\left|\det\mathbf{J}_{i}(\boldsymbol{\theta}_{q},t)\right|}. \tag*{(11)}

where ii identifies the macroimage, qq runs over all micromage solutions β(θq,t)=β\boldsymbol{\beta}(\boldsymbol{\theta}_{q},t) = \boldsymbol{\beta} within that macroimage, and the Jacobian is defined in equation (2). This absolute magnification includes the macro model. Its large-area or ensemble mean approaches ∣μmacro,i∣|\mu_{\mathrm{macro},i}|, but an individual small map need not have this mean.

Gravitational lensing preserves surface brightness (Schneider et al. 1992). At observer time tt, the lensed band flux is

Fν,i,bL(t)=∫Ωβμi(β,t)Iν,b(β,t−Δti) d2β,(12)F_{\nu,i,b}^{L}(t) = \int_{\Omega_{\beta}} \mu_{i}(\boldsymbol{\beta},t)I_{\nu,b}(\boldsymbol{\beta},t-\Delta t_{i})\,d^{2}\beta, \tag*{(12)}

where Ωβ\Omega_{\beta} is the requested source-plane region and Δti\Delta t_{i} is the macroimage delay. Setting μi=1\mu_{i}=1 and Δti=0\Delta t_{i}=0 recovers the unlensed flux at observer time tt. Numerically, we sum over source pixels, combining each magnification map with the requested source images.

The macroimage delays are supplied or calculated from the macro model using the standard Fermat-potential differences (Refsdal 1964; Treu & Marshall 2016). We set the reference image’s delay to zero, with positive delays corresponding to later arrival.

Note that nothing in the preceding section requires a particular source morphology. The simulator needs only a surface-brightness image or image sequence on a known physical and angular scale. The general relativistic quasar, supernova, and generic source interfaces are described in § 5.

Critical curves and caustics

The critical curves at time tt are the image-plane zero set of the lensing Jacobian determinant, and their mapping through the lens equation produces the source-plane caustics:

Cθ(t)={θ:det⁡J(θ,t)=0},Cβ(t)=β[Cθ(t),t].(13)C_{\theta}(t) = \{\boldsymbol{\theta} : \det\mathbf{J}(\boldsymbol{\theta},t)=0\}, \qquad C_{\beta}(t) = \boldsymbol{\beta}[C_{\theta}(t),t]. \tag*{(13)}

Point-source magnification formally diverges on a caustic, whereas the integral in equation (12) remains finite for an extended source. Across a generic fold caustic, a pair of micromages is created or destroyed (Schneider et al. 1992; Vernardos et al. 2024).

Efficient GPU-Accelerated Dynamical Microlensing Simulation

Numerical pipeline

The direct evaluation of equation (1) for NrayN_{\rm ray} image-plane positions and N⋆N_{\star} microlenses requires O(NrayN⋆)O(N_{\rm ray}N_{\star}) pairwise interactions. A conventional IRS calculation incurs this cost over a field large enough to contain most of the rays that can map into the source plane, even though a compact source generally receives flux from only a small and irregular subset of that field. A standard dynamical calculation repeats the operation at every epoch.

In contrast, Microcaustics reduces the costs of many-microlens deflection, noncontributing lens-plane area, finite-cell integration, and repeated dynamical evaluation. Several epochs and independent light curves are processed together on the GPU. For each epoch, we update the stellar positions and construct the local-exact/far-field deflection approximation (§ 3.2). A coarse scout identifies lens-plane cells whose mapped footprints can contribute to the source (§ 3.3). Nearby epochs reuse this cell selection while recalculating the lens mapping with the current stellar positions (§ 3.4). Only the selected region is traced at fine resolution. Within each cell, a biquadratic reconstruction supplies a finer virtual lattice without additional lens-equation evaluations, and IPM distributes the mapped areas among source pixels (§ 3.5). We multiply the resulting magnification maps by the multiband source brightness and sum over pixels to obtain the light curves (§ 3.6). When requested, a separate calculation evaluates the Jacobian in the selected regions, extracts critical curves, maps them into source-plane caustics, and assigns caustic-crossing labels (§ 3.7).

Local-exact/far-field deflection solver

Nearby microlenses can produce rapidly varying deflections, whereas the combined contribution from distant microlenses varies smoothly across a small region. We evaluate nearby stars individually and approximate the distant contribution with a polynomial that can be evaluated cheaply at many ray positions. This near/far separation is an established acceleration strategy. In particular, Zheng et al. (2022) combine direct nearby deflections with local Taylor expansions of the distant contribution.

We partition the stellar field into spatial cells. For a ray at θ\boldsymbol{\theta} in cell cc, we approximate the point-mass deflection as

α⋆(θ)≃∑j∈LcθE,j2rjrj2+Pc,ν(θ),rj≡θ−θj,(14)\boldsymbol{\alpha}_{\star}(\boldsymbol{\theta}) \simeq\sum_{j\in\mathcal{L}_{c}}\theta_{\mathrm{E},j}^{2}\frac{\boldsymbol{r}_{j}}{r_{j}^{2}}+\boldsymbol{\mathcal{P}}_{c,\nu}(\boldsymbol{\theta}), \qquad\boldsymbol{r}_{j}\equiv\boldsymbol{\theta}-\boldsymbol{\theta}_{j}, \tag*{(14)}

where Lc\mathcal{L}_{c} contains nearby microlenses and Fc\mathcal{F}_{c} contains the remaining, distant microlenses. Within each cell, a regular lattice of nodes supplies local polynomial expansions. The index ν(θ)\nu(\boldsymbol{\theta}) selects the node at the centre of the subcell containing the ray, and Pc,ν\mathcal{P}_{c,\nu} gives the corresponding far-field deflection.

Complex notation combines the two deflection components into a single expression. We write z=θx+iθyz=\theta_x+i\theta_y and represent the deflection by αx+iαy\alpha_x+i\alpha_y. A point mass then contributes θE,j2/(zˉ−zˉj)\theta_{\mathrm{E},j}^{2}/(\bar{z}-\bar{z}_j), where the bar denotes complex conjugation. Expanding about a node zc,νz_{c,\nu} uses the geometric series (1+x)−1=∑n=0∞(−x)n(1+x)^{-1}=\sum_{n=0}^{\infty}(-x)^n, with x=(zˉ−zˉc,ν)/(zˉc,ν−zˉj)x=(\bar{z}-\bar{z}_{c,\nu})/(\bar{z}_{c,\nu}-\bar{z}_j) and ∣x∣<1|x|<1. Summing over distant stars and retaining terms through order pp gives the nodal expansion

Pc,ν(zˉ)=∑j∈FcθE,j2zˉc,ν−zˉj∑n=0p[zˉ−zˉc,νzˉc,ν−zˉj]n,(15)\mathcal{P}_{c,\nu}(\bar{z})=\sum_{j\in\mathcal{F}_{c}}\frac{\theta_{\mathrm{E},j}^{2}}{\bar{z}_{c,\nu}-\bar{z}_{j}}\sum_{n=0}^{p}\left[\frac{\bar{z}-\bar{z}_{c,\nu}}{\bar{z}_{c,\nu}-\bar{z}_{j}}\right]^{n}, \tag*{(15)}

where p=4p=4 in the adopted configuration. Its real and imaginary parts give the two physical deflection components, so Pc,ν=(Re⁡Pc,ν,Im⁡Pc,ν)\mathcal{P}_{c,\nu}=(\operatorname{Re}\mathcal{P}_{c,\nu},\operatorname{Im}\mathcal{P}_{c,\nu}). Contributions to each coefficient are combined before tracing the rays. Each ray therefore evaluates a short polynomial rather than summing over every distant microlens.

Calculating these coefficients directly at every node would require repeatedly summing over the same distant stars. Instead, we first sum their contributions into an order-pp expansion about the cell centre. We then shift this expansion to each internal node and retain terms through fourth order. Terms above fourth order contribute to the lower-order coefficients when the expansion centre is shifted, so keeping them during this step improves accuracy. Each ray evaluates only the resulting fourth-order polynomial.

Figure 2 illustrates the adopted configuration. A 16×1616\times16 Cartesian partition covers the circular stellar aperture, with cells outside the aperture containing no microlenses. A microlens enters the exact local sum when its Euclidean distance from the ray-containing cell is smaller than Rexact=χnearmax⁡(Δθx,Δθy)R_{\mathrm{exact}}=\chi_{\mathrm{near}}\max(\Delta\theta_x,\Delta\theta_y), with χnear=1\chi_{\mathrm{near}}=1. Each cell contains an 8×88\times8 nodal lattice. Each ray evaluates the polynomial centred on its selected node using its displacement from that node. These nodes store polynomial coefficients rather than deflection values for interpolation. Fourth order was the lowest tested evaluation order that kept the far-field error small at the adopted accuracy target. Higher orders increased storage and arithmetic without a useful reduction in the final error.

Figure 2. Local-exact/far-field deflection solver diagram for a Q2237+0305 image-B realization. Left: the circular microlens field is partitioned into 16 × 16 spatial cells. Middle: for a ray in one cell, microlenses within the one cell width local neighbourhood are summed exactly, while the remaining microlenses define a smooth far field. Right: fourth-order Taylor expansions about the internal nodes of the 8 × 8 lattice approximate the far-field deflection at each ray position. Grey dashed connectors indicate successive enlargement of the same ray-containing cell across the three panels.

The lensing Jacobian uses the same decomposition. We sum the local point-mass derivatives exactly, differentiate the far-field polynomial analytically, and add the smooth macro-lens contribution in equation (2). This avoids finite differencing and keeps the deflection and Jacobian internally consistent.

The nearby-star selection and far-field coefficients are recalculated at every dynamical epoch. Several epochs are processed together on the GPU, and rays assigned to the same node share its polynomial coefficients. For the temporal benchmark references, we use a more conservative 32×3232\times32 nodal lattice and exact-neighbourhood factor χnear=1.5\chi_{\mathrm{near}}=1.5. § 4.4 tests the far-field approximation against direct point-mass deflections.

Source-directed lens-plane scouting

A compact source generally receives flux from only a sparse and irregular subset of the full image-plane field. Applying IPM or IRS to that entire field is therefore computationally inefficient. We first use a coarse scout to identify lens-plane cells whose mapped footprints intersect the requested source field, then perform the more expensive fine-grid calculation only in the selected region. The adaptive boundary method similarly refines image-plane regions that map near a compact source (Meena et al. 2022). Our scout performs finite-cell selection on the GPU for repeated calculations with an evolving stellar field.

The nominal ray count NrayN_{\rm ray} specifies the corresponding full-field regular grid, with spacings (Δθx,Δθy)(\Delta\theta_x,\Delta\theta_y). The scout uses every kkth fine-grid vertex, so each scout cell contains k×kk\times k fine cells. We trace its corners through the current lens equation and select the cell if the resulting quadrilateral intersects the source field. Testing the quadrilateral rather than only its vertices retains cells whose mapped footprint crosses the source even when every corner lies outside it. Figure 3 illustrates this selection and the subsequent IPM calculation.

Source-directed lens-plane scouting and biquadratic inverse polygon mapping

Figure 3. Source-directed lens-plane scouting and biquadratic inverse polygon mapping for the standard k=2k = 2, r=2r = 2, and v=4v = 4 configuration. Left: the nested scout grid is traced within the circular stellar aperture. A scout cell is selected when its mapped quadrilateral intersects the finite source. Here, the scouting retains only 0.26% of the full-field cells. The inset shows its four fine-grid vertices and their mapped positions. Right: a selected fine cell is evaluated on the (r+1)×(r+1)(r + 1) \times(r + 1) lattice of true ray-traced nodes. A biquadratic reconstruction supplies the virtual v=4v = 4 lattice, after which each virtual subcell is split into two mapped triangles whose areas are distributed according to their analytic overlap with the intersected source pixels, with an example triangle shown in orange.

We search cells intersecting the circular stellar aperture and one neighbouring layer outside it. Within this search region, we also retain one layer of neighbours around every selected cell to guard against contributions missed by the coarse scout. For the adopted k=2k = 2, each scout cell spans 2×22 \times2 fine cells, so each guard layer is two fine cells wide.

At the first epoch, we use the denser k=1k = 1 scout to estimate a normalization correction for the faster k=2k = 2 selection. We add this correction uniformly to subsequent magnification maps before integrating the source brightness. It accounts for an approximately uniform missing contribution, but does not recover unresolved spatial structure. The dense selection is then discarded, and subsequent epochs use the faster scout with temporal reuse.

A fixed rectangular shooting region can exclude cells that contribute to the source flux. The resulting error is primarily a missing-flux bias, but the omitted contribution can change as the stars move and therefore alter the light-curve shape. Our scout instead selects contributing cells from across the full circular stellar aperture, whose size is set by the large-deflection criterion in § 2.2.

Temporal scout reuse

Nearby epochs often receive flux from much the same lens-plane region, even as stellar motion changes the magnification within it. exploit this by reusing the selected cells between scout evaluations while recalculating their lens mapping at every epoch.

We repeat the scout calculation every ten frames. Between successive scout evaluations, we retain every cell selected at either endpoint to accommodate motion of the contributing region. The selection at the end of one interval also serves as the starting selection for the next. Only the cell selection is reused. The lens mapping, magnification, and Jacobian are recalculated at every frame using the current stellar positions. Several epochs are processed together on the GPU, each with its own stellar field.

For the benchmark’s 25-day map cadence, the scout evaluations are separated by 250 days. A cell that contributes only between the endpoints can still be missed, so the refresh interval must remain short enough to capture changes in the contributing region. The end-to-end benchmarks in § 4.2 validate the light-curve accuracy and caustic-crossing recovery with the adopted ten-frame scout interval.

Biquadratic inverse polygon mapping

IPM distributes the mapped area of each finite lens-plane cell among the source-plane pixels it intersects, rather than depositing its entire contribution at a single ray position (Mediavilla et al. 2006, 2011). This area-mapping principle is also used in recent FMM–IPM implementations (Jiménez-Vicente & Mediavilla 2022; Weisenbach 2025a). Our implementation reconstructs curvature in the lens mapping from a small grid of traced rays. We then subdivide this reconstructed mapping more finely without additional lens-equation evaluations and calculate the contributions to source pixels together on the GPU.

Classical IPM traces the corners of a lens-plane cell and represents its mapped area with straight triangles. This approximation can miss curvature near critical curves. Within each fine cell retained by the scout, we instead evaluate the lens equation on an (r+1)×(r+1)(r+1) \times(r+1) grid, including its four already available corners. Our adopted r=2r=2 supplies a 3×33 \times3 grid of nine traced nodes. We describe positions within the cell by normalized coordinates (ξ,ζ)(\xi,\zeta), each running from zero to one. The nodes lie at 0, 1/2, and 1 along each axis. To reconstruct the mapping between them, we fit a tensor-product quadratic Lagrange interpolant,

β~(ξ,ζ)=∑a=02∑b=02La(ξ)Lb(ζ)βab,0≤ξ,ζ≤1,(16)\tilde{\boldsymbol{\beta}}(\xi,\zeta)=\sum_{a=0}^{2}\sum_{b=0}^{2}L_a(\xi)L_b(\zeta)\boldsymbol{\beta}_{ab}, \qquad0\leq\xi,\zeta\leq1, \tag*{(16)}

where βab\boldsymbol{\beta}_{ab} are the traced source-plane coordinates and LaL_a are the one-dimensional quadratic Lagrange basis functions for these three node positions. The interpolant reproduces all nine traced values. It reconstructs the lens mapping, not the magnification, which is calculated from the mapped areas.

We evaluate the reconstructed mapping on a finer (ν+1)×(ν+1)(\nu+1)\times(\nu+1) virtual grid, with ν=4\nu=4 in the adopted configuration. These virtual vertices require no additional lens-equation evaluations. Each virtual lens-plane subcell is split into two triangles, whose vertices are mapped through the interpolant. Each triangle’s lens-plane area is then distributed among source pixels in proportion to their overlap with its mapped triangle. The triangle–pixel overlap areas are calculated analytically. The resulting straight-sided triangles approximate the curved mapping without the more complicated calculation of intersections between curved cell boundaries and source pixels.

The parameters rr and ν\nu therefore control different parts of the approximation. Increasing rr samples the physical lens equation at more positions and raises the interpolant’s order. For example, changing rr from 2 to 4 replaces the nine-node biquadratic reconstruction with a 25-node biquartic reconstruction. Increasing ν\nu instead subdivides the same reconstructed mapping more finely. At r=2r=2, changing ν\nu from 2 to 4 retains the nine traced nodes but increases the virtual grid from 3×33\times3 to 5×55\times5. Our adopted configuration uses r=2r=2 and ν=4\nu=4.

Fig. 3 illustrates this calculation. A fused Triton kernel performs the virtual interpolation, triangle–pixel clipping, and accumulation together, avoiding the large intermediate arrays required by the corresponding PyTorch calculation (Tillet et al. 2019). This accumulation of mapped areas into source pixels is the rasterization step. The same integrator can be applied to the full stellar aperture, a fixed rectangular region, or the scouted cells. Comparing these variants isolates the effects of spatial selection while holding the integration method fixed. § 4.3 tests convergence with ray count, including the adopted 10710^7-ray, r=2r=2, ν=4\nu=4 configuration, against the high-resolution 10910^9-ray, r=2r=2, ν=8\nu=8 reference.

From magnification maps to light curves

IPM divides the image-plane area deposited in each source pixel by that pixel’s area to obtain its magnification. We multiply the resulting map by the source brightness and sum over pixels to calculate the flux using equation (12). Several epochs and source bands are processed together on the GPU, with each epoch retaining its own magnification map and time-dependent source brightness. We can also process several independent light curves together, each with its own stellar field and source history. Only the final products are transferred to the CPU.

Critical curves, caustics, and binary caustic labels

We identify when a caustic passes across the source centre and measure the distance to the nearest caustic. Rather than tracing the entire caustic network, we construct only the caustics that can affect the requested source field. We then count intersections with these caustics to assign a binary label, using several reference points to make the classification reliable and consistent between frames.

The critical-curve calculation evaluates det⁡J(θ,t)\det\mathbf{J}(\boldsymbol{\theta},t), with J\mathbf{J} defined in equation (2), using analytic derivatives of the local-exact/far-field deflection. We first search a coarse grid for cells with a determinant sign change or unusually small ∣det⁡J∣\lvert\det\mathbf{J}\rvert. We add two neighbouring layers of coarse cells around these candidates, then evaluate the determinant at high resolution only in the selected regions. A complementary coarse scout searches the remainder of the stellar aperture for critical cells whose mapped footprints approach the source. Together, these searches retain relevant critical structure both near the nominal macroimage footprint and elsewhere in the stellar field.

The adopted determinant grid is 8192×81928192\times8192, with a 512×512512\times512 discovery grid, corresponding to a factor of 16 along each axis. The benchmark reference uses 16384×1638416384\times16384. Rectangular controls retain the same physical pixel spacing as the 8192×81928192\times8192 full-field grid, with their grid dimensions adjusted to the rectangular footprint.

A batched Triton marching-squares calculation locates the zero-determinant contours as image-plane line segments. Ambiguous saddle configurations are resolved using the bilinear asymptotic decider (Nielson & Hamann 1991). We trace the segment endpoints to obtain the source-plane caustics Cβ(t)\mathcal{C}_{\beta}(t) defined in equation (13). Open or incomplete components at the computational boundary are flagged for the subsequent label calculation.

For a source-plane point away from a caustic, we define its binary class relative to a reference point, or anchor, a\mathbf{a}:

χc(β,t)=Ncross(a→β;Cβ(t)) mod 2,(17)\chi_{\mathrm{c}}(\boldsymbol{\beta},t)=N_{\mathrm{cross}}(\mathbf{a}\to\boldsymbol{\beta};C_{\boldsymbol{\beta}}(t))\ \mathrm{mod}\ 2, \tag*{(17)}

where NcrossN_{\mathrm{cross}} counts transverse intersections between the straight reference segment and the caustics. Even and odd crossing counts give opposite labels, so adjacent caustic regions have different classes. Applying this calculation across the source plane produces the binary caustic map illustrated in Figure 4. The labels zero and one have no absolute physical meaning, and their convention must be aligned between frames before changes can be interpreted as crossings.

Figure 4. Anchor–gauge binary caustic labels for one dynamical frame. Caustics divide the source plane into alternating binary regions. Anchors near the source-field boundary establish a common binary convention within each frame. Gauges keep that convention consistent between frames, with greater weight given to points farther from caustics. The two sets of reference points are spatially offset to avoid coincident paths and boundary degeneracies. Lines to the source centre illustrate the crossing count for one source position. The binary field uses the native 1024 × 1024 source grid.

A single reference segment can give an unreliable count if it passes close to a caustic vertex, is nearly tangent to a caustic, or encounters an incomplete or under-resolved segment. We therefore use nine anchors surrounding the source. Crossing counts between the anchors first place their classifications in a common binary convention. Each anchor then supplies a classification for the source position, and the majority determines its label. The different directions reduce sensitivity to a problem affecting one path.

We reject an anchor vote when its reference segment intersects a flagged incomplete component. The remaining anchors can still determine the class without requiring every caustic component to be fully contained in the computational field. Nine valid votes cannot tie. If rejected votes leave an exact tie, we assign class zero by a fixed convention and report the vote and validity counts so that the ambiguity remains identifiable.

To align the zero and one labels between successive frames, we use a second set of nine fixed reference points, called gauges. Their votes select the convention that best preserves the preceding frame’s labels. A gauge close to a caustic is unreliable because a small displacement of the discretized curve can change which side contains the point. We therefore prefer gauges farther from caustics in both frames and weight their votes by their distance to the nearest caustic. Using several gauges reduces the influence of any one point near a caustic or an incomplete segment. The anchors and gauges are placed near the perimeter of the source field, with small positional offsets to break symmetry, and remain fixed throughout the simulation, as illustrated in Figure 4.

The binary class records only whether the reference path crosses an even or odd number of caustics. By comparison, a winding number counts how many times an oriented caustic curve wraps around a source position, including the direction of wrapping. The complete-field method of Weisenbach (2025b) traces the full critical-curve network and maps it to oriented caustics for this calculation. Our public code also supports complete winding maps, but the principal benchmarks use the less expensive source-centred binary labels.

Once the convention is aligned, we return the binary label, crossing history, and Euclidean distance to the nearest retained caustic segment. These quantities can be evaluated at any source-plane point, although the principal benchmark uses only the source centre. Two caustic crossings between successive epochs leave the binary label unchanged and would therefore be missed. This motivates a sufficiently short sampling interval. At the adopted 25-day cadence, our validation recovers all reference crossings (§ 4.2). A source-centre crossing is a geometric event marker, whereas the extended source’s photometric response can begin earlier and depends on its full brightness profile.

Validation and Performance Benchmarks

Benchmark sample, methods, and timing procedure

For each macroimage, we compare methods using the same physical configuration and stellar realization on the same RTX 5070 Ti GPU. Table 1 gives the lens, source, and field parameters. The 12 macroimages include both parities and contain 1,056–16,840 microlenses. They span a broad range in local convergence, shear, smooth-matter fraction, and number of cells contributing to the source. These systems provide a compact set of contrasting stellar fields with published lens and accretion-disc constraints. We adopt reasonable fiducial values where constraints are weak, since our purpose is to demonstrate numerical accuracy and runtime rather than model these systems individually.

SystemImage(zl,zs)(z_l,z_s)κ\kappaγ\gammaϕγ\phi_\gamma [deg]ssN⋆N_\starLlensL_{\mathrm{lens}} [μ\muas (θE\theta_E)]LsourceL_{\mathrm{source}} [μ\muas (θE\theta_E)]
Q2237+0305A(0.0395, 1.70)0.3960.3961750.004263793 (208)9.38 (2.46)
B0.3910.3911420.003805754 (197)
C0.7150.71569.10.003549539 (141)
D0.6040.60462.50.009568962 (252)
RX J1131−1231A(0.295, 0.658)0.5260.41073.20.57116840638 (546)4.60 (3.94)
B0.4590.4121060.5663352303 (259)
C0.4870.30639.50.5861394194 (166)
D0.8940.80776.00.4191056105 (90.2)
HE 0435−1223A(0.455, 1.69)0.4730.35863.80.6531214195 (172)2.89 (2.54)
B0.6300.5401650.6392208224 (197)
C0.4940.32788.70.6661104186 (164)
D0.6860.5751680.6201274159 (140)

Table 1. Benchmark lens and field parameters

Benchmark values are medians across the 12 macroimages, with superscript and subscript offsets reaching the observed 84th and 16th percentiles, respectively. These offsets describe case-to-case spread, not confidence intervals on the median. The four images within each lens system are related, and the benchmark is not a population sample.

Throughout the comparisons, NrayN_{\mathrm{ray}} denotes the number of launched rays for IRS and the nominal number of image-plane grid samples for IPM. Our adopted source-scouted biquadratic IPM configuration uses Nray=107N_{\mathrm{ray}}=10^{7}, k=2k=2, r=2r=2, and ν=4\nu=4. It reaches approximately the map accuracy of the calculation of Weisenbach (2025a) at its fiducial setting of one ray per output source pixel along the yy direction and a 1 per cent light-loss tolerance. This setting is not directly equivalent to our nominal ray count, so we compare the measured accuracy rather than assign an equivalent ray budget.

Our internal IRS controls launch rays on a regular Cartesian lattice and use the same lens fields, deflection solver, nominal ray counts, and batching settings as the corresponding IPM controls. The internal rectangular controls and GPU-D share a shear-aligned 1 per cent light-loss window expanded by 10 per cent along each axis, while retaining the complete circular microlens field. GPU-D uses pseudo-random IRS with the same nominal 10710^{7}-ray budget. The calculation Note: Blank redshift and source-field entries repeat the values from the first macroimage of each system. Here ss is the smooth-matter fraction and ϕγ\phi_\gamma is the local shear position angle, modulo 180∘180^\circ and measured counterclockwise from the positive horizontal coordinate. We use the tangential approximation derived from the published macroimage and lens-centre astrometry, rather than treating ϕγ\phi_\gamma as an independently measured model parameter. The Q2237 macro parameters are from Tuntsov et al. (2024). RX J1131 and HE 0435 use Chen et al. (2019), with s=1−κ⋆/κs=1-\kappa_\star/\kappa. Their astrometry is from Wertz & Surdej (2014), Witt & Mao (2015), and Fadely & Keeton (2012), respectively. The system-level source tuples (log⁡10(MBH/M⊙),a,i,λEdd,ϵ)(\log_{10}(M_{\mathrm{BH}}/M_\odot),a,i,\lambda_{\mathrm{Edd}},\epsilon) are (9.08,0.74,10∘,0.34,20)(9.08,0.74,10^\circ,0.34,20) for Q2237, (8.30,0.87,17∘,0.07,10)(8.30,0.87,17^\circ,0.07,10) for RX J1131, and (8.36,0.70,30∘,0.19,20)(8.36,0.70,30^\circ,0.19,20) for HE 0435. For Q2237, the black-hole mass and spin follow Reynolds et al. (2014), i=10∘i=10^\circ is a fiducial consistent with their upper limit, λEdd=0.34\lambda_{\mathrm{Edd}}=0.34 is a fiducial motivated by Berdina et al. (2021), who assumed a lower black-hole mass, and ϵ=20\epsilon=20 is a typical value. For RX J1131, the mass, spin, and inclination follow Reis et al. (2014), while λEdd=0.07\lambda_{\mathrm{Edd}}=0.07 is an adopted fiducial and ϵ=10\epsilon=10 is a typical value. For HE 0435, the mass follows Melo et al. (2023), while a=0.70a=0.70, i=30∘i=30^\circ, λEdd=0.19\lambda_{\mathrm{Edd}}=0.19 are adopted fiducials, and ϵ=20\epsilon=20 is a typical value. We set the shared fiducial source-plane disc position angle to ϕdisc=0∘\phi_{\mathrm{disc}}=0^\circ. This is not an observational constraint or the shear direction. Also, Hlamp/Rg=ϵ+RISCO/RgH_{\mathrm{lamp}}/R_g=\epsilon+R_{\mathrm{ISCO}}/R_g. Shared source settings are β=0.75\beta=0.75, fcol=1f_{\mathrm{col}}=1, and flamp=0.10f_{\mathrm{lamp}}=0.10. The Einstein-radius conversion adopts the benchmark mean microlens mass ⟨M⋆⟩=0.3 M⊙\langle M_\star\rangle=0.3\,M_\odot with Mmax⁡/Mmin⁡=100M_{\max}/M_{\min}=100 and Salpeter slope α=2.35\alpha=2.35. Every macroimage uses 147 frames at 25-day intervals. Here flampf_{\mathrm{lamp}} denotes the lamp-post luminosity in Eddington units.

of Weisenbach (2025a) uses its native shooting window at the same nominal light-loss tolerance.

We report root-mean-square errors (RMSEs) for light curves and maps, with fractional map RMSE defined in equation (20). The dynamical map and light-curve benchmarks use a reference with 10810^8 nominal rays per epoch, r=2r=2, and v=8v=8 at all 147 epochs. The snapshot maps in Figure 5 and convergence tests in Figure 7 use a 10910^9-ray reference with the same refinement settings. The internal candidate and reference maps share the same 102421024^2 source grid and physical pixel boundaries.

Figure 5. Comparison of the high-quality reference, the fast source-scouted IPM calculation, full-field and rectangular IPM controls, and Weisenbach IPM for Q2237+0305 image B. Columns show the magnification map and signed residual, uu-band source-convolved map and residual, and six-band light curve with its residuals below. Map residuals use Δm=−2.5log⁡10(μ/μref)\Delta m=-2.5\log_{10}(\mu/\mu_{\mathrm{ref}}) on signed linear millimagnitude scales shared within each column. All maps are evaluated on the same shear-aligned source-plane square. The map reference uses 10910^{9} rays, while the full light-curve reference uses 10810^{8} rays per epoch, both with r=2r=2 and v=8v=8. All internal IPM calculations use Nray=107N_{\mathrm{ray}}=10^{7}, r=2r=2, and v=4v=4, with k=2k=2 for the source-scouted calculation.

Figure 7. Ray-count convergence and computational cost. Candidate selective biquadratic IPM calculations hold k=2k = 2, r=2r = 2, and v=4v = 4 fixed and use Nray={1,2.5,5,10,20,50,100}N_{\rm ray} = \{1, 2.5, 5, 10, 20, 50, 100\} million. The left panels show raw and source-convolved fractional map RMSE against the matched 10910^9-ray, true-r=2r = 2, v=8v = 8 reference, with Q2237+0305 image B highlighted. Both IPM and matched IRS using the same local-exact/far-field deflection solver are evaluated for all 12 macroimages. The other 11 trajectories are shown faintly in the corresponding method colour. The right panel reports the runtime measured after compilation and warm-up for a 147-frame light curve using fixed local-exact/far-field solver settings. The temporal batch size is optimized for each method, macroimage, and ray count, with one timing per point. The runtime power law is fit empirically over 5×106≤Nray≤5×1075 \times10^6 \leq N_{\rm ray} \leq5 \times10^7 near the 10710^7-ray operating point. The 10610^6 and 2.5×1062.5 \times10^6 points are displayed but excluded because fixed launch overhead matters more at low ray counts. The displayed 10810^8 point is excluded because it enters a different GPU memory and chunking regime. Every annotated method slope summarizes 12 independent macroimage fits.

Timings exclude compilation and autotuning. The light-curve time tLCt_{\mathrm{LC}} includes magnification-map calculation and integration of the source brightness over all 147 epochs. The time tLC+labelst_{\mathrm{LC+labels}} also includes determinant evaluation, caustic construction, and source-centre labels. Internal IPM calculations process cells in groups of 524,288.

Weisenbach (2025a) calculates one map at a time. We measure their light-curve runtime and accuracy over all epochs, and compare their maps with references evaluated on the same complete, shear-aligned native grid. For this method and the direct-deflection controls, we measure the caustic-stage cost at the first epoch and scale it to the full sequence. Our labelled calculation returns source-centre labels, whereas the timing for Weisenbach (2025b) includes construction of the complete critical-curve and caustic network.

GPU-D timings include initialization, memory allocation, transfer of the microlens data to the GPU, ray shooting, and accumulation into source-plane pixels. GPU-D does not calculate caustics or labels.

Accuracy, runtime, and example map residuals

Figure 5 shows magnification maps, finite-source light curves, and residuals for the principal IPM methods before we summarize the full 12-macroimage comparison. The source-scouted and full-field light curves closely follow the reference in all six bands, with residuals on the sub-millimagnitude scale in this example.

In Figure 6 and Table 2, “full” and “rectangle” denote sampling over the full lens-plane field and the restricted rectangular shooting region, respectively. IRS deposits individual rays, whereas IPM distributes mapped cell areas among source pixels. “IPM scout” selects source-reaching cells independently at each epoch. “IPM scout batched” evaluates these independent frames in temporal batches without reusing selected cells or sharing normalization corrections. “IPM scout fast” additionally reuses selected cells between scout refreshes and applies a fixed normalization correction measured at frame zero.

Figure 6. Accuracy and runtime across 3 systems and 12 macroimages for complete 147-frame light curves and magnification maps. The left panels use light-curve-only runtime and the right panels include caustics and source-centre labels, following the timing definitions in § 4.1. The reference uses 10810^{8} nominal rays per epoch, r=2r = 2, and v=8v = 8. GPU-D appears only in the left panels because it provides no labels. Full-field and rectangular controls use the same nominal 10710^{7} samples. The rectangle samples its smaller footprint more densely and can have lower fractional map RMSE, while omitted contributions outside it increase light-curve RMSE. Rectangular determinant grids retain the full-field physical pixel spacing without oversampling.

MethodBatch (LC/labels)tLCt_{\mathrm{LC}} [s]tLC+labelst_{\mathrm{LC+labels}} [s]LC RMSE [mmag]Frac. map RMSEMap RMSE [mmag]
Weisenbach IPM1510−160+280510^{+280}_{-160}2100−1200+43002100^{+4300}_{-1200}6.3−1.5+6.76.3^{+6.7}_{-1.5}9.2−2.5+8.6×10−39.2^{+8.6}_{-2.5} \times10^{-3}10−2.7+9.410^{+9.4}_{-2.7}
IPM scout fast49/300.73−0.19+0.350.73^{+0.35}_{-0.19}0.97−0.23+0.400.97^{+0.40}_{-0.23}0.35−0.16+0.870.35^{+0.87}_{-0.16}7.2−3.8+4.7×10−37.2^{+4.7}_{-3.8} \times10^{-3}8.0−4.2+4.08.0^{+4.0}_{-4.2}
IPM scout fast (multi-curve)49/300.68−0.20+0.300.68^{+0.30}_{-0.20}0.88−0.20+0.340.88^{+0.34}_{-0.20}0.35−0.16+0.870.35^{+0.87}_{-0.16}7.2−3.8+4.7×10−37.2^{+4.7}_{-3.8} \times10^{-3}8.0−4.2+4.08.0^{+4.0}_{-4.2}
IPM scout batched492.2−0.17+0.392.2^{+0.39}_{-0.17}3.0−0.32+0.833.0^{+0.83}_{-0.32}1.8−0.79+1.41.8^{+1.4}_{-0.79}8.2−4.8+4.8×10−38.2^{+4.8}_{-4.8} \times10^{-3}8.1−4.2+4.08.1^{+4.0}_{-4.2}
IPM scout14.7−0.03+1.14.7^{+1.1}_{-0.03}5.6−0.24+1.25.6^{+1.2}_{-0.24}1.8−0.79+1.41.8^{+1.4}_{-0.79}8.2−4.8+4.8×10−38.2^{+4.8}_{-4.8} \times10^{-3}8.1−4.2+4.08.1^{+4.0}_{-4.2}
IPM full batched1014−2.1+2.814^{+2.8}_{-2.1}28−5.4+9.028^{+9.0}_{-5.4}0.35−0.22+1.10.35^{+1.1}_{-0.22}6.6−3.9+3.2×10−36.6^{+3.2}_{-3.9} \times10^{-3}7.4−3.9+3.17.4^{+3.1}_{-3.9}
IPM full116−2.7+0.6616^{+0.66}_{-2.7}30−4.8+6.530^{+6.5}_{-4.8}0.35−0.22+1.10.35^{+1.1}_{-0.22}6.6−3.9+3.2×10−36.6^{+3.2}_{-3.9} \times10^{-3}7.4−3.9+3.17.4^{+3.1}_{-3.9}
IPM rectangle batched49/308.7−1.4+1.88.7^{+1.8}_{-1.4}14−1.3+4.014^{+4.0}_{-1.3}0.79−0.98+0.790.79^{+0.79}_{-0.98}4.6−1.5+1.2×10−34.6^{+1.2}_{-1.5} \times10^{-3}5.4−1.6+1.25.4^{+1.2}_{-1.6}
IPM rectangle112−2.1+1.512^{+1.5}_{-2.1}16−1.3+2.416^{+2.4}_{-1.3}0.79−0.98+0.790.79^{+0.79}_{-0.98}4.6−1.5+1.2×10−34.6^{+1.2}_{-1.5} \times10^{-3}5.4−1.6+1.25.4^{+1.2}_{-1.6}
IPM no far-field approx.11600−920+17001600^{+1700}_{-920}5800−3100+62005800^{+6200}_{-3100}0.22−0.14+0.230.22^{+0.23}_{-0.14}7.1−4.5+2.6×10−37.1^{+2.6}_{-4.5} \times10^{-3}8.1−4.7+2.48.1^{+2.4}_{-4.7}
GPU-D IRS178−1.2+1278^{+12}_{-1.2}—33−7.2+2033^{+20}_{-7.2}1.0−1.5+1.0×1001.0^{+1.0}_{-1.5} \times10^{0}2500−680+8002500^{+800}_{-680}
IRS full batched49/103.3−0.63+0.543.3^{+0.54}_{-0.63}17−3.9+6.617^{+6.6}_{-3.9}44−8.0+3444^{+34}_{-8.0}1.1−0.13+0.36×1011.1^{+0.36}_{-0.13} \times10^{1}4600−330+7204600^{+720}_{-330}
IRS full18.2−1.2+4.78.2^{+4.7}_{-1.2}26−6.0+3.826^{+3.8}_{-6.0}44−8.0+3444^{+34}_{-8.0}1.1−0.13+0.36×1011.1^{+0.36}_{-0.13} \times10^{1}4600−330+7204600^{+720}_{-330}
IRS rectangle batched49/301.2−0.29+0.401.2^{+0.40}_{-0.29}2.4−0.26+2.12.4^{+2.1}_{-0.26}16−4.3+7.816^{+7.8}_{-4.3}5.2−1.7+1.3×1005.2^{+1.3}_{-1.7} \times10^{0}2900−830+4902900^{+490}_{-830}
IRS rectangle14.9−0.34+1.94.9^{+1.9}_{-0.34}10−2.1+2.910^{+2.9}_{-2.1}16−4.3+7.816^{+7.8}_{-4.3}5.2−1.7+1.3×1005.2^{+1.3}_{-1.7} \times10^{0}2900−830+4902900^{+490}_{-830}
IRS no far-field approx.1460−260+420460^{+420}_{-260}4600−2500+49004600^{+4900}_{-2500}25−16+5325^{+53}_{-16}1.2−0.21+0.34×1011.2^{+0.34}_{-0.21} \times10^{1}4600−320+7104600^{+710}_{-320}

Table 2. Light-curve and magnification-map benchmark.

At the adopted ray count, IRS sparsely samples the small source field, giving much larger raw-pixel errors than finite-source light-curve errors. The independent GPU-D ray-count test below checks their decrease with increasing ray count against the expected counting-noise scaling.

Figure 6 and Table 2 summarize the accuracy–runtime trade-off across all 12 macroimages. The source-scouted method approaches the full-field IPM accuracy at a fraction of its cost, both for light curves alone and when caustics and labels are included. For the adopted fast simulator configuration, the median 147-frame light-curve runtime is 0.73−0.19+0.35 s0.73^{+0.35}_{-0.19}\,\mathrm{s}. Including determinant evaluation, caustic construction, and source-centre labels increases the median runtime to 0.97−0.23+0.40 s0.97^{+0.40}_{-0.23}\,\mathrm{s}. Relative to the all-frame reference, the corresponding median light-curve RMSE is 0.35−0.16+0.87 mmag0.35^{+0.87}_{-0.16}\,\mathrm{mmag} and the raw fractional map RMSE is 7.2−3.8+4.7×10−37.2^{+4.7}_{-3.8}\times10^{-3}. Across all 12 macroimages, the adopted labels recover all 41 reference source-centred caustic crossings, and every gauge signature agrees with the reference. The batched full-field IPM control has comparable median light-curve accuracy (0.35 mmag0.35\,\mathrm{mmag}) and slightly lower fractional map RMSE (6.6×10−36.6\times10^{-3}) but requires 14 s for the light curve, illustrating that cell selection and temporal reuse, rather than a different flux observable, drive the practical speed.

Large simulation sets can also batch independent stellar realizations. To isolate the scheduling gain, we ran up to three separate calculations concurrently with the same seeded inputs as the single-curve control, without sharing maps or fluxes. The memory-heaviest RX J1131−1231 images use one or two curves. The amortized median runtimes are 0.68−0.20+0.300.68^{+0.30}_{-0.20} s per curve without labels and 0.88−0.20+0.340.88^{+0.34}_{-0.20} s with labels, giving median throughput gains of 1.11−0.041+0.0141.11^{+0.014}_{-0.041} and 1.12−0.052+0.0641.12^{+0.064}_{-0.052} times, respectively. These are throughput measurements rather than single-curve latencies. Larger GPUs can evaluate more independent curves concurrently and should increase this advantage.

The calculation of Weisenbach (2025a) takes a median 510−160+280510^{+280}_{-160} s for the complete light curve, with a median light-curve RMSE of 6.7−1.5+6.76.7^{+6.7}_{-1.5} mmag and fractional map RMSE of 9.2−2.5+8.6×10−39.2^{+8.6}_{-2.5}\times10^{-3}. Including the extrapolated cost of caustic construction (Weisenbach (2025b)), we expect the complete calculation to take 2.1−1.2+4.3×1032.1^{+4.3}_{-1.2}\times10^{3} s.

With labels included and independent light curves processed together, our method achieves a median throughput advantage of 2.5−1.8+2.8×1032.5^{+2.8}_{-1.8}\times10^{3} over this combined calculation. We calculate the runtime ratio for each macroimage before taking the median, rather than dividing the median runtimes.

For comparison with direct pseudorandom-ray shooting, we also ran the published GPU-D code (Thompson et al. 2010; Bate et al. 2010; Vernardos & Fluke 2014). Its rays were launched from the adopted 1 per cent light-loss rectangle while retaining the complete circular microlens field. At 10710^{7} rays, the median complete process time across the 12 macroimages was 78−1.2+1278^{+12}_{-1.2} s for 147 independently calculated maps. We then measured frame zero for every macroimage at Nray={107,3×107,108,109}N_{\mathrm{ray}}=\{10^{7},3\times10^{7},10^{8},10^{9}\}. Free fits to the two lowest ray counts give a median slope of −0.496−0.002+0.001-0.496^{+0.001}_{-0.002}. We therefore adopt the theoretical counting-noise relation separately for every macroimage,

ϵGPU−D,i=Ai(Nray109)−1/2,(18)\epsilon_{\mathrm{GPU-D},i}=A_i\left(\frac{N_{\mathrm{ray}}}{10^{9}}\right)^{-1/2}, \tag*{(18)}

where AiA_i is normalized with the 10710^{7} and 3×1073\times10^{7} ray measurements for macroimage ii. The complete GPU-D process time per map is well described over the 10710^{7}–3×1083\times10^{8} interval by

tGPU−D,i=ai+biNray,(19)t_{\mathrm{GPU-D},i}=a_i+b_iN_{\mathrm{ray}}, \tag*{(19)}

where aia_i and bib_i are the fitted process-time intercept and cost per ray for macroimage ii. The median measured coefficient is bi=1.7×10−8b_i=1.7\times10^{-8} s per ray. Matching each macroimage’s map RMSE with the IPM raw fractional map RMSE requires a median 3.5−2.4+4.0×10123.5^{+4.0}_{-2.4}\times10^{12} rays. Equations (18)

Note. The reference and timing definitions are given in § 4.1. Batch is the number of temporal frames evaluated jointly for light curves alone and with labels. A single value applies to both products. The fast path uses batches 49 and 30, respectively, because their throughput optima differ. For the multi-curve row, runtime is the total elapsed time divided by the number of curves, not the time required to calculate one curve alone. This row is omitted from Figure 6. Light-curve RMSE covers the complete light curve. Fractional map RMSE uses pixelwise fractional magnification residuals. Magnitude-map RMSE uses −2.5log⁡10(μ/μref)-2.5\log_{10}(\mu/\mu_{\mathrm{ref}}) only where both maps have positive magnification, excluding empty IRS pixels.

and (19) predict a median 100−63+100100^{+100}_{-63} days for 147 maps. Pairing each extrapolated time with the corresponding fast-IPM throughput gives a median speed ratio of 1.4−1.1+2.2×1071.4^{+2.2}_{-1.1} \times10^{7}.

The measured errors follow the N−1/2N^{-1/2} relation through 10910^{9} rays, where all 12 cases remain within 0.7 per cent of the prediction normalized at the two lowest ray counts. No finite-support floor is resolved over this range. The matched-accuracy estimate extrapolates this counting-noise relation far beyond the measured ray counts and assumes that missing rays outside the fixed shooting window do not limit the accuracy. It is therefore an idealized comparison favourable to GPU-D, not a demonstration that the fixed window reaches the fast-IPM accuracy. For context, the median extrapolated runtime is 16−10+1716^{+17}_{-10} GPU-hours per map.

Across independent timing repeats, individual median light-curve runtimes range from 0.50 s for HE 0435−1223 A to 1.8 s for RX J1131−1231 A. Including caustics and labels, they range from 0.73 s to 2.1 s for the same two macroimages. Runtimes vary with the lens parameters, number of stars, aperture size, and number and distribution of cells contributing to the source. The sample is too small to infer a separate scaling with parity or stellar density.

Synchronized timings of individual stages in the same benchmark calculations across the 12 macroimages show where the calculation spends its time. For the light-curve-only workload, the median fractions are 13 per cent for the local-exact/far-field calculation, 15 per cent for source scouting and correction, 68 per cent for shared ray tracing, interpolation, and IPM rasterization, and 2.2 per cent for source evaluation and flux integration. Scheduling accounts for less than 1 per cent. For the separately optimized labelled workload, which uses a total temporal batch of 30, the corresponding medians are 12 per cent, 11 per cent, 51 per cent, and 1.8 per cent. Caustic construction contributes 16 per cent, while source-centre labelling and other computational overhead contribute 7.2 per cent. These are medians of per-macroimage fractions and need not sum exactly to 100 per cent.

Ray-count convergence of the magnification map

We measure the pixelwise fractional map RMSE as

ϵμ=⟨(μN−μrefμref)2⟩1/2,(20)\epsilon_\mu= \left\langle\left(\frac{\mu_N-\mu_{\mathrm{ref}}}{\mu_{\mathrm{ref}}}\right)^2 \right\rangle^{1/2}, \tag*{(20)}

where the average is over the compared source-plane pixels. At fixed map geometry, μN\mu_N is the map calculated with NrayN_{\mathrm{ray}} rays and μref\mu_{\mathrm{ref}} is the reference map on the same source-plane grid. This statistic tests relative magnification accuracy across both demagnified and magnified regions. Because each residual is divided by its reference-pixel value, it gives low-magnification pixels greater leverage than a globally normalized L2L_2 error. We write the ray-count dependence as ϵμ∝Nrayp\epsilon_\mu\propto N_{\mathrm{ray}}^p.

Independent random-ray deposition has the familiar Poisson scaling p=−1/2p=-1/2. Regular-lattice IRS can approach p=−3/4p=-3/4 when source-pixel boundary cells dominate ((Kayser et al. 1986; Mediavilla et al. 2011)), with a measured relative-error slope of −0.79±0.01-0.79\pm0.01 in Mediavilla et al. (2006). Zheng et al. (2022) reported an intermediate slope near −2/3-2/3. These exponents are expressed in rays per source pixel, which is proportional to the total ray count for the fixed field of view and output grid used below.

IRS assigns the full weight of an image-plane cell to its centre ray, whereas IPM transforms the cell boundary and apportions its mapped area among all intersected source pixels. The practical piecewise-affine IPM error is therefore a deterministic finite-cell or linearization error whose scaling depends on the magnification gradients, cell-to-pixel size, critical-curve curvature, and critical-cell treatment ((Mediavilla et al. 2011)). Our biquadratic reconstruction is integrated using straight-sided subtriangles.

A Taylor argument for affine IPM gives an idealized Nray−1N_{\mathrm{ray}}^{-1} convergence rate in smooth regions. Let hh denote the image-plane cell spacing. At fixed field of view, the number of traced lattice vertices scales as Nray∝h−2N_{\mathrm{ray}}\propto h^{-2}. Away from point-mass poles, the lens mapping can be expanded locally as

β(θ+δθ)=β(θ)+J(θ) δθ+12H(θ)[δθ,δθ]+O(h3).(21)\boldsymbol{\beta}(\boldsymbol{\theta}+\delta\boldsymbol{\theta})=\boldsymbol{\beta}(\boldsymbol{\theta})+\mathbf{J}(\boldsymbol{\theta})\,\delta\boldsymbol{\theta}+\frac{1}{2}\mathbf{H}(\boldsymbol{\theta})[\delta\boldsymbol{\theta},\delta\boldsymbol{\theta}]+O(h^3). \tag*{(21)}

Here J\mathbf{J} and H\mathbf{H} are the Jacobian and Hessian of the two-dimensional lens mapping. An affine mapped triangle retains the constant and linear terms. The Hessian term gives the leading O(h2)O(h^2) displacement of the true mapped boundary. This displacement produces an O(h3)O(h^3) area error per boundary cell. Summing over the O(h−1)O(h^{-1}) cells intersected by a smooth source-pixel boundary gives the idealized integrated error

ϵaffine IPM=O(h2)=O(Nray−1).(22)\epsilon_{\mathrm{affine\ IPM}}=O(h^2)=O(N_{\mathrm{ray}}^{-1}). \tag*{(22)}

The exponent −1-1 is an idealized smooth-region rate, not a universal IPM upper bound. Approximate polygon filling, unresolved critical cells, and finite-field selection can make the observed rate shallower. The isolated point-lens experiment in Appendix C checks the expected Monte Carlo IRS and IPM rates against the analytic solution, without finite-reference uncertainty. IPM also has a lower error normalization. Mediavilla et al. (2006) found that approximately one mapped cell per unlensed pixel was about an order of magnitude more accurate than IRS with roughly 1024 rays per unlensed pixel. This advantage decreases with source convolution ((Mediavilla et al. 2011)), making area mapping most valuable for raw maps and compact sources.

The nominal NrayN_{\mathrm{ray}} specifies the full-field lattice before scouting, not the number of lens-equation evaluations actually performed. The convergence experiment fixes the stellar field, source-plane field of view, 102421024^2 output grid, scout ratio k=2k=2, true candidate refinement r=2r=2, and biquadratic virtual raster refinement v=4v=4, and varies only Nray={1,2.5,5,10,20,50,100}N_{\mathrm{ray}}=\{1,2.5,5,10,20,50,100\} million. Fixed rr and vv affect the work and error normalization, not the idealized affine h2h^2 rate. Changing the scout ratio kk changes the selected cells and need not preserve the measured slope. Every candidate and the independent 10910^9-ray reference use the same conservative far-field settings: a 32×3232\times32 nodal lattice, χnear=1.5\chi_{\mathrm{near}}=1.5, and an order-ten expansion about each cell centre. The reference uses k=2k=2, r=2r=2, and the finer virtual raster refinement v=8v=8. Higher ray count reduces finite-reference error when testing candidates up to 10810^8 rays.

We fit all seven ray counts separately for each macroimage before taking the median of the 12 slopes. The raw fractional map RMSE gives p=−0.84−0.06+0.03p=-0.84^{+0.03}_{-0.06}, and source convolution steepens the median slope to p=−0.87−0.03+0.07p=-0.87^{+0.07}_{-0.03}. Q2237+0305 image B, shown prominently in Figure 7, reaches p=−0.91±0.02p=-0.91\pm0.02 for the raw map and p=−0.90±0.02p=-0.90\pm0.02 after source convolution. The quoted ±\pm values for image B are individual-fit uncertainties, not the 12-macroimage percentile spread. The measured IPM slope near −0.84-0.84 is a finite-range rate over 1–100 million rays rather than an asymptotic prediction, with source-pixel intersections, caustic structure, the finite reference, and fixed reconstruction settings contributing to the measured error.

Although our internal IRS launches rays on a regular Cartesian lattice, its measured raw-map slope has a median slope p=−0.504−0.003+0.003p=-0.504^{+0.003}_{-0.003}. This effectively reproduces the Nray−1/2N_{\mathrm{ray}}^{-1/2} counting-noise rate. The non-linear microlensing mapping largely disrupts the regular image-plane sampling before the rays are deposited into source pixels. Many source pixels receive few or no rays. Pixels receiving no rays are assigned zero magnification, without interpolation or an artificial ray count. These effects make the unsmoothed source-plane sampling behave more like random counting noise. Convolution with the extended source averages over neighbouring pixels and suppresses this small-scale ray-count noise. The remaining deterministic lattice and mapped-boundary error then becomes more important, steepening the median finite-range IRS slope to −0.711−0.036+0.014-0.711^{+0.014}_{-0.036} and bringing it close to the expected Cartesian-lattice rate of −3/4-3/4. This change is specific to the regular lattice. GPU-D uses pseudorandom rays and therefore does not test this Cartesian-lattice behaviour. These empirical slopes depend on the tested lens-system sample.

Method validation

The fiducial local-exact/far-field configuration uses the order-ten Taylor scheme defined above. We fix the biquadratic IPM lattice and compare one complete map for each of the 12 macroimages with direct point-mass deflections, thereby isolating the deflection approximation. The audit also includes a conservative order-ten 16 ×\times 16 nodal-grid, χnear=1.5\chi_{\rm near} = 1.5 setting, distinct from the 32 ×\times 32 far-field grid used for the high-ray-count references. Across the 12 macroimages, the adopted 8 ×\times 8, χnear=1\chi_{\rm near} = 1 calculation has a median fractional map RMSE of 3.1−2.0+1.6×10−43.1^{+1.6}_{-2.0} \times10^{-4} and a median magnitude-map RMSE of 0.34−0.22+0.300.34^{+0.30}_{-0.22} mmag relative to direct point-mass deflections. The conservative control reduces these errors to 1.4−0.80+1.8×10−41.4^{+1.8}_{-0.80} \times10^{-4} and 0.15−0.086+0.210.15^{+0.21}_{-0.086} mmag, respectively. Both metrics use the same definitions as Table 2.

The fast configuration estimates its normalization correction by comparing the adopted scout grid with a denser scout grid at frame zero (§ 3.3). The resulting uniform magnification offset is applied at subsequent epochs. The independent-frame controls omit this temporal correction, so batching alone does not explain the accuracy difference. The correction does not restore missing spatial structure or guarantee agreement with an independently evaluated denser scout. Increasing the determinant discovery grid from 5122512^2 to 102421024^2 leaves the segment counts and source-centre labels unchanged.

The residuals show why the extent of the searched lens-plane region matters. In the representative Q2237+0305 image B map in Figure 5, the Weisenbach residual has a mean of +7.9+7.9 mmag and a centred spatial scatter of 4.1 mmag, compared with an uncentred RMSE of 8.9 mmag. The constant offset therefore contributes 79 per cent of the squared map error, and the mean fractional magnification deficit is 0.72 per cent. The matched full-field control has only −0.032-0.032 mmag bias, whereas the rectangular control has +4.1+4.1 mmag bias. The complete light curves show the same qualitative signature. All 12 Weisenbach residuals have positive mean offsets, with a median bias of 6.2 mmag, a median centred scatter of 1.3 mmag, and a median RMSE of 6.3 mmag. The bias contributes a median 94 per cent of their squared error. We retain the uncentred errors in every benchmark rather than calibrating against the reference. These coherent

offsets are consistent with finite shooting-field losses, although the residuals also include discretization and source-grid interpolation errors. Enlarging the Weisenbach shooting region would reduce the missing-flux contribution at additional cost if the ray density is maintained. A shared nominal light-loss tolerance therefore does not make a fixed rectangular shooting region equivalent to searching the full stellar aperture. Source scouting admits source-reaching cells from anywhere in that aperture, largely avoiding this coherent finite-field bias.

Automated numerical tests compare the uncompiled PyTorch, compiled PyTorch, and Triton implementations and check that temporal and independent-light-curve batching preserve flux and caustic labels. Selected elliptic-integral calculations are checked against SciPy (Virtanen et al. 2020), lens equations against NumPy (Harris et al. 2020) and lენტrometry (Birrer & Amara 2018; Birrer et al. 2021), cosmological distances against Astropy (Astropy Collaboration et al. [2]), and bandpass integration against speclite (Kirkby et al. 2024), complementing the map and caustic validations above and the SIM5 comparison in § 5.6.

General-Relativistic Quasar Discs and Evolving Sources

Once magnification-map generation becomes sufficiently fast, source construction and CPU–GPU transfers can limit the speed of complete light-curve simulations. We therefore implement the evolving source models on the GPU, evaluating their emission and combining it with magnification maps in time and wavelength batches, with only the requested final products transferred to the CPU.

The microlensing calculation accepts any source represented on a fixed pixel grid. Here we couple it to a time-dependent, general-relativistic quasar disc with viscous heating, lamppost reprocessing, and thermal emission. The source conventions follow Fagin et al. (2025b) and Chan et al. (2024). As in AMOEBA (Best et al. 2025), we couple spatially resolved source emission, intrinsic variability, and microlensing. Our contribution is the GPU implementation of the ray-traced Kerr transfers and their batched coupling to dynamical microlensing. We describe this coupling below, with the disc-profile and geodesic details collected in Appendix A. The source model can also be used without microlensing for continuum reverberation calculations. The same interface accepts analytic profiles, supplied images, and time-ordered image cubes, as illustrated by the expanding supernova in Appendix § 10.

Each source image provides a nonnegative observer-frame flux density Fν,b,p(t)F_{\nu,b,p}(t) in erg s−1^{-1} cm−2^{-2} Hz−1^{-1} for pixel pp and band bb. Summing over pixels gives the unlensed flux. Weighting the pixels by their magnifications, with the appropriate macroimage delay, gives the lensed flux as in equation (12). The fiducial quasar source uses a 102421024^{2} grid enclosing 99.9 per cent of the modelled baseline flux, with a 5 per cent radial safety margin.

Disc structure and intrinsic driving

We adopt a geometrically thin, optically thick equatorial disc with a zero-torque inner boundary at the innermost stable circular orbit (ISCO) and no emission at smaller radii (Shakura & Sunyaev 1973; Novikov & Thorne 1973; Page & Thorne 1974). Writing Rg=GMBH/c2R_{\rm g}=GM_{\rm BH}/c^{2}, the viscous temperature is

Tvisc4(R)=Nβ(RRg)3−4β3GMBHM˙8πσSBRg3fNT(R,a),(23)T_{\rm visc}^{4}(R)=N_{\beta}\left(\frac{R}{R_{\rm g}}\right)^{3-4\beta}\frac{3GM_{\rm BH}\dot{M}}{8\pi\sigma_{\rm SB}R_{\rm g}^{3}}f_{\rm NT}(R,a), \tag*{(23)}

where σSB\sigma_{\rm SB} is the Stefan–Boltzmann constant, fNT(R,a)f_{\rm NT}(R,a) is the dimensionless Novikov–Thorne radial flux profile and aa is the signed spin. The factor (R/Rg)3−4β(R/R_{\rm g})^{3-4\beta} gives an asymptotic temperature slope Tvisc∝R−βT_{\rm visc}\propto R^{-\beta}, with β=3/4\beta=3/4 recovering the standard thin disc (Fagin et al. 2025b). The accretion rate is M˙=λEddLEdd/(ηc2)\dot{M}=\lambda_{\rm Edd}L_{\rm Edd}/(\eta c^{2}), with η\eta the Novikov–Thorne radiative efficiency. The factor NβN_{\beta} preserves the disc-area integral of the local viscous flux, with $N_{3/4}=1. {xref}Appendix A1` gives the flux profile, efficiency, and explicit normalization.

The primary microlensing benchmarks use the mean disc brightness. For the variable-source demonstration, we generate a coronal driver with a smoothly broken power spectral density (PSD),

P(ν)=Aν−αL[1+(ννb)αH−αL]−1,(24)P(\nu)=A\nu^{-\alpha_{\rm L}}\left[1+\left(\frac{\nu}{\nu_{\rm b}}\right)^{\alpha_{\rm H}-\alpha_{\rm L}}\right]^{-1}, \tag*{(24)}

where AA sets the normalization, νb\nu_{\rm b} is the break frequency, and αL\alpha_{\rm L} and αH\alpha_{\rm H} are the low- and high-frequency slopes (McHardy et al. 2004; Uttley & McHardy 2005). Following Timmer & Koenig (1995), we draw Gaussian real and imaginary Fourier coefficients with variance proportional to P(ν)/2P(\nu)/2, impose Hermitian symmetry, and Fourier-transform to the time domain. We generate five times the required duration and retain an interior segment to reduce periodic-boundary effects. After standardizing this latent sequence Y(t)Y(t), we ensure positive irradiation with

X(t)=exp⁡[aX+bXY(t)],X(t)=\exp[a_X+b_XY(t)],
aX=ln⁡X‾−bX22,bX2=ln⁡[1+(σXX‾)2].(25)a_X=\ln\overline{X}-\frac{b_X^{2}}{2},\qquad b_X^{2}=\ln\left[1+\left(\frac{\sigma_X}{\overline{X}}\right)^{2}\right]. \tag*{(25)}

For Gaussian YY, X‾\overline{X} and σX\sigma_X are the target ensemble mean and standard deviation, not exact finite-sample moments. The PSD specifies YY, rather than the transformed driver XX. We use X‾=1\overline{X}=1 and an observer-frame grid with a 1000-day leading buffer for delayed evaluations. One driver illuminates all disc radii and wavelengths. Although lensing is linear in surface brightness, microlensing weights regions with different variability amplitudes and delays, so applying variability to the resolved source is generally not equivalent to modulating the final light curve.

Relativistic observer and lamppost transfers

The general-relativistic (GR) calculation traces a null geodesic from the centre of every source-screen pixel to its first equatorial-disc intersection (Kerr 1963; Cunningham & Bardeen 1973). We use analytic quartic roots and Jacobi elliptic functions for the intersection, and Carlson symmetric integrals for the emission coordinates and arrival time (Yang & Wang 2013; Gralla & Lupsasca 2020). Appendix A2 specifies the branches and numerical safeguards. The resulting static transfer records emission radius, azimuth, relative arrival time, and frequency shift

g=ν∞νem=1ut(1−Ωλ),Ω=1r3/2+a,(26)g=\frac{\nu_{\infty}}{\nu_{\rm em}}=\frac{1}{u^{t}(1-\Omega\lambda)},\qquad\Omega=\frac{1}{r^{3/2}+a}, \tag*{(26)}

where r=R/Rgr=R/R_{\rm g} on the equatorial disc, λ\lambda is the photon angular-momentum constant, and utu^{t} is the circular-orbit four-velocity normalization [36] (Cunningham & Bardeen 1973; Page & Thorne 1974). We keep the disc orientation fixed, so positive and negative spin describe prograde and retrograde orbits relative to that orientation. The model retains only the direct primary image and evaluates brightness at the actual emission coordinates without an oversampled screen or ray-deposition kernel.

We adopt two identical, isotropically emitting lampposts at ±Hlamp\pm H_{\rm lamp}, each with X-ray luminosity LXL_X. By symmetry, we trace the upper source and include both sources in the heating normalization. With albedo AalbA_{\rm alb}, the corresponding Newtonian profile is (Chan et al. 2024)

Flampflat(R)=(1−Aalb)LX2πHlamp(R2+Hlamp2)3/2.(27)F_{\rm lamp}^{\rm flat}(R)=\frac{(1-A_{\rm alb})L_X}{2\pi}\frac{H_{\rm lamp}}{(R^{2}+H_{\rm lamp}^{2})^{3/2}}. \tag*{(27)}

The configured height is Hlamp/Rg=ϵ+RISCO/RgH_{\rm lamp}/R_{\rm g}=\epsilon+R_{\rm ISCO}/R_{\rm g}. The relativistic calculation follows locally emitted rays to their first disc intersection and constructs

Klampraw(R)=gldpg(R)dΩdAproper,(28)\mathcal{K}_{\rm lamp}^{\rm raw}(R)=g_{\rm ld}^{p_g}(R)\frac{d\Omega}{dA_{\rm proper}}, \tag*{(28)}

where gldg_{\rm ld} is the lamp-to-disc frequency shift and dAproperdA_{\rm proper} is the receiving disc-comoving area in units of Rg2R_{\rm g}^{2}. We use pg=2p_g=2 for the photon-energy and arrival-rate factors (Wilkins & Fabian 2012). Equation (51) normalizes this kernel to the proper-area integral of the flat profile, retaining relativistic redistribution without changing the integrated heating. The comoving area and finite-axis ray calculation are specified in Appendix A4 (Dauser et al. 2013; Ingram et al. 2019).

The two transfers give the observer-frame relative delay

τ(R,ϕ)=(1+zs)Rgc[tld(R)+tdo(R,ϕ)−tmin].(29)\tau(R,\phi)=(1+z_{\rm s})\frac{R_{\rm g}}{c}\left[t_{\rm ld}(R)+t_{\rm do}(R,\phi)-t_{\rm min}\right]. \tag*{(29)}

Here tldt_{\rm ld} and tdot_{\rm do} are lamp-to-disc and disc-to-observer coordinate times in gravitational units. We subtract their minimum sum over valid pixels because only relative lags are needed, making the earliest retained disc response occur at τ=0\tau=0. The factor (1+zs)Rg/c(1+z_{\rm s})R_{\rm g}/c converts to observer-frame seconds, then to days for the driver. Comparison with a directly observed coronal signal would instead require the lamp-to-observer arrival time as the reference.

Time-dependent observer-frame emission

The normalized lamp kernel sets

Tlamp4(R)=flampηλEdd3c2M˙8πσSBRg2Klamp(R),(30)T_{\rm lamp}^{4}(R)=\frac{f_{\rm lamp}\eta}{\lambda_{\rm Edd}}\frac{3c^{2}\dot{M}}{8\pi\sigma_{\rm SB}R_{\rm g}^{2}}\mathcal{K}_{\rm lamp}(R), \tag*{(30)}

and the evolving temperature is

Teff4(R,ϕ,t)=Tvisc4(R)+Tlamp4(R)X[t−τ(R,ϕ)].(31)T_{\mathrm{eff}}^{4}(R,\phi,t)=T_{\mathrm{visc}}^{4}(R)+T_{\mathrm{lamp}}^{4}(R)X[t-\tau(R,\phi)] . \tag*{(31)}

The local bolometric flux is Fbol=σSBTeff4F_{\mathrm{bol}}=\sigma_{\mathrm{SB}}T_{\mathrm{eff}}^{4}. Following Fagin et al. (2025b), flamp≡(1−Aalb)LX/LEddf_{\mathrm{lamp}}\equiv(1-A_{\mathrm{alb}})L_{\mathrm{X}}/L_{\mathrm{Edd}} sets the mean irradiation and is partly degenerate with σX\sigma_{\mathrm{X}} in the variable response.

Each disc element emits a colour-corrected blackbody with Tcol=fcolTeffT_{\mathrm{col}}=f_{\mathrm{col}}T_{\mathrm{eff}} and dilution fcol−4f_{\mathrm{col}}^{-4} (Davis & El-Abd (2019); Chan et al. (2024)). Conservation of Iν/ν3I_{\nu}/\nu^{3} gives Iν,∞=g3Iν/g,emI_{\nu,\infty}=g^{3}I_{\nu}/g,\mathrm{em}, evaluated at the quasar-rest-frame wavelength λb,∞=λb,obs/(1+zs)\lambda_{b,\infty}=\lambda_{b,\mathrm{obs}}/(1+z_{\mathrm{s}}). Cosmological dimming then gives Iν,bobs=(1+zs)−3Iν,∞I_{\nu,b}^{\mathrm{obs}}=(1+z_{\mathrm{s}})^{-3}I_{\nu,\infty}. For physical screen spacing Δxp\Delta x_{p}, the observed pixel flux is Fν,b,p=Iν,b,pobs(Δxp/DA)2F_{\nu,b,p}=I_{\nu,b,p}^{\mathrm{obs}}(\Delta x_{p}/D_{\mathrm{A}})^{2}. Equivalently, Fν,b,p=(1+zs)Iν,∞,p(Δxp/DL)2F_{\nu,b,p}=(1+z_{\mathrm{s}})I_{\nu,\infty,p}(\Delta x_{p}/D_{\mathrm{L}})^{2}, where DL=(1+zs)2DAD_{\mathrm{L}}=(1+z_{\mathrm{s}})^{2}D_{\mathrm{A}}. The explicit blackbody expression is given in Appendix A5. Pixels with no valid primary disc intersection contribute zero. The disc position angle rotates the observer screen relative to the microlensing field.

We use fcol=1f_{\mathrm{col}}=1 and evaluate each band at its observed effective wavelength, rather than integrate over the filter throughput. The adopted ugrizyugrizy wavelengths are (3671, 4827, 6223, 7546, 8691, 9712) Å. The reddest rest-frame profile determines the source extent. The Kerr and lamppost transfers are calculated once for each geometry and reused across times and wavelength batches. At each source-evaluation time, we update the delayed driver, temperature, and thermal emission, then integrate the brightness against the magnification map.

Continuum transfer functions

For small variations around the mean driver, define the local response weight Wb(β)=∂Iν,bobs/∂X∣X=1W_b(\boldsymbol{\beta})=\left.\partial I_{\nu,b}^{\mathrm{obs}}/\partial X\right|_{X=1}. Its explicit form is given in Appendix A5. The microlensed response is

ψi,b(τ;t)=∫Ωβμi(β,t)Wb(β)δ[τ−τ(β)] d2β,(32)\psi_{i,b}(\tau;t)=\int_{\Omega_{\beta}}\mu_i(\boldsymbol{\beta},t)W_b(\boldsymbol{\beta})\delta[\tau-\tau(\boldsymbol{\beta})]\,d^{2}\boldsymbol{\beta}, \tag*{(32)}

where δ\delta is the Dirac delta distribution and τ(β)\tau(\boldsymbol{\beta}) is the disc delay. The corresponding mean lag is

⟨τ⟩i,b(t)=∫τψi,b(τ;t) dτ∫ψi,b(τ;t) dτ.(33)\langle\tau\rangle_{i,b}(t)=\frac{\int\tau\psi_{i,b}(\tau;t)\,d\tau}{\int\psi_{i,b}(\tau;t)\,d\tau}. \tag*{(33)}

Setting μ=1\mu=1 gives the intrinsic response. Differential magnification reweights regions with different light-travel times, changing the response shape and mean lag (Tie & Kochanek (2018a); Chan et al. (2020); Fagin et al. (2025b)). This image-dependent response acts in addition to the macroimage delay and can bias inter-image delay measurements if neglected (Tie & Kochanek (2018a)). In the Figure 8 snapshot, image A’s uu-band mean response lag decreases from 5.4 to 4.4 days, a shift of −0.98-0.98 days. This is a response-centroid shift, not a recovered cosmological-delay error.

Figure 8. End-to-end Q2237+0305-like simulation at t=2975t = 2975 days, showing macroimage A. The top row shows a pixelwise standardized ii-band disc fluctuation, the mock HST-like lens image, magnification, binary caustic class, and caustic distance. The middle row compares the combined and intrinsic light curves alongside the source-centre histories. Mock WFD observations appear only on the combined light curve, and the dashed black curve shows the rescaled driver. The bottom row shows response functions at 0.25-day spacing and mean lags, with dotted unlensed comparisons and arrows indicating the microlensing-induced lag shifts. The plotted responses ψ\psi are normalized to unit area. The light curves and response functions use the same 102421024^2 source grid. Source emission is evaluated daily and maps every 25 days, with Nray=107N_{\rm ray} = 10^7, k=2k = 2, r=2r = 2, and v=4v = 4.

The light curves reported here use the full non-linear source emission rather than the response approximation described in Appendix A5.

Multi-rate intrinsic variability and microlensing

Intrinsic source variability can be quickly evaluated more frequently than the evolving microlensing maps. Let Mi,j(β)\mathcal{M}_{i,j}(\boldsymbol{\beta}) denote the magnification map of macroimage ii at time tjt_j on a fixed source-plane grid. For a source-evaluation time tj≤t≤tj+1t_j\leq t\leq t_{j+1}, define

w=(t−tj)/(tj+1−tj)w=(t-t_j)/(t_{j+1}-t_j). The flux in band bb is approximated by

Fν,i,bL(t)≃∫d2β Iν,b(β,t−Δti)([(1−w)Mi,j(β)+wMi,j+1(β)]),(34)F_{\nu,i,b}^{\mathrm{L}}(t)\simeq\int d^{2}\boldsymbol{\beta}\,I_{\nu,b}(\boldsymbol{\beta},t-\Delta t_i)\left([(1-w)\mathcal{M}_{i,j}(\boldsymbol{\beta})+w\mathcal{M}_{i,j+1}(\boldsymbol{\beta})]\right), \tag*{(34)}

where Iν,bI_{\nu,b} is the evolving observer-frame source brightness and Δti\Delta t_i is the macroimage time delay, as in equation (12). At each requested time, we calculate the flux using each neighbouring map on the same pixel grid and linearly combine the two fluxes. This requires no spatial resampling or intermediate map. Evaluating the source at its own cadence retains changes in its spatial profile that scalar light-curve interpolation would miss. Between map epochs, interpolation blends neighbouring magnification maps rather than following individual caustics, so rapidly changing patterns may require a shorter map cadence. For example, we can evaluate the source and light curve daily while calculating microlensing maps every 25 days. Across the 12 benchmark macroimages, evaluating the variable Kerr source daily while interpolating 25-day magnification maps differs from direct daily-map light curves by a median six-band RMSE of 0.28−0.25+0.450.28^{+0.45}_{-0.25} mmag.

End-to-end LSST-like observations

We demonstrate the complete pipeline with a four-image Q2237+0305-like lens. Each macroimage has its own lens parameters and independently seeded stellar field, while the shared source is evaluated at the appropriate macroimage arrival time. Figure 8 shows image A’s maps, caustic labels, response functions, and light curves. The driver has (αL,αH)=(1,3)(\alpha_{\mathrm{L}},\alpha_{\mathrm{H}})=(1,3), 1/νb=1001/\nu_{\mathrm{b}}=100 days, and σX=0.3\sigma_{\mathrm{X}}=0.3. Daily source emission is combined with the neighbouring 25-day maps using equation (34).

The mock lens image uses the PyTorch-native caustics package (Stone et al. (2024)), with an elliptical power-law lens, external shear, extended lens and host light, and variable quasar images (Tessore & Metcalf (2015); Shajib et al. (2024)). It is an HST-like visualization rather than a calibrated reproduction of an observation. We sample the light curves at the times and filters of 869 visits from a WFD field in the Rubin baseline_v4.3.5_10yrs OpSim realization.2 The visit depths set the photometric noise through the standard LSST prescription, with a 0.005 mag systematic floor (Ivezić et al. (2019); Fagin et al. (2025b)). Rendering and noise parameters are given in Appendix § 9.6. These samples do not include image-level deblending of the macroimages. Extracting such curves from survey images requires scene modelling, for example with STARRED (Millon et al. (2024)).

An optional package spectral layer supplements the physical disc continuum with empirical emission lines, dust, and intergalactic absorption before bandpass integration (Temple et al. (2021); Fagin et al. (2025b)). Lines receive macro magnification but no stellar microlensing, and host light requires an explicit lensing prescription. The figures and benchmarks here instead use the six effective-wavelength disc calculations.

General-relativistic validation and performance

For the direct primary observer-to-disc transfer tested here, the analytic Kerr calculation reaches exactly the same valid observer-screen pixels as SIM5 and gives image normalized mean-square errors of 6.2×10−116.2 \times10^{-11}–1.2×10−81.2 \times10^{-8} for the three fiducial systems. After warm-up, the primary-image transfer takes 1.8–1.9 ms, compared with 0.54–0.57 s for the matched single-threaded SIM5 calculations. The detailed image and residual comparison is shown in Appendix § 9.7.

The matched SIM5 comparison isolates only the primary observer-to-disc ray trace and therefore does not characterize the cost of constructing the full relativistic source. Profiling of the benchmark implementation after compilation and warm-up gives a median 0.081 s to construct the complete 102421024^2 disc source across the three benchmark prescriptions. This calculation includes the primary image, relative observer delays, lamppost illumination and delay transfer, disc normalization, and intrinsic driving realization. The observer and lamppost transfers are calculated once for a fixed disc geometry and reused throughout the light curve. The one-time compilation cost is excluded. Evaluating the complete 147-epoch, six-band surface-brightness sequence in temporal batches of 49 takes a median 0.069 s. Each source prescription is shared by the four macroimages of its system. These source costs are reported separately from the microlensing-method timings. Rubin visit selection and photometric-noise sampling are also excluded because they are shared post-processing operations rather than part of the magnification calculation.

Other time-dependent sources

An expanding Type Ia-like photosphere demonstrates the same interface with changing luminosity, colour, and spatial extent. We use an early L∝t2.4L \propto t^{2.4} rise Goldstein et al. 2015, an exponential decline, and homologous expansion. The projected elliptical, limb-darkened profile is initially achromatic, motivated by Goldstein et al. (2018), with weak chromatic structure after 21 rest-frame days. Compact early emission is sensitive to fine caustic structure, while expansion averages over it and the later band-dependent spatial profiles allow chromatic microlensing. This is a source-interface demonstration rather than a precision supernova radiative-transfer model. Its prescription and matched 12-macroimage benchmark are given in Appendix § 10.

The benchmark evaluates the source and maps at 51 epochs over 200 observer-frame days. The fast method gives a median light-curve RMSE of 0.44 mmag and runtime of 0.14 s. A separate test with daily source evaluation finds that four-day maps differ from direct daily-map light curves by a median six-band RMSE of 0.056−0.029+0.0210.056^{+0.021}_{-0.029} mmag. Finer map cadences may be needed near rapidly evolving caustics.

Discussion

Origins of the speedup and relation to prior methods

The speedup is cumulative rather than attributable to one approximation, and most of its ingredients build on established ideas. Our comparisons therefore test complete implementations under a common source and stellar field rather than claim that each numerical idea is new in isolation. The fast source-scouted path is 19 times faster than the batched full-field IPM control at nearly the same fractional map RMSE. Its calculation of one light curve is about 710 times faster than the compared Weisenbach calculation, while batching independent curves raises the measured throughput advantage to 780 times.

Tree methods group distant microlenses hierarchically Wambsganss et al. 1990; Bate et al. 2010. Zheng et al. (2022) combine exact nearby deflections with an interpolated far field, while FMM-based methods use multipole and local expansions Jiménez-Vicente & Mediavilla 2022; Weisenbach 2025a. Our local-exact/far-field solver follows the same near/far principle but uses regular cell-local expansions that can be shared across rays and constructed for several epochs at once. For spatial selection, Meena et al. (2022) showed how image-plane pixels near a compact source can be refined adaptively. Our scout searches the full circular stellar aperture and retains cells whose mapped footprints reach the requested source field. It avoids most noncontributing area while retaining source-reaching cells that a fixed rectangular window can miss. Between scout evaluations, we retain cells selected at either endpoint. The frame-zero correction removes the dominant normalization offset of the faster k=2k = 2 selection.

The area-conserving principle of IPM was introduced and optimized by Mediavilla et al. (2006, 2011). Virtual refinement resolves the biquadratic mapping more finely without additional lens-equation evaluations. Fused Triton rasterization then avoids the large intermediate tensors required by the corresponding PyTorch calculation. Shared ray tracing, interpolation, and rasterization remain the dominant cost in the stage profiles reported in § 4.2. The IPM maps show a median raw-map convergence slope at −0.84-0.84, whereas both our Cartesian IRS and the pseudorandom GPU-D calculation scale close to Nray−1/2N_{\mathrm{ray}}^{-1/2} in these caustic-rich fields.

Moving-star calculations showed that evolving caustics can produce shorter, steeper, and more frequent events than bulk motion alone (Wambsganss & Kundic 1995). Processing several epochs together allows fixed-size arrays and allocated GPU memory to be reused. Batching independent light curves further increases throughput. For caustic labels, Weisenbach (2025b) traces the complete critical-curve network and describes winding-number labels from oriented caustics. We instead evaluate det⁡J\det J and apply marching squares only within the scouted region. Anchors and gauges then track the binary caustic class at the source centre and its distance to the nearest caustic without a complete winding map at every epoch. Caustic construction remains the largest additional cost of the labelled workload.

The adopted configuration is deliberately conservative, with sub-millimagnitude median light-curve error and sub-percent median raw fractional map RMSE. Less stringent applications can reduce the ray density or spatial refinement, while light-curve-only calculations can omit the determinant and labelling passes. The lens and source calculations remain on the GPU until final products are transferred to the CPU. PyTorch and Triton’s support for NVIDIA and AMD backends also offers portability beyond CUDA-only implementations.

Relativistic source effects

Relativistic frequency shifts make the observed disc brightness asymmetric even for an axisymmetric rest-frame temperature profile. Spin sets the ISCO and changes the innermost emitting area, while inclination strengthens the projected asymmetry and Doppler contrast. During a caustic crossing, the high-magnification region scans the Doppler-brightened side, strongly redshifted inner disc, and regions with different reverberation delays. It therefore changes the band-dependent transfer function and mean lag rather than merely rescaling the total flux.

Limitations

The benchmark uses three lenses, four macroimages per lens, and one stellar realization per macroimage, with fixed source and population prescriptions. It is a controlled comparison of numerical methods, not a representative population of lensed quasars. Each additional realization requires a high-quality reference and runs of the much slower external comparison codes, limiting the size of this matched benchmark. The distribution of runtime and error in a diverse training set requires a broader study. The primary quasar timings measure 147 microlensing epochs separated by 25 days. They do not include construction of the GR disc, daily intrinsic variability, or the LSST-like sampling and noise model. These shared source and observation stages are excluded so the benchmark isolates the microlensing methods.

The timings are specific to the RTX 5070 Ti, which is a moderate consumer GPU. Batch and chunk sizes should be retuned for the available hardware. The simulator can use the larger memory and parallel capacity of high-performance GPUs through temporal batching and batching across independent light curves. These forms of batching are not available in the comparison implementations, so larger GPUs can provide an additional practical advantage for our method. Our simulator also works on CPU, but will be significantly slower.

The source scout traces only lens-plane cells selected as capable of reaching the finite source. The initial correction reduces the dominant magnification offset in the faster k=2k = 2 selection, but finite support and finite ray density can still omit a small amount of flux or an unusually small caustic component. Increasing the ray count, scout support, or determinant resolution reduces these risks at additional cost. The adopted 819228192^2 determinant field can also miss caustics below its resolved scale.

The anchor and gauge method does not mathematically guarantee that every caustic crossing will be identified. The adopted nine anchors and nine gauges provide strong redundancy, and no reference crossing was missed in the 12 benchmark light curves. However, very dense caustics, incomplete components, or large changes in the caustic pattern between successive frames can challenge the classification. More anchor and gauge points and shorter temporal intervals increase robustness while raising the runtime. Likewise, temporal scout reuse assumes that the stellar field evolves slowly relative to the refresh interval. This condition is satisfied in the tested systems but should be validated for substantially larger velocities or longer cadences.

The source grid encloses nearly all modelled flux and resolves the wavelength dependent disc, but its fixed 102421024^2 sampling only marginally resolves the smallest inner-disc scales in some configurations. Adaptive or locally refined source grids would better isolate the ISCO and compact caustic-crossing structure. The calculations use primarily float32 arithmetic, which is sufficient for the reported map, light-curve, and GR validation errors. Float64 remains available when stricter numerical precision is required, with a substantial cost in memory and runtime.

The benchmark quasar source assumes a thin equatorial disc, symmetric point lampposts, and the primary Kerr image. The optional empirical spectral layer adds unresolved line and attenuation components, but neither it nor the benchmark source provides a self-consistent, spatially resolved broad-line region, diffuse continuum, or extended corona. The supernova uses effective band wavelengths and a simplified photosphere rather than detailed radiative transfer. Users can replace either source through the common image interface. Linear interpolation between dynamical maps can also blur rapidly moving caustics. Applications requiring stricter temporal accuracy should insert intermediate maps and validate the cadence for their velocities and source size.

Applications and future work

The immediate application is LSST-scale forward modelling in which many independent dynamical microlensing histories are combined with source variability and sparse survey sampling. Future work will use matched static and dynamical calculations to determine how neglecting stellar motion biases inferred quasar disc sizes. Large independent ensembles will also support simulation-based inference of quasar parameters and cosmological time delays, as well as predictions of caustic crossings and HMEs for follow-up (Vernardos & Tsagkatakis 2019; Fagin et al. 2025a). The multi-rate interface is important for this scaling because a daily source light curve does not require a daily stellar-field ray trace once the map cadence has been validated.

Future implementations could allocate resolution adaptively in both time and space, inserting microlensing epochs when caustic-distance diagnostics indicate an approaching crossing and locally refining source and magnification-map sampling around compact inner-disc emission and nearby caustic structure.

The expanding-supernova example demonstrates evolving luminosity, colour, and source extent through the same image interface. Detailed radiative-transfer profiles and non-spherical ejecta could replace the prototype without changing the map solver. Other applications include ring-like optical gamma-ray-burst afterglows (Loeb & Perna 1998; Garnavich et al. 2000), kilonovae, and tidal-disruption flares, provided suitable evolving brightness profiles are supplied (Chen et al. 2024; Ganguly & More 2026).

Natural source extensions include continuum and velocity-resolved reverberation, extended coronal geometries, Fe Kα\alpha emission, X-ray microlensing, broad-line regions, and diffuse continuum emission (Morgan et al. 2012; Paic et al. 2022; Best et al. 2025). The same numerical pipeline can study planetary and compact-dark-matter microlenses in macrolensed quasars (Mediavilla et al. 2017; Dai & Guerras 2018; Tuntsov et al. 2024). Compound microlensing in double-source-plane lenses is another possible extension, but stars in multiple deflector planes would require a multi-plane version of the present single-plane calculation (Salama et al. 2026).

Galactic stellar and planetary microlensing is another extension. Explicit point-mass positions and masses, source trajectories, and pixelated stellar brightness profiles fit the present interfaces. A complete exoplanet-event model would need event-specific geometry, limb darkening, blending, parallax, and orbital lens trajectories where relevant, followed by validation against established planetary calculations (Gaudi et al. 2008; Penny et al. 2011).

Cluster-scale macrocaustics provide another application. Intracluster stars break them into microlensing networks that can repeatedly magnify individual background stars (Venumadhav et al. 2017; Kelly et al. 2018). Applying the present local model in this extreme macrocritical regime will require dedicated validation.

The fast evaluation of evolving point-mass lens fields might also inform gravitational-wave and fast-radio-burst microlensing (Muñoz et al. 2016a; Diego et al. 2019). Predicting waveform interference or delayed radio pulses, however, requires arrival-time or wave-optics calculations beyond the present intensity-map model.

and fused rasterization also accelerate static maps, while temporal batching and reuse provide additional gains for dynamical sequences.

Across the 12-macroimage quasar benchmark, the adopted configuration reaches a median light-curve RMSE of 0.35 mmag and a raw fractional map RMSE of 7.2×10−37.2 \times10^{-3} relative to the high-resolution reference, recovering all 41 reference source-centred caustic crossings. For the ten-year, 147-epoch, six-band microlensing calculation on an RTX 5070 Ti GPU, concurrent evaluation gives median amortized runtimes of 0.68 s per macroimage, or 0.88 s with caustics and labels. These timings isolate the microlensing calculation after compilation warm-up. The light-curve-only throughput is approximately 780 times higher than that of the compared CUDA IPM implementation at comparable map accuracy, and approximately 2500 times faster including caustic crossing labels. Convergence tests give a median effective raw-map scaling of Nray−0.84N_{\mathrm{ray}}^{-0.84}, approaching the idealized Nray−1N_{\mathrm{ray}}^{-1} piecewise-affine IPM rate.

The same GPU-resident framework includes a relativistic quasar source that couples stochastic driving variability to spatially resolved disc emission and reverberation. Its analytic primary Kerr transfer agrees with SIM5 and is approximately 300 times faster than the matched single-threaded SIM5 calculation after compilation warm-up. End-to-end examples combine intrinsic variability, independent macroimage microlensing, macroimage time delays, microlensed response functions, and LSST-like sampling. An expanding-supernova prototype demonstrates the generic-source interface, producing 51-epoch light curves with a median RMSE of 0.44 mmag and a median amortized runtime of 0.12 s per curve.

Together, these results change dynamical microlensing from an exceptional calculation into a scalable component of forward modelling. Generating evolving stellar fields, time-dependent relativistic sources, and caustic-crossing information within one framework provides a foundation for Bayesian and simulation-based inference of quasar accretion-disc structure, microlensing-induced time-delay biases for time-delay cosmography, and forecasting of caustic crossings and high-magnification events. Microcaustics is open-source and available at https://github.com/JFagin/microcaustics.

Conclusions

We have presented Microcaustics, a GPU-accelerated simulator for dynamical microlensing of time-dependent extended sources. The method combines a local-exact/far-field deflection solver, source-directed lens-plane scouting, biquadratic IPM, fused Triton rasterization, temporal batching, and reuse of scouted cells. Selective mapping

Acknowledgements

Support was provided by Schmidt Sciences, LLC, for J.F., J.C., S.M., M.O., L.P.L., and Y.H. S.B. is supported by the US Department of Energy Grant DE-SC0026113. C.S. acknowledges the support of an NSERC Postdoctoral Fellowship and a CITA National Fellowship.

This work made use of ChatGPT and Codex (OpenAI) assistance for code development and manuscript editing. The authors reviewed and take responsibility for all the content of this paper. Software used: PyTorch (Paszke et al. 2019), Triton (Tillet et al. 2019), CAUSTICS (Stone et al. 2024), Matplotlib (Hunter 2007), NumPy (Harris et al. 2020), SciPy (Virtanen et al. 2020), Astropy [2], lenstronomy (Birrer & Amara 2018; Birrer et al. 2021), SPECLITE (Kirkby et al. 2024), SIM5 (Bursa 2018), Weisenbach 2025 (Weisenbach 2025a,b), GPU-D (Vernardos & Fluke 2014).

Data availability

The Microcaustics software is publicly available at https://github.com/JFagin/microcaustics. The benchmark data underlying this article are available from the corresponding author upon reasonable request.

Disc Source and Relativistic Transfer Details

This appendix specifies the source prescription and numerical choices used in § 5. The calculation has three stages. The disc profile fixes viscous heating. The observer and lamppost transfers then assign emission coordinates, irradiation, frequency shifts, and delays to the fixed source grid. Finally, the delayed driver determines the brightness and response weights. The transfers are static for a given geometry and are reused throughout a light curve.

Radial disc profile and normalization

We use Rg=GMBH/c2R_g = GM_{\rm BH}/c^2, signed spin −0.998≤a≤0.998-0.998 \le a \le0.998, and the equatorial ISCO radius of Bardeen et al. (1972), with RISCO=6RgR_{\rm ISCO} = 6R_g at a=0a = 0. Positive and negative spin describe prograde and retrograde motion relative to the fixed disc orientation. The Eddington luminosity is LEdd=4πGMBHmpc/σTL_{\rm Edd} = 4\pi GM_{\rm BH}m_p c/\sigma_T, where mpm_p is the proton mass and σT\sigma_T the Thomson cross section. The adopted efficiency is ηNT=1−[1−2Rg/(3RISCO)]1/2\eta_{\rm NT} = 1 - [1 - 2R_g/(3R_{\rm ISCO})]^{1/2}, compared with the Newtonian value ηSS=Rg/(2RISCO)\eta_{\rm SS} = R_g/(2R_{\rm ISCO}).

For completeness, the dimensionless Novikov–Thorne profile used in equation (23) is (Page & Thorne 1974)

fNT(R,a)=1x7−3x5+2ax4[x−x0−3a2ln⁡(xx0)−3(x1−a)2x1(x1−x2)(x1−x3)ln⁡(x−x1x0−x1)f_{\rm NT}(R,a) = \frac{1}{x^7 - 3x^5 + 2ax^4} \left[ x - x_0 - \frac{3a}{2}\ln\left(\frac{x}{x_0}\right) - \frac{3(x_1-a)^2}{x_1(x_1-x_2)(x_1-x_3)}\ln\left(\frac{x-x_1}{x_0-x_1}\right) \right.
−3(x2−a)2x2(x2−x1)(x2−x3)ln⁡(x−x2x0−x2)−3(x3−a)2x3(x3−x1)(x3−x2)ln⁡(x−x3x0−x3)].(35)\left. - \frac{3(x_2-a)^2}{x_2(x_2-x_1)(x_2-x_3)}\ln\left(\frac{x-x_2}{x_0-x_2}\right) - \frac{3(x_3-a)^2}{x_3(x_3-x_1)(x_3-x_2)}\ln\left(\frac{x-x_3}{x_0-x_3}\right) \right]. \tag*{(35)}

where x=(R/Rg)1/2x = (R/R_g)^{1/2}, x0=(RISCO/Rg)1/2x_0 = (R_{\rm ISCO}/R_g)^{1/2}, x1=2cos⁡[13cos⁡−1a−π/3]x_1 = 2\cos[\frac{1}{3}\cos^{-1}a - \pi/3], x2=2cos⁡[13cos⁡−1a+π/3]x_2 = 2\cos[\frac{1}{3}\cos^{-1}a + \pi/3], and x3=−2cos⁡(13cos⁡−1a)x_3 = -2\cos(\frac{1}{3}\cos^{-1}a). The corresponding Shakura–Sunyaev expression is fSS=(Rg/R)3[1−(RISCO/R)1/2]f_{\rm SS} = (R_g/R)^3[1 - (R_{\rm ISCO}/R)^{1/2}] (Shakura & Sunyaev 1973).

The normalization in equation (23) preserves the disc-area integral of the local viscous flux:

Nβ=∫RISCORoutfNT(R,a) R dR∫RISCORoutfNT(R,a)(R/Rg)3−4βR dR.(36)\mathcal{N}_{\beta} = \frac{\int_{R_{\rm ISCO}}^{R_{\rm out}} f_{\rm NT}(R,a)\,R\,\mathrm{d}R}{\int_{R_{\rm ISCO}}^{R_{\rm out}} f_{\rm NT}(R,a)(R/R_g)^{3-4\beta}R\,\mathrm{d}R}. \tag*{(36)}

We evaluate these integrals on 20,000 logarithmically spaced radii up to a fixed Rout=106RgR_{\rm out} = 10^6R_g. This normalization domain is distinct from the source-image extent, which is chosen from the reddest baseline monochromatic profile. The infinite-radius normalization converges only for β>1/2\beta> 1/2, but the finite domain remains defined for every supported β\beta.

Observer screen to primary disc intersection

For each observer-screen pixel, we trace a photon backward to its first equatorial disc intersection to find its emission radius and frequency shift. SIM5 inspired this implementation (Bursa 2017, 2018). The equations below specify our conventions and branch choices within established analytic Kerr solutions. We use Boyer–Lindquist coordinates (r,θ,ϕ)(r,\theta,\phi) with G=MBH=c=1G = M_{\rm BH} = c = 1. Radius is measured in units of RgR_g, with r=R/Rgr = R/R_g on the disc, and times are recovered using Rg/cR_g/c.

The screen position fixes the conserved quantities that determine the ray’s trajectory. For inclination ii and Bardeen screen coordinates (α,βim)(\alpha,\beta_{\rm im}), these are (Cunningham & Bardeen 1973; Yang & Wang 2013)

λ=−αsin⁡i,q2=βim2+(α2−a2)cos⁡2i,(37)\lambda= -\alpha\sin i,\qquad q^2 = \beta_{\rm im}^2 + (\alpha^2-a^2)\cos^2 i, \tag*{(37)}

where λ=Lz/E\lambda= L_z/E and q2=Q/E2q^2 = Q/E^2 normalize the axial angular momentum and Carter constant by the photon energy at infinity. Carter’s separation of the geodesic equations allows the radial and polar motion to be solved separately (Carter 1968; Gralla & Lupsasca 2020). Their allowed ranges and turning points are determined by the potentials, with Δ=r2−2r+a2\Delta= r^2 - 2r + a^2,

R(r)=(r2+a2−aλ)2−Δ[q2+(λ−a)2],Θ(θ)=q2+a2cos⁡2θ−λ2cot⁡2θ.(38)\mathcal{R}(r) = (r^2+a^2-a\lambda)^2 - \Delta\left[q^2+(\lambda-a)^2\right],\qquad\Theta(\theta) = q^2+a^2\cos^2\theta-\lambda^2\cot^2\theta. \tag*{(38)}

Using Mino time γM\gamma_M, the motion satisfies (dr/dγM)2=R(\mathrm{d}r/\mathrm{d}\gamma_M)^2 = \mathcal{R} and (dθ/dγM)2=Θ(\mathrm{d}\theta/\mathrm{d}\gamma_M)^2 = \Theta (Mino 2003). This is a path parameter, not the photon travel time. The polar solution first gives the observer-to-equator interval γα\gamma_\alpha at which the ray reaches θ=π/2\theta= \pi/2.

Substituting u=cos⁡2θu = \cos^2\theta into Θ=0\Theta= 0 gives a quadratic whose roots determine the polar turning points. To express the polar integral in elliptic form, we use

B=a2−q2−λ2,D=(B2+4a2q2)1/2,u+=2q2D−B,A−=B−D2.(39)B = a^2-q^2-\lambda^2,\qquad D = (B^2+4a^2q^2)^{1/2},\qquad u_+ = \frac{2q^2}{D-B},\qquad A_- = \frac{B-D}{2}. \tag*{(39)}

Here u+u_+ gives cos⁡2θ\cos^2\theta at the polar turning point. Following equations (29)–(35) of Gralla & Lupsasca (2020), define mθ=a2u+/A−≤0m_\theta= a^2u_+/A_- \le0, cθ=∣A−∣−1/2c_\theta= |A_-|^{-1/2}, and so=cos⁡i/u+s_o = \cos i/\sqrt{u_+}, with mθ=0m_\theta= 0 in the nonspinning limit. For an asymptotic observer at θo=i<π/2\theta_o = i < \pi/2, the parameter interval to the first disc crossing is

γd=cθ{F(sin⁡−1so∣mθ),βim≤0,2K(mθ)−F(sin⁡−1so∣mθ),βim>0.(40)\gamma_d = c_\theta\begin{cases} F(\sin^{-1}s_o \mid m_\theta), & \beta_{\rm im} \le0,\\ 2K(m_\theta)-F(\sin^{-1}s_o \mid m_\theta), & \beta_{\rm im} > 0. \end{cases} \tag*{(40)}

We write the incomplete first-kind elliptic integral as F(φ∣m)F(\varphi\mid m) with parameter mm, and K(m)=F(π/2∣m)K(m) = F(\pi/2 \mid m) for its complete form. The vertical Bardeen coordinate βim\beta_{\rm im} is signed so that a backward-traced ray with βim>0\beta_{\rm im}>0 initially moves toward the pole and turns before reaching the disc. The βim≤0\beta_{\rm im}\le0 branch reaches the equator directly.

We next solve the radial quartic R(r)=0\mathcal{R}(r)=0 with Ferrari’s method. Its real roots identify possible radial turning points, not the emission radius. The exterior four-, two-, and zero-real-root cases use equations (B46), (B75), and (B109) of Gralla & Lupsasca (2020). For four real roots we order r1<r2<r3<r4r_1<r_2<r_3<r_4, while for two real roots r1<r2r_1<r_2 are the real pair. Evaluating the observer-connected radial solution with Jacobi functions at γd\gamma_{\rm d} from equation (40) gives rem=r(γd)r_{\rm em}=r(\gamma_{\rm d}). A disc hit requires valid radial and polar domains, an intersection outside the horizon and within the emitting disc, and g>0g>0. Higher-order disc crossings are not retained.

At remr_{\rm em}, we evaluate the disc’s circular velocity uμ=ut(1,0,0,Ω)u^\mu=u^t(1,0,0,\Omega). Normalizing it by gμνuμuν=−1g_{\mu\nu}u^\mu u^\nu=-1 gives

ut=[−(gtt+2Ωgtϕ+Ω2gϕϕ)]−1/2,(41)u^t=\left[-\left(g_{tt}+2\Omega g_{t\phi}+\Omega^2g_{\phi\phi}\right)\right]^{-1/2}, \tag*{(41)}

with gtt=−(1−2/r)g_{tt}=-(1-2/r), gtϕ=−2a/rg_{t\phi}=-2a/r, and gϕϕ=r2+a2+2a2/rg_{\phi\phi}=r^2+a^2+2a^2/r on the equatorial plane (Cunningham & Bardeen 1973; Page & Thorne 1974). Substituting utu^t, Ω\Omega, and the photon’s conserved λ\lambda into equation (26) then gives that pixel’s frequency shift, without spatial deposition or resampling.

Arrival times and emission azimuth

Having found the disc intersection, we integrate the time and azimuth components of the same geodesic equations along that ray. Following equations (10)–(13) of Gralla & Lupsasca (2020), the polar contributions use

Gθ=∫raydθ±θΘ,Gϕ=∫raycsc⁡2θ dθ±θΘ,Gt=∫raycos⁡2θ dθ±θΘ.(42)G_\theta=\int_{\rm ray}\frac{d\theta}{\pm_\theta\sqrt{\Theta}},\qquad G_\phi=\int_{\rm ray}\frac{\csc^2\theta\,d\theta}{\pm_\theta\sqrt{\Theta}},\qquad G_t=\int_{\rm ray}\frac{\cos^2\theta\,d\theta}{\pm_\theta\sqrt{\Theta}}. \tag*{(42)}

For the observer-to-first-disc path, Gθ=γdG_\theta=\gamma_{\rm d}, while GϕG_\phi and GtG_t supply the polar contributions to azimuth and coordinate time. The signs follow the motion and reverse at turning points. The corresponding radial contributions are

Φr=∫raya(2r−aλ)Δdr±rR,Tr=∫ray[r2+2r(r2+a2−aλ)Δ]dr±rR.(43)\Phi_r=\int_{\rm ray}\frac{a(2r-a\lambda)}{\Delta}\frac{dr}{\pm_r\sqrt{\mathcal{R}}}, \qquad T_r=\int_{\rm ray}\left[r^2+\frac{2r(r^2+a^2-a\lambda)}{\Delta}\right]\frac{dr}{\pm_r\sqrt{\mathcal{R}}}. \tag*{(43)}

Adding the radial and polar contributions gives the azimuth and travel time. We evaluate the polar integrals and four-real-root radial endpoints through Carlson symmetric integrals RFR_F, RDR_D, and RJR_J (Carlson 1995; Yang & Wang 2013). Equations (29)–(35) and (B36)–(B44) of Gralla & Lupsasca (2020) give the corresponding Legendre expressions. The Legendre-to-Carlson identities are given in equations (19.25.5), (19.25.9), and (19.25.14) of Olver et al. [86], whose modulus kk corresponds to our parameter m=k2m=k^2.

We end the radial integrals at a common finite observer radius ro≥3000r_o\ge3000 outside the emitting disc to avoid the divergent travel time to infinity. The polar integral includes the path to infinity, so we subtract its outer time contribution Gttail≃γocos⁡2iG_t^{\rm tail}\simeq\gamma_o\cos^2 i, where θ≃i\theta\simeq i and γo=∫ro∞dr/R(r)\gamma_o=\int_{r_o}^{\infty}dr/\sqrt{\mathcal{R}(r)}. We evaluate this outer Mino-time interval by eight-point quadrature in u=1/ru=1/r. With observer azimuth ϕo=0\phi_o=0, we store

Δϕ=Φr+λGϕ,ϕemBL=−Δϕ,tdo=Tr+a2(Gt−γocos⁡2i).(44)\Delta\phi=\Phi_r+\lambda G_\phi,\qquad \phi_{\rm em}^{\rm BL}=-\Delta\phi,\qquad t_{\rm do}=T_r+a^2\left(G_t-\gamma_o\cos^2 i\right). \tag*{(44)}

where Δϕ=ϕo−ϕemBL\Delta\phi=\phi_o-\phi_{\rm em}^{\rm BL} is the source-to-observer azimuthal displacement. Axisymmetric emission does not require the azimuth, but variability requires tdot_{\rm do}. We subtract its minimum valid value, then combine it with the lamp travel time using equation (29). Appendix § 9.7 describes numerical checks and fallback evaluations.

Finite-axis lamppost transfer

We separately trace photons from the lamp to the disc to obtain its heating profile and illumination delay. Their conserved quantities are set by the launch direction, independently of the observer rays. For h≡Hlamp/Rgh\equiv H_{\rm lamp}/R_g, rays start in the local orthonormal frame of a static lamp at (h,θs)(h,\theta_s), with θs=0\theta_s=0 for the upper axial lamp. We sample launch angles 0≤α≤π0\le\alpha\le\pi, measured from the inward radial direction, with solely single-angle weights. Thus α<π/2\alpha<\pi/2 launches inward and α>π/2\alpha>\pi/2 outward. Axial rays have λ=0\lambda=0, and the local direction fixes the Carter constant,

q2=Σssin⁡2α−gtt,s−a2cos⁡2θs,Σs=h2+a2cos⁡2θs.(45)q^2=\frac{\Sigma_s\sin^2\alpha}{-g_{tt,s}}-a^2\cos^2\theta_s,\qquad \Sigma_s=h^2+a^2\cos^2\theta_s. \tag*{(45)}

where −gtt,s=1−2h/Σs>0-g_{tt,s}=1-2h/\Sigma_s>0 is required for a static source. We again solve the polar motion to the equator and evaluate the radial solution at the same parameter interval, now starting at the finite lamp height rather than infinity. The initial radial phase is set by the lamp radius and inward or outward launch direction. We use the infinity-connected radial branch unless r2≤h≤r3r_2\le h\le r_3 for four real roots, which requires the inner branch in equation (B27) of Gralla & Lupsasca (2020). Retaining both possibilities avoids discarding valid rays at low lamp heights and high spins.

The frequency shift is the ratio of photon energies measured in the orbiting disc and static lamp frames (Ingram et al. 2019, Appendix § 10),

gld≡νdiscνlamp=−gtt,sgdd.(46)g_{\rm ld}\equiv\frac{\nu_{\rm disc}}{\nu_{\rm lamp}}=\frac{\sqrt{-g_{tt,s}}}{g_{\rm dd}}. \tag*{(46)}

where gdd=1/utg_{\rm dd}=1/u^t follows from equation (26) with λ=0\lambda=0. Thus gld=−gtt,sutg_{\rm ld}=\sqrt{-g_{tt,s}}u^t reuses equation (41) at the receiving disc radius, without an additional ray trace.

The same coordinate-time integrals, evaluated from lamp to disc, give the illumination delay,

tld=Tr,ld+a2Gld.(47)t_{\mathrm{ld}}=T_{\mathrm{r,ld}}+a^{2}G_{\mathrm{ld}}. \tag*{(47)}

The polar integral is analytic, while the one-dimensional radial integral uses 24-point Gauss–Legendre quadrature. The Figure 8 source uses 1024 launch angles and 512 radial annuli for both the light curves and response functions.

To turn the ray distribution into illumination, we rebin from the ISCO to the outer radius of the finite source model into annuli that conserve the intercepted lamp solid angle. This outer radius is distinct from the normalization limit RoutR_{\mathrm{out}} in Appendix A1. We then divide by the receiving area and apply the energy and arrival-rate factors in equation (28). The area measured in the orbiting disc frame is (Ingram et al. 2019, Appendix A)

dAproperRg2=2πγϕ(r)grr(r)gϕϕ(r) dr,(48)\frac{dA_{\mathrm{proper}}}{R_{\mathrm{g}}^{2}}=2\pi\gamma_{\phi}(r)\sqrt{g_{rr}(r)g_{\phi\phi}(r)}\,dr, \tag*{(48)}

with

grr=r2Δ,gϕϕ=r2+a2+2a2r,γϕ=αZut,αZ=Δgϕϕ,(49)g_{rr}=\frac{r^{2}}{\Delta},\qquad g_{\phi\phi}=r^{2}+a^{2}+\frac{2a^{2}}{r},\qquad\gamma_{\phi}=\alpha_{Z}u^{t},\qquad\alpha_{Z}=\sqrt{\frac{\Delta}{g_{\phi\phi}}}, \tag*{(49)}

on the equatorial plane. Here αZ\alpha_{Z} is the lapse of a zero-angular-momentum observer, and γϕ\gamma_{\phi} converts the stationary spatial annulus to the disc-comoving area. Areas are in units of Rg2R_{\mathrm{g}}^{2}. For extreme annuli not reached by accepted launch angles, we use the dimensionless flat-space continuation

Kflat(r)=4h/3(r2+h2)3/2,(50)\mathcal{K}_{\mathrm{flat}}(r)=\frac{4h/3}{(r^{2}+h^{2})^{3/2}}, \tag*{(50)}

whose radial dependence is the Newtonian illumination profile (Dauser et al. 2013). The factor 4/34/3 combines with the 3/(8π)3/(8\pi) prefactor in equation (30) to recover the adopted two-lamppost Newtonian flux in equation (27). We match the continuation’s amplitude and Euclidean travel time to the nearest sampled relativistic annulus, then shift all delays by one common zero point. Finally, for the resulting profile Klampraw\mathcal{K}^{\mathrm{raw}}_{\mathrm{lamp}}, we adopt the normalization

Klamp(r)=Klampraw(r)∫discKflat(r) dAproper∫discKlampraw(r) dAproper.(51)\mathcal{K}_{\mathrm{lamp}}(r)=\mathcal{K}^{\mathrm{raw}}_{\mathrm{lamp}}(r)\frac{\int_{\mathrm{disc}}\mathcal{K}_{\mathrm{flat}}(r)\,dA_{\mathrm{proper}}}{\int_{\mathrm{disc}}\mathcal{K}^{\mathrm{raw}}_{\mathrm{lamp}}(r)\,dA_{\mathrm{proper}}}. \tag*{(51)}

The integrals are sums over annuli weighted by proper area. This prescription retains the relativistic radial redistribution while fixing the integrated heating to the flat-profile value, so its overall amplitude remains controlled by flampf_{\mathrm{lamp}}.

Thermal emission and response weights

For each observer pixel, we evaluate the lamp heating and illumination delay at its emission radius. Combining lamp-to-disc and disc-to-observer travel times gives the delay in equation (29). The delayed driver and viscous heating then set TpT_{p} through equation (31). With frequency shift gpg_{p} and rest-frame wavelength λb,∞\lambda_{b,\infty}, the colour-corrected intensity is

Iν,∞,p=1fcol42hcλb,∞3{exp⁡[hcλb,∞gpfcolkBTp]−1}−1.(52)I_{\nu,\infty,p}=\frac{1}{f_{\mathrm{col}}^{4}}\frac{2hc}{\lambda_{b,\infty}^{3}}\left\{\exp\left[\frac{hc}{\lambda_{b,\infty}g_{p}f_{\mathrm{col}}k_{\mathrm{B}}T_{p}}\right]-1\right\}^{-1}. \tag*{(52)}

Here hh and kBk_{\mathrm{B}} are the Planck and Boltzmann constants. This is the invariant transformation Iν,∞=g3Iν/g,emI_{\nu,\infty}=g^{3}I_{\nu/g,\mathrm{em}} specialized to a diluted blackbody. The factor fcol−4f_{\mathrm{col}}^{-4} preserves the bolometric flux. Cosmological dimming and the pixel solid angle are applied as described in § 5.3.

The response weight measures how this intensity changes under a small lamp-amplitude perturbation about X=1X=1. Writing xb=hc/(λb,∞gpfcolkBTeff)x_{b}=hc/(\lambda_{b,\infty}g_{p}f_{\mathrm{col}}k_{\mathrm{B}}T_{\mathrm{eff}}), differentiating the temperature and Planck functions gives

Wb(β)≡∂Iν,bobs(β,X)∂X∣X=1=Iν,bobs(β)xb(β)exb(β)Tlamp4(β)exb(β)−114Teff4(β).(53)W_{b}(\beta)\equiv\left.\frac{\partial I_{\nu,b}^{\mathrm{obs}}(\beta,X)}{\partial X}\right|_{X=1}=I_{\nu,b}^{\mathrm{obs}}(\beta)\frac{x_{b}(\beta)e^{x_{b}(\beta)}T_{\mathrm{lamp}}^{4}(\beta)}{e^{x_{b}(\beta)}-1}\frac{1}{4T_{\mathrm{eff}}^{4}(\beta)}. \tag*{(53)}

All quantities on the right are evaluated at X=1X=1. The Planck factor gives the intensity’s temperature sensitivity, while Tlamp4/(4Teff4)T_{\mathrm{lamp}}^{4}/(4T_{\mathrm{eff}}^{4}) gives the fractional temperature response to the lamp. Weighting pixels by their microlensing magnification and grouping them by delay gives equation (32). We distribute each pixel’s response between neighbouring delay bins, then average monotone cubic Hermite interpolations of the cumulative response on four shifted grids. Differences between cumulative values at the requested bin edges give the response integrated over each bin. The reconstruction preserves the integrated response and supplies both the displayed transfer functions and the optional response-mode convolutions. Mean lags are evaluated directly from the pixel weights. The non-linear light-curve calculation does not use this reconstruction.

Convolving the response with the driver perturbations and adding the baseline flux gives the linear approximation, with the magnification pattern held fixed over the response delay,

Fν,i,bL(t)≃Fν,i,bL,(0)(t)+∫0∞ψi,b(τ;t)δX(t−Δti−τ) dτ,(54)F_{\nu,i,b}^{\mathrm{L}}(t)\simeq F_{\nu,i,b}^{\mathrm{L},(0)}(t)+\int_{0}^{\infty}\psi_{i,b}(\tau;t)\delta X(t-\Delta t_{i}-\tau)\,d\tau, \tag*{(54)}

where δX(t)=X(t)−1\delta X(t) = X(t)-1 and Fν,i,bL,(0)F_{\nu,i,b}^{\mathrm{L},(0)} is the microlensed baseline flux. Microlensing changes the baseline, response amplitude, and response shape. The package offers linear- and quadratic-response modes for dense time-and-wavelength calculations, but their accuracy is not established by the present benchmarks.

Mock image and observing prescription

The mock HST-like image in Figure 8 contains a common elliptical power-law plus external-shear lens, extended lens-galaxy light, a lensed Sérsic host, and the variable quasar point images. It uses a 1602160^2 grid with 0.025 arcsec pixels and a 0.08 arcsec full width at half maximum point-spread function, with a realization of Poisson and read noise. The light-curve samples are generated separately from the source fluxes, not extracted from this mock image.

For visit depth m5m_5, noiseless magnitude mm, and xphot=100.4(m−m5)x_{\mathrm{phot}} = 10^{0.4(m-m_5)}, the LSST magnitude uncertainty is

σrand2=(0.04−γb)xphot+γbxphot2,σm2=σrand2+σsys2.(55)\sigma_{\mathrm{rand}}^2 = (0.04-\gamma_b)x_{\mathrm{phot}}+\gamma_b x_{\mathrm{phot}}^2,\qquad\sigma_m^2 = \sigma_{\mathrm{rand}}^2+\sigma_{\mathrm{sys}}^2. \tag*{(55)}

We use σsys=0.005\sigma_{\mathrm{sys}} = 0.005 mag, γu=0.038\gamma_u = 0.038, and γg,r,i,z,y=0.039\gamma_{g,r,i,z,y} = 0.039 (Ivezić et al. 2019; Suberlak et al. 2021; Sheng et al. 2022). These mock survey samples omit an additional image-deblending error model.

GPU execution and numerical checks

The solvers use PyTorch tensor operations on CPU or CUDA, with float32 real-pair representations of Ferrari roots, Jacobi functions, and Carlson RFR_F, RDR_D, and RJR_J algorithms. Fixed iteration counts support torch.compile and CUDA graphs, while spatial chunking bounds memory use. For rays from the axial lamp, we evaluate the polar integral analytically and use a numerically stable expression for the radial potential at launch, avoiding loss of precision for nearly tangential rays.

Roots are classified as real when ∣Im⁡rj∣≤ϵmachmax⁡(1,∣rj∣)|\operatorname{Im} r_j| \le\sqrt{\epsilon_{\mathrm{mach}}}\max(1,|r_j|). Numerical checks require the radial integral of 1/R1/\sqrt{R} to reproduce γd−γo\gamma_d-\gamma_o and the polar integral GθG_\theta to reproduce γd\gamma_d. Ill-conditioned polar endpoints are reevaluated in float64 while retaining the radial solution. Rays outside the four-real-root analytic coordinate domain, or failing an endpoint check, use endpoint-regularized Gauss–Legendre quadrature. Any remaining failed coordinates are collected and retried once in float64. A pixel is retained only if its coordinates are finite and the radial and polar solutions agree on the elapsed Mino time.

The SIM5 comparison in § 5.6 and Figure A1 validates the primary observer-to-disc image and transfer, not the lamppost heating or response delays ((Bursa 2017, 2018)). We define the image NMSE as ∑p(Ip−Ip,SIM5)2/∑pIp,SIM52\sum_p (I_p-I_{p,\mathrm{SIM5}})^2/\sum_p I_{p,\mathrm{SIM5}}^2, where pp indexes image pixels. Separate package tests compare lamp integrations with independent geodesic integration, selected lamp travel times with numerical quadrature, and float32 illumination profiles with float64 calculations.

Figure A1. Visual validation of the direct primary observer-to-disc analytic PyTorch Kerr transfer against SIM5 for the Q2237+0305 fiducial spin and inclination. The same matched calculation is also performed for RX J1131−1231 and HE 0435−1223. The panels show the frequency shift, observed brightness, and signed fractional residuals for Q2237+0305. Typical residuals are consistent with float32 numerical precision, with larger differences confined to localized regions. Colourbar extensions mark residuals outside the displayed range. Both calculations reach exactly the same observer-screen pixels in all three cases. Image NMSE ranges from 6.2×10−116.2 \times10^{-11} to 1.2×10−81.2 \times10^{-8}, and integrated flux differs by at most 3.7×10−73.7 \times10^{-7}.

Expanding Supernova Source Example

Our prototype defines the explosion epoch in the observer frame and all evolutionary time-scales in the rest frame. Its bolometric luminosity is

L(t)={0,t≤0,Lpeak(t/tpeak)2.4,0<t≤tpeak,Lpeakexp⁡[−(t−tpeak)/tfall],t>tpeak.(56)L(t) = \begin{cases} 0, & t \le0,\\ L_{\mathrm{peak}}(t/t_{\mathrm{peak}})^{2.4}, & 0 < t \le t_{\mathrm{peak}},\\ L_{\mathrm{peak}}\exp[-(t-t_{\mathrm{peak}})/t_{\mathrm{fall}}], & t > t_{\mathrm{peak}}. \end{cases} \tag*{(56)}

Here LpeakL_{\mathrm{peak}} is the peak bolometric luminosity, tpeakt_{\mathrm{peak}} is its rest-frame peak time, and tfallt_{\mathrm{fall}} is the post-peak exponential decay time-scale. The adopted parameters are Lpeak=1043.2 erg s−1L_{\mathrm{peak}} = 10^{43.2}\,\mathrm{erg}\,\mathrm{s}^{-1}, tpeak=18t_{\mathrm{peak}} = 18 days, and tfall=28t_{\mathrm{fall}} = 28 days. The photosphere expands as Rph=R0+vphtR_{\mathrm{ph}} = R_0 + v_{\mathrm{ph}}t and its colour temperature follows L=4πRph2σSBT4L = 4\pi R_{\mathrm{ph}}^2\sigma_{\mathrm{SB}}T^4. We adopt R0=1011R_0 = 10^{11} cm, vph=1.2×104 km s−1v_{\mathrm{ph}} = 1.2 \times10^4\,\mathrm{km}\,\mathrm{s}^{-1}, and temperature bounds of 3000–18000 K. Time in the expansion law is converted to seconds. When a temperature bound is active, a wavelength-independent dilution factor renormalizes the bounded blackbody to the prescribed bolometric luminosity. This prevents photospheric expansion from producing an artificial late-time rebrightening. A blackbody continuum and a phenomenological rest-UV blanketing factor supply six-band FνF_\nu images. The projected ellipse, position angle, and linear limb-darkening profile evolve on the fixed source grid. Every band-dependent spatial correction is renormalized independently, so it redistributes surface brightness without changing the corresponding band flux. The adopted photospheric parameters are representative prototype values. The approximately three-week achromatic phase is typical rather than universal, but variation in microlensing configuration and filter choice can shorten it to only a few days (Huber et al. 2021). We restrict interpretation to the photospheric phase and do not use this source as a distance estimator or substitute for radiative-transfer templates such as those considered by Huber et al. (2021). The matched 12-macroimage transient benchmark uses 51 map epochs over 200 observer-frame days at a four-day cadence. It uses the same frame-zero dense k=1k = 1 scout to normalize the subsequent k=2k = 2 selected maps as in the adopted fast quasar configuration. The correction is source-model independent.

Figure B1 summarizes the corresponding accuracy and runtime distribution across the 12 macroimages. The fast source-scouted biquadratic IPM method has a median light-curve RMSE of 0.44−0.22+0.720.44^{+0.72}_{-0.22} mmag and a fractional map RMSE of 5.8−3.7+6.7×10−35.8^{+6.7}_{-3.7} \times10^{-3}. The complete light curve takes 0.14−0.016+0.0440.14^{+0.044}_{-0.016} s, or 0.20−0.023+0.0390.20^{+0.039}_{-0.023} s with caustics and labels. The Weisenbach comparison evaluates all 51 epochs, with median light-curve and fractional map RMSEs of 10 mmag and 1.0×10−21.0 \times10^{-2}. Its complete measured light-curve runtime is 93 s, increasing to 500 s when the extrapolated caustic cost is included. Across individual macroimages, the fast IPM scout method has a median single-curve speed advantage of 520 for the light curve and 2.5×1032.5 \times10^3 when the Weisenbach caustic calculation is included. Batching up to four curves increases these median advantages to 620 and 3.6×1033.6 \times10^3.

Figure B1. Accuracy–runtime comparison for the evolving supernova source across the same 12 macroimages as the quasar benchmark. Internal light-curve runtimes refer to all 51 dynamical-map epochs, and fractional map RMSE uses every pixel at every epoch. Light-curve metrics omit only samples below 1 per cent of the peak reference flux in that observer band. For the few above-threshold GPU-D samples with zero candidate flux, the magnitude residual uses the 1 per cent flux-ratio floor. Weisenbach light-curve timing and accuracy use all 51 epochs. Its map errors compare the complete native square with a reference evaluated directly on the same grid. Caustic-stage timing follows § 4.1. GPU-D IRS appears only in the left panels because it does not calculate caustics or labels. Its plotted runtime is the complete measured 51-frame executable process time.

We separately measured throughput for the 51-epoch supernova sequence, which spans 0–200 observer-frame days at a four-day cadence. Batching up to four separate light-curve calculations with matched seed inputs decreases the amortized median runtime from 0.14−0.016+0.0440.14^{+0.044}_{-0.016} s to 0.12−0.015+0.0410.12^{+0.041}_{-0.015} s per curve. The median throughput gain is 1.17−0.062+0.0641.17^{+0.064}_{-0.062} times. For the workload that includes caustics and source-centre labels, the same batching lowers the amortized per-curve runtime from 0.20−0.023+0.0390.20^{+0.039}_{-0.023} s to 0.13−0.016+0.0380.13^{+0.038}_{-0.016} s per curve. The corresponding median throughput gain is 1.38−0.087+0.131.38^{+0.13}_{-0.087} times.

We also evaluate the published GPU-D implementation for all 51 epochs in each macroimage. At the same nominal 10710^7-ray budget, its median complete process time is 22−1.2+1.722^{+1.7}_{-1.2} s for the map sequence. Across matched macroimages, this is 160−24+25160^{+25}_{-24} times slower than the complete fast IPM scout light curve, even though GPU-D does not integrate the source brightness over the magnification maps or calculate caustics and labels. The much smaller transient field is severely undersampled by direct ray deposition at this budget. The median raw fractional map RMSE is 4.2 and 93 per cent of its source-plane pixels receive no ray. The 12 macroimage parameter sets deliberately match the quasar benchmark and are therefore a numerical stress test, not an observability-selected lensed-supernova sample.

Analytic point-lens convergence

An isolated point lens provides an exact end-to-end convergence test without the finite-reference uncertainty of a many-star magnification map. In units of its Einstein radius, the point-source magnification is

μpt(u)=u2+2uu2+4(57)\mu_{\mathrm{pt}}(u) = \frac{u^2 + 2}{u\sqrt{u^2 + 4}} \tag*{(57)}

where uu is the angular lens–source separation in units of the point-lens Einstein radius. We compare the numerical maps with this analytic solution using the fractional map RMSE defined in equation (20). The 102421024^2 source grid spans 4θE4\theta_{\mathrm{E}} on a side, the lens grid spans 6θE6\theta_{\mathrm{E}}, and the reported norm uses 0.08≤u≤1.80.08 \leq u \leq1.8 to exclude the singular point caustic and the finite-field boundary. The IPM calculation retains the fiducial k=2k = 2, r=2r = 2, v=4v = 4 scout, scalar-correction, and biquadratic-polygon settings, while evaluating the sole point lens directly so that an unnecessary far-field approximation cannot set the floor.

Figure C1 fits four ray budgets from 10510^5 to 10610^6. Monte Carlo IRS, shown as the median of eight independent realizations, gives p=−0.5003±0.0001p = -0.5003 \pm0.0001 for ϵμ∝Nrayp\epsilon_\mu\propto N_{\mathrm{ray}}^p, recovering the expected N−1/2N^{-1/2} sampling law. Cartesian IRS gives p=−0.604±0.029p = -0.604 \pm0.029 over the same low-occupancy interval. It converges more rapidly than random sampling but has not yet reached the nominal N−3/4N^{-3/4} boundary-dominated regime. The source-convolved macroimage experiment in § 4.3 suppresses the pixel-occupancy noise and gives the steeper Cartesian IRS rate p=−0.711−0.036+0.014p = -0.711^{+0.014}_{-0.036}. The adopted biquadratic IPM calculation gives p=−0.989±0.008p = -0.989 \pm0.008, recovering the expected N−1N^{-1} piecewise-affine IPM benchmark.

Figure C1. Analytic point-lens convergence over 10510^5–10610^6 nominal rays. Teal circles show the fiducial r=2r = 2, v=4v = 4 biquadratic IPM rule. Blue diamonds show Cartesian IRS. Orange squares and their shaded 16th–84th percentile envelope show eight independent Monte Carlo IRS realizations. Dashed coloured lines are log–log fits over the complete displayed interval.

References

  1. [2]Astropy Collaboration et al., 2018, AJ, 156, 123
  2. [18]Chan J. H. H., Rojas K., Millon M., Courbin F., Bonvin V., Jauffret G., 2021, A&A, 647, A115
  3. [36]Gates D. E. A., Hadar S., Lupasca A., 2021, Phys. Rev. D, 103, 044050
  4. [43]Hamilton A. J. S., 2001, MNRAS, 322, 419
  5. [86]Olver F. W. J., et al., eds, 2026, NIST Digital Library of Mathematical Functions. Release 1.2.8 of 2026-09-15. National Institute of Standards and Technology, https://dlmf.nist.gov/
  6. [91]Planck Collaboration 2020, A&A, 641, A1
  7. [121]van de Ven G., Falcón-Barroso J., McDermid R. M., Cappellari M., Miller B. W., de Zeeuw P. T., 2010, ApJ, 719, 1481
  8. [135]Wu Z., Ho L. C., 2025, ApJ, 985, 197

Paper details

vlnc:W_hh3dxc65
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 11

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

ChatGPT, Codex

View statement
Looking for related papers…
Contents