Skip to content

feat: PowerLawIntermediate — intermediate-axis (COOLEST) Einstein radius power-law#503

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/coolest-powerlaw-herculens
Jul 17, 2026
Merged

feat: PowerLawIntermediate — intermediate-axis (COOLEST) Einstein radius power-law#503
Jammy2211 merged 1 commit into
mainfrom
feature/coolest-powerlaw-herculens

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds ag.mp.PowerLawIntermediate (PyAutoLens#616, follow-up to the COOLEST interop #612): an elliptical power-law identical in mass distribution to PowerLaw, but whose einstein_radius is the intermediate-axis Einstein radius used by COOLEST/lenstronomy/herculens — theta_int = sqrt(q)·(2/(1+q))^(1/(gamma−1))·theta_PL. Its COOLEST PEMD mapping is therefore an identity (no √q factors), giving direct parameter-level exchange with other lens modeling codes.

Implementation is a behavior-preserving hook: PowerLawCore.einstein_radius_major_from(xp) (returns einstein_radius for all existing profiles) now feeds einstein_radius_rescaled and PowerLaw.deflections_yx_2d_from; the new class overrides only that hook with the xp-threaded conversion (JAX-traceable like its parent). Also: ag.mp export, PowerLawIntermediate: priors block in config/priors/mass/total/power_law.yaml (verified via af.Model(...)), and interop.coolest.mass_profile_from(..., intermediate=True) to rebuild PEMDs in this parameterisation.

API Changes

Added only — ag.mp.PowerLawIntermediate, the einstein_radius_major_from hook (identity for existing profiles), and an optional intermediate kwarg on interop.coolest.mass_profile_from. No existing symbol's behaviour changes (full suite is the regression net).
See full details below.

Test Plan

  • New test_autogalaxy/profiles/mass/total/test_power_law_intermediate.py: PowerLawIntermediate ≡ PowerLaw convergence/deflections/potential under the θ rescale (parametrized over q, γ incl. isothermal); analytic COOLEST-form certification with identity θ_E; PowerLaw numeric pin proving the hook is a no-op.
  • test_autogalaxy/interop/: COOLEST mapping identity + intermediate=True round trip + default-import equivalence.
  • Full suite: 988 passed.
Full API Changes (for automation & release notes)

Added

  • ag.mp.PowerLawIntermediate(centre, ell_comps, einstein_radius, slope) — power-law with intermediate-axis (COOLEST) Einstein radius
  • PowerLawCore.einstein_radius_major_from(xp) — convention hook; returns einstein_radius for all pre-existing profiles
  • autogalaxy.interop.coolest.mass_profile_from(..., intermediate=False) — new optional kwarg; True builds PEMD as PowerLawIntermediate
  • config/priors/mass/total/power_law.yamlPowerLawIntermediate: block

Generated by the PyAutoLabs agent workflow.

New elliptical power-law whose einstein_radius parameter follows the
intermediate-axis convention of COOLEST/lenstronomy/herculens
(theta_int = sqrt(q) (2/(1+q))^(1/(gamma-1)) theta_PL), giving an
identity COOLEST PEMD mapping. Implemented via a behavior-preserving
einstein_radius_major_from(xp) hook in PowerLawCore/PowerLaw (all
existing profiles numerically unchanged; full suite green), a thin
xp-threaded override, ag.mp export, and a priors-config block.
mass_profile_from gains intermediate=True to rebuild PEMDs as
PowerLawIntermediate.

Part of PyAutoLabs/PyAutoLens#616.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Jul 17, 2026
@Jammy2211
Jammy2211 merged commit 5c79b90 into main Jul 17, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/coolest-powerlaw-herculens branch July 17, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant