plima.models.nla#

Nonlinear alignment intrinsic alignment models.

This module provides small composable functions for nonlinear alignment NLA intrinsic alignment calculations. The amplitude functions define different redshift, halo mass, or luminosity function dependent IA normalizations. The spectrum functions then convert those amplitudes into matter intrinsic and intrinsic intrinsic power spectra using the standard NLA response.

The functions are backend independent. They do not require CCL or any other cosmology package. Callers provide the matter power spectrum, growth factor, and cosmological density parameter explicitly.

Functions

lf_nla_amplitude(z, ...[, red_fraction, ...])

Return a luminosity function weighted NLA amplitude.

nla_amplitude(z, *, a_ia)

Return a constant NLA amplitude on a redshift grid.

nla_mass_amplitude(*, a_ia, red_fraction, ...)

Return a galaxy type and halo mass dependent NLA amplitude.

nla_response(growth_factor, omega_m, *, ...)

Return the NLA response multiplying the matter power spectrum.

nla_z_amplitude(z, *, a_ia, b_ia[, ...])

Return the KiDS style redshift dependent NLA amplitude.

p_delta_i_nla(matter_power, growth_factor, ...)

Return the NLA matter intrinsic power spectrum.

p_ii_nla(matter_power, growth_factor, ...[, ...])

Return the NLA intrinsic-intrinsic power spectrum.

red_fraction_from_luminosity_functions(z, *, ...)

Return the red galaxy fraction using LFKit luminosity functions.

plima.models.nla.lf_nla_amplitude(z, luminosity_weighted_average, *, a_ia, red_fraction=1.0, eta_low_z=0.0, eta_high_z=0.0, low_z_pivot=0.3, high_z_pivot=0.75)[source]#

Return a luminosity function weighted NLA amplitude.

Parameters:
  • z (ArrayLike) – Redshift values where the amplitude should be evaluated. Values may be negative for future scale factors, but must be greater than -1.

  • luminosity_weighted_average (ArrayLike) – Luminosity dependent IA weight, usually computed from a luminosity function or galaxy sample.

  • a_ia (float) – Overall intrinsic alignment amplitude.

  • red_fraction (ArrayLike | float) – Red galaxy fraction multiplying the IA amplitude.

  • eta_low_z (float) – Power law redshift evolution applied at all redshifts.

  • eta_high_z (float) – Additional high redshift power law evolution.

  • low_z_pivot (float) – Pivot redshift for the low redshift evolution term. This may be negative, but must be greater than -1.

  • high_z_pivot (float) – Redshift above which the high redshift evolution term is applied. This may be negative, but must be greater than -1.

Returns:

Redshift, red fraction, and luminosity weighted NLA amplitude.

Raises:
  • ValueError – If any redshift value is less than or equal to -1.

  • ValueError – If either redshift pivot is less than or equal to -1.

  • ValueError – If red_fraction is outside the interval from zero to one.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

plima.models.nla.nla_amplitude(z, *, a_ia)[source]#

Return a constant NLA amplitude on a redshift grid.

Parameters:
  • z (ArrayLike) – Redshift values where the amplitude should be evaluated.

  • a_ia (float) – Constant intrinsic alignment amplitude.

Returns:

Array with the same shape as z containing the constant amplitude.

Raises:

ValueError – If any redshift value is not finite.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

plima.models.nla.nla_mass_amplitude(*, a_ia, red_fraction, halo_mass, beta, pivot_halo_mass=31622776601683.793)[source]#

Return a galaxy type and halo mass dependent NLA amplitude.

Parameters:
  • a_ia (float) – Overall intrinsic alignment amplitude.

  • red_fraction (ArrayLike) – Red galaxy fraction for each sample, bin, or object.

  • halo_mass (ArrayLike) – Halo mass values.

  • beta (float) – Power law dependence of the IA amplitude on halo mass.

  • pivot_halo_mass (float) – Pivot halo mass used to normalize the mass scaling. Defaults to the pivot halo mass used in arXiv:2409.15416 and arXiv:2503.19441.

Returns:

NLA amplitude weighted by red fraction and halo mass.

Raises:
  • ValueError – If red_fraction is outside the interval from zero to one.

  • ValueError – If any halo mass value is not positive.

  • ValueError – If pivot_halo_mass is not positive.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

plima.models.nla.nla_z_amplitude(z, *, a_ia, b_ia, pivot_redshift=0.62)[source]#

Return the KiDS style redshift dependent NLA amplitude.

Parameters:
  • z (ArrayLike) – Redshift values where the amplitude should be evaluated. Values may be negative for future scale factors, but must be greater than -1.

  • a_ia (float) – Intrinsic alignment amplitude at the pivot redshift.

  • b_ia (float) – Linear scale factor dependence of the IA amplitude.

  • pivot_redshift (float) – Pivot redshift used to define the redshift dependence. This may be negative, but must be greater than -1.

Returns:

Redshift dependent NLA amplitude evaluated at z.

Raises:
  • ValueError – If any redshift value is less than or equal to -1.

  • ValueError – If pivot_redshift is less than or equal to -1.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

plima.models.nla.p_delta_i_nla(matter_power, growth_factor, omega_m, *, amplitude, c1_rho_critical=0.0134)[source]#

Return the NLA matter intrinsic power spectrum.

Parameters:
  • matter_power (ArrayLike) – Matter power spectrum values.

  • growth_factor (ArrayLike) – Linear growth factor evaluated consistently with matter_power.

  • omega_m (float) – Present day matter density fraction.

  • amplitude (ArrayLike | float) – NLA amplitude. This may be a scalar or an array matching matter_power.

  • c1_rho_critical (float) – Conventional NLA normalization C1 * rho_crit.

Returns:

Matter intrinsic power spectrum predicted by the NLA model.

Raises:
  • ValueError – If any matter power value is not finite.

  • ValueError – If any growth factor value is not positive.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

plima.models.nla.p_ii_nla(matter_power, growth_factor, omega_m, *, amplitude, c1_rho_critical=0.0134)[source]#

Return the NLA intrinsic-intrinsic power spectrum.

Parameters:
  • matter_power (ArrayLike) – Matter power spectrum values.

  • growth_factor (ArrayLike) – Linear growth factor evaluated consistently with matter_power.

  • omega_m (float) – Present day matter density fraction.

  • amplitude (ArrayLike | float) – NLA amplitude. This may be a scalar or an array matching matter_power.

  • c1_rho_critical (float) – Conventional NLA normalization C1 * rho_crit.

Returns:

Intrinsic intrinsic power spectrum predicted by the NLA model.

Raises:
  • ValueError – If any matter power value is not finite.

  • ValueError – If any growth factor value is not positive.

Return type:

ndarray[tuple[Any, …], dtype[float64]]

plima.models.nla.red_fraction_from_luminosity_functions(z, *, red_lf, all_lf, m_bright, m_faint, n_m=512)[source]#

Return the red galaxy fraction using LFKit luminosity functions.

Parameters:
  • z (ArrayLike) – Redshift values where the red fraction should be evaluated.

  • red_lf (Any) – LFKit luminosity function for the red galaxy population.

  • all_lf (Any) – LFKit luminosity function or callable for the full galaxy population.

  • m_bright (float) – Bright absolute magnitude limit.

  • m_faint (float) – Faint absolute magnitude limit.

  • n_m (int) – Number of magnitude samples used by LFKit for the integral.

Returns:

Red galaxy fraction evaluated at each redshift.

Raises:
  • ValueError – If any redshift value is less than or equal to -1.

  • ValueError – If m_faint is not greater than m_bright.

  • ValueError – If n_m is less than two.

  • ValueError – If LFKit returns values outside the interval from zero to one.

Return type:

ndarray[tuple[Any, …], dtype[float64]]