CAMB: reuse results with changing source windows

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Nicolas Tessore
Posts: 2
Joined: February 08 2019
Affiliation: UCL

CAMB: reuse results with changing source windows

Post by Nicolas Tessore » October 11 2022

I am repeatedly computing angular power spectra for counts and lensing using the exact same cosmology, but differing splined source windows. You could think of it as exploring different parametrisations of $n(z)$.

Is there a way for CAMB to reuse parts of the computation, such as e.g. the nonlinear matter power spectra? It seems that passing the updated parameter object pars in the call to get_source_cls_dict(pars, ...) is not much different than calling it on new results as in get_results(pars).get_source_cls_dict(...).

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: CAMB: reuse results with changing source windows

Post by Antony Lewis » October 13 2022

No, the best you can do is pass an array of source windows to calculate them all at once. Of course for quick investigations, or where limber is accurate, you could just separately calculate the result yourself from Pk using Limber.

Nicolas Tessore
Posts: 2
Joined: February 08 2019
Affiliation: UCL

Re: CAMB: reuse results with changing source windows

Post by Nicolas Tessore » October 13 2022

Thanks, that's what I was doing, but I was hoping to get around the "batching" that it requires. Unfortunately, Limber is not an option.

NB: A related question maybe, can (or could) CAMB compute not the entire matrix of cls, but e.g. just individual rows like "W1xWn"?

Antony Lewis
Posts: 1941
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: CAMB: reuse results with changing source windows

Post by Antony Lewis » October 14 2022

Currently it calculates all of them. I don't think it would be much faster as calculating the Cl is relatively quick once you have the transfer functions (except perhaps for very large arrays of windows).

Post Reply