Theory Module

MGLensing.theory

class MGLensing.theory.Theory(SurveyClass, model: dict)

Bases: object

Initialize the theory class with the given survey and model parameters.

Parameters:

SurveyClassobject

An instance of the survey class containing survey-specific information.

modeldict

A dictionary containing model parameters with the following keys:

  • ‘nl_model’: Nonlinear model option. Valid options are:
    • NL_MODEL_HMCODE

    • NL_MODEL_BACCO

    • NL_MODEL_NDGP

    • NL_MODEL_GAMMAZ

    • NL_MODEL_MUSIGMA

    • NL_MODEL_DS

  • ‘baryon_model’: Baryonic model option. Valid options are:
    • NO_BARYONS

    • BARYONS_HMCODE

    • BARYONS_BCEMU

    • BARYONS_BACCO

  • ‘ia_model’: Intrinsic alignment model option. Valid options are:
    • IA_NLA

    • IA_TATT

  • ‘bias_model’: Galaxy bias model option. Valid options are:
    • BIAS_LIN

    • BIAS_B1B2

    • BIAS_HEFT

  • ‘photoz_err_model’: Redshift uncertainty model option. Valid options are:
    • PHOTOZ_NONE

    • PHOTOZ_ADD

    • PHOTOZ_MULT

Raises:

ValueError:

If an invalid option is provided for ‘nl_model’, ‘baryon_model’, ‘ia_model’, or ‘bias_model’. If ‘ia_model’ is set to IA_TATT and ‘bias_model’ is not BIAS_LIN.

apply_relations(params)

Apply cosmological parameter relations and compute derived parameters.

Parameters:

params (dict): Dictionary containing cosmological parameters.

Returns:

dict: Updated dictionary with derived cosmological parameters.

check_consistency(params)

Check the consistency of the provided cosmological parameters.

Parameters:

params (dict): Dictionary containing cosmological parameters.

Raises:

KeyError: If ‘h’ is not found in the dictionary.

ValueError: If too many density parameters are present,

if multiple amplitude parameters are present, or if no amplitude parameters are present.

Returns:

dict: Updated parameters after applying relations.

check_pars(param_dic)

Check and validate the parameters for the model within a chain.

Parameters:

param_dic (dict): Dictionary containing the parameters to be checked.

Returns:

tuple: A tuple containing the updated parameter dictionary and the status

of the parameter range check.

check_pars_ini(param_dic)

Initial check and validate the parameters for the model and data.

Parameters:

param_dic (dict): Dictionary containing the parameters to be checked.

Returns:

tuple: A tuple containing the updated parameter dictionary and the status

of the parameter range check.

Raises:

KeyError: If the required parameter ‘h’ is not found in the parameter dictionary.

KeyError: If some cosmological parameters are missing from the parameter dictionary.

check_ranges(params)

Check if the parameters are within the valid ranges for the emulators at each step of MCMC.

Parameters:

params (dict): Dictionary containing the parameters to be checked.

Returns:

boolean: True if all parameters are within the valid ranges, False otherwise.

check_ranges_ini(params)

Check if the parameters are within the valid ranges for the emulators once at initialization of data and model with explicit error messages.

Parameters:

params (dict): Dictionary containing the parameters to be checked.

Returns:

boolean: True if all parameters are within the valid ranges, False otherwise.

compute_3x2pt(params_dic)

Compute the 3x2pt correlation functions. Use this when all 3 correlation funcions are required, as it is designed to compute properties needed in different computations just once. Attention: order of IA-components is importnant!

Parameters:

params_dicdict

Dictionary containing cosmological and survey parameters.

Returns:

cl_llndarray

Weak lensing angular power spectra of length Survey.nell_wl.

cl_ggndarray

Photometric galaxy clustering angular power spectra of length Survey.nell_gc.

cl_lgndarray

Cross-correlated galaxy-galaxy lensing angular power spectra of length Survey.nell_xc.

