Skip to content

[Feature Req] Vectorised redshift calculations in hmf+halomod #discussion #247

@andrejdvornik

Description

@andrejdvornik

Is your feature request related to a problem? Please describe.
This feature request is not related to a problem, but would significantly speed up calculations, with relatively little development (I think).

Describe the solution you'd like
It would be quite practical to implement an option to pass a redshift array and evaluate all the quantities at all redshifts in the array. While one can easily use the update() method to loop over redshifts, some initial testing shows that passing an array is around factor of 10 faster.

Additional context
I have tried to rough hack the implementation in hmf, and it shows significant speed up with minimal development, as majority of functions seem to work out of the box on (all numpy array broadcasting is mostly there, CAMB seems to deal with that without an issue either, there is only a couple of interpolation functions that need some further changes).
The same would need to be passed on to halomod, where it seems that the implementation is a bit more involved, but not impossible.

I am willing to have a proper go at this myself in the following weeks/months and can open PRs for implementation. Any thoughts welcome, or reasons why this might not be a good idea...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions