Class

NumCosmoXcorKernel

Description [src]

abstract class NumCosmo.XcorKernel : NumCosmoMath.Model
{
  /* No available fields */
}

Base object for the kernels of projected observables used in cross-correlations.

The projected field and its kernel are linked by \begin{equation} $A(\hat{\mathbf{n}}) = \int_0^\infty dz \ W^A(z) \ \delta(\chi(z)\hat{\mathbf{n}}, z)$ \end{equation} where $\delta$ is the matter density field.

Kernels also implement the noise power spectrum.

See UltraLevin: Non-Limber Angular Power Spectra for the pipeline a kernel drives: the adaptive $k$ domain, the closure fitted to $W_\ell(k)$, and the error estimate the fit residuals feed.

Ancestors

Functions

nc_xcor_kernel_clear

Atomically decrements the reference count of xclk by one. If the reference count drops to zero, all memory allocated by xclk is released. xclk is set to NULL after being freed.

nc_xcor_kernel_id
No description available.

nc_xcor_kernel_log_all_models

Logs all registered NcXcorLimberKernel subclasses to the message log. This is useful for debugging and discovering available kernel implementations.

Instance methods

nc_xcor_kernel_add_noise

Vp2 = vp1 + noise spectrum.

nc_xcor_kernel_eval_limber_z

Evaluates the Limber kernel at redshift z for multipole l. The kinetic quantities (comoving distance and Hubble parameter) are provided in xck. Returns zero if z is outside the kernel’s redshift range.

nc_xcor_kernel_eval_limber_z_full

Evaluates the Limber kernel at redshift z for multipole l, including the normalization factor. This function computes the kinetic quantities internally using dist and applies the kernel’s constant factor.

nc_xcor_kernel_eval_limber_z_prefactor

Evaluates the Limber approximation redshift-dependent prefactor for multipole l.

nc_xcor_kernel_free

Decreases the reference count of xclk by one. If the reference count reaches zero, the object is freed.

nc_xcor_kernel_get_adaptive_boundary_tries

Gets the number of consecutive boundary points that must be below the convergence threshold before stopping boundary extension. This helps avoid false positives where a single low point prematurely stops the adaptive k-range determination.

nc_xcor_kernel_get_adaptive_epsilon

Gets the convergence threshold for adaptive k-range determination in the non-Limber integrand. The algorithm stops extending the k range when all component contributions drop below epsilon times the maximum kernel value.

nc_xcor_kernel_get_component_list

Gets the list of components that make up this kernel.

nc_xcor_kernel_get_eval

Gets an evaluation function for the kernel at multipole l. Convenience wrapper around nc_xcor_kernel_get_eval_vectorized() for a single multipole.

nc_xcor_kernel_get_eval_vectorized

Gets a vectorized evaluation function for the kernel over a range of multipoles. The returned integrand will have len = lmax - lmin + 1, and will evaluate all multipoles in the range [lmin, lmax] simultaneously.

nc_xcor_kernel_get_eval_vectorized_full

Same as nc_xcor_kernel_get_eval_vectorized(), but integrates with sbi instead of the kernel’s integrator property.

nc_xcor_kernel_get_expansion_factor

Gets the expansion factor used for domain extension in the non-Limber integrand construction. This determines how much the domain is extended in each iteration.

nc_xcor_kernel_get_k_range

Gets the valid k range for the kernel at multipole l. Uses the component-based implementation.

nc_xcor_kernel_get_l_limber

Gets the Limber approximation threshold for the kernel. Returns -1 for never using Limber, 0 for always using Limber, or N > 0 to use Limber for l >= N.

nc_xcor_kernel_get_lmax

Gets the maximum multipole for the kernel.

nc_xcor_kernel_get_max_border_expansions

Gets the maximum number of border expansion iterations allowed during domain extension in the non-Limber integrand construction.

nc_xcor_kernel_get_max_iter

Gets the maximum number of adaptive midpoint refinement iterations allowed in the non-Limber integrand construction.

nc_xcor_kernel_get_panel_order_cap
No description available.

nc_xcor_kernel_get_peak_epsilon
No description available.

nc_xcor_kernel_get_reltol

Gets the relative tolerance used for adaptive midpoint refinement in the non-Limber integrand construction.

nc_xcor_kernel_get_track_fit_residual
No description available.

nc_xcor_kernel_get_z_range

Get the redshift range of the kernel. This is a virtual method that must be implemented by subclasses.

nc_xcor_kernel_mark_outdated

Announces that data the kernel is built on changed outside its parameters (a replaced window table, say), so the next nc_xcor_kernel_prepare_if_needed() prepares again even at an unchanged cosmology.

nc_xcor_kernel_obs_len

Gets the number of observables required by this kernel.

nc_xcor_kernel_obs_params_len

Gets the number of parameters needed to describe the observables for this kernel (e.g., measurement uncertainties, systematic parameters).

nc_xcor_kernel_peek_dist

Peeks the distance object from the kernel. This method is intended for use by subclass implementations.

nc_xcor_kernel_peek_integrator

Peeks the spherical Bessel integrator object from the kernel. This method is intended for use by subclass implementations. Returns NULL if no integrator is set.

nc_xcor_kernel_peek_powspec

Peeks the power spectrum object from the kernel. This method is intended for use by subclass implementations.

nc_xcor_kernel_prepare

Prepares the kernel for evaluation with the given cosmological model. This may involve precomputing quantities that depend on cosmo but not on redshift or multipole.

nc_xcor_kernel_prepare_if_needed

Calls nc_xcor_kernel_prepare() only when something the prepared state depends on has changed since the last preparation: the cosmology (tracked through a NcmModelCtrl), the kernel’s own parameters (its NcmModel pkey), or a change announced with nc_xcor_kernel_mark_outdated(). Repeated solves at one cosmology then pay nothing here, which is what a sampler that keeps its kernels and its NcXcorSolver across steps relies on.

nc_xcor_kernel_ref

Increases the reference count of xclk by one.

nc_xcor_kernel_set_adaptive_boundary_tries

Sets the number of consecutive boundary points that must be below the convergence threshold before stopping boundary extension. Higher values provide more robust convergence detection at the cost of additional function evaluations. Typical values range from 2 to 5.

nc_xcor_kernel_set_adaptive_epsilon

Sets the convergence threshold for adaptive k-range determination in the non-Limber integrand. Typical values range from 1e-4 to 1e-8, with smaller values providing more accurate integration at the cost of more evaluations.

nc_xcor_kernel_set_expansion_factor

Sets the expansion factor for domain extension. Larger values result in more aggressive expansion. Typical values range from 0.1 to 0.5.

nc_xcor_kernel_set_l_limber

Sets the Limber approximation threshold for the kernel.

nc_xcor_kernel_set_lmax

Sets the maximum multipole for the kernel.

nc_xcor_kernel_set_max_border_expansions

Sets the maximum number of border expansion iterations. Higher values allow the domain to extend further when needed, at the cost of potentially more function evaluations. Typical values range from 1000 to 10000.

nc_xcor_kernel_set_max_iter

Sets the maximum number of adaptive midpoint refinement iterations. Higher values allow for more refinement passes when needed. Typical values range from 1000 to 100000.

nc_xcor_kernel_set_panel_order_cap

Sets NcXcorKernel:panel-order-cap. Read when a closure is built, so one already built keeps the panels it was built with.

nc_xcor_kernel_set_peak_epsilon

Sets the peak-relative floor of the adaptive refinement. Below this fraction of the fitted function’s own peak the refinement stops regardless of the relative tolerance, so a kernel is not resolved to a precision its amplitude cannot carry.

nc_xcor_kernel_set_reltol

Sets the relative tolerance for adaptive midpoint refinement. Smaller values provide more accurate spline interpolation at the cost of more sample points. Typical values range from 1e-4 to 1e-8.

nc_xcor_kernel_set_track_fit_residual

Sets NcXcorKernel:track-fit-residual. It is read when a closure is built, so a closure already built keeps whatever it was built with.

Methods inherited from NcmModel (91)

Please see NcmModel for a full list of methods.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmo.XcorKernel:adaptive-epsilon

Convergence threshold for the adaptive $k$-range determination: sampling stops extending outwards once $\Vert W\Vert$ falls below this fraction of its running maximum, for NcXcorKernel:adaptive-boundary-tries consecutive steps.

NumCosmo.XcorKernel:dist
No description available.

NumCosmo.XcorKernel:expansion-factor
No description available.

NumCosmo.XcorKernel:integrator
No description available.

NumCosmo.XcorKernel:l-limber
No description available.

NumCosmo.XcorKernel:lmax
No description available.

NumCosmo.XcorKernel:max-border-expansions
No description available.

NumCosmo.XcorKernel:max-iter
No description available.

NumCosmo.XcorKernel:panel-order-cap

Highest Chebyshev order tried on one panel before it is bisected, as $N = 2^\mathrm{cap} + 1$ coefficients.

NumCosmo.XcorKernel:peak-epsilon

Peak-relative floor of the adaptive refinement of the $W_i(k)$ closure. An interval is accepted once its estimated interpolation error falls below peak-epsilon $\times \max\vert F\vert$, the maximum taken over the smallest of the block’s peaks so that a sub-dominant multipole is not held to a tolerance relative to its neighbours.

NumCosmo.XcorKernel:powspec
No description available.

NumCosmo.XcorKernel:reltol

Relative tolerance for the adaptive refinement of the $W_i(k)$ spline.

NumCosmo.XcorKernel:track-fit-residual

