weak_rates

class weak_rates.WeakRates(RC_corr=True, FM_corr=True, weak_mag_corr=True, thermal_corr=True)[source]

Bases: Module

Class for weak rates calculation.

RC_corr

Radiative corrections to weak rates.

Type:

bool

thermal_corr

Thermal and bremsstrahlung corrections to weak rates (pre-tabulated, assuming standard BBN).

Type:

bool

FM_corr

Finite mass corrections to weak rates.

Type:

bool

weak_mag_corr

Weak magnetism corrections to weak rates.

Type:

bool

T_nTOp_thermal_interval

EM temperature abscissa for tabulated n->p thermal corrections.

Type:

array

T_pTOn_thermal_interval

EM temperature abscissa for tabulated p->n thermal corrections.

Type:

array

L_nTOpCCRTh_res

Tabulated dimensionless thermal corrections to n->p rate. Divide by (tau_n * lambda_0) for the actual correction.

Type:

array

L_pTOnCCRTh_res

Tabulated dimensionless thermal corrections to p->n rate. Divide by (tau_n * lambda_0) for the actual correction.

Type:

array

Fermi(b, me=0.51099895)[source]

Fermi function in the relativistic limit.

Parameters:
  • b (float) – Speed of the electron.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me

Notes

See Pitrou+ 1801.08023 Eq. (100). Equivalent to Sommerfeld enhancement factor when v << 1.

Fermi_sgn(sgnq, sgnE, b, me=0.51099895)[source]

Fermi function, with a check for proton and electron final state.

Parameters:
  • sgnq (int) – +1 or -1 to choose between F_+ and F_-.

  • sgnE (int) – +1 or -1 to choose between positive or negative arguments of F.

  • b (float) – The speed of the electron.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (102).

R_RC(kmax, en, me=0.51099895)[source]

Resummed radiative correction term at T = 0.

Parameters:
  • kmax (float) – Dimensionless maximum energy of photon considered in radiative correction, normalized to electron mass.

  • en (float) – Dimensionless electron energy, normalized to electron mass)

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (103), full definition in Eq. (B35). Note that the constant 1/134 below is approximately the fine-structure constant at the proton mass scale.

Sirlin_G(kmax, en, me=0.51099895)[source]

Sirlin’s universal function.

Parameters:
  • kmax (float) – Dimensionless maximum energy of photon considered in radiative correction, normalized to electron mass.

  • en (float) – Dimensionless electron energy, normalized to electron mass)

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (B32).

__call__(T_vec_ref, T_start, T_end, sampling_nTOp, me=0.51099895)[source]

Evaluate n <-> p rates over range of EM temperatures.

Parameters:
  • T_vec_ref (tuple of ndarray) – Reference (T_gamma, T_nu) to evaluate weak rates. In MeV.

  • T_start (float) – Highest photon temperature to evaluate rates at. In MeV.

  • T_end (float) – Lowest photon temperature to evaluate rates at. In MeV.

  • sampling_nTOp (int) – Number of points between T_start and T_end to evaluate at.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Returns:

(T_EM abscissa, n->p rates, p->n rates). Note that rates are dimensionless, normalized to the neutron decay width. T_EM abscissa limits are T_start, T_end, binned according to sampling_nTOp.

Return type:

tuple

bFermi(b, me=0.51099895)[source]

Fermi function in the relativistic limit, times speed of electron.

Parameters:
  • b (float) – Speed of the electron.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me

Notes

See Pitrou+ 1801.08023 Eq. (100). Equivalent to Sommerfeld enhancement factor when v << 1.

chi_Born(en, x, x_nu, sgnq, me=0.51099895)[source]

Integrand in momentum integral for Born weak rate.

Parameters:
  • en (float) – Dimensionless energy of the electron, normalized to electron mass.

  • x (float) – Dimensionless inverse EM temperature, normalized to electron mass.

  • x_nu (float) – Dimensionless inverse nu temperature, normalized to electron mass.

  • sqnq (int) – Should have value +1 or -1, to switch between chi_+ and chi_-.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Notes

See Pitrou+ 1801.08023 Eq. (79).

chi_FM(en, x, x_nu, sgnq, me=0.51099895)[source]

Integrand over momentum for finite mass correction to n <-> p rate.

Parameters:
  • en (float) – Dimensionless energy of the electron, normalized to the electron mass.

  • x (float) – Dimensionless EM inverse temperature, normalized to the electron mass.

  • x_nu (float) – Dimensionless neutrino inverse temperature, normalized to the electron mass.

  • sgnq (int) – +1 or -1 corresponding to chi_+ or chi_-.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Notes

See Pitrou+ 1801.08023 Eq. (B23). However, instead of m_N, this appears to choose m_p for + and m_n for -. This is consistent with PRIMAT, and probably makes sense, since we should apply the finite mass correction to the outgoing state.

