Exemple #1
0
 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()
Exemple #2
0
    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")
Exemple #3
0
 def test_wcxf_smpar_incomplete(self):
     wc = wcxf.WC('SMEFT', 'Warsaw', 160, {'qd1_1111': {'Im': 1e-6}})
     smeft = SMEFT(wc)
     smeft.run(91.1876)