pyccl.tk3d module
- class pyccl.tk3d.Tk3D(self, *, a_arr, lk_arr, tkk_arr=None, pk1_arr=None, pk2_arr=None, is_logt=True, extrap_order_lok=1, extrap_order_hik=1)[source]
Bases:
CCLObject
A container for “isotropized” connected trispectra, relevant for covariance matrix calculations. These are functions of 3 variables of the form \(T(k_1,k_2,a)\), where \(k_i\) are wavenumbers, and \(a\) is the scale factor. This function can be provided as a 3D array (one dimension per variable), or as two 2D arrays corresponding to functions \(f_i(k,a)\) such that
\[T(k_1,k_2,a) = f_1(k_1,a)\,f_2(k_2,a)\]Typical uses for these objects will be:
To store perturbation theory or halo model “isotropized” connected trispectra of the form:
\[\bar{T}_{abcd}(k_1, k_2, a) = \int \frac{d\varphi_1}{2\pi} \int \frac{d\varphi_2}{2\pi} T_{abcd}({\bf k_1},-{\bf k_1},{\bf k_2},-{\bf k_2}),\]where \({\bf k}_i\equiv k_i(\cos\varphi_i,\sin\varphi_i,0)\), and \(T_{abcd}({\bf k}_a,{\bf k}_b,{\bf k}_c,{\bf k}_d)\) is the connected trispectrum of fields \(\{a,b,c,d\}\).
To store the kernel for super-sample covariance calculations as a product of the responses of power spectra to long-wavelength overdensity modes \(\delta_L\):
\[\bar{T}_{abcd}(k_1,k_2,a)= \frac{\partial P_{ab}(k_1,a)}{\partial\delta_L}\, \frac{\partial P_{cd}(k_2,a)}{\partial\delta_L}.\]These objects can then be used, analogously to
Pk2D
objects, to construct the non-Gaussian covariance of angular power spectra via Limber integration. Seecovariances
.- Parameters:
a_arr (array) – an array holding values of the scale factor. Note that the trispectrum will be extrapolated as constant on values of the scale factor outside those held by this array.
lk_arr (array) – an array holding values of the natural logarithm of the wavenumber (in units of \({\rm Mpc}^{-1}\)).
tkk_arr (array) – a 3D array with shape
[na,nk,nk]
, wherena
andnk
are the sizes ofa_arr
andlk_arr
respectively. This array should contain the values of the trispectrum at the values of scale factor and wavenumber held bya_arr
andlk_arr
. The array can hold the values of the natural logarithm of the trispectrum, depending on the value ofis_logt
. Iftkk_arr
isNone
, then it is assumed that the trispectrum can be factorized as described above, and the two functions \(f_i(k_i,a)\) are described bypk1_arr
andpk2_arr
. You are responsible for making sure all these arrays are sufficiently well sampled (i.e. the resolution ofa_arr
andlk_arr
is high enough to sample the main features in the trispectrum). For reference, CCL will use bicubic interpolation to evaluate the trispectrum in the 2D space of wavenumbers \((k_1,k_2)\) at a fixed scale factor, and will use linear interpolation in the scale factor dimension.pk1_arr (array) – a 2D array with shape
[na,nk]
describing the first function \(f_1(k,a)\) that makes up a factorizable trispectrum \(T(k_1,k_2,a)=f_1(k_1,a)f_2(k_2,a)\).pk1_arr
andpk2_arr
are ignored iftkk_arr
is notNone
.pk2_arr (array) – a 2D array with shape
[na,nk]
describing the second factor \(f_2(k,a)\) for a factorizable trispectrum.is_logt (
bool
) – if True,tkk_arr
/pk1_arr
/pk2_arr
hold the natural logarithm of the trispectrum (or its factors). Otherwise, the true values of the corresponding quantities are expected. Note that arrays will be interpolated in log space ifis_logt
is set toTrue
.extrap_order_lok (
int
) – extrapolation order to be used on k-values below the minimum of the splines (use 0 or 1). Note that the extrapolation will be done in either \(\log(T(k_1,k_2,a))\) or \(T(k_1,k_2,a)\), depending on the value ofis_logt
.extrap_order_hik (
int
) – same asextrap_order_lok
for k-values above the maximum of the splines.
- __call__(k, a)[source]
Evaluate trispectrum. If
k
is a 1D array with sizenk
, anda
is a scalar, the outputout
will be a 2D array with shape[nk,nk]
holdingout[i,j] = T(k[j],k[i],a)
, whereT
is the trispectrum function held by thisTk3D
object. Ifa
is an array, the shape will be[len(a),nk,nk]
.
- property has_tsp
- property extrap_order_lok
- property extrap_order_hik