hmf.core.transfer

The Transfer stage: the transfer function and unnormalised P(k) at z = 0.

The stage holds a cosmology, a transfer model and the wavenumber accuracy (k_accuracy). It solves the model once (one Boltzmann run, for a CAMB or CLASS model) and gives, for each matter species ("cb", CDM + baryons; "tot", total matter):

Every species comes from the same solution, so asking for the power spectrum of one species and normalising with another never runs the Boltzmann code twice. Runs are also memoised by the content of their input, so stages that differ only in n_s (or in fields the run does not depend on) share one run, and they can be cached on disk across processes (disk_cache).

The cosmology field

The cosmology is an astropy FLRW. Astropy cosmologies are immutable and compare by value, but are not hashable, so the field is compared and hashed by cosmology_key(): its class and parameter values, without its name and metadata. Two stages with equal parameters are therefore equal (and hash equal) even if their cosmologies have different names.

Classes

Transfer(*, cosmology[, Om0, Tcmb0, Neff, ...])

The transfer function and the shape of the linear power spectrum at z = 0.

UnnormalisedPower(*, transfer, species)

The shape of the linear power spectrum of one species at z = 0, at kernel level.