How to use the zfit.core.tfext.to_complex function in zfit

To help you get started, we’ve selected a few zfit 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 zfit / zfit / zfit / physics / flavour / rare_decays / bToKstarll / amplitudes.py View on Github external
def A_time(q2, ml):
    normalization = normalize_amplitudes(q2, ml)
    return (-1. * tfext.to_complex(normalization * 2.0) * (wc.C10 - wc.C10p) *
            tfext.to_complex(ff.F_time(q2)))
github zfit / zfit / zfit / physics / flavour / rare_decays / bToKstarll / amplitudes.py View on Github external
def A_para_L(q2, ml):
    normalization = normalize_amplitudes(q2, ml)
    return -1. * tfext.to_complex(normalization) * (
        ((wc.C9 - wc.C9p) - (wc.C10 - wc.C10p)) * tfext.to_complex(ff.F_para(q2))
        + tfext.to_complex(2.0 * (const.Mb - const.Ms) * const.MB / q2) *
        ((wc.C7 - wc.C7p) * tfext.to_complex(ff.F_para_T(q2)) - tfext.to_complex(
            16.0 * tf.square(tfext.pi) * const.MB / const.Mb) * nlh.H_para(q2)))
github zfit / zfit / zfit / core / kinematics.py View on Github external
def WignerD(phi, theta, psi, j2, m2_1, m2_2):
    """
    Calculate Wigner capital-D function.
    phi,
    theta,
    psi  : Rotation angles
    j : spin (in units of 1/2, e.g. 1 for spin=1/2)
    m1 and m2 : spin projections (in units of 1/2, e.g. 1 for projection 1/2)
    """
    i = tf.complex(tfext.constant(0), tfext.constant(1))
    m1 = m2_1 / 2.
    m2 = m2_2 / 2.
    return tf.exp(-i * tfext.to_complex(m1 * phi)) * tfext.to_complex(
        Wignerd(theta, j2, m2_1, m2_2)) * tf.exp(-i * tfext.to_complex(m2 * psi))
github zfit / zfit / zfit / physics / flavour / ckm_parameters.py View on Github external
# CKM parametrization taken from EOS
rho_eta = (tf.complex(rho_CKM, eta_CKM) *
           to_complex(tf.sqrt(1. - tf.square(A_CKM) * tf.pow(lambda_CKM, 4)) /
                      tf.sqrt(1.0 - tf.square(lambda_CKM))) /
           (1. - to_complex(tf.square(A_CKM) * tf.pow(lambda_CKM, 4)) * tf.complex(rho_CKM,
                                                                                   eta_CKM)))

Vtb = (1. - tf.square(A_CKM) * tf.pow(lambda_CKM, 4) / 2. - tf.square(A_CKM) * tf.pow(lambda_CKM,
                                                                                      6) *
       abs_square(rho_eta) / 2. - tf.pow(A_CKM, 4) * tf.pow(lambda_CKM, 8) / 8.)

Vts = (to_complex(-1.0 * A_CKM * tf.square(lambda_CKM)) *
       (1.0 - to_complex(tf.square(lambda_CKM)) * (1.0 - 2.0 * rho_eta) / 2.0 -
        to_complex(tf.pow(lambda_CKM, 4) / 8.0) - to_complex(tf.pow(lambda_CKM, 6)) *
        (1.0 + 8.0 * to_complex(tf.square(A_CKM)) * rho_eta) / 16.0))
Vts = tf.abs(Vts)
github zfit / zfit / zfit / physics / flavour / rare_decays / bToKstarll / amplitudes.py View on Github external
def A_para_R(q2, ml):
    normalization = normalize_amplitudes(q2, ml)
    return -1. * tfext.to_complex(normalization) * (
        ((wc.C9 - wc.C9p) + (wc.C10 - wc.C10p)) * tfext.to_complex(ff.F_para(q2))
        + tfext.to_complex(2.0 * (const.Mb - const.Ms) * const.MB / q2) *
        ((wc.C7 - wc.C7p) * tfext.to_complex(ff.F_para_T(q2)) - tfext.to_complex(
            16.0 * tf.square(tfext.pi) * const.MB / const.Mb) * nlh.H_para(q2)))