Note also a typo on the first term Eq. (B23) (on dimensional grounds), corrected in PRIMAT. It should be g_nu^(2,0) as well.

chi_n_decay(pe, me=0.51099895)[source]

Finite nucleon mass correction term for neutron decay.

Parameters:
  • pe (float) – Dimensionless momentum of the electron, normalized to electron mass.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (B26).

dGamma_dp(p, x, x_nu, sgnq, me=0.51099895)[source]

Integrand over momentum for n <-> p rate. including radiative corrections.

Parameters:
  • p (float) – Dimensionless momentum of the electron, normalized to the electron mass.

  • x (float) – Dimensionless EM inverse temperature, normalized to the electron mass.

  • x_nu (float) – Dimensionless neutrino inverse temperature, normalized to the electron mass.

  • sgnq (int) – +1 or -1, to select between n -> p or p -> n.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (101) and (104). Radiative corrections included as desired. Without radiative corrections, this gives the Born approximation result.

dGamma_nTOp_dp(p, x, xnu, me=0.51099895)[source]

Integrand over momentum for n -> p rate including radiative corrections.

Parameters:
  • p (float) – Dimensionless momentum of the electron, normalized to the electron mass.

  • x (float) – Dimensionless EM inverse temperature, normalized to the electron mass.

  • x_nu (float) – Dimensionless neutrino inverse temperature, normalized to the electron mass.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (101).

dGamma_pTOn_dp(p, x, xnu, me=0.51099895)[source]

Integrand over momentum for p -> n rate including radiative corrections.

Parameters:
  • p (float) – Dimensionless momentum of the electron, normalized to the electron mass.

  • x (float) – Dimensionless EM inverse temperature, normalized to the electron mass.

  • x_nu (float) – Dimensionless neutrino inverse temperature, normalized to the electron mass.

  • sgnq (int) – +1 or -1, to select between n -> p or p -> n.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (104).

ddelt_Gamma_FM_dp(p, x, znu, sgnq, me=0.51099895)[source]

Integrand over momentum for finite mass corrections to the n <-> p rate.

Parameters:
  • p (float) – Dimensionless momentum of the electron, normalized to the electron mass.

  • x (float) – Dimensionless EM inverse temperature, normalized to the electron mass.

  • x_nu (float) – Dimensionless neutrino inverse temperature, normalized to the electron mass.

  • sgnq (int) – +1 or -1, to select between n -> p or p -> n.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (115). Radiative corrections included as desired.

ddelt_Gamma_nTOp_FM_dp(p, x, xnu, me=0.51099895)[source]

Integrand over momentum for finite mass corrections to the n -> p rate.

Parameters:
  • p (float) – Dimensionless momentum of the electron, normalized to the electron mass.

  • x (float) – Dimensionless EM inverse temperature, normalized to the electron mass.

  • x_nu (float) – Dimensionless neutrino inverse temperature, normalized to the electron mass.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (115).

ddelt_Gamma_pTOn_FM_dp(p, x, xnu, me=0.51099895)[source]

Integrand over momentum for finite mass corrections to the p -> n rate.

Parameters:
  • p (float) – Dimensionless momentum of the electron, normalized to the electron mass.

  • x (float) – Dimensionless EM inverse temperature, normalized to the electron mass.

  • x_nu (float) – Dimensionless neutrino inverse temperature, normalized to the electron mass.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (115).

dlambda_den_RC(en, me=0.51099895)[source]

Derivative of lambda with respect to energy of electron, including radiative corrections at T = 0.

Parameters:
  • en (float) – Energy of the electron produced in neutron decay, normalized to the electron mass.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (106), but note the change in variables.

dlambda_dp_FM(pe, me=0.51099895)[source]

Derivative of the correction to lambda with respect to momentum, due to finite mass effects.

Parameters:
  • pe (float) – Dimensionless momentum of the electron, normalized to the electron mass.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Return type:

float

Notes

See Pitrou+ 1801.08023 Eq. (118). If radiative correction is included, add a factor of R. Derivative with respect to momentum (and not energy) to keep consistency with PRyMordial.

nTOp_rates(Tg, T_vec_ref, me=0.51099895)[source]

Dimensionless n <-> p rates, normalized to neutron decay width.

Parameters:
  • Tg (float) – EM temperature in MeV at which to evaluate rate.

  • T_vec_ref (tuple) – (EM temperature array, neutrino temperature array) in MeV, used for computing the weak rates.

  • me (float, optional) – Electron mass in MeV. Defaults to const.me.

Returns:

(n -> p rate, p -> n rate). Note that rates are dimensionless, normalized to the neutron decay width.

Return type:

tuple