Skip to content

Commit

Permalink
Use LeProHQ.Adler
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Oct 16, 2023
1 parent aaca1c1 commit 560dea0
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 47 deletions.
168 changes: 143 additions & 25 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ numba = "^0.57.0"
eko = "^0.13.4"
pandas = "^1.3.0"
rich = "^12.4.4"
LeProHQ = "^0.2.3"
LeProHQ = "^0.2.5"
# pineappl dependency
pineappl = { version = "^0.6.0", optional = true }
# yadmark
Expand Down
9 changes: 2 additions & 7 deletions src/yadism/coefficient_functions/heavy/f2_nc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Massive :math:`F_2^{NC}` components."""
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 @@ -143,12 +142,8 @@ def dq(z, _args):
)
return r

# 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([-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 CubicSpline(logxis, vals)([np.log10(self._xi)])[0]
# add minus sign
return -LeProHQ.Adler("F2", "VV", self._xi)

return RSL(dq, loc=Adler)
6 changes: 5 additions & 1 deletion src/yadism/coefficient_functions/heavy/f3_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ def dq(z, _args):
* (LeProHQ.dq1("xF3", "VA", self._xi, self._eta(z)))
)

return RSL(dq)
def Adler(_x, _args):
# add minus sign
return -LeProHQ.Adler("xF3", "VA", self._xi)

return RSL(dq, loc=Adler)
9 changes: 2 additions & 7 deletions src/yadism/coefficient_functions/heavy/fl_nc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
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 @@ -142,12 +141,8 @@ def dq(z, _args):
* (LeProHQ.dq1("FL", "VV", self._xi, self._eta(z)))
)

# 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]
# add minus sign
return -LeProHQ.Adler("FL", "VV", self._xi)

return RSL(dq, loc=Adler)
6 changes: 5 additions & 1 deletion src/yadism/coefficient_functions/heavy/g1_nc.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,8 @@ def dq(z, _args):
* (LeProHQ.dq1("x2g1", "VV", self._xi, self._eta(z)))
)

return RSL(dq)
def Adler(_x, _args):
# add minus sign
return -LeProHQ.Adler("x2g1", "VV", self._xi)

return RSL(dq, loc=Adler)
5 changes: 2 additions & 3 deletions src/yadism/coefficient_functions/heavy/g4_nc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import LeProHQ
import numpy as np
from scipy.integrate import quad

from ..partonic_channel import RSL
from . import partonic_channel as pc
Expand All @@ -26,7 +25,7 @@ def dq(z, _args):
)

def Adler(_x, _args):
l = quad(dq, 0.0, 1.0, args=np.array([]))
return -l[0]
# add minus sign
return -LeProHQ.Adler("g4", "VA", self._xi)

return RSL(dq, loc=Adler)
7 changes: 5 additions & 2 deletions src/yadism/coefficient_functions/heavy/gl_nc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import LeProHQ
import numpy as np
from scipy.integrate import quad

from ..partonic_channel import RSL
from . import partonic_channel as pc
Expand All @@ -23,4 +22,8 @@ def dq(z, _args):
* (LeProHQ.dq1("gL", "VA", self._xi, self._eta(z)))
)

return RSL(dq)
def Adler(_x, _args):
# add minus sign
return -LeProHQ.Adler("gL", "VA", self._xi)

return RSL(dq, loc=Adler)

0 comments on commit 560dea0

Please sign in to comment.