def smeft_toarray(wc_name, wc_dict): """Construct a numpy array with Wilson coefficient values from a dictionary of label-value pairs corresponding to the non-redundant elements.""" shape = smeftutil.C_keys_shape[wc_name] C = np.zeros(shape, dtype=complex) for k, v in wc_dict.items(): if k.split('_')[0] != wc_name: continue indices = k.split('_')[-1] # e.g. '1213' indices = tuple(int(s) - 1 for s in indices) # e.g. (1, 2, 1, 3) C[indices] = v C = smeftutil.symmetrize({wc_name: C})[wc_name] return C
def set_initial_wcxf(self, wc, scale_high=None): """Load the initial values for Wilson coefficients from a wcxf.WC instance. Parameters: - `scale_high`: since Wilson coefficients are dimensionless in DsixTools but not in WCxf, the high scale in GeV has to be provided. If this parameter is None (default), either a previously defined value will be used, or the scale attribute of the WC instance will be used. """ from wilson import wcxf if wc.eft != 'SMEFT': raise ValueError("Wilson coefficients use wrong EFT.") if wc.basis != 'Warsaw': raise ValueError("Wilson coefficients use wrong basis.") if scale_high is not None: self.scale_high = scale_high elif self.scale_high is None: self.scale_high = wc.scale C = smeftutil.wcxf2arrays(wc.dict) keys_dim5 = ['llphiphi'] keys_dim6 = list( set(smeftutil.WC_keys_0f + smeftutil.WC_keys_2f + smeftutil.WC_keys_4f) - set(keys_dim5)) self.scale_in = wc.scale for k in keys_dim5: if k in C: C[k] = C[k] * self.scale_high for k in keys_dim6: if k in C: C[k] = C[k] * self.scale_high**2 C = smeftutil.symmetrize(C) # fill in zeros for missing WCs for k, s in smeftutil.C_keys_shape.items(): if k not in C and k not in smeftutil.SM_keys: if s == 1: C[k] = 0 else: C[k] = np.zeros(s) if self.C_in is None: self.C_in = C else: self.C_in.update(C)
def load_initial(self, streams): """Load the initial values for parameters and Wilson coefficients from one or several files. `streams` should be a tuple of file-like objects strings.""" d = {} for stream in streams: s = load(stream) if 'BLOCK' not in s: raise ValueError("No BLOCK found") d.update(s['BLOCK']) d = {'BLOCK': d} C = wc_lha2dict(d) sm = sm_lha2dict(d) self.scale_high = lha2scale(d) self.scale_in = lha2scale(d) C.update(sm) C = smeftutil.symmetrize(C) self.C_in = C
def match_all(d_SMEFT, parameters=None): """Match the SMEFT Warsaw basis onto the WET JMS basis.""" p = default_parameters.copy() if parameters is not None: # if parameters are passed in, overwrite the default values p.update(parameters) C = wilson.translate.smeft.wcxf2arrays(d_SMEFT) C = smeftutil.symmetrize(C) C = smeftutil.scale_dict(C) C = smeftutil.add_missing(C) C['vT'] = 246.22 C_WET = match_all_array(C, p) C_WET = wetutil.unscale_dict_wet(C_WET) C_WET = wilson.translate.wet.rotate_down(C_WET, p) d_WET = wilson.translate.smeft.arrays2wcxf(C_WET) basis = wcxf.Basis['WET', 'JMS'] keys = set(d_WET.keys()) & set(basis.all_wcs) d_WET = {k: d_WET[k] for k in keys} return d_WET
def test_symmetrize_C(self): C_symm = smeftutil.symmetrize(C) # check all keys are present self.assertSetEqual(set(C.keys()), set(C_symm.keys())) for i, v in C_symm.items(): # check trivial cases are the same if i in smeftutil.C_symm_keys[0] + smeftutil.C_symm_keys[ 1] + smeftutil.C_symm_keys[3]: if smeftutil.C_keys_shape[i] == 1: self.assertEqual(v, C[i]) else: npt.assert_array_equal(v, C[i]) # check symmetric elif i in smeftutil.C_symm_keys[9]: npt.assert_array_equal(v, v.T) # check hermitian elif i in smeftutil.C_symm_keys[2]: npt.assert_array_equal(v, v.T.conj()) # check 2 identical FFbar elif i in smeftutil.C_symm_keys[4]: npt.assert_array_equal(v, v.transpose((2, 3, 0, 1))) npt.assert_array_equal(v, v.transpose((1, 0, 3, 2)).conj()) # check 2 independent FFbar elif i in smeftutil.C_symm_keys[5]: npt.assert_array_equal(v, v.transpose((1, 0, 3, 2)).conj()) # check special case ee elif i in smeftutil.C_symm_keys[6]: npt.assert_array_equal(v, v.transpose((2, 3, 0, 1))) npt.assert_array_equal(v, v.transpose((0, 3, 2, 1))) npt.assert_array_equal(v, v.transpose((2, 1, 0, 3))) # check special case qque elif i in smeftutil.C_symm_keys[7]: npt.assert_array_equal(v, v.transpose((1, 0, 2, 3))) # check special case qqql elif i in smeftutil.C_symm_keys[8]: # see eq. (10) of arXiv:1405.0486 npt.assert_array_almost_equal(v + v.transpose((1, 0, 2, 3)), v.transpose( (1, 2, 0, 3)) + v.transpose( (2, 1, 0, 3)), decimal=15)
def warsaw_up_to_warsaw(C, parameters=None): """Translate from the 'Warsaw up' basis to the Warsaw basis. Parameters used: - `Vus`, `Vub`, `Vcb`, `gamma`: elements of the unitary CKM matrix (defined as the mismatch between left-handed quark mass matrix diagonalization matrices). """ C_in = wcxf2arrays(C) C_in = smeftutil.symmetrize(C_in) p = default_parameters.copy() if parameters is not None: # if parameters are passed in, overwrite the default values p.update(parameters) Uu = Ud = Ul = Ue = np.eye(3) V = ckmutil.ckm.ckm_tree(p["Vus"], p["Vub"], p["Vcb"], p["gamma"]) Uq = V C_out = smeftutil.flavor_rotation(C_in, Uq, Uu, Ud, Ul, Ue) C_out = arrays2wcxf(C_out) warsaw = wcxf.Basis['SMEFT', 'Warsaw'] all_wcs = set(warsaw.all_wcs) # to speed up lookup return {k: v for k, v in C_out.items() if k in all_wcs}
def _set_initial_wcxf(self, wc, get_smpar=True): """Load the initial values for Wilson coefficients from a wcxf.WC instance. Parameters: - `get_smpar`: boolean, optional, defaults to True. If True, an attempt is made to determine the SM parameters from the requirement of reproducing the correct SM masses and mixings at the electroweak scale. As approximations are involved, the result might or might not be reliable, depending on the size of the Wilson coefficients affecting the SM masses and mixings. If False, Standard Model parameters have to be provided separately and are assumed to be in the weak basis used for the Warsaw basis as defined in WCxf, i.e. in the basis where the down-type and charged lepton mass matrices are diagonal. """ if wc.eft != 'SMEFT': raise ValueError("Wilson coefficients use wrong EFT.") if wc.basis != 'Warsaw': raise ValueError("Wilson coefficients use wrong basis.") C = wilson.translate.smeft.wcxf2arrays(wc.dict) self.scale_in = wc.scale C = smeftutil.symmetrize(C) # fill in zeros for missing WCs for k, s in smeftutil.C_keys_shape.items(): if k not in C and k not in smeftutil.SM_keys: if s == 1: C[k] = 0 else: C[k] = np.zeros(s) if self.C_in is None: self.C_in = C else: self.C_in.update(C) if get_smpar: self.C_in.update(self._get_sm_scale_in())