wilson-eft / wilson

A Python package for the running and matching of Wilson coefficients above and below the electroweak scale
https://wilson-eft.github.io
MIT License
26 stars 19 forks source link

'An error on printing a WC with zero value' #9

Closed jackypheno closed 6 years ago

jackypheno commented 6 years ago

If we try to print a WC which has zero value, we get an error. It would be better if it returns zero instead of an error.

DavidMStraub commented 6 years ago

Minimal example please.

jackypheno commented 6 years ago

Here it is:

from wilson import Wilson wc_dict = {'lq1_3333': 2e-6, 'lq3_3333': 1e-6} wc_in = Wilson(wc_dict,1000, 'SMEFT', 'Warsaw') wc_out = wc_in.match_run(160, 'SMEFT', 'Warsaw') print(wc_out.dict['ll_2333'])

this gives an error. Because in this case only ll_2233, ll_2332 and ll_3333 are generated at the EW scale and If you try to print out any other flavor combinations, you get an error, but should not it return zeros for all vanishing WCs instead of an error?

DavidMStraub commented 6 years ago

Thanks.

Note that wc_out is an instance of wcxf.WC, so this is actually the behaviour of wcxf-python, not wilson.

The wcxf.wc.dict method returns a dictionary containing only the non-vanishing WCs. This is intentional, as WCxf files should not contain thousands of vanishing entries. To get what you want you can just do

wc_out.get('ll_2333', 0)

or more concisely

wc_out['ll_2333']