Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
niclaurenti committed Mar 25, 2024
1 parent 564b518 commit 394c751
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tests/test_exact_coeff_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_as2_order_mudep():
nf = 1
for kind in ['2', 'L']:
for channel in ['g', 'q']:
cf = ad.ExactCoefficientFunction(2, kind, channel, 1e-3, 1e-3, 1000, 1, 25000)
cf = ad.ExactCoefficientFunction(2, kind, channel, 1e-3, 1e-3, 1000)
for xi in np.geomspace(1e-2, 1e4, 10, endpoint=True):
for ximu in np.geomspace(1e-2, 1e4, 10, endpoint=True):
xmax = 1/(1 + 4/xi)
Expand All @@ -56,3 +56,23 @@ def test_as2_order_mudep():
else:
res2 = old.CL_ps21(x, 1/xi)
np.testing.assert_allclose(res1, res2 * np.log(ximu), rtol = 1e-7)

def test_as3_order_mudep():
for kind in ['2', 'L']:
for channel in ['g', 'q']:
cf = ad.ExactCoefficientFunction(3, kind, channel, 1e-3, 1e-3, 1000, 0)
for xi in np.geomspace(1e-2, 1e4, 5, endpoint=True):
for ximu in np.geomspace(1e-2, 1e4, 5, endpoint=True):
xmax = 1/(1 + 4/xi)
for x in np.geomspace(1e-5, xmax, 5, endpoint=False):
for nf in range(4, 6 + 1):
res1 = cf.MuDependentTerms(x, 1./xi, 1./ximu, nf)
if kind == '2' and channel == 'g':
res2 = old.C2_g31(x, 1/xi, nf) * np.log(ximu) + old.C2_g32(x, 1/xi, nf) * np.log(ximu)**2
elif kind == 'L' and channel == 'g':
res2 = old.CL_g31(x, 1/xi, nf) * np.log(ximu) + old.CL_g32(x, 1/xi, nf) * np.log(ximu)**2
elif kind == '2' and channel == 'q':
res2 = old.C2_ps31(x, 1/xi, nf) * np.log(ximu) + old.C2_ps32(x, 1/xi, nf) * np.log(ximu)**2
else:
res2 = old.CL_ps31(x, 1/xi, nf) * np.log(ximu) + old.CL_ps32(x, 1/xi, nf) * np.log(ximu)**2
np.testing.assert_allclose(res1, res2, rtol = 1e-7)

0 comments on commit 394c751

Please sign in to comment.