コード例 #1
0
ファイル: test_smpar.py プロジェクト: knut0815/wilson
 def test_smeftpar_small(self):
     wc = get_random_wc('SMEFT', 'Warsaw', cmax=1e-24)
     smeft = SMEFT(wc=None)
     smeft.scale_in = 160
     smeft._set_initial_wcxf(wc, get_smpar=False)
     with self.assertRaises(ValueError):
         smpar.smeftpar(smeft.scale_in, smeft.C_in, 'flavio')
     CSM = smpar.smeftpar(smeft.scale_in, smeft.C_in, 'Warsaw')
     p = smpar.p
     self.assertAlmostEqual(CSM['m2'], p['m_h']**2 / 2)
     v = sqrt(1 / sqrt(2) / p['GF'])
     self.assertAlmostEqual(CSM['Lambda'], p['m_h']**2 / v**2)
     self.assertAlmostEqual(CSM['g'], 2 * p['m_W'] / v)
     # self.assertAlmostEqual(CSM['gp'])
     self.assertAlmostEqual(CSM['gs'], sqrt(4 * pi * p['alpha_s']))
     self.assertAlmostEqual(CSM['Gd'][0, 0], p['m_d'] / (v / sqrt(2)))
     self.assertAlmostEqual(CSM['Gd'][1, 1], p['m_s'] / (v / sqrt(2)))
     self.assertAlmostEqual(CSM['Gd'][2, 2], p['m_b'] / (v / sqrt(2)))
     self.assertAlmostEqual(CSM['Ge'][0, 0], p['m_e'] / (v / sqrt(2)))
     self.assertAlmostEqual(CSM['Ge'][1, 1], p['m_mu'] / (v / sqrt(2)))
     self.assertAlmostEqual(CSM['Ge'][2, 2], p['m_tau'] / (v / sqrt(2)))
     UL, S, UR = ckmutil.diag.msvd(CSM['Gu'])
     V = UL.conj().T
     self.assertAlmostEqual(S[0], p['m_u'] / (v / sqrt(2)))
     self.assertAlmostEqual(S[1], p['m_c'] / (v / sqrt(2)))
     self.assertAlmostEqual(S[2], p['m_t'] / (v / sqrt(2)))
     self.assertAlmostEqual(abs(V[0, 2]), p['Vub'])
     self.assertAlmostEqual(abs(V[1, 2]), p['Vcb'])
     self.assertAlmostEqual(abs(V[0, 1]), p['Vus'])
コード例 #2
0
ファイル: test_smpar.py プロジェクト: knut0815/wilson
 def test_smpar_roundtrip(self):
     wc = get_random_wc('SMEFT', 'Warsaw', cmax=1e-6)
     smeft = SMEFT(wc=None)
     smeft.scale_in = 160
     smeft._set_initial_wcxf(wc, get_smpar=False)
     CSM = smpar.smeftpar(smeft.scale_in, smeft.C_in, 'Warsaw')
     Cboth = CSM.copy()
     Cboth.update(smeft.C_in)
     Cback = smpar.smpar(Cboth)
     for k in smpar.p:
         if k in ['m_Z']:
             self.assertAlmostEqual(smpar.p[k] / Cback[k],
                                    1,
                                    msg="Failed for {}".format(k),
                                    delta=0.05)
         elif k in ['delta']:
             self.assertAlmostEqual(smpar.p[k] / Cback[k],
                                    1,
                                    msg="Failed for {}".format(k),
                                    delta=1e-3)
         else:
             self.assertAlmostEqual(smpar.p[k] / Cback[k],
                                    1,
                                    msg="Failed for {}".format(k),
                                    delta=1e-5)
コード例 #3
0
 def test_wcxf_smpar(self):
     wc = get_random_wc('SMEFT', 'Warsaw', 1e5, 1e-11)
     smeft = SMEFT(wc)
     C_out = smeft._rgevolve(91.1876)
     p_out = smpar.smpar(C_out)
     for k in p_out:
         self.assertAlmostEqual(p_out[k] / smpar.p[k], 1,
                                delta=0.05,
                                msg="Failed for {}".format(k))
コード例 #4
0
ファイル: test_smpar.py プロジェクト: knut0815/wilson
 def test_method(self):
     wc = wcxf.WC('SMEFT', 'Warsaw', 1000, {'uG_33': 1e-6})
     smeft = SMEFT(wc)
     p_out = smeft.get_smpar()
     p_def = smpar.p
     for k, v in p_out.items():
         self.assertAlmostEqual(v / p_def[k],
                                1,
                                places=1,
                                msg="Failed for {}".format(k))
コード例 #5
0
 def test_smpar_small(self):
     wc = get_random_wc('SMEFT', 'Warsaw', cmax=1e-24)
     smeft = SMEFT(wc=None)
     smeft.scale_in = 160
     smeft._set_initial_wcxf(wc, get_smpar=False)
     CSM = smpar.smeftpar(smeft.scale_in, smeft.C_in, 'Warsaw')
     Cboth = CSM.copy()
     Cboth.update(smeft.C_in)
     Cback = smpar.smpar(Cboth)
     for k in smpar.p:
         if k not in ['m_Z', 'gamma']:
             self.assertAlmostEqual(smpar.p[k], Cback[k],
                                    msg="Failed for {}".format(k))
コード例 #6
0
ファイル: test_classes.py プロジェクト: knut0815/wilson
 def test_empty(self):
     wc_sm = wcxf.WC('SMEFT', 'Warsaw', 160, {})
     smeft_sm = SMEFT(wc_sm, get_smpar=False)
     C_in_sm = smeft_sm.C_in
     C_in_sm_2 = beta.C_array2dict(np.zeros(9999))
     for k, v in C_in_sm_2.items():
         if k not in SM_keys:
             npt.assert_array_equal(v, C_in_sm[k],
                                    err_msg="Failed for {}".format(k))
コード例 #7
0
ファイル: test_classes.py プロジェクト: wilson-eft/wilson
 def test_smeft(self):
     wc = get_random_wc('SMEFT', 'Warsaw', 1000, 1e-8)
     with self.assertRaises(Exception):
         # no initial condition set
         smeft = SMEFT()
     # just check this doesn't raise errors
     smeft = SMEFT(wc)
     wc = smeft.run(900)
     wc.validate()
     wc = smeft.run(900, 'leadinglog')
     wc.validate()
コード例 #8
0
ファイル: classes.py プロジェクト: wilson-eft/wilson
    def match_run(self, scale, eft, basis, sectors='all'):
        """Run the Wilson coefficients to a different scale
        (and possibly different EFT)
        and return them as `wcxf.WC` instance.

        Parameters:

        - `scale`: output scale in GeV
        - `eft`: output EFT
        - `basis`: output basis
        - `sectors`: in the case of WET (or WET-4 or WET-3), a tuple of sector
          names can be optionally provided. In this case, only the Wilson coefficients
          from this sector(s) will be returned and all others discareded. This
          can speed up the computation significantly if only a small number of sectors
          is of interest. The sector names are defined in the WCxf basis file.
        """
        cached = self._get_from_cache(sector=sectors,
                                      scale=scale,
                                      eft=eft,
                                      basis=basis)
        if cached is not None:
            return cached
        if sectors == 'all':
            # the default value for sectors is "None" for translators
            translate_sectors = None
        else:
            translate_sectors = sectors
        scale_ew = self.get_option('smeft_matchingscale')
        mb = self.get_option('mb_matchingscale')
        mc = self.get_option('mc_matchingscale')
        if self.wc.basis == basis and self.wc.eft == eft and scale == self.wc.scale:
            return self.wc  # nothing to do
        if self.wc.eft == eft and scale == self.wc.scale:
            wc_out = self.wc.translate(
                basis, sectors=translate_sectors,
                parameters=self.parameters)  # only translation necessary
            self._set_cache(sectors, scale, eft, basis, wc_out)
            return wc_out
        if self.wc.eft == 'SMEFT':
            smeft_accuracy = self.get_option('smeft_accuracy')
            if eft == 'SMEFT':
                smeft = SMEFT(
                    self.wc.translate('Warsaw',
                                      sectors=translate_sectors,
                                      parameters=self.parameters))
                # if input and output EFT ist SMEFT, just run.
                wc_out = smeft.run(scale,
                                   accuracy=smeft_accuracy).translate(basis)
                self._set_cache('all', scale, 'SMEFT', wc_out.basis, wc_out)
                return wc_out
            else:
                # if SMEFT -> WET-x: match to WET at the EW scale
                wc_ew = self._get_from_cache(sector='all',
                                             scale=scale_ew,
                                             eft='WET',
                                             basis='JMS')
                if wc_ew is None:
                    if self.wc.scale == scale_ew:
                        wc_ew = self.wc.match(
                            'WET', 'JMS', parameters=self.matching_parameters
                        )  # no need to run
                    else:
                        smeft = SMEFT(
                            self.wc.translate('Warsaw',
                                              parameters=self.parameters))
                        wc_ew = smeft.run(
                            scale_ew, accuracy=smeft_accuracy).match(
                                'WET',
                                'JMS',
                                parameters=self.matching_parameters)
                self._set_cache('all', scale_ew, wc_ew.eft, wc_ew.basis, wc_ew)
                wet = WETrunner(wc_ew, **self._wetrun_opt())
        elif self.wc.eft in ['WET', 'WET-4', 'WET-3']:
            wet = WETrunner(
                self.wc.translate('JMS',
                                  parameters=self.parameters,
                                  sectors=translate_sectors),
                **self._wetrun_opt())
        else:
            raise ValueError(
                f"Input EFT {self.wc.eft} unknown or not supported")
        if eft == wet.eft:  # just run
            wc_out = wet.run(scale, sectors=sectors).translate(
                basis, sectors=translate_sectors, parameters=self.parameters)
            self._set_cache(sectors, scale, eft, basis, wc_out)
            return wc_out
        elif eft == 'WET-4' and wet.eft == 'WET':  # match at mb
            wc_mb = wet.run(mb, sectors=sectors).match(
                'WET-4', 'JMS', parameters=self.matching_parameters)
            wet4 = WETrunner(wc_mb, **self._wetrun_opt())
            wc_out = wet4.run(scale, sectors=sectors).translate(
                basis, sectors=translate_sectors, parameters=self.parameters)
            self._set_cache(sectors, scale, 'WET-4', basis, wc_out)
            return wc_out
        elif eft == 'WET-3' and wet.eft == 'WET-4':  # match at mc
            wc_mc = wet.run(mc, sectors=sectors).match(
                'WET-3', 'JMS', parameters=self.matching_parameters)
            wet3 = WETrunner(wc_mc, **self._wetrun_opt())
            wc_out = wet3.run(scale, sectors=sectors).translate(
                basis, sectors=translate_sectors, parameters=self.parameters)
            return wc_out
            self._set_cache(sectors, scale, 'WET-3', basis, wc_out)
        elif eft == 'WET-3' and wet.eft == 'WET':  # match at mb and mc
            wc_mb = wet.run(mb, sectors=sectors).match(
                'WET-4', 'JMS', parameters=self.matching_parameters)
            wet4 = WETrunner(wc_mb, **self._wetrun_opt())
            wc_mc = wet4.run(mc, sectors=sectors).match(
                'WET-3', 'JMS', parameters=self.matching_parameters)
            wet3 = WETrunner(wc_mc, **self._wetrun_opt())
            wc_out = wet3.run(scale, sectors=sectors).translate(
                basis, sectors=translate_sectors, parameters=self.parameters)
            self._set_cache(sectors, scale, 'WET-3', basis, wc_out)
            return wc_out
        else:
            raise ValueError(
                f"Running from {wet.eft} to {eft} not implemented")
コード例 #9
0
ファイル: test_smpar.py プロジェクト: knut0815/wilson
 def test_wcxf_smpar_incomplete(self):
     wc = wcxf.WC('SMEFT', 'Warsaw', 160, {'qd1_1111': {'Im': 1e-6}})
     smeft = SMEFT(wc)
     smeft.run(91.1876)