Skip to content

Commit

Permalink
Add more unit tests for ren_sv_coeffs
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Dec 14, 2023
1 parent f52db38 commit 5726f35
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/test_scale_variations.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,42 @@ def test_ren_sv_coeffs():
scale_variations.ren_sv_coeffs(m=0, max_as=2, logpart=2, which_part=0, nf=5),
0.0,
)
# check all coeff are set
for m in (0, 1, 10):
for max_as in range(1, 3 + 1):
for logpart in range(1, max_as + 1):
for which_part in range(0, max_as - logpart + 1):
for nf in (4, 5):
c = scale_variations.ren_sv_coeffs(
m=m,
max_as=max_as,
logpart=logpart,
which_part=which_part,
nf=nf,
)
assert np.isfinite(c)
if which_part > 0 and not m == 0:
assert c > 0.0
else:
assert c >= 0.0
# due to the exponential structure we can predict some things:
for nf in (4, 5):
# the highest log is always proportional beta0^k
for k in range(1, 3 + 1):
c = scale_variations.ren_sv_coeffs(
m=1, max_as=k, logpart=k, which_part=0, nf=nf
)
bare_c = c * (4.0 * np.pi / beta_qcd((2, 0), nf)) ** k
int_c = bare_c * np.math.factorial(k)
np.testing.assert_allclose(int_c, int(int_c))
# and even the second highest for the highest coeff
for k in range(2, 3 + 1):
c = scale_variations.ren_sv_coeffs(
m=1, max_as=k, logpart=k - 1, which_part=1, nf=nf
)
bare_c = c * (4.0 * np.pi / beta_qcd((2, 0), nf)) ** (k - 1)
int_c = bare_c * np.math.factorial(k)
np.testing.assert_allclose(int_c, int(int_c))


def test_requirements():
Expand Down

0 comments on commit 5726f35

Please sign in to comment.