Skip to content

Add a Kaplinghat, Tulin & Yu (2016) isothermal-Jeans cored-NFW dark matter mass profile #564

Closed

Description

@mwiet

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. Inside r_1 self-interactions thermalise the dark matter, and the density follows the isothermal-Jeans equation

    sigma_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. Beyond r_1 the halo is unmodified NFW with the host's (rho_s, r_s) (equivalently (M_200, c)).

  • Matching at r_1. r_1 is defined by one interaction per particle over the age t_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 of rho and enclosed mass M(<r_1) across r_1 fixes rho_0 and sigma_0 given (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 cNFWMCRLudlowSph

Methods required for the forward-model + analysis paths (same surface ascNFWSph):

  1. convergence_2d_from(grid) — projected Sigma(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 any sigma/m >= 0.
  2. 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 at r_1.
  3. potential_2d_from(grid) (for the likelihood path / time delays).
  4. Standard MassProfile plumbing: mass_at_200-style constructors, pytree registration for the JAX path (cf. PyAutoArray feature/vectorised triangles #286 / PyAutoLens feat: end to end jax.jit (and ideally vmap) for a multi plane substructure simulator #542), and a vmapped_deflections_from static 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

  1. Jammy2211 commented on Jun 8, 2026

    @Jammy2211
    Collaborator

    PyAutoGalaxy PR Created — 2026-06-08

    PR

    Status

    The PyAutoGalaxy implementation phase is complete and open as a pending-release PR. 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 PyAutoLens is currently claimed by the active datacube-shared-state worktree task. Once that clears, the remaining work is to validate al.mp.* exposure and add/update PyAutoLens substructure batching support if required.

    Tests

    • test_autogalaxy/profiles/mass/dark/test_kaplinghat.py: 5 passed
    • Neighbouring dark-profile subset: 41 passed
    • Full test_autogalaxy/ -x: 938 passed
  2. Jammy2211 commented on Jun 8, 2026

    @Jammy2211
    Collaborator

    Library PRs Created — 2026-06-08

    PRs

    Status

    Both PRs are open with the pending-release label.

    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

    • PyAutoGalaxy Kaplinghat profile tests: 7 passed
    • PyAutoLens lens/config subset against the corrected local PyAutoGalaxy branch: 106 passed

    Next

    Workspace impact analysis / smoke-test routing remains pending.

  3. Jammy2211 commented on Jun 8, 2026

    @Jammy2211
    Collaborator

    Workspace-Test PR Created — 2026-06-08

    PR

    Upstream PRs

    Summary

    Added KaplinghatCoredNFWSph to scripts/mass/dark.py via the targeted convergence_func enclosed-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.py completed; Kaplinghat enclosed-mass row passed.
    • The script still reports the pre-existing NFWTruncatedSph — grad(p)=a table failure while exiting successfully.
  4. Jammy2211 commented on Jun 8, 2026

    @Jammy2211
    Collaborator

    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:

    • deflection angles
    • convergence
    • potential

    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.

  5. Jammy2211 commented on Aug 7, 2026

    @Jammy2211
    Collaborator

    Closing — this is implemented and merged.

    The profile shipped as part of the recent dark-matter profile work:

    • PyAutoGalaxy#471 — ag.mp.KaplinghatCoredNFWSph (inner isothermal-Jeans solution matched to an outer NFW envelope at the interaction radius r_1) plus the Ludlow MCR constructor ag.mp.KaplinghatCoredNFWMCRLudlowSph, default priors, exports and tests. Merged 2026-07-08.
    • PyAutoLens#567 — substructure-array support so both profiles pack correctly for batched multi-plane substructure simulation. Merged 2026-07-08.
    • autolens_workspace_test#139 — enclosed-mass cross-check coverage in scripts/mass/dark.py. Merged 2026-07-08.

    Both classes are re-exported through al.mp.*, so from PyAutoLens:

    halo = al.mp.KaplinghatCoredNFWSph(...)
    halo = al.mp.KaplinghatCoredNFWMCRLudlowSph(...)   # from mass_at_200, sigma_over_m, t_age, redshifts

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions