-
Notifications
You must be signed in to change notification settings - Fork 4
Implementing smelli as an external likelihood #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ElieHammou
wants to merge
8
commits into
main
Choose a base branch
from
external_likelihood_smelli
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a2b3007
Initialised PR with pseudocode placeholder
ElieHammou 7e59994
Added example runcard in pseudocode
ElieHammou 276c454
Moved from pseudocode to skeleton implementation
ElieHammou 84e82a8
Modified external_chi2 arguments in runcard
ElieHammou 5a1fbf0
Added basis functional arguments to runcard
ElieHammou 6167a77
Added non-JIT option to load smelli chi2
ElieHammou 50b2372
Made example fit very light weight
ElieHammou 372db2f
Tried to remove runcard to solve pre-commit error
ElieHammou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| from smefit.rge import RGE | ||
|
|
||
|
|
||
| class smelli_chi2: | ||
| # coefficients are mandatory, taken from smefit runcard. rge_dict is the rge dictionary in the runcard, | ||
| # in this case we will only need it to read the initial scale, but we also need to build the RGE object. | ||
| # everything else is optional and can be specified in the external_chi2 runcard | ||
| def __init__(self, coefficients, rge_dict=None, dataset=[]): | ||
|
ElieHammou marked this conversation as resolved.
Outdated
|
||
| # this gives you the scale | ||
| self.scale = rge_dict["init_scale"] | ||
|
ElieHammou marked this conversation as resolved.
Outdated
|
||
|
|
||
| # this gives you the names of the coeff in smefit | ||
| self.names = coefficients.name | ||
|
ElieHammou marked this conversation as resolved.
Outdated
|
||
|
|
||
| # construct the RGE object. We don't actually need the RGE from smefit, but | ||
| # it has inside of it a method to translate coefficients from smefit to wcxf. | ||
| # Maybe not super ideal that it's inside that but ok for now. | ||
| self.rge_obj = RGE( | ||
| self.names, | ||
| self.scale, | ||
| rge_dict["smeft_accuracy"], | ||
| rge_dict["adm_QCD"], | ||
| rge_dict["yukawa"], | ||
| # the last three are not actually needed | ||
| ) | ||
|
|
||
| # This is a dictionary of dictionaries, associating to each of the smefit wc names, the wc_dict for smelli | ||
| self.translation_basis = self.rge_obj.RGEbasis | ||
|
|
||
| def compute_chi2(self, coefficient_values): | ||
| # this receives an array of numbers, which order corresponds | ||
| # to self.names | ||
|
|
||
| # you need to take those values and construct the wc_dict for smelli | ||
| # you have already the basis, which is telling you stuff like | ||
| # self.translation_basis["OpD"] -> {"phiD": 1e-6} | ||
| # so you need to take them all, multiply their values for the coefficien_values | ||
| # then create a single dictionary (possible repeated keys should be summed) | ||
| # something along these lines (adapted to the situation, this is copied from rge.RGEevolve) | ||
| wc_dict = {} | ||
| for op, values in self.RGEbasis.items(): | ||
| for key in values: | ||
| if key not in wc_wilson: | ||
| wc_dict[key] = values[key] * wcs[op] | ||
| else: | ||
| wc_dict[key] += values[key] * wcs[op] | ||
|
|
||
| # now you should have the self.scale and the wc_dict needed for the smelli likelihood. | ||
| # make sure you are returning a "chi2" | ||
| return -2 smelli_loglikelihood | ||
|
ElieHammou marked this conversation as resolved.
Outdated
ElieHammou marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.