cl_glndarray

Cross-correlated galaxy-galaxy lensing angular power spectra of length Survey.nell_xc.

compute_covariance_cosmosis_3x2pt(params_dic)
compute_covariance_gc(params_dic)

Compute the Gaussian (only diagonal components with \(\ell=\ell'\)) covariance matrix for the galaxy clustering (GC) analysis. This function calculates the covariance matrix for the auto-correlation of galaxy clustering. The covariance matrix is computed for different bins and multipoles as follows:

\[\mathrm{Cov}[C_{ij}^{GG}(\ell)C_{kl}^{GG}(\ell)]=\frac{1}{2f_{\rm sky}(2 \ell+1) \Delta \ell} \left( C^{GG}_{ik}C^{GG}_{jl}+C^{GG}_{il}C^{GG}_{jk}\right)\, ,\]

where \(G\) corresponds to galaxy clustering and \(i,j\) correspond to redshift bins.

Parameters:

params_dicdict

Dictionary containing the parameters required for the computation of the galaxy clustering angular power spectra.

Returns:

cov_flat_maskednumpy.ndarray

The masked covariance matrix for the galaxy clustering analysis.

compute_covariance_wl(params_dic)

Compute the Gaussian (only diagonal components with \(\ell=\ell'\)) covariance matrix for the weak lensing (WL) analysis. This function calculates the covariance matrix for the weak lensing analysis, which includes the auto-correlation of shear (LL). The covariance matrix is computed for different bins and multipoles as follows:

\[\mathrm{Cov}[C_{ij}^{LL}(\ell)C_{kl}^{LL}(\ell)]=\frac{1}{2f_{\rm sky}(2 \ell+1) \Delta \ell} \left( C^{LL}_{ik}C^{LL}_{jl}+C^{LL}_{il}C^{LL}_{jk}\right)\, ,\]

where \(L\) corresponds to weak lensing and \(i,j\) correspond to redshift bins.

Parameters:

params_dicdict

Dictionary containing the parameters required for the computation of the weak lensing angular power spectra.

Returns:

cov_flat_maskednumpy.ndarray

The masked covariance matrix for the weak lensing analysis.

compute_data_matrix_3x2pt(params_dic)

This function computes the 3x2pt angular power spectra and composes a matrix for computing the likelihood with determinants. The resulting matrix is structured as:

\[\begin{split}\begin{pmatrix} C_{LL} & C_{LG} \\ C_{GL} & C_{GG} \end{pmatrix}\end{split}\]

for the same scale-cuts per-redshift bin, i.e. ell_max_gc. We also compute a “high”-matrix for ell>ell_max_gc with weak lensing angular power spectra, as we assume that ell_max_wl>ell_max_gc. These matrices are later used in the likelihood computation via determinants.

Parameters:

params_dicdict

Dictionary containing the parameters required for computing the 3x2pt angular power spectra.

Returns:

cov_theorynumpy.ndarray

The data matrix for the 3x2pt angular power spectra.

cov_theory_highnumpy.ndarray

The data matrix for ell > ell_max_gc with weak lensing angular power spectra.

compute_data_matrix_gc(params_dic)

This function computes the angular power spectra for galaxy clustering using the provided parameters dictionary, and then constructs the data matrix based on the computed power spectra and survey parameters. This is later used in likelihood with determinants.

Parameters:

params_dicdict

Dictionary containing the parameters required for computing the galaxy clustering spectra.

Returns:

cov_theorynumpy.ndarray

The computed data matrix for the photo-GC data.

compute_data_matrix_wl(params_dic)

This function calculates the weak lensing angular power spectra using the provided parameters and constructs the corresponding covariance matrix. This is later used in lieklihood with determinants.

Parameters:

params_dicdict

Dictionary containing the parameters required for computing the shear power spectra.

Returns:

cov_theorynumpy.ndarray

The computed data matrix for the weak lensing data.

compute_data_vector_3x2pt(params_dic)

This function calculates the 3x2pt angular power spectra and constructs a data vector by combining the power spectra for different bins. It then applies a mask to the data vector based on the survey’s scale-cuts per photo-z bin.

Parameters:

params_dicdict

Dictionary containing the parameters required for computing the 3x2pt angular power spectra.

Returns:

data_vector_maskednumpy.ndarray

The masked data vector containing the 3x2pt angular power spectra for the given parameters.

compute_data_vector_gc(params_dic)

This method computes the angular power spectra for galaxy clustering using the provided parameters dictionary, constructs the data vector, and applies a mask to the data vector.

Parameters:

params_dicdict

Dictionary containing the parameters required for computing the angular power spectra.

Returns:

data_vector_maskednumpy.ndarray

The masked data vector for galaxy clustering.

compute_data_vector_wl(params_dic)

This function calculates the weak lensing angular power spectra and constructs the data vector for weak lensing, applying a mask to the resulting data vector.

Parameters:

params_dicdict

Dictionary containing the parameters required for the computation of the shear.

Returns:

data_vector_maskednumpy.ndarray

The masked data vector for weak lensing, containing the angular power spectra for the specified survey configuration.

compute_galclust(params_dic)

Compute the photo-GC correlation functions. Use this for likelihood computations.

Parameters:

params_dicdict

Dictionary containing cosmological and survey parameters.

Returns:

cl_ggndarray

Photometric galaxy clustering angular power spectra of length Survey.nell_gc.

compute_shear(params_dic)

Compute the shear power spectrum given a set of cosmological parameters. Use this when in likelihood computations.

Parameters:

params_dicdict

Dictionary containing the cosmological parameters.

Returns:

numpy.ndarray

The shear angular power spectrum.

get_add_photoz_error(nz, deltaz, nbin)

Additative photo-z error to the redshift distribution of galaxies: \(n(z')=n(z+\delta_z)\).

Parameters:

deltaznumpy.ndarray

Array containing photo-z error parameters for sources or lenses.

nznumpy.ndarray

Array of redshift distribution of galaxies, sources or lenses.

Returns:

nz_biasednumpy.ndarray

The biased redshift distribution of galaxies after applying the additive photo-z error.

get_cell_cross()

Compute the galaxy-galaxy lensing or cross-correlation angular power spectrum given by:

\[C^{\rm LG}_{ij}(\ell) = c \int \mathrm{d}z \frac{\left( W^{\gamma}_i(z)P_{\rm gm}(k(\ell, z), z)+ W^{\rm IA}_i(z)P_{\rm IAg}(k(\ell, z), z) \right) W^{\rm G}_j(z)}{H(z) r^2_{\rm com}(z)} \]

and

\[C^{\rm GL}_{ij}(\ell) = c \int \mathrm{d}z \frac{W^{\rm G}_i(z) \left( W^{\gamma}_j(z) P_{\rm gm} (k(\ell, z), z)+ W^{\rm IA}_j(z) P_{\rm gIA}(k(\ell, z), z)\right)}{H(z) r^2_{\rm com}(z)}\]

where:

  • \(W^{\gamma}\), \(W^{\rm IA}\), \(W^{\rm G}\) are the lensing, intrinsic alignment and clustering kernels.

  • \(H(z)\) is the expansion function.

  • \(r_{\rm com}(z)\) is the comoving distance.

  • \(P_{\rm gm}(z, k)\), \(P_{\rm g IA}(z, k)\) are the galaxy-matter, and galaxy-IA power spectra.

Returns:

cl_lgnumpy.ndarray

The galaxy-galaxy lensing angular power spectrum with dimensions (ell, bin_i, bin_j).

cl_glnumpy.ndarray

The galaxy-lensing angular power spectrum with dimensions (ell, bin_i, bin_j).

get_cell_galclust()

Compute the galaxy clustering angular power spectrum:

\[C^{\rm GG}_{ij}(\ell) = c \int \mathrm{d}z \frac{W^{\rm G}_i(z) W^{\rm G}_j(z)}{H(z) r^2_{\rm com}(z)} P_{\rm gg}(k(\ell, z), z)\]

This function calculates the galaxy clustering angular power spectrum given the cosmological parameters and the precomputed power spectra.

Parameters:

params_dicdict

Dictionary containing the parameters for the computation.

Returns:

cl_ggnumpy.ndarray

Galaxy clustering angular power spectrum with dimensions (ell, bin_i, bin_j).

get_cell_shear()

Calculate the weak lensing power spectrum (C_ell):

\[C^{\rm LL}_{ij}(\ell) = \frac{c}{H_0} \int \mathrm{d}z \frac{\left[ W^{\gamma}_i(z)W^{\gamma}_j(z)P_{\rm mm}(k(\ell, z), z) + (W^{\gamma}_i(z)W^{\rm IA}_j(z)+W^{\rm IA}_i(z)W^{\gamma}_j(z))P_{\rm IA m}(k(\ell, z), z)) + W^{\rm IA}_i(z)W^{\rm IA}_j(z)P_{\rm IA IA}(k(\ell, z), z)\right]}{E(z) r^2_{\rm com}(z)}\, ,\]

where:

  • \(W^{\gamma}\), \(W^{\rm IA}\) are the lensing and intrinsic alignment kernels.

  • \(E(z)\) is the expansion function.

  • \(r_{\rm com}(z)\) is the comoving distance.

  • \(P_{\rm mm}(z, k)\), \(P_{\rm m IA}(z, k)\), \(P_{\rm IA IA}(z, k)\) are the matter-matter, matter-IA and IA-IA power spectra.

Returns:

cl_llnumpy.ndarray

Weak lensing power spectrum (C_ell) for different redshift bins.

get_cov_diag_ijkl(theory_spectra, name1, name2, bin_ij, bin_kl)
get_deltaz(params)
get_ez_rz_k(params_dic)

Calculate the \(E(z)\), \(r_{\rm com}(z)\), and \(k(z)=(\ell+1/2)/r_{\rm com}(z)\) grids based on cosmological parameters.

Parameters:

params_dicdict

Dictionary containing cosmological parameters:

  • ‘Omega_m’: Matter density parameter.

  • ‘w0’: Equation of state parameter w0.

  • ‘wa’: Equation of state parameter wa.

Returns:

e_z_gridnumpy.ndarray

Array of E(z) values corresponding to the survey’s redshift integration grid.

r_z_gridnumpy.ndarray

Array of r_com(z) values corresponding to the survey’s redshift integration grid, in units of Mpc/h.

k_gridnumpy.ndarray

Array of k(z) values corresponding to the survey’s redshift integration grid, in units of h/Mpc.

get_fpt_terms(plin_z0, C_window=0.75)

Computes the terms of the Intrinsic Alignment (IA) TATT model at 1-loop order. For reference on the equations, see https://arxiv.org/pdf/1708.09247. Adapted from CLOE.

Parameters:

plin_z0numpy.ndarray

Linear power spectrum at redshift z = 0.

C_windowfloat, optional

Window function parameter to remove high frequency modes and avoid ringing effects. Default value is 0.75.

Returns:

dict

Dictionary containing the 1-loop order terms of the intrinsic alignment model: - ‘a00e’: scipy.interpolate.interp1d - ‘c00e’: scipy.interpolate.interp1d - ‘a0e0e’: scipy.interpolate.interp1d - ‘a0b0b’: scipy.interpolate.interp1d - ‘ae2e2’: scipy.interpolate.interp1d - ‘ab2b2’: scipy.interpolate.interp1d - ‘a0e2’: scipy.interpolate.interp1d - ‘b0e2’: scipy.interpolate.interp1d - ‘d0ee2’: scipy.interpolate.interp1d - ‘d0bb2’: scipy.interpolate.interp1d Each entry in the dictionary is an interpolation function of the corresponding term as a function of the wavenumber.

get_gg_kernel(params_dic)

Calculate the galaxy-galaxy lensing kernel in units of h/Mpc.

\[W_i^{G} = n_i(z)\frac{H(z)}{c}\, ,\]

where n_i(z) is the lens distribution.

Parameters:

params_dicdict

Dictionary containing the cosmological parameters.

Returns:

numpy.ndarray

The galaxy-galaxy lensing kernel with shape (1, zbin_integr, nbin).

get_ia_kernel(params_dic)

This function computes the intrinsic alignment (IA) kernel, which is a function of redshift and cosmological parameters:

\[W^{\rm IA}_{i}(z) = n_i(z) H(z)\]

where:

  • \(n_i(z)\) is the redshift distribution of the sourses.

  • \(H(z)\) is the expansion function.

Parameters:

params_dicdict

Dictionary containing the necessary parameters for the calculation.

Returns:

w_ianumpy.ndarray

A 3D array with dimensions (ell, zz_integr, bin_i) representing the intrinsic alignment kernel.

get_mult_photoz_error(nz, deltaz, nbin)

Multiplicative photo-z error to the redshift distribution of galaxies: \(n(z')=n(z(1+\delta_z))\).

Parameters:

deltaznumpy.ndarray

Array containing photo-z error parameters for sources or lenses.

nznumpy.ndarray

Array of redshift distribution of galaxies, sources or lenses.

Returns:

nz_biasednumpy.ndarray

The biased redshift distribution of galaxies after applying the multiplicative photo-z error.

get_pgg_heft_bias(params_dic)

Calculate the galaxy-galaxy power spectrum with HEFT Lagrangian bias expansion, in units of (Mpc/h)^3.

Parameters:

params_dicdict

Dictionary containing the bias parameters.

Returns:

pggnumpy.ndarray

The galaxy-galaxy power spectrum.

get_pgg_heft_bias_pnl(params_dic)

Calculate the galaxy-galaxy power spectrum with HEFT Lagrangian bias expansion, in units of (Mpc/h)^3.

Parameters:

params_dicdict

Dictionary containing the bias parameters.

Returns:

pggnumpy.ndarray

The galaxy-galaxy power spectrum.

get_pgg_lin_bias(params_dic)

Calculate the galaxy-galaxy power spectrum with linear bias (constant in a given redshift bin), in units of (Mpc/h)^3.

Parameters:

params_dicdict

Dictionary containing the bias parameters.

Returns:

pggnumpy.ndarray

The galaxy-galaxy power spectrum.

get_pgg_quadr_bias(params_dic)

Calculate the galaxy-galaxy power spectrum with quadratic bias model, in units of (Mpc/h)^3.

Parameters:

params_dicdict

Dictionary containing the bias parameters.

Returns:

pgmnumpy.ndarray

The galaxy-galaxy power spectrum.

get_pgm_heft_bias(params_dic)

Calculate the galaxy-matter power spectrum with HEFT Lagrangian bias expansion, in units of (Mpc/h)^3.

Parameters:

params_dicdict

Dictionary containing the bias parameters.

Returns:

pgmnumpy.ndarray

The matter-galaxy power spectrum.

get_pgm_heft_bias_pnl(params_dic)

Calculate the galaxy-matter power spectrum with HEFT Lagrangian bias expansion, in units of (Mpc/h)^3.

Parameters:

params_dicdict

Dictionary containing the bias parameters.

Returns:

pgmnumpy.ndarray

The matter-galaxy power spectrum.

get_pgm_lin_bias(params_dic)

Calculate the galaxy-matter power spectrum with linear bias (constant in a given redshift bin), in units of (Mpc/h)^3.

Parameters:

params_dicdict

Dictionary containing the bias parameters.

Returns:

pgmnumpy.ndarray

The matter-galaxy power spectrum.

get_pgm_quadr_bias(params_dic)

Calculate the galaxy-matter power spectrum with quadratic bias, in units of (Mpc/h)^3.

Parameters:

params_dicdict

Dictionary containing the bias parameters.

Returns:

pgmnumpy.ndarray

The matter-galaxy power spectrum.

get_pk_cross_nla(params_dic)

Computes the galaxy-intrinsic alignment power spectrum for the e-zNLA model.

\[P_{\rm g IA}(z, k) = f_{\rm IA}(z) b_g(z, k) P_{\rm mm}(z, k) \]

where:

  • \(b_g(z)\) is the galaxy bias.

  • \(f_{\rm IA}(z)\) is the intrinsic alignment parameters (see get_pk_nla).

  • \(P_{\rm mm}(z, k)\) is the matter power spectrum with baryons.

get_pk_cross_tatt(params_dic)

Computes the galaxy-intrinsic alignment power spectrum for the TATT model.

\[P_{\rm g IA}(z, k) = b_g(z) \left[ C_{1}P_{\rm mm}(z, k) + C_{1\delta}D(z)^{4}[ A_{0|0E}(k) + C_{0|0E}(k)] + C_{2}D(z)^{4}[ A_{0|E2}(k) + B_{0|E2}(k)] \right]\]

where:

  • \(D(z)\) is the growth factor normalized at \(z=0\).

  • \(b_g(z)\) is the galaxy bias.

  • \(C_{1}\), \(C_{1\delta}\), and \(C_{2}\) are the intrinsic alignment parameters.

  • \(P_{\rm mm}(z, k)\) is the matter power spectrum.

  • \(A_{0|0E}(k)\), \(C_{0|0E}(k)\), \(A_{0|E2}(k)\), and \(B_{0|E2}(k)\) are the FAST-PT terms.

get_pk_nla(params_dic)

Calculate the extended non-linear alignment (e-zNLA) power spectra:

\[\begin{split}P_{\delta \mathrm{IA}}(z, k) = f_{\rm IA}(z) P_{\rm mm}(z, k) \\ P_{\rm IAIA}(z, k) = [f_{\rm IA}(z)]^2 P_{\rm mm}(z, k) \end{split}\]

with the factor

\[f_{\rm IA} = - A_1 C_\rm {IA} \frac{\Omega_{\rm m}}{D(z)} \left(\frac{1+z}{1+z_{\rm piv}}\right)^{\eta_1} [L(z)]^\beta\]

where:

  • \(P_{\rm mm}\) is the matter-matter power spectrum.

  • \(D(z)\) is the normalised at z=0 growth factor.

  • \(L(z)\) is the luminosity function.

  • \(C_{\rm IA} = \bar{C}_{\rm IA} \rho_{\rm crit}\) and \(\bar{C}_{\rm IA}=5 \times 10^{-14} M^{-1}_\odot h^{-2} \rm{Mpc}^3\).

  • \(z_{\rm piv}\) is the pivot redshift that we set to 0, often in the literature it equals 0.62.

Parameters:

params_dicdict

Dictionary containing the following keys:

  • ‘Omega_m’: float, matter density parameter.

  • ‘a1_IA’: float, intrinsic alignment amplitude.

  • ‘eta1_IA’: float, redshift evolution parameter for intrinsic alignment.

  • ‘beta_IA’: float, luminosity evolution parameter for intrinsic alignment.

Returns:

tuple

A tuple containing:

  • pk_delta_iandarray

    The cross power spectrum between the density field and the intrinsic alignment field.

  • pk_iaiandarray

    The auto power spectrum of the intrinsic alignment field.

get_pk_tatt(params_dic)

Calculate the power spectra for tidal alignment and tidal torquing (TATT) model.

Parameters:

params_dicdict

Dictionary containing the parameters needed to compute the TATT power spectra.

Returns:

pk_delta_ianumpy.ndarray

Power spectrum for the intrinsic alignment density.

pk_iaianumpy.ndarray

Power spectrum for the intrinsic alignment-intrinsic alignment.

get_pmm(params_dic)

Calculate the matter-matter power spectrum (P_mm) with optional baryonic corrections.

Parameters:

params_dicdict

Dictionary containing the cosmological parameters.

Returns:

pknumpy.ndarray

The matter power spectrum with the specified baryonic corrections applied.

boost_barnumpy.ndarray

The baryonic boost factor applied to the matter power spectrum.

get_tatt_parameters(params)

Calculate the normalised tidal alignment and tidal torque (TATT) model parameters. See definitions of C1, C1d and C2 in https://arxiv.org/pdf/1708.09247.

Parameters:

paramsdict

Dictionary containing the following keys:

  • ‘Omega_m’: float, matter density parameter.

  • ‘a1_IA’: float, amplitude of the tidal alignment model.

  • ‘a2_IA’: float, amplitude of the torque alignment model.

  • ‘b1_IA’: float, amplitude of the density-weighted linear alignment model.

  • ‘eta1_IA’: float, redshift evolution parameter for the tidal alignment model.

  • ‘eta2_IA’: float, redshift evolution parameter for the torque alignment model.

Returns:

tuple

A tuple containing three numpy arrays:

  • c1

  • c1d

  • c2

get_theory_arrays_3x2pt(params_dic)

Compute all theory arrays needed for 3x2pt C_ell and likelihood, without performing the C_ell z-integration or building the data vector. Used by the JAX path: Python does emulators and scipy; JAX does C_ell sums/integrations and likelihood.

Parameters:
params_dicdict

Cosmological and survey parameters.

Returns:
dict

With keys: ez, rz, zz_integr, pmm, pgm, pgg, w_gamma, w_ia, w_g, pk_delta_ia, pk_iaia, pk_gal_ia, and survey constants (nell_wl, nell_gc, nell_xc, nbin_s, nbin_l, nbin_flat_s, nbin_flat_l, noise_LL, noise_GG, H0_h_c). All array values are numpy; JAX will convert and JIT from these.

get_wl_kernel(params_dic)

Calculate the weak lensing kernel:

\[W^{\gamma}_{i} = \frac{3}{2} \left( \frac{H_0}{c} \right)^2 \Omega_{\rm m} (1+z) r_{\rm com}(z) \bar{W}_i(z)\]

with

\[\bar{W}_i(z) = \int \mathrm{d}z' n_i(z')\left[ 1-\frac{r_{\rm com}(z)}{r_{\rm com}(z')} \right] \]

where:

  • \(n_i(z)\) is the redshift distribution of the sourses.

  • \(E(z)\) is the expansion function.

  • \(r_{\rm com}(z)\) is the comoving distance.

Parameters:

params_dicdict

Dictionary containing cosmological parameters. Must include:

  • ‘Omega_m’: float, the matter density parameter.

Returns:

w_gammanumpy.ndarray

The weak lensing kernel. The shape of the array is (1, zz_integr, num_bins), where num_bins is the number of redshift bins.

MGLensing.theory.build_data_matrix(c_ell, binned_ell, all_int_ell, nbin1, nbin2)
MGLensing.theory.build_data_matrix_3x2pt(cl_ll, cl_gg, cl_lg, cl_gl, binned_ell_wl, binned_ell_gc, binned_ell_xc, all_int_ell_wl, all_int_ell_gc, ell_jump, nbin_s, nbin_l)
MGLensing.theory.check_zmax(zmax, emu_obj)
MGLensing.theory.compute_spline(c_ell, binned_ell, nbin1, nbin2)