Repository navigation
Description
autogalaxy currently ships exactly one cored dark-matter profile family: the cored-NFW (cNFWSph, cNFWMCRLudlowSph), whose 3D density is the Baltz–Marshall–Oguri "NFW with a flat inner core" form
rho(r) = rho_s / [ (r/r_s + r_core/r_s) (1 + r/r_s)^2 ].
This is a perfectly good phenomenological core, but it is not the density profile that the self-interacting dark matter (SIDM) literature uses to map a cross-section per unit mass sigma/m onto a halo's inner structure. The standard for SIDM strong-lensing forecasts seems to the isothermal-Jeans profile of Kaplinghat, Tulin & Yu 2016
(arXiv:1508.03339, "Dark Matter Halos as Particle Colliders"): an isothermal core, set by the requirement of (order) one elastic scattering per particle over the halo's age, matched continuously onto an outer collisionless NFW envelope at the radius r_1 where that condition is met.
I would like autogalaxy to ship this as a MassProfile so that SIDM lensing analyses can render cored halos with the same profile their gravothermal models predict, rather than reaching for the phenomenological cNFW core.
Physical model
The Kaplinghat+ 2016 construction has two regions joined at r_1:
-
Inner (isothermal) region,
r < r_1. Insider_1self-interactions thermalise the dark matter, and the density follows the isothermal-Jeans equationsigma_0^2 d ln(rho)/dr = - d Phi/dr, Phi = Phi_DM + Phi_baryons,
with a single velocity dispersion sigma_0. In the DM-only, baryon-negligible limit relevant for low-mass perturbers this integrates to a cored isothermal profile rho_iso(r) with a near-constant central density rho_0 and a core radius set by sigma_0.
-
Outer (collisionless) region,
r >= r_1. Beyondr_1the halo is unmodified NFW with the host's(rho_s, r_s)(equivalently(M_200, c)). -
Matching at
r_1.r_1is defined by one interaction per particle over the aget_age,rho_dm(r_1) <sigma v> / m * t_age = 1,i.e.
(sigma/m) * rho_NFW(r_1) * v_rms(r_1) * t_age = 1. Continuity ofrhoand enclosed massM(<r_1)acrossr_1fixesrho_0andsigma_0given(M_200, c, sigma/m, t_age). Kaplinghat+ 2016 §2 gives the matching conditions; their public code and several re-implementations (Gilman+pyHalo; Robertson+; Yang & Yu) solve the same two-equation system.
Proposed API
Mirror the existing dark-profile layout
(autogalaxy/profiles/mass/dark/):
# autogalaxy/profiles/mass/dark/kaplinghat.py
class KaplinghatCoredNFWSph(MassProfile):
def __init__(
self,
centre=(0.0, 0.0),
kappa_s=0.05, # NFW envelope normalisation (as cNFWSph)
scale_radius=1.0, # r_s in arcsec
sigma_over_m=1.0, # cm^2 / g — SIDM cross-section per unit mass
t_age=10.0, # Gyr — halo age entering the r_1 condition
): ...
# autogalaxy/profiles/mass/dark/kaplinghat_mcr.py
class KaplinghatCoredNFWMCRLudlowSph(KaplinghatCoredNFWSph):
def __init__(
self,
centre=(0.0, 0.0),
mass_at_200=1e9,
sigma_over_m=1.0,
t_age=10.0,
redshift_object=0.5,
redshift_source=1.0,
): ... # derives (kappa_s, r_s) from M_200 via Ludlow16, as cNFWMCRLudlowSphMethods required for the forward-model + analysis paths (same surface ascNFWSph):
convergence_2d_from(grid)— projectedSigma(R)/Sigma_cr. The inner isothermal core has a closed form Abel projection; the outer NFW uses the existing NFW surface-density branch. A continuous, positive, smoothly-varying field for anysigma/m >= 0.deflections_yx_2d_from(grid)—alpha(R) = (2/R) integral_0^R Sigma(R') R' dR'. Closed-form for the isothermal-inside path; the NFW deflection for the outside path; continuous atr_1.potential_2d_from(grid)(for the likelihood path / time delays).- Standard
MassProfileplumbing:mass_at_200-style constructors, pytree registration for the JAX path (cf. PyAutoArray feature/vectorised triangles #286 / PyAutoLens feat: end to endjax.jit(and ideallyvmap) for a multi plane substructure simulator #542), and avmapped_deflections_fromstatic method so the profile composes with the batched substructure simulator (autolens.lens.substructure_util.simulate_substructure).
Limiting behaviour / acceptance criteria
For sigma/m -> 0 (or t_age -> 0): r_1 -> 0, and convergence_2d_from / deflections_yx_2d_from reduce to the host NFW within a few percent. This is the single most important regression to ship with the profile, because it makes the new family a continuous extension of the existing one.
Activity
Jammy2211 commentedon Jun 8, 2026
PyAutoGalaxy PR Created — 2026-06-08
PR
Status
The PyAutoGalaxy implementation phase is complete and open as a
pending-releasePR. This adds the spherical Kaplinghat / SIDM cored-NFW profile, the Ludlow MCR constructor, default priors, exports, and focused tests.PyAutoLens follow-up remains pending because
PyAutoLensis currently claimed by the activedatacube-shared-stateworktree task. Once that clears, the remaining work is to validateal.mp.*exposure and add/update PyAutoLens substructure batching support if required.Tests
test_autogalaxy/profiles/mass/dark/test_kaplinghat.py: 5 passedtest_autogalaxy/ -x: 938 passedJammy2211 commentedon Jun 8, 2026
Library PRs Created — 2026-06-08
PRs
Status
Both PRs are open with the
pending-releaselabel.PyAutoGalaxy adds the Kaplinghat SIDM cored-NFW profile and vmapped deflection support for batched substructure simulations. PyAutoLens adds the matching substructure-array parameter packing and validation.
Tests
7 passed106 passedNext
Workspace impact analysis / smoke-test routing remains pending.
Jammy2211 commentedon Jun 8, 2026
Workspace-Test PR Created — 2026-06-08
PR
Upstream PRs
Summary
Added
KaplinghatCoredNFWSphtoscripts/mass/dark.pyvia the targetedconvergence_funcenclosed-mass cross-check. This exercises the nonzero SIDM-core profile path without making the full-grid potential finite-difference sweep prohibitively slow.Test
scripts/mass/dark.pycompleted; Kaplinghat enclosed-mass row passed.NFWTruncatedSph — grad(p)=atable failure while exiting successfully.Jammy2211 commentedon Jun 8, 2026
Manual Science Review Requested
The implementation PRs are now open:
Before merging, could someone explicitly check the Kaplinghat profile's lensing calculations by hand / independent calculation, especially:
The tests exercise consistency and regression coverage, but given this is a new scientific mass profile, I would like an explicit manual verification that these formulae and numerical integrations are safe before we merge and release.
Jammy2211 commentedon Aug 7, 2026
Closing — this is implemented and merged.
The profile shipped as part of the recent dark-matter profile work:
ag.mp.KaplinghatCoredNFWSph(inner isothermal-Jeans solution matched to an outer NFW envelope at the interaction radiusr_1) plus the Ludlow MCR constructorag.mp.KaplinghatCoredNFWMCRLudlowSph, default priors, exports and tests. Merged 2026-07-08.scripts/mass/dark.py. Merged 2026-07-08.Both classes are re-exported through
al.mp.*, so from PyAutoLens:Thanks for the detailed writeup — the physical model and matching condition in the issue is what the implementation follows. If anything in the profile's behaviour doesn't match what you expect for your SIDM forecasts, please open a new issue.
Generated by Claude Code