Skip to content

gh-289: Adding new tracer class PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC - #534

Draft
NastassiaG wants to merge 41 commits into
mainfrom
289-PositionsTracerWeyl
Draft

gh-289: Adding new tracer class PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC #534
NastassiaG wants to merge 41 commits into
mainfrom
289-PositionsTracerWeyl

Conversation

@NastassiaG

Copy link
Copy Markdown
Collaborator

🚀 Pull Request Checklist

✅ Summary

This PR adds new Weyl-specific PositionsTracer classes, enabling a model-independent measurement of the Weyl potential.

🔄 Changes

  • cloelib/observables/photo_Weyl.py (new): adds two new Weyl tracer classes.
  • cloelib/cosmology/Weyl_cosmology.py (new): adds a wrapper class that applies a non-linear boost to a power spectrum at fixed z_ini.
  • cloelib/summary_statistics/angular_two_point.py (small modifications): checks based on type(...) are not compatible with subclasses of PositionsTracer, so an isinstance(...) fallback was added for compatibility with the new Weyl tracer classes.
  • Updated the perturbations and observables documentation to include the new classes.

🛠 How to Test

A dedicated playground branch (called as well 289-PositionsTracerWeyl) has been used to test these changes extensively, including:

  • Initializing instances of both new classes, PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC, with various settings.
  • Computing angular power spectra for GC and GGL using the new tracer classes.
  • Comparing the Weyl and standard positions tracer classes at the level of both window functions and angular power spectra.

📝 Documentation

  • This PR updates documentation
  • This PR does not require documentation changes
  • Issue created for documentation update: Don't forget to link the task!

🏗 Related Issues

Resolves #289

📌 Additional Notes

A follow-up PR will include Weyl-specific EuclidLikelihood classes in cloelike and, if appropriate, merge the playground branch into main.

✅ PR Checklist for Developers

  • I have titled this PR before merging as "gh-#:", where "#" represents the task it closes
  • I have run locally pre-commit using pre-commit run --all-files
  • I have tested my changes locally
  • No new warnings or errors introduced
  • I have updated documentation (if applicable)
  • My changes do not introduce breaking changes (i.e: the package still gets installed)
  • I have added unit tests (if applicable)
  • I have consistently updated the GitHub information for the project, including milestones, task types, and other relevant details.

✅ PR Checklist for Reviewers

  • The next PR targets the correct branch
  • CI tests have run and passed for the latest commit on the source branch
  • Check that the code can still be installed if new packages are imported
  • If necessary, the notebooks in the playground will be updated in a corresponding follow-up PR
  • Coverage percentage is retained or increased
  • Quality of new/changed code is acceptable
  • Quality of new/changed unit tests is acceptable
  • No data files have been included in the commits
  • Implementation follows the agreed task description point by point
  • Check that any added folder/file has been added to the README.md file
  • Check that the documentation has been updated accordantly
  • Check that the corresponding branch has been deleted after merging. If not, delete it

Created a new file photo_Weyl.py, with a class PositionsTracer_Weyl. Appropriate changes compared to the original PositionsTracer still need to be implemented.
For both classes, this keeps only the per-bin implementation of the bias; per-bin Jhat introduced for the GGL class; multiplied positions window function in GGL class with Jhat and \Omega_m^{-1}(z).
Added pre-factors of growth function and sigma_8
sigma8_ini implemented such that it works with a CAMB background
Changed name of parameter b1_photo to bhat; small adjustments in comments
Fixed mistake when dividing through Omega_m(z) in GGL positions window function.
Classes PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC are now implemented as child classes of PositionsTracer.
Added an isinstance fallback in the rule resolver so subclasses of PositionsTracer (e.g. PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC) correctly match existing (PositionsTracer, PositionsTracer) rules.
New class Weyl_Perturbations allows us to apply a boost to the initial matter power spectrum; It's init function takes an instance of a Perturbations class as argument, while the new class itself also follows the Perturbations protocol
Changes taking into account that sigma8_0 can now be called consistently for each perturbations class
Some changes for compatibility with CLASS perturbations
Updated class_cosmology for compatibility with photo.py
Removed np.array input to Omega_m0 (not necessary with modified class_cosmology.py)
Adding k to Weyl_perturbations.py, and adjustments in photo_Weyl.py to use self.perturbations.k instead of np.array([0.01])
Omega_m at z now directly calculated as self.background.Omega_m(y)
Adjusting growth_rate to properly include RSD effect.
include_rsd parameter added; adjusted window functions of Positions_Tracer_Weyl to include one growth_factor only; created new class ShearTracer_Weyl which multiplies original window function with growth_factor
GR growth factor now included in RSD window functions (instead of growth_rate in photo_Weyl.py); ShearTracer_Weyl removed again
Renamed Weyl_cosmology.py into Weyl_perturbations.py; Implemented general boost; added some sanity checks
Check tracer_types with isinstance for compatibility with child classes of PositionTracer
Add sigma8_0() to HMemuLinearPerturbations; change name of self.sigma8_0 array to self.sigma8 to avoid method being overwritten by array
Use current file version from main
@NastassiaG NastassiaG added this to the v0.12 milestone May 14, 2026
@NastassiaG NastassiaG added weak-lensing Tasks related to the photometric observables th-2 labels May 14, 2026
@NastassiaG

Copy link
Copy Markdown
Collaborator Author

@cloe-org/cloe-maintainers I believe this branch is in good shape. It has two new files and one changed file. I've grouped them all into one draft PR, since they're all related to the new Weyl PositionsTracer classes, but let me know if you prefer to split them into various PRs. Also, let us know if unit tests are required for this - if yes, maybe @zsirap could look into it ?

@NastassiaG NastassiaG changed the title gh-#289 gh-#289 Adding new tracer class PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC May 15, 2026
@NastassiaG NastassiaG changed the title gh-#289 Adding new tracer class PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC gh-#289: Adding new tracer class PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC May 15, 2026
@gcanasherrera gcanasherrera changed the title gh-#289: Adding new tracer class PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC gh-289: Adding new tracer class PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC May 18, 2026
Included sigma8_zini calculation in Weyl_cosmology.py and adjusted scale at which the growth factor is evaluated
Remove default value 1 for bhat_bin and Jhat_bin parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

th-2 weak-lensing Tasks related to the photometric observables

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding new tracer class PositionsTracer_Weyl_GGL and PositionsTracer_Weyl_GC

2 participants