def test_functions(self): # check if the limit q2->0 is implemented correctly self.assertAlmostEqual(matrixelements.F_87(0.1, 0.), matrixelements.F_87(0.1, 1e-8), places=6) self.assertAlmostEqual(matrixelements.SeidelA(0, 4, 5), matrixelements.SeidelA(1e-8, 4, 5), places=6) # for F_89, just see if this raises an exception matrixelements.F_89(0.4, 0.5) wc_obj = WilsonCoefficients() wc = wctot_dict(wc_obj, 'bsmumu', 4.2, par) matrixelements.delta_C7(par, wc, q2=3.5, scale=4.2, qiqj='bs') matrixelements.delta_C9(par, wc, q2=3.5, scale=4.2, qiqj='bs') # comparing to the values from the data file x = [1.3, 0.13, 0.18] self.assertEqual(matrixelements.F_17(*x), -0.795182 - 0.0449909j) self.assertAlmostEqual(matrixelements.F_19(*x), -16.3032 + 0.281462j, places=3) self.assertEqual(matrixelements.F_27(*x), 4.77109 + 0.269943j) self.assertAlmostEqual(matrixelements.F_29(*x), 6.75552 - 1.6887j, places=3) # it should be that F17+F27/6=0 self.assertAlmostEqual(matrixelements.F_17(*x), -matrixelements.F_27(*x) / 6, places=5) # check the limiting cases of the quark loop function self.assertAlmostEqual(matrixelements.h(3.5, 1e-8, 4.2), matrixelements.h(3.5, 0., 4.2), places=6) self.assertAlmostEqual(matrixelements.h(1e-8, 1.2, 4.2), matrixelements.h(0., 1.2, 4.2), places=6) # comparing roughly to the plots in hep-ph/0403185v2 (but with opposite sign!) x = [2.5, 4.75, 4.75] np.testing.assert_almost_equal(-matrixelements.Fu_17(*x), 1.045 + 0.62j, decimal=1) np.testing.assert_almost_equal(-matrixelements.Fu_19(*x), -0.57 + 8.3j, decimal=1) np.testing.assert_almost_equal(-matrixelements.Fu_29(*x), -13.9 + -32.5j, decimal=0)
import unittest import numpy as np from .bvlnu import * from flavio.physics.bdecays.formfactors.b_v import bsz_parameters from flavio.physics.eft import WilsonCoefficients from flavio.parameters import default_parameters import flavio constraints = default_parameters wc_obj = WilsonCoefficients() par = constraints.get_central_all() class TestBVll(unittest.TestCase): def test_brhoee(self): q2 = 3.5 self.assertEqual( dBRdq2(q2, wc_obj, par, 'B0', 'rho+', 'e'), flavio.Observable.get_instance("dBR/dq2(B0->rhoenu)").prediction_central(constraints, wc_obj, q2=q2) ) def test_decays(self): # just check if any of the modes raises an exception flavio.Observable.get_instance("dBR/dq2(B0->rhoenu)").prediction_central(constraints, wc_obj, q2=3) flavio.Observable.get_instance("dBR/dq2(B+->rhoenu)").prediction_central(constraints, wc_obj, q2=3) flavio.Observable.get_instance("dBR/dq2(B0->D*enu)").prediction_central(constraints, wc_obj, q2=3) flavio.Observable.get_instance("dBR/dq2(B+->D*enu)").prediction_central(constraints, wc_obj, q2=3) flavio.Observable.get_instance("dBR/dq2(B+->omegaenu)").prediction_central(constraints, wc_obj, q2=3) flavio.Observable.get_instance("dBR/dq2(Bs->K*enu)").prediction_central(constraints, wc_obj, q2=3)
import unittest import numpy as np from .bvgamma import * from flavio.physics.bdecays.formfactors.b_v import bsz_parameters from flavio.physics.eft import WilsonCoefficients from flavio.physics.bdecays.wilsoncoefficients import wctot_dict from flavio.parameters import default_parameters import flavio wc = WilsonCoefficients() par = default_parameters # class TestBVgamma(unittest.TestCase): def test_bksgamma(self): # just check if this works flavio.Observable.get_instance("ACP(B0->K*gamma)").prediction_central( par, wc) flavio.Observable.get_instance("S_K*gamma").prediction_central(par, wc) # numerical comparison to David's old Mathematica code self.assertAlmostEqual(flavio.Observable.get_instance( "BR(B0->K*gamma)").prediction_central(par, wc) * 1e5 / 3.91526, 1, places=1) self.assertAlmostEqual(flavio.Observable.get_instance( "BR(B+->K*gamma)").prediction_central(par, wc) * 1e5 / 4.11625, 1, places=1) def test_bksgamma(self): # just check if this works
from . import amplitude, observables from math import sin, asin, cos, pi from flavio.physics.eft import WilsonCoefficients from flavio import Observable from flavio.parameters import default_parameters import copy import flavio import cmath from wilson import Wilson s = 1.519267515435317e+24 c = copy.deepcopy(default_parameters) par = c.get_central_all() wc_obj = WilsonCoefficients() wc_B0 = wc_obj.get_wc('bdbd', 4.2, par) wc_Bs = wc_obj.get_wc('bsbs', 4.2, par) wc_K = wc_obj.get_wc('sdsd', 2, par) # this is the DeltaF=2 evolution matrix from mt to 4.2 GeV as obtained # from the formulae in hep-ph/0102316 U_mb = np.array([[0.83693251, 0., 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0.83693251, 0., 0., 0., 0., 0., 0., 0., 0.], [0., 0., 0.91882327, 0., 0., 0., -0.04335413, 0., 0., 0.], [0., 0., 0., 0.91882327, 0., 0., 0., -0.04335413, 0., 0.], [0., 0., 0., 0., 1.68277548, 0., 0., 0., 2.06605957, 0.], [0., 0., 0., 0., 0., 1.68277548, 0., 0., 0., 2.06605957], [0., 0., -0.92932569, 0., 0., 0., 2.31878868, 0., 0., 0.], [0., 0., 0., -0.92932569, 0., 0., 0., 2.31878868, 0., 0.], [0., 0., 0., 0., -0.00686759, 0., 0., 0., 0.53745488, 0.],
import unittest import numpy as np from . import amplitude, rge, observables from math import sin, asin from flavio.physics.eft import WilsonCoefficients from flavio import Observable from flavio.parameters import default_parameters import copy import flavio s = 1.519267515435317e+24 c = copy.deepcopy(default_parameters) par = c.get_central_all() wc_obj = WilsonCoefficients() wc_B0 = wc_obj.get_wc('bdbd', 4.2, par) wc_Bs = wc_obj.get_wc('bsbs', 4.2, par) wc_K = wc_obj.get_wc('sdsd', 2, par) # this is the DeltaF=2 evolution matrix from mt to 4.2 GeV as obtained # from the formulae in hep-ph/0102316 U_mb = np.array([[ 0.83693251, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0.83693251, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ], [ 0. , 0. , 0.91882327, 0. , 0. , 0. , -0.04335413, 0. , 0. , 0. ], [ 0. , 0. , 0. , 0.91882327, 0. , 0. , 0. , -0.04335413, 0. , 0. ], [ 0. , 0. , 0. , 0. , 1.68277548,