How to use the smelli.GlobalLikelihood function in smelli

To help you get started, we’ve selected a few smelli 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 smelli / smelli / smelli / test_ckm.py View on Github external
def test_init(self):
        gl = smelli.GlobalLikelihood()
        # with fix_ckm
        gl_fixckm = smelli.GlobalLikelihood(fix_ckm=True)
        self.assertEqual(gl.par_dict_default['Vcb'], par['Vcb'])
        VcbSM = gl.par_dict_sm['Vcb']
        VubSM = gl.par_dict_sm['Vub']
        VusSM = gl.par_dict_sm['Vus']
        deltaSM = gl.par_dict_sm['delta']
        self.assertAlmostEqual(par['Vcb'], VcbSM, delta=0.0002)
        self.assertAlmostEqual(par['Vub'], VubSM, delta=0.0005)
        self.assertAlmostEqual(par['Vus'], VusSM, delta=0.0006)
        pre = -4 * par['GF'] / sqrt(2)
        # Vcb
        w = Wilson({'lq3_1123': 0.5 * pre * VcbSM * (-0.5)}, 91.1876, 'SMEFT', 'Warsaw')
        pp = gl.parameter_point(w)
        self.assertAlmostEqual(pp.par_dict_np['Vcb'] / VcbSM,  1.5, delta=0.03)
        # with fix_ckm
github smelli / smelli / smelli / test_ckm.py View on Github external
def test_init(self):
        gl = smelli.GlobalLikelihood()
        # with fix_ckm
        gl_fixckm = smelli.GlobalLikelihood(fix_ckm=True)
        self.assertEqual(gl.par_dict_default['Vcb'], par['Vcb'])
        VcbSM = gl.par_dict_sm['Vcb']
        VubSM = gl.par_dict_sm['Vub']
        VusSM = gl.par_dict_sm['Vus']
        deltaSM = gl.par_dict_sm['delta']
        self.assertAlmostEqual(par['Vcb'], VcbSM, delta=0.0002)
        self.assertAlmostEqual(par['Vub'], VubSM, delta=0.0005)
        self.assertAlmostEqual(par['Vus'], VusSM, delta=0.0006)
        pre = -4 * par['GF'] / sqrt(2)
        # Vcb
        w = Wilson({'lq3_1123': 0.5 * pre * VcbSM * (-0.5)}, 91.1876, 'SMEFT', 'Warsaw')
        pp = gl.parameter_point(w)
        self.assertAlmostEqual(pp.par_dict_np['Vcb'] / VcbSM,  1.5, delta=0.03)
        # with fix_ckm
        pp = gl_fixckm.parameter_point(w)
        self.assertEqual(pp.par_dict_np['Vcb'] / par['Vcb'],  1)
github smelli / smelli / smelli / test_ckm.py View on Github external
def test_fast_likelihoods(self):
        scheme = ckm.CKMSchemeRmuBtaunuBxlnuDeltaM()
        ckm_central = scheme.ckm_np()
        gl = smelli.GlobalLikelihood()
        for fl in gl.fast_likelihoods.values():
            par = fl.par_obj
            self.assertAlmostEqual(par.get_central('Vus'), ckm_central[0], delta=0.00001)
            self.assertAlmostEqual(par.get_central('Vcb'), ckm_central[1], delta=0.00001)
            self.assertAlmostEqual(par.get_central('Vub'), ckm_central[2], delta=0.00001)
            self.assertAlmostEqual(par.get_central('delta'), ckm_central[3], delta=0.0001)
github smelli / smelli / smelli / data / cache / save_covariances.py View on Github external
parser.add_argument('-n', type=int, default=5000,
                        help='Number of evaluations (default 5000)')
    parser.add_argument('-t', type=int, default=1,
                        help='Number of threads (default 1)')
    parser.add_argument('-f', action='store_true',
                        help='Force recomputation (default false)')
    parser.add_argument('-s', type=str, default=DEFAULT_ckm_scheme,
                        help="Name of CKM scheme (default {})".format(
                        DEFAULT_ckm_scheme))
    parser.add_argument('--fix_ckm', action='store_true',
                        help='Fix CKM values to their SM values (default false)')

    args = parser.parse_args()

    from smelli import GlobalLikelihood
    gl = GlobalLikelihood(ckm_scheme=args.s, fix_ckm=args.fix_ckm)

    logging.info("Computing covariances with N={} and {} threads".format(args.n, args.t))

    gl.make_measurement(N=args.n, threads=args.t, force=args.f)
    gl.save_sm_covariances('.')

smelli

A Python package providing a global likelihood function in the space of dimension-6 Wilson coefficients of the Standard Model Effective Field Theory (SMEFT)

MIT
Latest version published 4 months ago

Package Health Score

52 / 100
Full package analysis