Skip to content

Commit

Permalink
Merge pull request #98 from LHCfitNikhef/remove-input-effect-rge
Browse files Browse the repository at this point in the history
Linearise wilson rge
  • Loading branch information
LucaMantani authored Nov 26, 2024
2 parents b2cd8a1 + 57084fc commit 3fc174d
Showing 1 changed file with 57 additions and 1 deletion.
58 changes: 57 additions & 1 deletion src/smefit/rge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pathlib
import warnings
from copy import deepcopy
from functools import partial
from functools import partial, wraps

import ckmutil.ckm
import jax.numpy as jnp
Expand All @@ -25,6 +25,7 @@
ckmutil.ckm.ckm_tree = partial(ckm_tree, delta_expansion_order=0)
### End of patch

##################### MONKEY PATCH
# switch off the SM - EFT mixing, since SMEFiT assumes that the
# RGE solution is linearised
# Keep a reference to the original beta function
Expand All @@ -39,6 +40,61 @@ def beta_wrapper(C, HIGHSCALE=np.inf, *args, **kwargs):
wilson.run.smeft.beta.beta_array = partial(
wilson.run.smeft.beta.beta_array, HIGHSCALE=np.inf
)
##################### END OF MONKEY PATCH

##################### MONKEY PATCH
# Patch smeftpar: we remove all dependence on SMEFT parameters
# in SM paramaters, otherwise the linear approximation is not valid
C_patch = {
"phi": 0.0,
"phiBox": 0.0,
"phiD": 0.0,
"phiWB": 0.0,
"phiG": 0.0,
"phiW": 0.0,
"phiB": 0.0,
"dphi": 0.0,
"uphi": 0.0,
"ephi": 0.0,
}
# Reference to the original smeftpar function
original_smeftpar = wilson.run.smeft.smpar.smeftpar


# Define the monkey-patched function
@wraps(original_smeftpar)
def patched_smeftpar(*args, **kwargs):
# check if C is passed as a keyword argument
if "C" in kwargs:
kwargs["C"] = C_patch
# otherwise, check if it is passed as a positional argument
else:
args = list(args)
args[1] = C_patch

return original_smeftpar(*args, **kwargs)


# Apply the monkey patch
wilson.run.smeft.smpar.smeftpar = patched_smeftpar
##################### END OF MONKEY PATCH


##################### MONKEY PATCH
# Monkey patch flavour rotation
# Define the new method
def _to_wcxf_no_rotation(self, C_out, scale_out):
"""Return the Wilson coefficients `C_out` as a wcxf.WC instance, without rotation."""
# Skip the self._rotate_defaultbasis line
d = wilson.util.smeftutil.arrays2wcxf_nonred(C_out)
d = wilson.wcxf.WC.dict2values(d)
wc = wilson.wcxf.WC("SMEFT", "Warsaw", scale_out, d)
return wc


# Monkey-patch the method
wilson.run.smeft.classes.SMEFT._to_wcxf = _to_wcxf_no_rotation
##################### END OF MONKEY PATCH

# Suppress the ComplexWarning
warnings.filterwarnings("ignore", category=ComplexWarning)
Expand Down

0 comments on commit 3fc174d

Please sign in to comment.