wale.CriticalPoints module

class wale.CriticalPoints.CriticalPointsFinder(variables, lw, z, chis, ngrid=50, plot=False)[source]

Bases: object

A class designed to identify critical points where the rate function’s convexity changes in a cosmological context. This is achieved through analyzing the Hessian matrix of the rate function across a grid of values, identifying zero crossings in its determinant to locate changes in convexity.

The rate function \(I(x)\) characterizes the exponential decay rate of the probabilities of certain outcomes as the system size increases. The rate function is required to be convex, which ensures that the study of rare events through large deviation principles can be approached effectively through minimization techniques.

Cumulant Generating Function and Legendre-Fenchel Transform The CGF, denoted by \(\Lambda(\theta)\), is foundational for deriving the rate function through the Legendre-Fenchel transform. This transform connects the CGF and the rate function as follows:

\[I(x) = \sup_{\theta} \{ \theta x - \Lambda(\theta) \}\]

This equation ensures that the rate function \(I(x)\) is convex, inheriting this property from the convex CGF \(\Lambda(\theta)\). The supremum operation over \(\theta\) highlights that \(I(x)\) represents the tightest upper bound of the linear functions defined by \(\theta x - \Lambda(\theta)\).

Convexity of the Rate Function The convexity of the rate function \(I(x)\) implies the following inequality for any two points \(x_1\) and \(x_2\) in its domain and any \(\lambda \in [0, 1]\):

\[I(\lambda x_1 + (1 - \lambda)x_2) \leq \lambda I(x_1) + (1 - \lambda) I(x_2)\]

This inequality defines the convexity of the rate function, critical for analyzing rare events in large deviation theory.

In this method, we use the determinant of the Hessian of the rate function to locate points where it vanishes. These points help identify the values of \(\lambda\) used in our subsequent calculations.

Methods

find_zero_crossing_point(x1, y1, x2, y2, ...)

Finds the zero crossing point between two points based on the determinant values.

find_zero_crossings(determinant)

Identifies zero crossings in the determinant grid.

get_critical_points(variance, lw, z, chi_value)

Calculates critical points for the given redshift z and plots them if requested.

get_hessian(x)

Calculates the Hessian matrix of a function.

find_zero_crossing_point(x1, y1, x2, y2, determinant_value1, determinant_value2)[source]

Finds the zero crossing point between two points based on the determinant values.

find_zero_crossings(determinant)[source]

Identifies zero crossings in the determinant grid.

get_critical_points(variance, lw, z, chi_value)[source]

Calculates critical points for the given redshift z and plots them if requested.

get_hessian(x)[source]

Calculates the Hessian matrix of a function.

wale.CriticalPoints.find_critical_points_for_cosmo(variables, variance, ngrid_critical=90, plot=False, min_z=1, max_z=4)[source]

Finds critical points in the lensing potential based on the provided variables.

Parameters:
  • variables – Object containing necessary cosmological variables (e.g., lensingweights, redshifts, chis).

  • variance – Variance or smoothing parameter needed for critical point computation.

  • ngrid_critical (int, optional) – Grid resolution for critical point search. Defaults to 90.

  • plot (bool, optional) – Whether to plot the results. Defaults to False.

  • max_nz (int, optional) – Maximum number of redshift slices to use. Defaults to 4.

Returns:

Smallest positive and largest negative critical point values.

Return type:

tuple

wale.CriticalPoints.find_smallest_pair(critical_values)[source]

Finds the pair of points with the smallest Euclidean distance between them from a set of critical values.

Parameters:

critical_values (numpy.ndarray) – An array of critical points.

Returns:

The pair of points with the smallest distance and their Euclidean distance.

Return type:

tuple