Skip to content

Allow Separable Growth Functions to compute Isotropized Power Spectra#1216

Merged
damonge merged 4 commits intomasterfrom
cov_separable_growth
Dec 4, 2024
Merged

Allow Separable Growth Functions to compute Isotropized Power Spectra#1216
damonge merged 4 commits intomasterfrom
cov_separable_growth

Conversation

@paulrogozenski
Copy link
Contributor

A large bottleneck in the computation time of covariances is the calculation of isotropized power spectra. The current implementation calculates this at each scale factor considered in the computation. By separating the growth factor from this computation, one can save computation time and maintain accuracy to a good approximation.

The implementation includes optional flags when calculating the 2h_22, 3h, and 4h Trispectrum terms in pk_4pt.py and the corresponding functions for wrappers.

@coveralls
Copy link

coveralls commented Dec 3, 2024

Pull Request Test Coverage Report for Build 12161562031

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 17 of 17 (100.0%) changed or added relevant lines in 1 file are covered.
  • 36 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.04%) to 97.455%

Files with Coverage Reduction New Missed Lines %
pyccl/baryons/baccoemu_baryons.py 1 98.72%
pyccl/cells.py 1 97.92%
pyccl/nl_pt/ept.py 1 99.63%
pyccl/_nonlimber_FKEM.py 2 96.12%
pyccl/pk2d.py 3 98.71%
pyccl/tracers.py 12 95.07%
pyccl/halos/pk_4pt.py 16 96.25%
Totals Coverage Status
Change from base Build 11958349869: 0.04%
Covered Lines: 6548
Relevant Lines: 6719

💛 - Coveralls

p_of_k_a (:class:`~pyccl.pk2d.Pk2D`): a `Pk2D` object to
be used as the linear matter power spectrum. If `None`, the power
spectrum stored within `cosmo` will be used.
separable_growth (Boolean): Indeicates whether a separable
Copy link
Contributor

@rreischke rreischke Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Indeicates -> Indicates and in all following occurrences.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and Boolean -> bool for consistency (and so the docs look nice)

p_of_k_a (:class:`~pyccl.pk2d.Pk2D`): a `Pk2D` object to
be used as the linear matter power spectrum. If `None`, the power
spectrum stored within `cosmo` will be used.
separable_growth (Boolean): Indeicates whether a separable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Indeicates -> Indicates

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean -> bool

Copy link
Collaborator

@damonge damonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @paulrogozenski ! Just a few typos (thanks @rreischke )

zero values are found).
separable_growth (Boolean): Indeicates whether a separable
growth function approximation can be used to calculate
the isotropized power spectrum.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeicates -> Indicates
Boolean -> bool

zero values are found).
separable_growth (Boolean): Indeicates whether a separable
growth function approximation can be used to calculate
the isotropized power spectrum.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indicates, bool

zero values are found).
separable_growth (Boolean): Indeicates whether a separable
growth function approximation can be used to calculate
the isotropized power spectrum.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indicates, bool

p_of_k_a (:class:`~pyccl.pk2d.Pk2D`): a `Pk2D` object to
be used as the linear matter power spectrum. If `None`, the power
spectrum stored within `cosmo` will be used.
separable_growth (Boolean): Indeicates whether a separable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and Boolean -> bool for consistency (and so the docs look nice)

p_of_k_a (:class:`~pyccl.pk2d.Pk2D`): a `Pk2D` object to
be used as the linear matter power spectrum. If `None`, the power
spectrum stored within `cosmo` will be used.
separable_growth (Boolean): Indeicates whether a separable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean -> bool

p_of_k_a (:class:`~pyccl.pk2d.Pk2D`): a `Pk2D` object to
be used as the linear matter power spectrum. If `None`, the power
spectrum stored within `cosmo` will be used.
separable_growth (Boolean): Indeicates whether a separable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boolean -> bool

zero values are found).
separable_growth (Boolean): Indeicates whether a separable
growth function approximation can be used to calculate
the isotropized power spectrum.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indicates, bool

@damonge
Copy link
Collaborator

damonge commented Dec 4, 2024

Also, we need to add a unit test for this. Checking that you get the same result for some of this functions with or without scaling would be enough.

Copy link
Contributor

@rreischke rreischke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, apart from the typo (as noted by @damonge ).

If the results agree, we can merge.

Copy link
Contributor

@rreischke rreischke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks Paul!

@paulrogozenski paulrogozenski removed the request for review from carlosggarcia December 4, 2024 14:57
Copy link
Collaborator

@damonge damonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@damonge damonge merged commit 406b548 into master Dec 4, 2024
@damonge damonge deleted the cov_separable_growth branch December 4, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants