How to use the flavio.physics.running function in flavio

To help you get started, we’ve selected a few flavio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flav-io / flavio / flavio / physics / bdecays / test_wc.py View on Github external
def test_C78p(self):
        wc_obj = eft.WilsonCoefficients()
        wc_low = wilsoncoefficients.wctot_dict(wc_obj, 'bsmumu', 4.2, par)
        ms = flavio.physics.running.running.get_ms(par, 4.2, nf_out=5)
        mb = flavio.physics.running.running.get_mb(par, 4.2, nf_out=5)
        self.assertAlmostEqual(wc_low['C7p_bs']/wc_low['C7_bs'], ms/mb)
        self.assertAlmostEqual(wc_low['C8p_bs']/wc_low['C8_bs'], ms/mb)
github flav-io / flavio / flavio / physics / taudecays / tauvl.py View on Github external
def br_tauvl(wc_obj, par, V, lep):
    r"""Branching ratio of $\tau^+\to V^0\ell^+$."""
    scale = flavio.config['renormalization scale']['taudecays']
    sec = wcxf_sector_names['tau', lep]
    wc = wc_obj.get_wc(sec, scale, par, nf_out=4)
    alpha = flavio.physics.running.running.get_alpha_e(par, scale, nf_out=3)
    e = sqrt(4 * pi * alpha)
    mtau = par['m_tau']
    ml = par['m_' + lep]
    mV = par['m_' + V]
    fV = par['f_' + V]
    fTV = flavio.physics.running.running.get_f_perp(par, V, scale)
    Cgamma_taul = wc['Cgamma_tau{}'.format(lep)]
    Cgamma_ltau = wc['Cgamma_{}tau'.format(lep)]
    if V == 'rho0':
        g_u = get_wcs(wc, 'u', lep)
        g_d = get_wcs(wc, 'd', lep)
        g = (g_u-g_d)/sqrt(2)
        KV = -1/sqrt(2)*e
    if V == 'phi':
        g = get_wcs(wc, 's', lep)
        KV = 1/3*e
github flav-io / flavio / flavio / physics / bdecays / bvll / qcdf.py View on Github external
def T_perp(q2, par, wc, B, V, scale,
           include_WA=True, include_O8=True, include_QSS=True):
    if not include_WA and not include_O8 and not include_QSS:
        raise ValueError("At least one contribution to the QCDF corrections has to be switched on")
    mB = par['m_'+B]
    mV = par['m_'+V]
    mc = running.get_mc_pole(par)
    EV = En_V(mB, mV, q2)
    fB = par['f_'+B]
    fVperp = flavio.physics.running.running.get_f_perp(par, V, scale)
    fVpara = par['f_'+V]
    N = pi**2 / 3. * fB * fVperp / mB
    a1_perp = par['a1_perp_'+V]
    a2_perp = par['a2_perp_'+V]
    def phiV_perp(u):
        return phiV(u, a1_perp, a2_perp)
    def T_minus(u):
        return 0
    def T_plus(u):
        T = 0
        if include_O8:
            T += T_perp_plus_O8(q2=q2, par=par, wc=wc, B=B, V=V, u=u, scale=scale)
        if include_QSS:
            T += T_perp_plus_QSS(q2, par, wc, B, V, u, scale)
        return N / lB_plus(par=par, B=B) * phiV_perp(u) * T
    def T_powercorr_1(u):
github flav-io / flavio / flavio / physics / bdecays / bpll_subleading.py View on Github external
def _helicity_amps_deltaC(q2, deltaC, C_name, par, B, P):
    mB = par['m_'+B]
    mP = par['m_'+P]
    scale = config['renormalization scale']['bpll']
    mb = flavio.physics.running.running.get_mb(par, scale)
    N = flavio.physics.bdecays.bpll.prefactor(q2, par, B, P)
    ff = flavio.physics.bdecays.bpll.get_ff(q2, par, B, P)
    wc  = {'7': 0, '7p': 0, 'v': 0, 'a': 0, 's': 0, 'p': 0, 't': 0,'vp': 0, 'ap': 0, 'sp': 0, 'pp': 0, 'tp': 0, }
    wc[C_name] = deltaC
    return flavio.physics.bdecays.angular.helicity_amps_p(q2, mB, mP, mb, 0, 0, 0, ff, wc, N) # ml=0 as this only affects scalar contributions
github flav-io / flavio / flavio / physics / bdecays / bvnunu.py View on Github external
def prefactor(q2, par, B, V):
    GF = par['GF']
    scale = flavio.config['renormalization scale']['bvll']
    alphaem = flavio.physics.running.running.get_alpha(par, scale)['alpha_e']
    di_dj = flavio.physics.bdecays.common.meson_quark[(B,V)]
    xi_t = flavio.physics.ckm.xi('t',di_dj)(par)
    return 4*GF/sqrt(2)*xi_t*alphaem/(4*pi)
