pybird.resum module

class pybird.resum.Resum(LambdaIR=0.1, NFFT=192, fft=False, co=<pybird.common.Common object>)[source]

Bases: object

A class for IR-resummation of the power spectrum and correlation function.

The Resum class performs the IR-resummation of the power spectrum by computing the bulk flow effects on the BAO feature. Two resummation schemes are available:

  1. fullresum (default): FFTLog transforms are performed on the full integrands from s = 0.1 to s = 10000 Mpc/h. This is the more complete treatment.

  2. optiresum: FFTLog transforms are performed only on the extracted BAO peak (after removing the broadband). The peak is padded with zeros and transforms run from s = 0.1 to s = 1000 Mpc/h. This is computationally faster.

co

Common parameters shared across calculations.

Type:

Common

LambdaIR

Integral cutoff for IR-filters X and Y. Default is 0.2 for fullresum, but 1.0 works for either scheme.

Type:

float

# Correlation function arrays
sr

Separation array for resummation.

Type:

ndarray

sbao

Separation array for BAO peak (optiresum).

Type:

ndarray

snobao

Separation array for broadband (optiresum).

Type:

ndarray

# Power spectrum arrays
kr

Wavenumber array for resummation.

Type:

ndarray

k2p

Powers of k^2 for IR corrections.

Type:

ndarray

# FFTLog settings and objects
fftsettings

Settings for IR correction FFTLog.

Type:

dict

fft

FFTLog engine for IR corrections.

Type:

FFTLog

M

Spherical Bessel transform matrices for IR corrections.

Type:

ndarray

kPow

k-dependent power terms for IR corrections.

Type:

ndarray

Xfftsettings

Settings for IR-filter FFTLog.

Type:

dict

Xfft

FFTLog engine for IR-filters.

Type:

FFTLog

XM

Spherical Bessel transform matrices for IR-filters.

Type:

ndarray

XsPow

s-dependent power terms for IR-filters.

Type:

ndarray

Cfftsettings

Settings for correlation function FFTLog.

Type:

dict

Cfft

FFTLog engine for correlation functions.

Type:

FFTLog

Ml

Spherical Bessel transform matrices for correlation functions.

Type:

ndarray

sPow

s-dependent power terms for correlation functions.

Type:

ndarray

# Damping windows
dampPs

Damping windows for power spectrum.

Type:

ndarray

dampCf

Damping window for correlation function.

Type:

ndarray

# Optimization paths
optipath_cf

Optimized einsum path for correlation function.

Type:

list

optipath_XpYpC

Optimized path for XpYp * correlation function.

Type:

list

optipath_IRPs

Optimized path for IR power spectrum.

Type:

list

optipath_k2IRPs

Optimized path for k^2 * IR power spectrum.

Type:

list

setXsPow()[source]

Compute s-dependent power terms for IR-filters.

setXM()[source]

Compute transform matrices for IR-filters.

IRFilters()[source]

Compute the IR-filters X and Y.

setkPow()[source]

Compute k-dependent power terms for IR corrections.

setM()[source]

Compute transform matrices for IR corrections.

IRn()[source]

Compute spherical Bessel transform for IR correction order n.

extractBAO()[source]

Extract BAO feature from correlation function.

setXpYp()[source]

Compute powers of IR-filters X and Y.

makeQ()[source]

Compute bulk flow coefficients Q.

setMl()[source]

Compute transform matrices for correlation functions.

setsPow()[source]

Compute s-dependent power terms for correlation functions.

Ps2Cf()[source]

Transform power spectrum to correlation function.

IRCf()[source]

Compute IR corrections in configuration space.

IRPs()[source]

Compute IR corrections in Fourier space.

PsCf()[source]

Compute both power spectrum and correlation function with IR-resummation.

Ps()[source]

Compute power spectrum with IR-resummation.

Initialize the Resum engine for IR-resummation calculations.

Parameters:
  • LambdaIR (float, optional) – Integral cutoff for IR-filters X and Y in Mpc/h, by default 0.1

  • NFFT (int, optional) – Number of FFT points for transforms, by default 192

  • fft (bool, optional) – Whether to use O(NFFT logNFFT) FFT instead of O(NFFT x Nk) sum, by default False

  • co (Common, optional) – Common parameters object, by default co

Notes

The choice of LambdaIR depends on the resummation scheme: - fullresum: LambdaIR = 0.2 (default for complete treatment) - optiresum: LambdaIR = 1.0 (faster, works for either scheme)

setXsPow()[source]

Multiply the coefficients with the s’s to the powers of the FFTLog to evaluate the IR-filters X and Y.

setXM()[source]

Compute the matrices to evaluate the IR-filters X and Y. Called at instantiation.

IRFilters(bird, soffset=1.0, LambdaIR=None, RescaleIR=1.0)[source]

Compute the IR-filters X and Y.

setkPow()[source]

Multiply the coefficients with the k’s to the powers of the FFTLog to evaluate the IR-corrections.

setM(Nl=3)[source]

Compute the matrices to evaluate the IR-corrections. Called at instantiation.

IRn(XpYpC)[source]

Compute the spherical Bessel transform in the IR correction of order n given [XY]^n

extractBAO(cf)[source]

Given a correlation function cf, - if fullresum, return cf - if optiresum, extract the BAO peak

setXpYp(bird)[source]
makeQ(f)[source]

Compute the bulk coefficients Q^{ll’}_{||N-j}(n, lpha, f)

setMl()[source]

Compute the power spectrum to correlation function spherical Bessel transform matrices. Called at the instantiation.

setsPow()[source]

Multiply the coefficients with the s’s to the powers of the FFTLog to evaluate the IR corrections in configuration space.

Ps2Cf(P, l=0)[source]
IRCf(bird)[source]

Compute the IR corrections in configuration space by spherical Bessel transforming the IR corrections in Fourier space.

PsCf(bird, makeIR=True, makeQ=True, setIR=True, setPs=True, setCf=True)[source]

Perform IR-resummation for both power spectrum and correlation function.

This is the main method that applies IR-resummation to both the power spectrum and correlation function, handling the bulk flow effects on the BAO feature.

Parameters:
  • bird (Bird) – Bird object containing the power spectrum and correlation function

  • makeIR (bool, optional) – Whether to compute IR-resummed power spectrum, by default True

  • makeQ (bool, optional) – Whether to compute the Q factors, by default True

  • setIR (bool, optional) – Whether to set IR-resummed components, by default True

  • setPs (bool, optional) – Whether to set power spectrum components, by default True

  • setCf (bool, optional) – Whether to set correlation function components, by default True

Notes

This method orchestrates the complete IR-resummation procedure, including computing Q factors, IR filters, and applying resummation to both Fourier and configuration space quantities.

Ps(bird, makeIR=True, makeQ=True, setIR=True, setPs=True)[source]

Apply IR-resummation to the power spectrum.

Computes the IR-resummed power spectrum by applying bulk flow corrections to the BAO feature using the IR-resummation formalism.

Parameters:
  • bird (Bird) – Bird object containing the power spectrum to be resummed

  • makeIR (bool, optional) – Whether to compute IR-resummed components, by default True

  • makeQ (bool, optional) – Whether to compute Q factors for resummation, by default True

  • setIR (bool, optional) – Whether to set IR components in the bird object, by default True

  • setPs (bool, optional) – Whether to set final power spectrum components, by default True

Notes

The IR-resummation process involves: 1. Computing Q factors from the growth rate 2. Computing IR-resummed power spectrum components 3. Setting the resummed components in the bird object

getIRPs(cf, XpYp, optipath_cf=False, optipath_XpYpC=False, optipath_IRPs=False, optipath_k2IRPs=False)[source]
IRPs(bird)[source]

This is the main method of the class. Compute the IR corrections in Fourier space.