Skip to content

Commit

Permalink
Merge branch 'numerical_fonll' into massive_n3lo
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomomagni committed Oct 16, 2023
2 parents 2ed1e62 + aaca1c1 commit 9de67cf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/yadism/coefficient_functions/heavy/f2_nc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Massive :math:`F_2^{NC}` components."""
import LeProHQ
import numpy as np
from scipy.interpolate import BarycentricInterpolator
from scipy.interpolate import CubicSpline

from ..partonic_channel import RSL
from . import partonic_channel as pc
Expand Down Expand Up @@ -154,7 +154,7 @@ def dq(z, _args):
return 0.0
# TODO move this hack into LeProHQ
eta = self._eta(z)
eta = min(eta, 1e5)
eta = min(eta, 1e8)
r = (
self._FHprefactor
/ z
Expand All @@ -165,10 +165,10 @@ def dq(z, _args):

# TODO lift this function into LeProHQ
# fmt: off
logxis = np.array([-6.,-5.9,-5.8,-5.7,-5.6,-5.5,-5.4,-5.3,-5.2,-5.1,-5.,-4.9,-4.8,-4.7,-4.6,-4.5,-4.4,-4.3,-4.2,-4.1,-4.,-3.9,-3.8,-3.7,-3.6,-3.5,-3.4,-3.3,-3.2,-3.1,-3.,-2.9,-2.8,-2.7,-2.6,-2.5,-2.4,-2.3,-2.2,-2.1,-2.,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1.,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.])
vals = np.array([-4.31775075154324e-6,-5.36701428532163e-6,-6.67016757554631e-6,-8.28834253436362e-6,-0.0000102973069173677,-0.0000127909450807086,-0.0000158855600304828,-0.0000197251887136215,-0.0000244881668394693,-0.0000303952339541446,-0.0000377195362696619,-0.0000467989666213965,-0.0000580513812291765,-0.0000719933557245974,-0.0000892632931003173,-0.000110649879797077,-0.000137127110281953,-0.000169897373895703,-0.000210444430957266,-0.000260598510743099,-0.000322616257178168,-0.000399278847058463,-0.000494012331167958,-0.000611035135015622,-0.000755538700197888,-0.000933908564726267,-0.00115399469589179,-0.00142544177083169,-0.00176009232847162,-0.00217247839409124,-0.00268042037539811,-0.00330575583867385,-0.00407522529892489,-0.00502154751586287,-0.00618472310813660,-0.00761361272453588,-0.00936784469721828,-0.0115201172111864,-0.0141589717228970,-0.0173921278123935,-0.0213504850077014,-0.0261929145000228,-0.0321119831500926,-0.0393407737763503,-0.0481609893201922,-0.0589125538705854,-0.0720049502859446,-0.0879305616293708,-0.107280310901335,-0.130761919336861,-0.159221126164939,-0.193666230108350,-0.235296322487155,-0.285533580604817,-0.346059974808037,-0.418858709662556,-0.506260665515978,-0.610996028067369,-0.736251187872195,-0.885730857584996,-1.06372519245996,-1.27518151164027,-1.52578000909733,-1.82201262156352,-2.17126399703945,-2.58189329443875,-3.06331535728638,-3.62607965724226,-4.28194531083085,-5.04395044694658,-5.92647425143555,-6.94529014126800,-8.11760872183633,-9.46210944844544,-10.9989601749240,-12.7498244246557,-14.7378558506660,-16.9876807198927,-19.5253688839296,-22.3783939650644,-25.5755843093813,-29.1470657060820,-33.1241861478952,-37.5395053973696,-42.4266052184745,-47.8201213196923,-53.7556644942167,-60.2696464182845,-67.3993063275125,-75.1826378056694,-83.6582241870451,-92.8652810526019,-102.843541628920,-113.633210752990,-125.274912395365,-137.809641501730,-151.278720093253,-165.723757499034,-181.186614539308,-197.709371436022,-215.334299216791,-234.103834361192,-254.060556378063,-275.247168049343,-297.706478254068,-321.481386973778,-346.614871863184,-373.149977148964,-401.129803760321,-430.597497710567,-461.596255112282,-494.169300847881,-528.359882503872,-564.211281969937,-601.766798840314,-641.069750271690,-682.163468181970,-725.091296878593,-769.896591054024,-816.622714094366,-865.313036654766])
logxis = np.array([-6.,-5.9,-5.8,-5.7,-5.6,-5.5,-5.4,-5.3,-5.2,-5.1,-5.,-4.9,-4.8,-4.7,-4.6,-4.5,-4.4,-4.3,-4.2,-4.1,-4.,-3.9,-3.8,-3.7,-3.6,-3.5,-3.4,-3.3,-3.2,-3.1,-3.,-2.9,-2.8,-2.7,-2.6,-2.5,-2.4,-2.3,-2.2,-2.1,-2.,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1.,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.])
vals = np.array([-4.31775e-6, -5.36701e-6, -6.67017e-6, -8.28834e-6, -0.0000102973, -0.0000127909, -0.0000158856, -0.0000197252, -0.0000244882, -0.0000303952, -0.0000377195, -0.000046799, -0.0000580514, -0.0000719934, -0.0000892633, -0.00011065, -0.000137127, -0.000169897, -0.000210444, -0.000260599, -0.000322616, -0.000399279, -0.000494012, -0.000611035, -0.000755539, -0.000933909, -0.00115399, -0.00142544, -0.00176009, -0.00217248, -0.00268042, -0.00330576, -0.00407523, -0.00502155, -0.00618472, -0.00761361, -0.00936784, -0.0115201, -0.014159, -0.0173921, -0.0213505, -0.0261929, -0.032112, -0.0393408, -0.048161, -0.0589126, -0.072005, -0.0879306, -0.10728, -0.130762, -0.159221, -0.193666, -0.235296, -0.285534, -0.34606, -0.418859, -0.506261, -0.610996, -0.736251, -0.885731, -1.06373, -1.27518, -1.52578, -1.82201, -2.17126, -2.58189, -3.06332, -3.62608, -4.28195, -5.04395, -5.92647, -6.94529, -8.11761, -9.46211, -10.999, -12.7498, -14.7379, -16.9877, -19.5254, -22.3784, -25.5756, -29.1471, -33.1242, -37.5395, -42.4266, -47.8201, -53.7557, -60.2696, -67.3993, -75.1826, -83.6582, -92.8653, -102.844, -113.633, -125.275, -137.81, -151.279, -165.724, -181.187, -197.709, -215.334, -234.104, -254.061, -275.247, -297.706, -321.481, -346.615, -373.15, -401.13, -430.598, -461.596, -494.169, -528.36, -564.211, -601.767, -641.07, -682.163, -725.091, -769.897, -816.623, -865.313, -916.011, -968.76, -1023.6, -1080.58, -1139.75, -1201.13, -1264.79, -1330.75, -1399.07, -1469.79, -1542.95, -1618.6, -1696.77, -1777.52, -1860.88, -1946.89, -2035.62, -2127.08, -2221.34, -2318.42])
# fmt: on
def Adler(_x, _args):
return BarycentricInterpolator(logxis, vals)([np.log10(self._xi)])[0]
return CubicSpline(logxis, vals)([np.log10(self._xi)])[0]

return RSL(dq, loc=Adler)
11 changes: 10 additions & 1 deletion src/yadism/coefficient_functions/heavy/fl_nc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import LeProHQ
import numpy as np
from scipy.interpolate import CubicSpline

from ..partonic_channel import RSL
from . import partonic_channel as pc
Expand Down Expand Up @@ -164,4 +165,12 @@ def dq(z, _args):
* (LeProHQ.dq1("FL", "VV", self._xi, self._eta(z)))
)

return RSL(dq)
# TODO lift this function into LeProHQ
# fmt: off
logxis = np.array([-6.,-5.9,-5.8,-5.7,-5.6,-5.5,-5.4,-5.3,-5.2,-5.1,-5.,-4.9,-4.8,-4.7,-4.6,-4.5,-4.4,-4.3,-4.2,-4.1,-4.,-3.9,-3.8,-3.7,-3.6,-3.5,-3.4,-3.3,-3.2,-3.1,-3.,-2.9,-2.8,-2.7,-2.6,-2.5,-2.4,-2.3,-2.2,-2.1,-2.,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1.,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.,4.1,4.2,4.3,4.4,4.5,4.6,4.7,4.8,4.9,5.,5.1,5.2,5.3,5.4,5.5,5.6,5.7,5.8,5.9,6.,6.1,6.2,6.3,6.4,6.5,6.6,6.7,6.8,6.9,7.,7.1,7.2,7.3,7.4,7.5,7.6,7.7,7.8,7.9,8.])
vals = np.array([-2.37037e-7, -2.98412e-7, -3.75678e-7, -4.7295e-7, -5.95409e-7, -7.49575e-7, -9.43658e-7, -1.18799e-6, -1.4956e-6, -1.88284e-6, -2.37035e-6, -2.98409e-6, -3.75674e-6, -4.72944e-6, -5.954e-6, -7.4956e-6, -9.43636e-6, -0.0000118796, -0.0000149554, -0.0000188276, -0.0000237022, -0.0000298389, -0.0000375642, -0.0000472895, -0.0000595323, -0.0000749442, -0.0000943452, -0.000118767, -0.00014951, -0.000188207, -0.000236916, -0.000298225, -0.00037539, -0.000472505, -0.000594722, -0.000748515, -0.000942025, -0.00118548, -0.00149173, -0.00187689, -0.00236122, -0.00297008, -0.00373526, -0.00469656, -0.00590371, -0.00741883, -0.00931929, -0.0117014, -0.0146845, -0.0184165, -0.0230797, -0.0288981, -0.0361457, -0.0451558, -0.0563314, -0.0701561, -0.0872054, -0.108158, -0.133802, -0.165048, -0.202921, -0.248565, -0.303222, -0.368217, -0.444916, -0.534693, -0.63887, -0.758666, -0.895142, -1.04915, -1.22128, -1.41187, -1.62094, -1.84828, -2.09337, -2.3555, -2.63378, -2.92716, -3.23451, -3.55466, -3.88642, -4.22861, -4.58009, -4.9398, -5.30674, -5.67998, -6.05871, -6.44217, -6.82969, -7.22069, -7.61466, -8.01114, -8.40975, -8.81016, -9.21208, -9.61526, -10.0195, -10.4246, -10.8305, -11.237, -11.6439, -12.0513, -12.4591, -12.8671, -13.2754, -13.6839, -14.0925, -14.5012, -14.9101, -15.3191, -15.7281, -16.1372, -16.5463, -16.9555, -17.3647, -17.7739, -18.1832, -18.5924, -19.0017, -19.411, -19.8203, -20.2297, -20.639, -21.0483, -21.4576, -21.867, -22.2763, -22.6856, -23.095, -23.5043, -23.9137, -24.323, -24.7324, -25.1417, -25.5511, -25.9604, -26.3697, -26.7791, -27.1884, -27.5978, -28.0071])
# fmt: on
def Adler(_x, _args):
return CubicSpline(logxis, vals)([np.log10(self._xi)])[0]

return RSL(dq, loc=Adler)
4 changes: 0 additions & 4 deletions tests/yadbox/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ def test_pineappl_sf(tmp_path: pathlib.Path):
"F2_light": [{"x": 0.1, "Q2": 10.0}],
"F2_total": [{"x": 0.2, "Q2": 20.0}],
}
# TODO: move this to banana
theory_card["FONLLParts"] = "full"
out = run_yadism(theory_card, oo)
dump_pineappl_to_file(out, pl, "F2_light")
# try read
Expand All @@ -37,8 +35,6 @@ def test_pineappl_xs(tmp_path: pathlib.Path):
oo["observables"] = {
"XSCHORUSCC": [{"x": 0.1, "Q2": 10.0, "y": 0.3}],
}
# TODO: move this to banana
theory_card["FONLLParts"] = "full"
out = run_yadism(theory_card, oo)
dump_pineappl_to_file(out, pl, "XSCHORUSCC")
# try read
Expand Down

0 comments on commit 9de67cf

Please sign in to comment.