def test_config(self): wilson.Wilson._default_options['smeft_accuracy'] = 'leadinglog' w = wilson.Wilson({'qd1_1123': 1}, 1000, 'SMEFT', 'Warsaw') self.assertEqual(w.get_option('smeft_accuracy'), 'leadinglog') wilson.Wilson.set_default_option('smeft_accuracy', 'integrate') self.assertEqual(w.get_option('smeft_accuracy'), 'leadinglog') # not changed! w2 = wilson.Wilson({'qd1_1123': 1}, 1000, 'SMEFT', 'Warsaw') self.assertEqual(w2.get_option('smeft_accuracy'), 'integrate') # changed! w.set_option('smeft_accuracy', 'leadinglog') self.assertEqual(w.get_option('smeft_accuracy'), 'leadinglog') with self.assertRaises(KeyError): w.get_option('my_config_doesntexist')
def test_ee_ww_GF(self): """Check that the NP contribution from phil3_22 and ll_1221 differs by a factor -2, since they only enter through the modified Fermi constant.""" np1 = wilson.Wilson({'phil3_22': 1e-6}, 91.1876, 'SMEFT', 'Warsaw') np2 = wilson.Wilson({'ll_1221': 1e-6}, 91.1876, 'SMEFT', 'Warsaw') for E in Es: R1 = np_prediction('R(ee->WW)', E=E, wc_obj=np1) R2 = np_prediction('R(ee->WW)', E=E, wc_obj=np2) self.assertAlmostEqual((R1 - 1) / (R2 - 1), -2, delta=0.2, msg="Failed for {}".format(E))
def test_smeft_matching_order(self): # with tree-level matching (and no SMEFT running): no effect w = wilson.Wilson({'uG_33': 1e-8}, 100, 'SMEFT', 'Warsaw') w.set_option('smeft_accuracy', 'leadinglog') w.set_option('smeft_matchingscale', 100) wc = w.match_run(5, 'WET', 'JMS') self.assertEqual(wc['dG_23'], 0) # now with 1-loop matching w = wilson.Wilson({'uG_33': 1e-8}, 100, 'SMEFT', 'Warsaw') w.set_option('smeft_accuracy', 'leadinglog') w.set_option('smeft_matchingscale', 100) w.set_option('smeft_matching_order', 1) wc = w.match_run(5, 'WET', 'JMS') self.assertNotEqual(wc['dG_23'], 0)
def test__translate_warsaw_to_warsawup(self): w_in = wilson.Wilson({'qd1_1211': 1e-6}, 1e3, 'SMEFT', 'Warsaw') wc_out = w_in.match_run(1e3, 'SMEFT', 'Warsaw up') V = ckmutil.ckm.ckm_tree(p["Vus"], p["Vub"], p["Vcb"], p["delta"]) self.assertAlmostEqual(wc_out.dict['qd1_1111'], V[0, 1] * V[0, 0].conjugate() * 1e-6 + V[0, 0] * V[0, 1].conjugate() * 1e-6, places=11) self.assertAlmostEqual(wc_out.dict['qd1_1211'], V[0, 1] * V[1, 0].conjugate() * 1e-6 + V[0, 0] * V[1, 1].conjugate() * 1e-6, places=11) self.assertAlmostEqual(wc_out.dict['qd1_1311'], V[0, 1] * V[2, 0].conjugate() * 1e-6 + V[0, 0] * V[2, 1].conjugate() * 1e-6, places=11) self.assertAlmostEqual(wc_out.dict['qd1_2211'], V[1, 1] * V[1, 0].conjugate() * 1e-6 + V[1, 0] * V[1, 1].conjugate() * 1e-6, places=11) self.assertAlmostEqual(wc_out.dict['qd1_2311'], V[1, 1] * V[2, 0].conjugate() * 1e-6 + V[1, 0] * V[2, 1].conjugate() * 1e-6, places=11) self.assertAlmostEqual(wc_out.dict['qd1_3311'], V[2, 1] * V[2, 0].conjugate() * 1e-6 + V[2, 0] * V[2, 1].conjugate() * 1e-6, places=11)
def test_obs_np_ff(self): w = wilson.Wilson({'ephi_33': 1e-8}, 125, 'SMEFT', 'Warsaw') mu_tau = flavio.np_prediction('mu_gg(h->tautau)', w) mu_mu = flavio.np_prediction('mu_gg(h->mumu)', w) # mu_mu is not exactly =1 since it modifies the Higgs total width self.assertAlmostEqual(mu_mu, 1, delta=0.02) self.assertNotAlmostEqual(mu_tau, 1, delta=0.02)
def test_clearcache(self): w = wilson.Wilson({'CVLL_sdsd': 1}, 160, 'WET', 'flavio') # after init, cache empty self.assertDictEqual(w._cache, {}) # run w.match_run(140, 'WET', 'flavio') # now cache not empty self.assertIsInstance(w._cache['WET'][140]['flavio']['all'], wcxf.WC) w.clear_cache() # now cache empty again self.assertDictEqual(w._cache, {}) # check that setting option empties cache wilson.Wilson._default_options['smeft_accuracy'] = 666 w = wilson.Wilson({'CVLL_sdsd': 1}, 160, 'WET', 'flavio') w.match_run(140, 'WET', 'flavio') w.set_option('smeft_accuracy', 'leadinglog') self.assertDictEqual(w._cache, {})
def test_run_lq3_3333(self): w = wilson.Wilson({'lq3_2333': 1e-6}, 1000, 'SMEFT', 'Warsaw') # determine g at input scale g = wilson.run.smeft.SMEFT(w.wc).C_in['g'] # run down wc = w.match_run(100, 'SMEFT', 'Warsaw') # compare LL to expected value sf = 2 # symmetry factor since our 2333 is 2* larger self.assertAlmostEqual(wc['ll_2333'], sf * 1e-6 / (16 * pi**2) * (-g**2) * log(100 / 1000))
def _prepare_spoint(self, spoint): return wilson.Wilson( wcdict={ self.coeffs[icoeff]: spoint[icoeff] for icoeff in range(len(self.coeffs)) }, scale=self.scale, eft=self.eft, basis=self.basis, )
def test_smeft_matchingscale(self): w = wilson.Wilson({'lq1_2223': 1e-8}, 1000, 'SMEFT', 'Warsaw') w.set_option('smeft_accuracy', 'leadinglog') w.set_option('smeft_matchingscale', 145) w.set_option('mb_matchingscale', 4) w.set_option('mc_matchingscale', 2) w.match_run(80, 'WET', 'JMS') self.assertSetEqual(set(w._cache['WET'].keys()), {145, 80}) w.match_run(1, 'WET-3', 'JMS') self.assertEqual(w.get_option('mb_matchingscale'), 4) self.assertEqual(w.get_option('mc_matchingscale'), 2)
def test_config_parameters(self): w = wilson.Wilson({'qd1_1123': 1}, 1000, 'SMEFT', 'Warsaw') with self.assertRaises(vol.MultipleInvalid): # value must be dict w.set_option('parameters', 4) with self.assertRaises(vol.MultipleInvalid): # dict value must be number w.set_option('parameters', {'bla': 'blo'}) # int should be OK but corced to float w.set_option('parameters', {'bla': 1}) self.assertTrue(type(w.get_option('parameters')['bla']), float) self.assertEqual(w.get_option('parameters'), {'bla': 1.}) w.set_option('parameters', {'m_b': 4.0}) self.assertEqual(w.get_option('parameters'), {'m_b': 4.0}) self.assertEqual(w.parameters['m_b'], 4.0)
def test_diff_ee_ww_NP(self): coeffs = ['phiWB', 'phiD', 'phil3_11', 'phil3_22', 'll_1221', 'phil1_11', 'phie_11'] for coeff in coeffs: for E in [182.66, 189.09, 198.38, 205.92]: _E = Es.flat[np.abs(Es - E).argmin()] dsigma = [] dsigma_sm = [] for i in range(10): args = (E, np.round(i * 0.2 - 1, 1), np.round((i + 1) * 0.2 - 1, 1)) w = wilson.Wilson({coeff: 0.1 / 246.22**2}, 91.1876, 'SMEFT', 'Warsaw') dsigma.append(np_prediction('<dR/dtheta>(ee->WW)', w, *args)) dsigma_sm.append(sm_prediction('<dR/dtheta>(ee->WW)', *args)) r_tot = np_prediction('R(ee->WW)', w, _E) sigma_tot_sm = sum(dsigma_sm) sigma_tot = sum(dsigma) self.assertAlmostEqual(sigma_tot / sigma_tot_sm, r_tot, delta=0.25, msg="Failed for E={}, C_{}".format(E, coeff))
def test_run_smeft(self): w = wilson.Wilson({'qd1_1123': 1}, 1000, 'SMEFT', 'Warsaw') wc = w.match_run(160, 'SMEFT', 'Warsaw up') wc.validate()
def test_obs(self): w = wilson.Wilson({}, scale=91.1876, eft='SMEFT', basis='Warsaw') self.assertAlmostEqual(flavio.sm_prediction('m_W'), par['m_W'], delta=0.03) self.assertEqual(flavio.sm_prediction('m_W'), flavio.np_prediction('m_W', w))
def test_obs_np_gaga(self): w = wilson.Wilson({'phiW': 1e-6}, 125, 'SMEFT', 'Warsaw') mu = flavio.np_prediction('mu_gg(h->gammagamma)', w) self.assertNotAlmostEqual(mu, 1, delta=0.02)
def test_class(self): wilson.Wilson({'qd1_1123': 1}, 1000, 'SMEFT', 'Warsaw')
import wilson.match._smeft_old import wilson.match.smeft_tree from wilson.parameters import p np.random.seed(77) # These WCs appear quadratically in the "old" matching implementation wc_sm = ['phiD', 'phiWB'] wc_vert = [ k for k in wcxf.Basis['SMEFT', 'Warsaw'].all_wcs if 'phiq' in k or 'phil' in k or 'phiu' in k or 'phid' in k or 'phie' in k ] _wcr = get_random_wc('SMEFT', 'Warsaw', 100, cmax=1e-8) wc_linear = wilson.Wilson( {k: v for k, v in _wcr.dict.items() if k not in wc_sm + wc_vert}, 100, 'SMEFT', 'Warsaw').wc wc_quadratic = wilson.Wilson( {k: v for k, v in _wcr.dict.items() if k in wc_sm + wc_vert}, 100, 'SMEFT', 'Warsaw').wc class TestSMEFTWETreimpl(unittest.TestCase): def test_linear(self): """For WCs entering linearly, agreement should be numerically exact""" C = wilson.util.smeftutil.wcxf2arrays_symmetrized(wc_linear.dict) c_old = wilson.match._smeft_old.match_all_array(C, p) c_new = wilson.match.smeft_tree.match_all_array(C, p) for k in c_old: npt.assert_almost_equal(c_old[k],
def test_from_wc(self): wc = wcxf.WC('SMEFT', 'Warsaw', 1000, {'qd1_1123': 1}) w1 = wilson.Wilson.from_wc(wc) w2 = wilson.Wilson({'qd1_1123': 1}, 1000, 'SMEFT', 'Warsaw') self.assertDictEqual(w1.wc.dict, w2.wc.dict)
def test_gamma_h_quadratic(self): # large up quark Yukawa coupling to make h>uu comparable to h>bb C = -sqrt(2) * 2.80 / 246.22**3 # -sqrt(2) * m_b(m_h) / v**2 wc_np = wilson.Wilson({'uphi_11': C}, 125, 'SMEFT', 'Warsaw') R = flavio.physics.higgs.width.Gamma_h(par, wc_np.wc) self.assertAlmostEqual(R, 1.58, delta=0.15)