github zfit / zfit / zfit / physics / flavour / rare_decays / bToKstarll / amplitudes.py View on Github external
def A_zero_R(q2, ml):
    normalization = normalize_amplitudes(q2, ml)
    return -1. * tfext.to_complex(normalization) * (
        ((wc.C9 - wc.C9p) + (wc.C10 - wc.C10p)) * tfext.to_complex(ff.F_zero(q2))
        + tfext.to_complex(2.0 * (const.Mb - const.Ms) * const.MB / q2) *
        ((wc.C7 - wc.C7p) * tfext.to_complex(ff.F_zero_T(q2)) - tfext.to_complex(
            16.0 * tf.square(tfext.pi) * const.MB / const.Mb) * nlh.H_zero(q2)))
github zfit / zfit / zfit / physics / flavour / rare_decays / bToKstarll / non_local_hadronic / nlh_parametrization_from_analycity.py View on Github external
def H_para(q2):
    z_q2 = utils.z(q2, t_H_plus, t_H_zero)
    z__jpsi2 = utils.z(tf.square(const.MJpsi), t_H_plus, t_H_zero)
    z_psi2_s2 = utils.z(tf.square(const.Mpsi2S), t_H_plus, t_H_zero)
    return (tfext.to_complex((1.0 - z_q2 * z__jpsi2) * (1.0 - z_q2 * z_psi2_s2) /
                             ((z_q2 - z__jpsi2) * (z_q2 - z_psi2_s2))) *
            poly_complex(alpha_para_0, alpha_para_1, alpha_para_2,
                         alpha_para_3, alpha_para_4, alpha_para_5, z_q2, real_x=True) *
            tfext.to_complex(ff.F_para(q2)))
github zfit / zfit / zfit / physics / flavour / rare_decays / bToKstarll / non_local_hadronic / nlh_parametrization_from_analycity.py View on Github external
def H_zero(q2):
    z_q2 = utils.z(q2, t_H_plus, t_H_zero)
    z__jpsi2 = utils.z(tf.square(const.MJpsi), t_H_plus, t_H_zero)
    z_psi2_s2 = utils.z(tf.square(const.Mpsi2S), t_H_plus, t_H_zero)
    return (tfext.to_complex((1.0 - z_q2 * z__jpsi2) * (1.0 - z_q2 * z_psi2_s2) /
                             ((z_q2 - z__jpsi2) * (z_q2 - z_psi2_s2))) *
            poly_complex(alpha_zero_0, alpha_zero_1, alpha_zero_2,
                         alpha_zero_3, alpha_zero_4, z_q2, real_x=True) *
            tfext.to_complex(z_q2 - utils.z(0.0, t_H_plus, t_H_zero)) * tfext.to_complex(
            ff.F_zero(q2)))
github zfit / zfit / zfit / physics / flavour / rare_decays / bToKstarll / amplitudes.py View on Github external
def A_perp_L(q2, ml):
    normalization = normalize_amplitudes(q2, ml)
    return tfext.to_complex(normalization) * \
           (((wc.C9 + wc.C9p) - (wc.C10 + wc.C10p)) * tfext.to_complex(ff.F_perp(q2))
            + tfext.to_complex(2.0 * (const.Mb + const.Ms) * const.MB / q2) *
            ((wc.C7 + wc.C7p) * tfext.to_complex(ff.F_perp_T(q2)) -
             tfext.to_complex(16.0 * tf.square(tfext.pi) * const.MB / const.Mb) *
             nlh.H_perp(q2)))
github zfit / zfit / zfit / physics / flavour / rare_decays / bToKstarll / amplitudes.py View on Github external
def A_zero_L(q2, ml):
    normalization = normalize_amplitudes(q2, ml)
    return -1. * tfext.to_complex(normalization) * (
        ((wc.C9 - wc.C9p) - (wc.C10 - wc.C10p)) * tfext.to_complex(ff.F_zero(q2))
        + tfext.to_complex(2.0 * (const.Mb - const.Ms) * const.MB / q2) *
        ((wc.C7 - wc.C7p) * tfext.to_complex(ff.F_zero_T(q2)) - tfext.to_complex(
            16.0 * tf.square(tfext.pi) * const.MB / const.Mb) * nlh.H_zero(q2)))