-
Notifications
You must be signed in to change notification settings - Fork 7
Fix scale variations expanded #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
975c097
2000859
74938d4
b4bfd1f
e790fd4
462a80a
1d23323
45c266a
dfd5e92
5b6c3fe
910c5b4
b9d8371
9dcf7e6
bd02ec2
591dfbb
1336f45
5ee0d51
007ba72
2afdbac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
|
|
||
| from eko import basis_rotation as br | ||
| from eko.anomalous_dimensions import gamma_ns, gamma_singlet | ||
| from eko.beta import beta_qcd_as2 | ||
| from eko.beta import beta_qcd_as2, beta_qcd_as3 | ||
| from eko.kernels import non_singlet, singlet | ||
| from eko.scale_variations import Modes, expanded, exponentiated | ||
|
|
||
|
|
@@ -43,13 +43,12 @@ def test_singlet_sv_dispacher(): | |
| def test_scale_variation_a_vs_b(): | ||
| r""" | ||
| Test ``ModSV=exponentiated`` kernel vs ``ModSV=expanded``. | ||
| We test that the quantity :math:`(ker_A - ker_B)/ker_{unv}` depends | ||
| only on the accuracy in the :math:`\alpha_s` expansion | ||
| and not in the size of the `fact_to_ren` itself. | ||
| However in our implementation the exponentiated mode depends on | ||
| the actual value of a0 and a1, since the evolution integral in :math:`\alpha_s` | ||
| is evaluated. Thus this test ratio :math:`(ker_A - ker_B)/ker_{unv}` | ||
| still contains a dependency on `fact_to_ren`. | ||
| We test that the quantity :math:`(ker_A - ker_B)/ker_{unv}` | ||
|
|
||
| Note this is NOT the real difference between scheme expanded | ||
| and exponentiated since here we don't take into account the | ||
| shifts in path length and :math:`\alpha_s` values. | ||
| The real difference is always higher order. | ||
| """ | ||
| nf = 5 | ||
| n = 10 | ||
|
|
@@ -64,20 +63,50 @@ def scheme_diff(g, k, pto, is_singlet): | |
| the accuracy of singlet quantities is slightly worse. | ||
| """ | ||
| if pto[0] >= 2: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we really want a
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As the test is build, this is correct with |
||
| diff = g[0] * k * a0 | ||
| diff = g[0] * k * a0 - 2 * a1 * k * g[0] | ||
|
andreab1997 marked this conversation as resolved.
|
||
| if pto[0] >= 3: | ||
| b0 = beta_qcd_as2(nf) | ||
| g02 = g[0] @ g[0] if is_singlet else g[0] ** 2 | ||
| diff += a0**2 * g[1] * k - k**2 * ( | ||
| 1 / 2 * a0**2 * b0 * g[0] + a1 * a0 * g02 - 1 / 2 * a0**2 * g02 | ||
| diff += ( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the |
||
| -2 * a1**2 * g[1] * k | ||
| + a0**2 * g[1] * k | ||
| + a1**2 * b0 * g[0] * k**2 | ||
| - 0.5 * a0**2 * b0 * g[0] * k**2 | ||
| - a1 * a0 * g02 * k**2 | ||
| + 0.5 * a0**2 * g02 * k**2 | ||
| + a1**2 * g02 * k**2 | ||
| ) | ||
| if pto[0] >= 4: | ||
| b1 = beta_qcd_as3(nf) | ||
| g0g1 = g[0] @ g[1] if is_singlet else g[0] * g[1] | ||
| g03 = g02 @ g[0] if is_singlet else g02 * g[0] | ||
| diff += ( | ||
| a0**3 * g[2] * k | ||
| - 2 * a1**3 * g[2] * k | ||
| - 1 / 2 * a0**3 * b1 * g[0] * k**2 | ||
| + a1**3 * b1 * g[0] * k**2 | ||
| - a0**3 * b0 * g[1] * k**2 | ||
| + 2 * a1**3 *b0 * g[1] * k**2 | ||
| + a0**3 * g0g1 * k**2 | ||
| - a0**2 * a1 * g0g1 * k**2 | ||
| - a0 * a1**2 * g0g1 * k**2 | ||
| + 2 * a1**3 * g0g1 * k**2 | ||
| + 1 / 3 * a0**3 * b0**2 * g[0] * k**3 | ||
| - 2 / 3 * a1**3 * b0**2 * g[0] * k**3 | ||
| - 1 / 2 * a0**3 * b0 * g02 * k**3 | ||
| + 1 / 2 * a0**2 * a1 * b0 * g02 * k**3 | ||
| + 1 / 2 * a0 * a1**2 * b0 * g02 * k**3 | ||
| - a1**3 * b0 * g02 * k**3 | ||
| + 1 / 6 * a0**3 * g03 * k**3 | ||
| - 1 / 2 * a0**2 * a1 * g03 * k**3 | ||
| + 1 / 2 * a0 * a1**2 * g03 * k**3 | ||
| - 1 / 3 * a1**3 * g03 * k**3 | ||
| ) | ||
| return diff | ||
|
|
||
| # TODO: perform this test also at N3LO, once evolution kernels | ||
| # will be implemented | ||
|
|
||
| for L in [np.log(0.5), np.log(2)]: | ||
| for order in [(2, 0), (3, 0)]: | ||
| for order in [(2, 0), (3, 0), (4,0)]: | ||
| # Non singlet kernels | ||
| gns = gamma_ns(order, br.non_singlet_pids_map["ns+"], n, nf) | ||
| ker = non_singlet.dispatcher( | ||
|
|
@@ -89,7 +118,12 @@ def scheme_diff(g, k, pto, is_singlet): | |
| ) | ||
| ker_b = ker * expanded.non_singlet_variation(gns, a1, order, nf, L) | ||
| ns_diff = scheme_diff(gns, L, order, False) | ||
| np.testing.assert_allclose((ker_a - ker_b) / ker, ns_diff, atol=1e-3) | ||
| np.testing.assert_allclose( | ||
| (ker_a - ker_b) / ker, | ||
| ns_diff, | ||
| atol=1e-3, | ||
| err_msg=f"L={L},order={order},non-singlet", | ||
| ) | ||
|
|
||
| # Singlet kernels | ||
| gs = gamma_singlet(order, n, nf) | ||
|
|
@@ -103,5 +137,8 @@ def scheme_diff(g, k, pto, is_singlet): | |
| ker_b = ker @ expanded.singlet_variation(gs, a1, order, nf, L) | ||
| s_diff = scheme_diff(gs, L, order, True) | ||
| np.testing.assert_allclose( | ||
| (ker_a - ker_b) @ np.linalg.inv(ker), s_diff, atol=5e-3 | ||
| (ker_a - ker_b) @ np.linalg.inv(ker), | ||
| s_diff, | ||
| atol=5e-3, | ||
| err_msg=f"L={L},order={order},singlet", | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we also shift the alpha values, as we should? we know how to do it (it's written in the notebook)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just laziness. As mentioned above the test will not test the real HO difference A-B, since we have verified that is too complex.
This fix was derived assuming that the sv are now correct (as implemented) and checking that the difference between kernels without shifting paths/a_s is what we expect.
If you don't like it I'd propose to scratch it.