Skip to content

fix: elliptical MGE potential via deflection line integral#460

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/mge-potential-elliptical
May 27, 2026
Merged

fix: elliptical MGE potential via deflection line integral#460
Jammy2211 merged 1 commit into
mainfrom
feature/mge-potential-elliptical

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Replace the circular E1 potential formula with Gauss-Legendre quadrature integration of the MGE deflection field along radial lines. The E1 formula only worked for spherical profiles; the new approach correctly handles elliptical profiles by construction. Fixes #459.

Key results (from Phase 1 self-consistency tests):

  • Sersic/SersicCore/Exponential elliptical: was FAIL (4%), now PASS (1e-4)
  • DevVaucouleurs elliptical: was FAIL (3%), now PASS (9e-4)
  • Chameleon elliptical: was FAIL (1%), now PASS (8e-3)
  • cNFW elliptical: was FAIL (5%), now PASS (1e-4)
  • Gaussian: still fails — MGE decomposition of a single narrow Gaussian is inherently lossy (known limitation, needs direct analytic implementation)

API Changes

Changed internal implementation of MGEDecomposer.potential_2d_via_mge_from. Added sigma_function static method and n_quad parameter. No public API changes.

Test Plan

  • pytest test_autogalaxy/profiles/mass/ — 406 passed, 0 failed
  • Elliptical Sersic/Chameleon/DevVaucouleurs/cNFW now PASS self-consistency
  • Spherical profiles unchanged (still PASS)

🤖 Generated with Claude Code

Replace the circular E1 potential formula (which only worked for
spherical profiles) with a Gauss-Legendre quadrature integration of
the MGE deflection field along radial lines. This correctly handles
elliptical profiles by construction — the potential is the integral
of the (verified correct) MGE deflections.

Sersic, SersicCore, Exponential, DevVaucouleurs, Chameleon, cNFW
elliptical variants all now pass self-consistency checks (errors
1e-4 to 1e-3). Gaussian mass profile remains a known limitation
(MGE decomposition of a single narrow Gaussian is inherently lossy).

Fixes #459.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label May 27, 2026
@Jammy2211 Jammy2211 merged commit 8154981 into main May 27, 2026
6 checks passed
@Jammy2211 Jammy2211 deleted the feature/mge-potential-elliptical branch May 27, 2026 14:17
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.

fix: elliptical MGE potential via Shajib 2019 line integral

1 participant