Whether the closure records the residual its fit achieved on each interval it is a single polynomial on — a knot interval of a spline closure, a panel of a Chebyshev one. That record is what nc_xcor_compute_full() turns into an error estimate. On by default: without it the estimate has only NcXcorKernel:reltol and NcXcorKernel:peak-epsilon to work from — the tolerances the fit was asked for, which it beats by 12 to 3100 times depending on the kernel, so the resulting bound tracks the pair’s cancellation rather than its accuracy.

Properties inherited from NcmModel (9)
NumCosmoMath.Model:implementation

The implementation flags of the model class, see ncm_model_check_impl_flag().

NumCosmoMath.Model:name

The name of the model class.

NumCosmoMath.Model:nick

The nickname of the model class.

NumCosmoMath.Model:params-types

The NcmParamType of each parameter.

NumCosmoMath.Model:reparam

The reparametrization, see ncm_model_set_reparam().

NumCosmoMath.Model:scalar-params-len

The number of scalar parameters.

NumCosmoMath.Model:sparam-array

The parameter descriptions that differ from the class ones, NcmSParam keyed by parameter index. Each one is placed by its parameter name: a description of a parameter declared with ncm_model_class_add_removed_param() is skipped, and one of any other unknown parameter aborts.

NumCosmoMath.Model:submodel-array

The submodels, attached at construction.

NumCosmoMath.Model:vector-params-len

The number of vector parameters (not their lengths).

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct NumCosmoXcorKernelClass {
  void (* get_z_range) (
    NcXcorKernel* xclk,
    gdouble* zmin,
    gdouble* zmax,
    gdouble* zmid
  );
  gdouble (* eval_limber_z) (
    NcXcorKernel* xclk,
    NcHICosmo* cosmo,
    gdouble z,
    const NcXcorKinetic* xck,
    gint l
  );
  gdouble (* eval_limber_z_prefactor) (
    NcXcorKernel* xclk,
    NcHICosmo* cosmo,
    gint l
  );
  void (* prepare) (
    NcXcorKernel* xclk,
    NcHICosmo* cosmo
  );
  void (* add_noise) (
    NcXcorKernel* xclk,
    NcmVector* vp1,
    NcmVector* vp2,
    guint lmin
  );
  guint (* obs_len) (
    NcXcorKernel* xclk
  );
  guint (* obs_params_len) (
    NcXcorKernel* xclk
  );
  GPtrArray* (* get_component_list) (
    NcXcorKernel* xclk
  );
  
}

No description available.

Class members
get_z_range: void (* get_z_range) ( NcXcorKernel* xclk, gdouble* zmin, gdouble* zmax, gdouble* zmid )

No description available.

eval_limber_z: gdouble (* eval_limber_z) ( NcXcorKernel* xclk, NcHICosmo* cosmo, gdouble z, const NcXcorKinetic* xck, gint l )

No description available.

eval_limber_z_prefactor: gdouble (* eval_limber_z_prefactor) ( NcXcorKernel* xclk, NcHICosmo* cosmo, gint l )

No description available.

prepare: void (* prepare) ( NcXcorKernel* xclk, NcHICosmo* cosmo )

No description available.

add_noise: void (* add_noise) ( NcXcorKernel* xclk, NcmVector* vp1, NcmVector* vp2, guint lmin )

No description available.

obs_len: guint (* obs_len) ( NcXcorKernel* xclk )

No description available.

obs_params_len: guint (* obs_params_len) ( NcXcorKernel* xclk )

No description available.

get_component_list: GPtrArray* (* get_component_list) ( NcXcorKernel* xclk )

No description available.

Virtual methods

NumCosmo.XcorKernelClass.add_noise

Vp2 = vp1 + noise spectrum.

NumCosmo.XcorKernelClass.eval_limber_z

Evaluates the Limber kernel at redshift z for multipole l. The kinetic quantities (comoving distance and Hubble parameter) are provided in xck. Returns zero if z is outside the kernel’s redshift range.

NumCosmo.XcorKernelClass.eval_limber_z_prefactor

Evaluates the Limber approximation redshift-dependent prefactor for multipole l.

NumCosmo.XcorKernelClass.get_component_list

Gets the list of components that make up this kernel.

NumCosmo.XcorKernelClass.get_z_range

Get the redshift range of the kernel. This is a virtual method that must be implemented by subclasses.

NumCosmo.XcorKernelClass.obs_len

Gets the number of observables required by this kernel.

NumCosmo.XcorKernelClass.obs_params_len

Gets the number of parameters needed to describe the observables for this kernel (e.g., measurement uncertainties, systematic parameters).

NumCosmo.XcorKernelClass.prepare

Prepares the kernel for evaluation with the given cosmological model. This may involve precomputing quantities that depend on cosmo but not on redshift or multipole.