Skip to content

Implementing smelli as an external likelihood#219

Open
ElieHammou wants to merge 8 commits into
mainfrom
external_likelihood_smelli
Open

Implementing smelli as an external likelihood#219
ElieHammou wants to merge 8 commits into
mainfrom
external_likelihood_smelli

Conversation

@ElieHammou
Copy link
Copy Markdown
Collaborator

This PR adresses issue #218

The goal is to load from SMEFiT the appropriate datasets and likehood names and the name of the SMEFT/LEFT operators, to pass them one to smelli for a chi2 evaluation which would be taken into account during SMEFiT nested sampling.

Copilot AI review requested due to automatic review settings March 16, 2026 13:02
@ElieHammou ElieHammou changed the title Initialised PR with pseudocode placeholder Implementing smelli as an external likelihood Mar 16, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces an initial (placeholder) implementation for integrating smelli as an external likelihood/chi² contribution within SMEFiT’s existing external_chi2 plugin mechanism (Issue #218).

Changes:

  • Adds a new external_chi2_smelli.py module intended to translate SMEFiT coefficients (via RGE.RGEbasis) into a format suitable for smelli likelihood evaluation.
  • Sketches a compute_chi2 entrypoint compatible with SMEFiT’s external chi² API (callable accepting a coefficient-value array).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/smefit/external_chi2_smelli.py Outdated
Comment thread src/smefit/external_chi2_smelli.py Outdated
Comment thread src/smefit/external_chi2_smelli.py Outdated
Comment thread src/smefit/external_chi2_smelli.py Outdated
Comment thread src/smefit/external_chi2_smelli.py Outdated
Comment thread src/smefit/external_chi2_smelli.py Outdated
@ElieHammou
Copy link
Copy Markdown
Collaborator Author

I am not familiar with the ultranest.py implementation so my changes there should be examined very carefully

@ElieHammou
Copy link
Copy Markdown
Collaborator Author

With this implementation, running the following runcard:

result_path: "/Users/eliehammou/Software/smefit/smefit_release/results"
data_path: "/Users/eliehammou/Software/smefit/smefit_database/commondata"
theory_path: "/Users/eliehammou/Software/smefit/smefit_database/theory"

use_quad: False

nlive: 5
n_samples: 10
maxiter: 100

rge:
   init_scale: 1000.0
   obs_scale: dynamic # float or "dynamic"
   smeft_accuracy: integrate # options: integrate, leadinglog
   yukawa: top # options: top, full or none
   adm_QCD: False # if true, the EW couplings are set to zero

coefficients:
  OpD: {'min': -10.0, 'max' : 10.0}

external_chi2:
  SmelliChi2:
    # path: /abs/path/to/smefit/smefit_release/src/smefit/external_chi2_smelli.py
    path: /Users/eliehammou/Software/smefit/smefit_release/src/smefit/external_chi2_smelli.py
    include_likelihoods:
      - likelihood_ewpt.yaml
    # optional override:
    # initial_scale: 1000.0

allows to run the following fit:

smefit NS runcard_smelli.yaml
........
[15:19:43] DEBUG    iteration=532, ncalls=785, regioncalls=29320, ndraw=40, logz=-5.40, remainder_fraction=22.1536%, Lmin=1.63, Lmax=1.66                                        integrator.py:2791
[15:19:44] DEBUG    iteration=533, ncalls=786, regioncalls=29360, ndraw=40, logz=-5.40, remainder_fraction=21.8194%, Lmin=1.63, Lmax=1.66                                        integrator.py:2791
[15:19:45] DEBUG    iteration=534, ncalls=787, regioncalls=29400, ndraw=40, logz=-5.40, remainder_fraction=21.4877%, Lmin=1.63, Lmax=1.66                                        integrator.py:2791
[15:19:46] DEBUG    iteration=535, ncalls=788, regioncalls=29440, ndraw=40, logz=-5.39, remainder_fraction=21.1650%, Lmin=1.63, Lmax=1.66                                        integrator.py:2791
[ultranest] Explored until L=2  
           INFO     Explored until L=2                                                                                                                                           integrator.py:2835
[ultranest] Likelihood function evaluations: 788
           INFO     Likelihood function evaluations: 788                                                                                                                         integrator.py:2936
           DEBUG    did a run_iter pass!                                                                                                                                         integrator.py:2478
[ultranest] Reached maximum number of improvement loops.
           INFO     Reached maximum number of improvement loops.                                                                                                                 integrator.py:2852
[ultranest] done iterating.
           INFO     done iterating.                                                                                                                                              integrator.py:2481
[15:19:46] Time : 16.751 minutes                                                                                                                                                   ultranest.py:470
           Number of samples: 10                                                                                                                                                   ultranest.py:471
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━┓
┃ Parameter ┃ Best value ┃ Error ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━┩
│ OpD       │ -0.014     │ 0.009 │
└───────────┴────────────┴───────┘

@ElieHammou
Copy link
Copy Markdown
Collaborator Author

The tests/build errors comes from the fact that smelli must be installed in the environment for the fit to run, which is not currently taken cared of in the github implementation.

@ElieHammou ElieHammou self-assigned this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants