Skip to content

Rewrite line-of-sight integral to use cosmology-independent spherical Bessel function cache #4

Description

@hersle

Line-of-sight integrations are currently calculated in los_integrate as

$$I_l(k,\tau_0) = \int_0^{\tau_0} d\tau S(k,\tau) j_l(k(\tau_0-\tau)).$$

This is done over

  • a grid of $k$ that depends on $l/\tau_0$,
  • a grid of $\tau$ that depends on $\tau_0$.

Both of these grids depend on cosmological parameters (e.g. the age of universe changes with parameters).


I think it would be better to rewrite the integral by defining $y = k\tau_0$ and $x=\tau/\tau_0$ and calculating

$$I_l(k,\tau_0) = \tau_0 \int_0^1 dx S(y,x) j_l\left(y \left(1-x\right)\right). $$

This should be equivalent. It could be done over

  • a grid of $y$ that depends only on $l$ (i.e. angular scales the user requests independent of cosmology),
  • a grid of $x \in [0, 1]$.

Both of these grids are independent of cosmological parameters.

Even better, the argument of $j_l(y(1-x))$ is also cosmology-independent, so a cosmology-independent SphericalBesselCache(x, y, l) struct could be created that precomputes values (not splines/functions) of $j_l(y(1-x))$ on given grids of $l$, $y$ and $x$ for efficient reuse in line-of-sight integrating solutions with different cosmological parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions