forked from yuxunguo/GUMP-Global-GPDs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Evolution.py
559 lines (417 loc) · 19.9 KB
/
Evolution.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
"""
LO QCD evolution of moment space GPD. Credits to K. Kumericki at https://github.com/kkumer/gepard.
Note:
Functions in this module have as first argument Mellin moment
n = j + 1, where j is conformal moment used everywhere else.
Thus, they should always be called as f(j+1, ...).
"""
# from cmath import exp
# from scipy.special import loggamma as clngamma
#from this import d
import numpy as np
from scipy.special import psi, gamma
from typing import Tuple
import numba
from numba import vectorize, njit
from functools import lru_cache, wraps
################################################################
def np_cache(function):
@lru_cache(maxsize=None)
def cached_wrapper(*args, **kwargs):
args = [np.array(a) if isinstance(a, tuple) else a for a in args]
kwargs = {
k: np.array(v) if isinstance(v, tuple) else v for k, v in kwargs.items()
}
return function(*args, **kwargs)
@wraps(function)
def wrapper(*args, **kwargs):
args = [tuple(a) if isinstance(a, np.ndarray) else a for a in args]
kwargs = {
k: tuple(v) if isinstance(v, np.ndarray) else v for k, v in kwargs.items()
}
return cached_wrapper(*args, **kwargs)
wrapper.cache_info = cached_wrapper.cache_info
wrapper.cache_clear = cached_wrapper.cache_clear
return wrapper
################################################################
"""
***********************QCD constants***************************************
Refer to the constants.py at https://github.com/kkumer/gepard.
"""
NC = 3
CF = (NC**2 - 1) / (2 * NC)
CA = NC
CG = CF - CA/2
TF = 0.5
Alpha_Mz = 0.1181
# All unit in GeV for dimensional quantities.
Mz = 91.1876
# Two loop accuracy for running strong coupling constant.
nloop_alphaS = 2
# Initial scale of distribution functions at 2 GeV.
Init_Scale_Q = 2
# Transform the original flavor basis to the evolution basis (qVal, q_du_plus, q_du_minus, qSigma, g)
# The same basis for PDF evolution are used, check references.
flav_trans =np.array([[1, 0, 1, 0, 0],
[-1, -2, 1, 2, 0],
[-1, 0, 1, 0 , 0],
[1, 2, 1, 2, 0],
[0, 0, 0, 0, 1]])
inv_flav_trans = np.linalg.inv(flav_trans)
"""
***********************pQCD running coupling constant***********************
"""
B00 = 11./3. * CA
B01 = -4./3. * TF
B10 = 34./3. * CA**2
B11 = -20./3. * CA*TF - 4. * CF*TF
@njit(["float64(int32)"])
def beta0(nf: int) -> float:
""" LO beta function of pQCD, will be used for LO GPD evolution. """
return - B00 - B01 * nf
@njit(["float64(int32)"])
def beta1(nf):
""" NLO beta function of pQCD """
return - B10 - B11 * nf
@njit(["float64[:](float64[:], int32)", "float64(float64, int32)"])
def _fbeta1(a: float, nf: int) -> float:
return a**2 * (beta0(nf) + a * beta1(nf))
@njit(["float64[:](int32, float64[:])", "float64(int32, float64)"])
def AlphaS0(nf: int, Q: float) -> float:
return Alpha_Mz / (1 - Alpha_Mz/2/np.pi * beta0(nf) * np.log(Q/Mz))
@njit(["float64[:](int32, float64[:])", "float64(int32, float64)"])
def AlphaS1(nf: int, Q: float) -> float:
NASTPS = 20
# a below is as defined in 1/4pi expansion
a = np.ones_like(Q) * Alpha_Mz / 4 / np.pi
lrrat = 2 * np.log(Q/Mz)
dlr = lrrat / NASTPS
for k in range(1, NASTPS+1):
xk0 = dlr * _fbeta1(a, nf)
xk1 = dlr * _fbeta1(a + 0.5 * xk0, nf)
xk2 = dlr * _fbeta1(a + 0.5 * xk1, nf)
xk3 = dlr * _fbeta1(a + xk2, nf)
a += (xk0 + 2 * xk1 + 2 * xk2 + xk3) / 6
# Return to .../(2pi) expansion
a *= 4*np.pi
return a
@njit(["float64[:](int32, int32, float64[:])", "float64(int32, int32, float64)"])
def AlphaS(nloop: int, nf: int, Q: float) -> float:
if nloop==1:
return AlphaS0(nf, Q)
if nloop==2:
return AlphaS1(nf, Q)
raise ValueError('Only LO and NLO implemented!')
"""
***********************Anomalous dimensions of GPD in the moment space*****
Refer to the adim.py at https://github.com/kkumer/gepard.
"""
def S1(z: complex) -> complex:
""" Harmonic sum S_1. """
return np.euler_gamma + psi(z+1)
def non_singlet_LO(n: complex, nf: int, p: int, prty: int = 1) -> complex:
"""
Non-singlet LO anomalous dimension.
Args:
n (complex): which moment (= Mellin moment for integer n)
nf (int): number of active quark flavors
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et)
prty (int): 1 for NS^{+}, -1 for NS^{-}, irrelevant at LO
Returns:
Non-singlet LO anomalous dimension.
"""
return CF*(-3.0-2.0/(n*(1.0+n))+4.0*S1(n))
def singlet_LO(n: complex, nf: int, p: int, prty: int = 1) -> np.ndarray:
"""
Singlet LO anomalous dimensions.
Args:
n (complex): which moment (= Mellin moment for integer n)
nf (int): number of active quark flavors
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et)
prty (int): C parity, irrelevant at LO
Returns:
2x2 complex matrix ((QQ, QG),
(GQ, GG))
Here, n and nf are scalars.
p is array of shape (N)
However, it will still work if nf and n are arrays of shape (N)
In short, this will work as long as n, nf, and p can be broadcasted together.
"""
'''
if(p == 1):
qq0 = CF*(-3.0-2.0/(n*(1.0+n))+4.0*S1(n))
qg0 = (-4.0*nf*TF*(2.0+n+n*n))/(n*(1.0+n)*(2.0+n))
gq0 = (-2.0*CF*(2.0+n+n*n))/((-1.0+n)*n*(1.0+n))
gg0 = -4.0*CA*(1/((-1.0+n)*n)+1/((1.0+n)*(2.0+n))-S1(n)) -11*CA/3. + 4*nf*TF/3.
return np.array([[qq0, qg0],
[gq0, gg0]])
if(p == -1):
qq0 = CF*(-3.0-2.0/(n*(1.0+n))+4.0*S1(n))
qg0 = (-4.0*nf*TF*(-1.0+n))/(n*(1.0+n))
gq0 = (-2.0*CF*(2.0+n))/(n*(1.0+n))
gg0 = -4.0*CA*(2/(n*(1.0+n))-S1(n)) -11*CA/3. + 4*nf*TF/3.
return np.array([[qq0, qg0],
[gq0, gg0]])
'''
epsilon = 0.00001 * ( n == 1)
# Here, I am making the assumption that a is either 1 or -1
qq0 = np.where(p>0, CF*(-3.0-2.0/(n*(1.0+n))+4.0*S1(n)), CF*(-3.0-2.0/(n*(1.0+n))+4.0*S1(n)))
qg0 = np.where(p>0, (-4.0*nf*TF*(2.0+n+n*n))/(n*(1.0+n)*(2.0+n)), (-4.0*nf*TF*(-1.0+n))/(n*(1.0+n)) )
gq0 = np.where(p>0, (-2.0*CF*(2.0+n+n*n))/((-1.0+n + epsilon)*n*(1.0+n)), (-2.0*CF*(2.0+n))/(n*(1.0+n)))
gg0 = np.where(p>0, -4.0*CA*(1/((-1.0+n + epsilon)*n)+1/((1.0+n)*(2.0+n))-S1(n)) -11*CA/3. + 4*nf*TF/3., \
-4.0*CA*(2/(n*(1.0+n))-S1(n)) -11*CA/3. + 4*nf*TF/3. )
# all of the four above have shape (N)
# more generally, if p is a multi dimensional array, like (N1, N1, N2)... Then this could also work
qq0_qg0 = np.stack((qq0, qg0), axis=-1)
gq0_gg0 = np.stack((gq0, gg0), axis=-1)
return np.stack((qq0_qg0, gq0_gg0), axis=-2)# (N, 2, 2)
"""
***********************Evolution operator of GPD in the moment space*******
Refer to the evolution.py at https://github.com/kkumer/gepard. Modifications are made.
"""
def lambdaf(n: complex, nf: int, p: int, prty: int = 1) -> np.ndarray:
"""
Eigenvalues of the LO singlet anomalous dimensions matrix.
Args:
n (complex): which moment (= Mellin moment for integer n)
nf (int): number of active quark flavors
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et)
prty (int): 1 for NS^{+}, -1 for NS^{-}, irrelevant at LO
Returns:
lam[a, k]
a in [+, -] and k is MB contour point index
Normally, n and nf should be scalars. p should be (N)
More generally, as long as they can be broadcasted, any shape is OK.
"""
# To avoid crossing of the square root cut on the
# negative real axis we use trick by Dieter Mueller
gam0 = singlet_LO(n, nf, p, prty) # (N, 2, 2)
aux = ((gam0[..., 0, 0] - gam0[..., 1, 1]) *
np.sqrt(1. + 4.0 * gam0[..., 0, 1] * gam0[..., 1, 0] /
(gam0[..., 0, 0] - gam0[..., 1, 1])**2)) # (N)
lam1 = 0.5 * (gam0[..., 0, 0] + gam0[..., 1, 1] - aux) # (N)
lam2 = lam1 + aux # (N)
return np.stack([lam1, lam2], axis=-1) # shape (N, 2)
def projectors(n: complex, nf: int, p: int, prty: int = 1) -> Tuple[np.ndarray, np.ndarray]:
"""
Projectors on evolution quark-gluon singlet eigenaxes.
Args:
n (complex): which moment (= Mellin moment for integer n)
nf (int): number of active quark flavors
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et)
prty (int): 1 for NS^{+}, -1 for NS^{-}, irrelevant at LO
Returns:
lam: eigenvalues of LO an. dimm matrix lam[a, k] # Eq. (123)
pr: Projector pr[k, a, i, j] # Eq. (122)
k is MB contour point index
a in [+, -]
i,j in {Q, G}
n and nf will be scalars
p will be shape (N)
prty should be scalar (but maybe I can make it work with shape N)
"""
gam0 = singlet_LO(n, nf, p, prty) # (N, 2, 2)
lam = lambdaf(n, nf, p, prty) # (N, 2)
den = 1. / (lam[..., 0] - lam[..., 1]) #(N)
# P+ and P-
ssm = gam0 - np.einsum('...,ij->...ij', lam[..., 1], np.identity(2)) #(N, 2, 2)
ssp = gam0 - np.einsum('...,ij->...ij', lam[..., 0], np.identity(2)) #(N, 2, 2)
prp = np.einsum('...,...ij->...ij', den, ssm) # (N, 2, 2)
prm = np.einsum('...,...ij->...ij', -den, ssp) # (N, 2, 2)
# We insert a-axis before i,j-axes, i.e. on -3rd place
pr = np.stack([prp, prm], axis=-3) # (N, 2, 2, 2)
return lam, pr # (N, 2) and (N, 2, 2, 2)
@np_cache
def evolop(j: complex, nf: int, p: int, Q: float):
"""
GPD evolution operator E(j, nf, Q)[a,b].
Args:
j: MB contour points (Note: n = j + 1 !!)
nf: number of effective fermion
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et)
Q: final scale of evolution
Returns:
Evolution operator E(j, nf, Q)[a,b] at given j nf and Q as 3-by-3 matrix
- a and b are in the flavor space (non-singlet, singlet, gluon)
In original evolop function, j, nf, p, and Q are all scalars.
Here, j and nf will be scalars.
p and Q will have shape (N)
"""
#Alpha-strong ratio.
R = AlphaS(nloop_alphaS, nf, Q)/AlphaS(nloop_alphaS, nf, Init_Scale_Q) # shape N
R = np.array(R)
#LO singlet anomalous dimensions and projectors
lam, pr = projectors(j+1, nf, p) # (N, 2) (N, 2, 2, 2)
#LO pQCD beta function of GPD evolution
b0 = beta0(nf) # scalar
#Singlet LO evolution factor (alpha(mu)/alpha(mu0))^(-gamma/beta0) in (+,-) space
Rfact = R[..., np.newaxis]**(-lam/b0) # (N, 2)
#Singlet LO evolution matrix in (u+d, g) space
"""
# The Gepard code by K. Kumericki reads:
evola0ab = np.einsum('kaij,ab->kabij', pr, np.identity(2))
evola0 = np.einsum('kabij,bk->kij', evola0ab, Rfact)
# We use instead
"""
evola0 = np.einsum('...aij,...a->...ij', pr, Rfact) # (N, 2, 2)
#Non-singlet LO anomalous dimension
gam0NS = non_singlet_LO(j+1, nf, p) #this function is already numpy compatible
# shape (N)
#Non-singlet evolution factor
evola0NS = R**(-gam0NS/b0) #(N)
return [evola0NS, evola0] # (N) and (N, 2, 2)
def Moment_Evo(j: complex, nf: int, p: int, Q: float, ConfFlav: np.array) -> np.array:
"""
Evolution of moments in the flavor space
Args:
uneolved conformal moments in flavor space ConfFlav = [ConfMoment_uV, ConfMoment_ubar, ConfMoment_dV, ConfMoment_dbar, ConfMoment_g]
j: conformal spin j (conformal spin is actually j+2 but anyway): scalar
t: momentum transfer squared
nf: number of effective fermions;
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et): array (N,)
Q: final evolution scale: array(N,)
Returns:
Evolved conformal moments in flavor space (non-singlet, singlet, gluon)
return shape (N, 5)
"""
# flavor_trans (5, 5) ConfFlav (N, 5)
# Transform the unevolved moments to evolution basis
# ConfEvoBasis = np.einsum('...j,j', flav_trans, ConfFlav) # originally, output will be (5), I want it to be (N, 5)
ConfEvoBasis = np.einsum('ij, ...j->...i', flav_trans, ConfFlav) # shape (N, 5)
# Taking the non-singlet and singlet parts of the conformal moments
ConfNS = ConfEvoBasis[..., :3] # (N, 3)
ConfS = ConfEvoBasis[..., -2:] # (N, 2)
# Calling evolution mulitiplier
[evons, evoa] = evolop(j, nf, p, Q) # (N) and (N, 2, 2)
# non-singlet part evolves multiplicatively
EvoConfNS = evons[..., np.newaxis] * ConfNS # (N, 3)
# singlet part mixes with the gluon
EvoConfS = np.einsum('...ij, ...j->...i', evoa, ConfS) # (N, 2)
# Recombing the non-singlet and singlet parts
EvoConf = np.concatenate((EvoConfNS, EvoConfS), axis=-1) # (N, 5)
# Inverse transform the evolved moments back to the flavor basis
EvoConfFlav = np.einsum('...ij, ...j->...i', inv_flav_trans, EvoConf) #(N, 5)
return EvoConfFlav
def Coeff_Evo(j: complex, nf: int, p: int, Q: float, CoeffFlav: np.array) -> np.array:
"""
Evolution of coefficients in the flavor space
Args:
uneolved wilson coefficients in flavor space CoeffFlav
For the basis, see Moment_Evo function for more details.
NOTE: here, CoeffFlav should have shape (N, n, num_flav).
where num_flav is the number of flavors, and n is some number.
Namely, (N, n, 5)
This is to say, besides N, the CoeffFlav is a matrix.
If your coefficient is not a matrix, you need to cast it to a matrix.
j: conformal spin j (conformal spin is actually j+2 but anyway): scalar
t: momentum transfer squared
nf: number of effective fermions;
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et): array (N,)
Q: final evolution scale: array(N,)
Returns:
Evolved conformal moments in flavor space (non-singlet, singlet, gluon)
return shape (N, 5)
"""
CoeffEvoBasis = np.einsum('...ki,ij->...kj', CoeffFlav, inv_flav_trans) #(N, n, 5)
# Taking the non-singlet and singlet parts of the Wilson coefficients
CoeffNS = CoeffEvoBasis[..., :3] # (N, n, 3)
CoeffS = CoeffEvoBasis[..., -2:] # (N, n, 2)
# Calling evolution mulitiplier
[evons, evoa] = evolop(j, nf, p, Q) # (N) and (N, 2, 2)
# non-singlet part evolves multiplicatively
EvoCoeffNS = np.einsum('...ij,...->...ij', CoeffNS, evons) # (N, n, 3)
# singlet part mixes with the gluon
EvoCoeffS = np.einsum('...ki,...ij->...kj', CoeffS, evoa) # (N, n, 2)
# Recombing the non-singlet and singlet parts
EvoCoeff = np.concatenate((EvoCoeffNS, EvoCoeffS), axis=-1) # (N, n, 5)
# Inverse transform the evolved coefficients back to the flavor basis
EvoCoeffFlav = np.einsum('...ki, ij->...kj', EvoCoeff, flav_trans) #(N, n, 5)
return EvoCoeffFlav
def CWilson(j: complex) -> complex:
return 2 ** (1+j) * gamma(5/2+j) / (gamma(3/2) * gamma(3+j))
def CWilsonT(j: complex, nf: int) -> complex:
return np.array([3 * 2 ** (1+j) * gamma(5/2+j) / (gamma(3/2) * gamma(3+j)), 3 * 2 ** (1+j) * gamma(5/2+j) / (gamma(3/2) * gamma(3+j)), 3 * 2 ** (1+j) * gamma(5/2+j) / (gamma(3/2) * gamma(3+j)), 3 * 2 ** (1+j) * gamma(5/2+j) / nf / (gamma(3/2) * gamma(3+j)), 3 * 2 * 2 ** (1+j) * gamma(5/2+j) / (j + 3) / (gamma(3/2) * gamma(3+j))])
def Moment_Evo_fast(j: complex, nf: int, p: int, Q: float, ConfFlav: np.array) -> np.array:
"""
Evolution of WCs multiplying conf moments then transformed back into the flavor space
Args:
uneolved conformal moments in flavor space ConfFlav = [ConfMoment_uV, ConfMoment_ubar, ConfMoment_dV, ConfMoment_dbar, ConfMoment_g]
j: conformal spin j (conformal spin is actually j+2 but anyway): scalar
t: momentum transfer squared
nf: number of effective fermions;
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et): array (N,)
Q: final evolution scale: array(N,)
Returns:
Evolved conformal moments in flavor space (non-singlet, singlet, gluon)
return shape (N, 5)
"""
ConfEvoBasis = np.einsum('ij, ...j->...i', flav_trans, ConfFlav) # shape (N, 5)
# Taking the non-singlet and singlet parts of the conformal moments
ConfNS = ConfEvoBasis[..., :3] # (N, 3)
ConfS = ConfEvoBasis[..., -2:] # (N, 2)
# Calling evolution mulitiplier
[evons, evoa] = evolop(j, nf, p, Q) # (N) and (N, 2, 2)
EvoWCNS = np.einsum('i,i...->i...', CWilson(j), evons)
EvoWCS = np.einsum('i,i...->i...', CWilson(j), evoa)
EvoConfNS = EvoWCNS[...,np.newaxis] * ConfNS
EvoConfS = np.einsum('...ij,...j->...i', EvoWCS, ConfS)
EvoConf = np.concatenate((EvoConfNS,EvoConfS),axis=-1)
EvoConfFlav = np.einsum('...ij,...j->...i', inv_flav_trans, EvoConf)
return EvoConfFlav
def Moment_Evo_0(j: complex, nf: int, p: int, Q: float, ConfFlav: np.array) -> np.array:
"""
j = 0 pole piece, should find a less cumbersome way to handle this
"""
ConfEvoBasis = np.einsum('ij, ...j->...i', flav_trans, ConfFlav) # shape (N, 5)
# Taking the non-singlet and singlet parts of the conformal moments
ConfNS = ConfEvoBasis[..., :3] # (N, 3)
ConfS = ConfEvoBasis[..., -2:] # (N, 2)
# Calling evolution mulitiplier
[evons, evoa] = evolop(j, nf, p, Q) # (N) and (N, 2, 2)
# non-singlet part evolves multiplicatively
EvoConfNS = evons[..., np.newaxis] * ConfNS # (N, 3)
# singlet part mixes with the gluon
EvoConfS = np.einsum('...ij, ...j->...i', evoa, ConfS) # (N, 2)
# Recombing the non-singlet and singlet parts
EvoConf = np.concatenate((EvoConfNS, EvoConfS), axis=-1) # (N, 5)
# Combine with Wilson coefficients
#print(CWilsonT(j,nf))
#print(EvoConf)
#print("Wilson coef. shape is %.2f", CWilsonT(j,nf).shape)
#print("Conf. Moments shape is %.2f", EvoConf.shape)
EvoConfwWC = CWilson(j)*EvoConf #(N,5)
#print("MB integrand shape is %2f",EvoConfwWC.shape)
# Inverse transform the evolved moments back to the flavor basis
EvoConfFlav = np.einsum('...ij, ...j->...i', inv_flav_trans, EvoConfwWC) #(N, 5)
#print('Wilson co shape is',CWilsonDVCS.shape)
#EvoConfFlavwWC = np.einsum('i,i...->i...',CWilson(j),EvoConfFlav)
return EvoConfFlav
def Moment_Evo_T_fast(j: complex, nf: int, p: int, Q: float, ConfFlav: np.array) -> np.array:
"""
Evolution of WCs multiplying conf moments then transformed back into the flavor space
Args:
uneolved conformal moments in flavor space ConfFlav = [ConfMoment_uV, ConfMoment_ubar, ConfMoment_dV, ConfMoment_dbar, ConfMoment_g]
j: conformal spin j (conformal spin is actually j+2 but anyway): scalar
t: momentum transfer squared
nf: number of effective fermions;
p (int): 1 for vector-like GPD (Ht, Et), -1 for axial-vector-like GPDs (Ht, Et): array (N,)
Q: final evolution scale: array(N,)
Returns:
Evolved conformal moments in flavor space (non-singlet, singlet, gluon)
return shape (N, 5)
"""
ConfEvoBasis = np.einsum('ij, ...j->...i', flav_trans, ConfFlav) # shape (N, 5)
# Taking the non-singlet and singlet parts of the conformal moments
ConfNS = ConfEvoBasis[..., :3] # (N, 3)
ConfS = ConfEvoBasis[..., -2:] # (N, 2)
# Calling evolution mulitiplier
[evons, evoa] = evolop(j, nf, p, Q) # (N) and (N, 2, 2)
CWilsonNS = CWilsonT(j,nf)[:3]
CWilsonSG = CWilsonT(j,nf)[-2:]
EvoWCNS = np.einsum('i...,...->...i', CWilsonNS, evons)
EvoWCS = np.einsum('i...,...ij->...j', CWilsonSG, evoa)
EvoConfNS = np.einsum('...i,...i->...i',EvoWCNS,ConfNS)
EvoConfS = np.einsum('...j,...j->...j', EvoWCS, ConfS)
EvoConf = np.concatenate((EvoConfNS,EvoConfS),axis=-1)
EvoConfFlav = np.einsum('...ij,...j->...i', inv_flav_trans, EvoConf)
return EvoConfFlav