Repository navigation
Implement Einasto and Core Einasto profiles - #500
Merged
Merged
Conversation
- Core Einasto enclosed mass had the wrong sign: gsl_sf_gamma_inc is the upper incomplete gamma, so differences of it gave -M(r) - Einasto potential at r=0 included a spurious term - Inside the core (r < r_c) the closed-form mass cancels catastrophically; integrate rho numerically with gsl_integration_qng there instead - Einasto now shares the core-Einasto implementation with r_c = 0 - Compute scale^a Gamma(a) in log space to avoid overflow at small alpha - Add Hessians for both potentials and remove unused helpers Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add both potentials to CANONICAL (fixes test collection), enable Hessian tests, compare Phi and dPhi/dr to direct quadrature of the density, and check that core Einasto with r_c = 0 matches Einasto. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
adrn
force-pushed
the
potential/einasto
branch
from
October 16, 2026 21:17
9eed01e to
87f3576
Compare
The Einasto C functions only exist when compiled with GSL, so reference them only under USE_GSL (as PowerLawCutoffWrapper does) and mark both potentials GSL_only. Fixes an undefined-symbol ImportError on import of gala.potential in no-GSL builds. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Fixes #368.
The core einasto model is currently failing tests and I'm not sure where the bug is!
Checklist
CHANGES.rst)