-
Notifications
You must be signed in to change notification settings - Fork 3
X space conversion of the N3LO matching #444
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
Merged
+3,056
−0
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
39c0b77
init xspace converter
giacomomagni 8f6c81f
improve saving methods
giacomomagni 8b1e00c
adding large-x expansion
giacomomagni 719f1f0
subtract large-n limit
giacomomagni acaf4d8
expand docs
giacomomagni 20e5703
fix minus sign and larger grid
giacomomagni 274487f
add a test to see the accuracy
giacomomagni e3101cb
fix qq limit and 5% accuracy, Hg not working
giacomomagni c474d1e
mathemetica notebook
giacomomagni ee8f533
fix cast to interpolation
giacomomagni e9ccce8
Track ome interp output dir
felixhekhorn 5298647
Update extras/ome_n3lo/large_n_limit.py
giacomomagni 1a5f1d4
Update extras/ome_n3lo/convert_ome_xspace.py
giacomomagni a95dcec
Update extras/ome_n3lo/convert_ome_xspace.py
giacomomagni 00fad3a
apply comments
giacomomagni 1723ef0
Update extras/ome_n3lo/large_n_limit.py
giacomomagni 07e8bf3
minor fixes
giacomomagni ffa351c
pre-commit
giacomomagni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
|
||
import numpy as np | ||
from click import progressbar | ||
from eko.mellin import Path | ||
from ekore.harmonics import cache as c | ||
from ekore.operator_matrix_elements.unpolarized.space_like import as3 | ||
from scipy import integrate | ||
|
||
XGRID = np.geomspace(1e-6, 1, 500) # 500 | ||
"""X-grid.""" | ||
|
||
LOG = 0 | ||
"""Matching threshold displaced ?""" | ||
|
||
MAP_ENTRIES = { | ||
"gg": (0, 0), | ||
"gq": (0, 1), | ||
"qg": (1, 0), | ||
"qq": (1, 1), | ||
"Hg": (2, 0), | ||
"Hq": (2, 1), | ||
"gH": (0, 2), | ||
"HH": (2, 2), | ||
"qq_ns": (0, 0), | ||
} | ||
|
||
|
||
def compute_ome(nf, n, is_singlet): | ||
"""Get the correct ome from eko.""" | ||
cache = c.reset() | ||
if is_singlet: | ||
return as3.A_singlet(n, cache, nf, L=0) | ||
else: | ||
return as3.A_ns(n, cache, nf, L=0) | ||
|
||
|
||
def compute_xspace_ome(entry, nf, x_grid=XGRID): | ||
"""Compute the x-space transition matrix element, returns A^3(x).""" | ||
mellin_cut = 5e-2 | ||
giacomomagni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
is_singlet = "ns" not in entry | ||
|
||
def integrand(u, x): | ||
"""Mellin inversion integrand.""" | ||
path = Path(u, np.log(x), is_singlet) | ||
integrand = path.prefactor * x ** (-path.n) * path.jac | ||
if integrand == 0.0: | ||
giacomomagni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return 0.0 | ||
|
||
ome_n = compute_ome(nf, path.n, is_singlet) | ||
idx1, idx2 = MAP_ENTRIES[entry] | ||
ome_n = ome_n[idx1, idx2] | ||
|
||
# recombine everything | ||
return np.real(ome_n * integrand) | ||
|
||
ome_x = [] | ||
print(f"Computing operator matrix element {entry} @ pto: 3") | ||
# loop on xgrid | ||
with progressbar(x_grid) as bar: | ||
for x in bar: | ||
if x == 1: | ||
ome_x.append(0) | ||
continue | ||
res = integrate.quad( | ||
lambda u: integrand(u, x), | ||
felixhekhorn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
0.5, | ||
1.0 - mellin_cut, | ||
epsabs=1e-12, | ||
epsrel=1e-6, | ||
limit=200, | ||
full_output=1, | ||
giacomomagni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
)[0] | ||
ome_x.append(res) | ||
|
||
return np.array(ome_x) | ||
|
||
|
||
def save_files(entry, nf, ome_x, xgrid=XGRID): | ||
giacomomagni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"""Write the space reuslt in a txt file.""" | ||
with open(f"x_space/A_{entry}_nf{nf}.txt", "w") as file: | ||
for x, a in zip(xgrid, ome_x): | ||
file.write(f"{x}\t{a}\n") | ||
|
||
|
||
if __name__ == "__main__": | ||
nf = 3 # nf = 3,4,5. | ||
# non diagonal temrms | ||
for k in ["gq", "qg", "Hg", "Hq"]: | ||
result = compute_xspace_ome(k, nf) | ||
save_files(k, nf, result) | ||
# ["ns", "gg", "qq",]: |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.