github flav-io / flavio / flavio / physics / mesonmixing / wilsoncoefficient.py View on Github external
Parameters
    ----------

    - `par`:
        parameter dictionary
    - `meson`:
        should be one of `'B0'`, `'Bs'`, or `'K0'`

    Returns
    -------
    a tuple of three complex numbers `(C_tt, C_cc, C_ct)` that contain the top-,
    charm-, and charm-top-contribution to the Wilson coefficient. This
    separation is necessary as they run differently.
    """
    mt = flavio.physics.running.running.get_mt(par, scale)
    mc = flavio.physics.running.running.get_mc(par, scale)
    mu = flavio.physics.running.running.get_mu(par, scale)
    mW = par['m_W']
    xt = mt**2/mW**2
    xc = mc**2/mW**2
    xu = mu**2/mW**2
    di_dj = meson_quark[meson]
    xi_t = ckm.xi('t',di_dj)(par)
    xi_c = ckm.xi('c',di_dj)(par)
    N = df2_prefactor(par)
    C_cc = N * xi_c**2     * S0_box(xc, xc, xu)
    C_tt = N * xi_t**2     * S0_box(xt, xt, xu)
    C_ct = N * 2*xi_c*xi_t * S0_box(xc, xt, xu)
    return (C_tt, C_cc, C_ct)
github flav-io / flavio / flavio / physics / edms / common.py View on Github external
def get_m(par, f, scale, eft):
    if f in ['e', 'mu', 'tau']:
        return par['m_' + f]
    nf_out = eft_nf_out[eft]
    if f == 'u':
        return flavio.physics.running.running.get_md(par, scale, nf_out=nf_out)
    elif f == 'd':
        return flavio.physics.running.running.get_mu(par, scale, nf_out=nf_out)
    elif f == 's':
        return flavio.physics.running.running.get_ms(par, scale, nf_out=nf_out)
    else:
        raise ValueError("get_m not defined for fermion {}".format(f))
github flav-io / flavio / flavio / physics / bdecays / bvll / lfv.py View on Github external
def helicity_amps(q2, wc, par, B, V, l1, l2):
    scale = flavio.config['renormalization scale']['bvll']
    wc_eff = flavio.physics.bdecays.wilsoncoefficients.get_wceff_lfv(q2, wc, par, B, V, l1, l2, scale)
    ml1 = par['m_'+l1]
    ml2 = par['m_'+l2]
    mB = par['m_'+B]
    mV = par['m_'+V]
    mb = flavio.physics.running.running.get_mb(par, scale)
    N = prefactor(q2, par, B, V, l1, l2)
    ff = flavio.physics.bdecays.bvll.amplitudes.get_ff(q2, par, B, V)
    h = flavio.physics.bdecays.angular.helicity_amps_v(q2, mB, mV, mb, 0, ml1, ml2, ff, wc_eff, N)
    return h
github flav-io / flavio / flavio / physics / bdecays / lambdablambdall.py View on Github external
def prefactor(q2, par, scale):
    xi_t = flavio.physics.ckm.xi('t','bs')(par)
    alphaem = flavio.physics.running.running.get_alpha(par, scale)['alpha_e']
    mLb = par['m_Lambdab']
    mL = par['m_Lambda']
    la_K = flavio.physics.bdecays.common.lambda_K(mLb**2, mL**2, q2)
    return par['GF'] * xi_t * alphaem * sqrt(q2) * la_K**(1/4.) / sqrt(3 * 2 * mLb**3 * pi**5) / 32.
github flav-io / flavio / flavio / physics / bdecays / blnu.py View on Github external
def _br_blnu(wc_obj, par, B, lep, nu):
    r"""Branching ratio of $B_q\to\ell^+\nu_\ell$."""
    bq = meson_quark[B]
    # CKM element
    if bq == 'bc':
        Vxb = flavio.physics.ckm.get_ckm(par)[1,2]
    elif bq == 'bu':
        Vxb = flavio.physics.ckm.get_ckm(par)[0,2]
    # renormalization scale
    scale = flavio.config['renormalization scale']['bll']
    # Wilson coefficients
    wc = wc_obj.get_wc(bq + lep + 'nu' + nu, scale, par)
    # add SM contribution to Wilson coefficient
    if lep == nu:
        wc['CVL_'+bq+lep+'nu'+nu] += flavio.physics.bdecays.wilsoncoefficients.get_CVLSM(par, scale, nf=5)
    mb = flavio.physics.running.running.get_mb(par, scale)
    if B == 'B+':
        mq = 0  # neglecting up quark mass
    elif B == 'Bc':
        mq = flavio.physics.running.running.get_mc(par, scale)
    return br_plnu_general(wc, par, Vxb, B, bq, lep, nu, mb, mq, delta=0)