Skip to content
This repository was archived by the owner on Apr 12, 2018. It is now read-only.

Commit 741633c

Browse files
committed
Major internal refactoring
Instead of the evolution matrices, the anomalous dimension matrices are now directly implemented in the code. The evolution matrices are then calculated numerically according to the usual formulae. Memoization is used to ensure this does not have to be repeated when running multiple times. This new procedure makes the code cleaner, more maintainable, more stable and more easily extensible.
1 parent 5d849a1 commit 741633c

10 files changed

Lines changed: 453 additions & 258 deletions

File tree

wetrunner/adm.py

Lines changed: 349 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,349 @@
1+
r"""Anomalous dimension matrices.
2+
3+
The RGE have the form
4+
5+
$$\frac{d \vec{C}}{d\ln\mu} = \gamma^T \vec{C}$$
6+
7+
with
8+
9+
$$\gamma = \frac{\alpha_s}{4\pi} \gamma^{1,0} + \frac{\alpha_s}{4\pi} \gamma^{0,1}$$
10+
11+
The functions `adm_s_X` return $\gamma^{1,0}$.
12+
The functions `adm_e_X` return $\gamma^{0,1}$.
13+
"""
14+
15+
import numpy as np
16+
17+
18+
def adm_s_I(*args, **kwargs):
19+
return np.array([[4, 0, 0, 0, 0, 0, 0, 0],
20+
[0, -28/3, 4/3, 0, 0, 0, 0, 0],
21+
[0, 16/3, 32/3, 0, 0, 0, 0, 0],
22+
[0, 0, 0, -16, 0, 0, 0, 0],
23+
[0, 0, 0, -6, 2, 0, 0, 0],
24+
[0, 0, 0, 0, 0, 4, 0, 0],
25+
[0, 0, 0, 0, 0, 0, -28/3, 4/3],
26+
[0, 0, 0, 0, 0, 0, 16/3, 32/3]])
27+
28+
29+
def adm_e_I(*args, **kwargs):
30+
return np.array([[12, 0, 0, 0, 0, 0, 0, 0],
31+
[0, -4, 16, 0, 0, 0, 0, 0],
32+
[0, 16, -4, 0, 0, 0, 0, 0],
33+
[0, 0, 0, -12, 0, 0, 0, 0],
34+
[0, 0, 0, 0, -12, 0, 0, 0],
35+
[0, 0, 0, 0, 0, 12, 0, 0],
36+
[0, 0, 0, 0, 0, 0, -4, 16],
37+
[0, 0, 0, 0, 0, 0, 16, -4]]) / 9
38+
39+
40+
def adm_s_II(*args, **kwargs):
41+
return np.array([[0, 0, 0, 0, 0], [0, -8, 0, 0, 0],
42+
[0, 0, 0, 0, 0], [0, 0, 0, -8, 0], [0, 0, 0, 0, 8/3]])
43+
44+
45+
def adm_e_II(*args, **kwargs):
46+
return np.array([[-4, 0, 0, 0, 0], [0, 4/3, 0, 0, 0],
47+
[0, 0, -2, 0, 0], [0, 0, 0, 4/3, 1/6], [0, 0, 0, 8, -40/9]])
48+
49+
50+
def adm_s_III(*args, **kwargs):
51+
return np.array([[0, -20, 0, 2, 0, 0, 0, 0, 0, 0],
52+
[-(40/9), -(52/3), 4/9, 5/6, 0, 0, 0, 0, 0, 0],
53+
[0, -128, 0, 20, 0, 0, 0, 0, 0, 0],
54+
[-(256/9), -(160/3), 40/9, -(2/3), 0, 0, 0, 0, 0, 0],
55+
[0, 0, 0, 0, -16, 0, 0, -2, 0, 0],
56+
[0, 0, 0, 0, 0, 2, -(4/9), -(5/6), 0, 0],
57+
[0, 0, 0, 0, 0, 32, 16/3, -32, 0, -2],
58+
[0, 0, 0, 0, 64/9, 40/ 3, -(64/9), -26, -(4/9), -(5/6)],
59+
[0, 0, 0, 0, 0, -512, -(1024/3), 384, -16, 32],
60+
[0, 0, 0, 0, -(1024/9), -(640/3), 256/3, 1184/3, 64/ 9, 46/3]])
61+
62+
63+
def adm_e_III(*args, **kwargs):
64+
return np.array([[40/9, 0, -(4/9), 0, 0, 0, 0, 0, 0, 0],
65+
[0, 40/9, 0, -(4/9), 0, 0, 0, 0, 0, 0],
66+
[256/9, 0, -(40/9), 0, 0, 0, 0, 0, 0, 0],
67+
[0, 256/9, 0, -(40/9), 0, 0, 0, 0, 0, 0],
68+
[0, 0, 0, 0, -(10/3), 0, 4/9, 0, 0, 0],
69+
[0, 0, 0, 0, 0, -(10/3), 0, 4/9, 0, 0],
70+
[0, 0, 0, 0, -(64/9), 0, 74/9, 0, 4/9, 0],
71+
[0, 0, 0, 0, 0, -(64/9), 0, 74/9, 0, 4/9],
72+
[0, 0, 0, 0, 1024/9, 0, -(1408/9), 0, -(94/9), 0],
73+
[0, 0, 0, 0, 0, 1024/9, 0, -(1408/9), 0, -(94/9)]])
74+
75+
76+
def adm_s_IV(f, m_u, m_d, m_s, m_c, m_b, m_e, m_mu, m_tau):
77+
return np.array([[4/3, 1/6, 16, -4, -1/4],
78+
[-32/3, 14/3, 64, -16, -1],
79+
[0, 0, -18, 11/6, 1/8],
80+
[0, 0, -40/3, 74/3, 5/6],
81+
[0, 0, 256/3, -1600/3, -64/3]])
82+
83+
84+
def adm_e_IV(f, m_u, m_d, m_s, m_c, m_b, m_e, m_mu, m_tau):
85+
return np.array([[-20/9, 2/9, 0, 0, 0],
86+
[-128/9, 20/9, 0, 0, 0],
87+
[0, 0, -4/3, -2/9, 0],
88+
[0, 0, 32/9, -28/9, -2/9],
89+
[0, 0, -512/9, 128/9, 20/9]])
90+
91+
92+
def adm_s_Vsb(f, m_u, m_d, m_s, m_c, m_b, m_e, m_mu, m_tau):
93+
xu = m_u / m_b
94+
xc = m_c / m_b
95+
xd = m_d / m_b
96+
xs = m_s / m_b
97+
xe = m_e / m_b
98+
xmu = m_mu / m_b
99+
xtau = m_tau / m_b
100+
Aud = np.array([[0, -20, 0, 2],
101+
[-(40/9), -16, 4/9, 5/6],
102+
[0, -128, 0, 20],
103+
[-(256/9), -40, 40/9, -(2/3)]])
104+
Bud = np.array([[-16, 0, 0, -2, 0, 0],
105+
[0, 2, -(4/9), -(5/6), 0, 0],
106+
[0, 32, 16/3, -32, 0, -2],
107+
[64/9, 40/ 3, -(64/9), -26, -(4/9), -(5/6)],
108+
[0, -512, -(1024/3), 384, -16, 32],
109+
[-(1024/9), -(640/3), 256/3, 1184/3, 64/9, 46/3]])
110+
Cmat = np.array([[8/9, 2/9, 128/9, -(32/9), -(2/9)],
111+
[-(160/9), 50/9, 320/ 9, -(80/9), -(5/9)],
112+
[2/9, -(1/36), -(154/9), 29/18, 1/9],
113+
[0, 0, -(40/3), 74/3, 5/6],
114+
[32/9, -(4/9), 896/ 9, -(4832/9), -(194/9)]])
115+
Dmat = np.array([[-(4/9), 1/18, -(16/9), 4/9, 1/36],
116+
[-(64/9), 8/9, -(256/9), 64/9, 4/9],
117+
[2/9, -(1/36), 8/9, -(2/9), -(1/72)],
118+
[0, 0, 0, 0, 0],
119+
[32/9, -(4/9), 128/9, -(32/9), -(2/9)]])
120+
Emat = np.array([[-(14/3) - 20/3 + 4/3 * f, 0],
121+
[-(32/9), -6 - 20/3 + 4/3 * f]])
122+
Fmat = np.array([[0, 0, 0, 0, 0],
123+
[0, 0, 0, 0, 0],
124+
[0, 0, -8, 0, 0],
125+
[0, 0, 0, 8/3, 0],
126+
[0, 0, 0, -(512/3), -8]])
127+
Iud = np.array([[0, 4/3, 0, 0],
128+
[0, 64/3, 0, 0],
129+
[0, -(2/3), 0, 0],
130+
[0, 0, 0, 0],
131+
[0, -(32/3), 0, 0]])
132+
Hud = np.array([[0, 0, 0, 0, 0],
133+
[-(4/9), 1/18, -(16/9), 4/9, 1/36],
134+
[0, 0, 0, 0, 0],
135+
[-(40/9), 5/9, -(160/9), 40/9, 5/18]])
136+
Zud = np.array([[0, 0, 0, 0],
137+
[0, 4/3, 0, 0],
138+
[0, 0, 0, 0],
139+
[0, 40/3, 0, 0]])
140+
Kmatu = np.array([[0, 0], [0, 0],
141+
[-16 * xu, 0],
142+
[0, -4 * xu],
143+
[256 * xu, 0],
144+
[0, 64 * xu]])
145+
Kmatc = np.array([[0, 0], [0, 0],
146+
[-16 * xc, 0],
147+
[0, -4 * xc],
148+
[256 * xc, 0],
149+
[0, 64 * xc]])
150+
Kmatd = np.array([[0, 0], [0, 0],
151+
[8 * xd, 0], [0, -4 * xd],
152+
[-128 * xd, 0], [0, 64 * xd]])
153+
Jmats = np.array([[0, 0], [0, 0],
154+
[-(1/3) * xs, xs], [28/3 * xs, -4 * xs],
155+
[-(512/3) * xs, 128 * xs]])
156+
Jmat = np.array([[0, 0],
157+
[0, 0],
158+
[-(1/3), 1],
159+
[28/3, -4],
160+
[-(512/3), 128]])
161+
Mmate = np.array([[0, 0], [0, 0], [0, 0],
162+
[8 * xe, 0],
163+
[-128 * xe, 0]])
164+
Mmatmu = np.array([[0, 0], [0, 0], [0, 0],
165+
[8 * xmu, 0],
166+
[-128 * xmu, 0]])
167+
Mmattau = np.array([[0, 0], [0, 0], [0, 0],
168+
[8 * xtau, 0],
169+
[-128 * xtau, 0]])
170+
G = np.zeros((57, 57))
171+
G[0:4, 0:4] = G[10:14, 10:14] = G[20:24, 20:24] = Aud
172+
G[4:10, 4:10] = G[14:20, 14:20] = G[24:30, 24:30] = Bud
173+
G[30:35, 30:35] = G[35:40, 35:40] = Cmat
174+
G[30:35, 35:40] = G[35:40, 30:35] = Dmat
175+
G[40:42, 40:42] = Emat
176+
G[42:47, 42:47] = G[47:52, 47:52] = G[52:57, 52:57] = Fmat
177+
G[30:35, 0:4] = G[30:35, 10:14] = G[30:35, 20:24] = G[35:40, 0:4] = G[35:40, 10:14] = G[35:40, 20:24] = Iud
178+
G[0:4, 30:35] = G[0:4, 35:40] = G[10:14, 30:35] = G[10:14, 35:40] = G[20:24, 30:35] = G[20:24, 35:40] = Hud
179+
G[10:14, 0:4] = G[20:24, 0:4] = G[20:24, 10:14] = G[0:4, 10:14] = G[0:4, 20:24] = G[10:14, 20:24] = Zud
180+
G[4:10, 40:42] = Kmatu
181+
G[14:20, 40:42] = Kmatd
182+
G[24:30, 40:42] = Kmatc
183+
G[30:35, 40:42] = Jmats
184+
G[35:40, 40:42] = Jmat
185+
G[42:47, 40:42] = Mmate
186+
G[47:52, 40:42] = Mmatmu
187+
G[52:57, 40:42] = Mmattau
188+
return G
189+
190+
191+
def adm_e_Vsb(f, m_u, m_d, m_s, m_c, m_b, m_e, m_mu, m_tau):
192+
Au = np.array([[8, 0, -(4/9), 0],
193+
[0, 40/9, 0, -(4/9)],
194+
[64, 0, -(40/9), 0],
195+
[0, 256/9, 0, -(40/9)]])
196+
Ad = np.array([[-(4/3), 0, 2/9, 0],
197+
[0, -(20/9), 0, 2/9],
198+
[-(16/3), 0, 20/9, 0],
199+
[0, -(128/9), 0, 20/9]])
200+
Bu = np.array([[-(10/3), 0, 4/9, 0, 0, 0],
201+
[0, -(10/3), 0, 4/9, 0, 0],
202+
[-(64/9), 0, 74/9, 0, 4/9, 0],
203+
[0, -(64/9), 0, 74/9, 0, 4/ 9],
204+
[1024/9, 0, -(1408/9), 0, -(94/9), 0],
205+
[0, 1024/9, 0, -(1408/9), 0, -(94/9)]])
206+
Bd = np.array([[-(4/3), 0, -(2/9), 0, 0, 0],
207+
[0, -(4/3), 0, -(2/9), 0, 0],
208+
[32/9, 0, -(28/9), 0, -(2/9), 0],
209+
[0, 32/9, 0, -(28/9), 0, -(2/9)],
210+
[-(512/9), 0, 128/9, 0, 20/9, 0],
211+
[0, -(512/9), 0, 128/9, 0, 20/9]])
212+
Cmat = np.array([[-(32/27), 2/9, 0, 0, 0],
213+
[-(80/27), 20/9, 0, 0, 0],
214+
[-(2/27), 0, -(4/3), -(2/9), 0],
215+
[0, 0, 32/ 9, -(28/9), -(2/9)],
216+
[-(32/27), 0, -(512/9), 128/9, 20/9]])
217+
Emat = np.array([[16/9, -8/3],
218+
[0, 8/9]])
219+
Fmat = np.array([[-4, 2/3, 0, 0, 0],
220+
[-16, 20/3, 0, 0, 0],
221+
[0, 0, -(20/3), -(2/3), 0],
222+
[0, 0, 32/3, -(76/9), -(2/3)],
223+
[0, 0, -(512/3), -(128/9), 4]])
224+
Gmat = np.array([[8/3, 0, 0, 0, 0],
225+
[80/3, 0, 0, 0, 0],
226+
[0, 0, 0, 0, 0],
227+
[0, 0, 0, 0, 0],
228+
[0, 0, 0, 0, 0]])
229+
Iu = np.array([[-(56/27), 0, 0, 0],
230+
[-(608/27), 0, 0, 0],
231+
[4/27, 0, 0, 0],
232+
[0, 0, 0, 0],
233+
[64/27, 0, 0, 0]])
234+
Id = np.array([[28/27, 0, 0, 0],
235+
[304/27, 0, 0, 0],
236+
[-(2/27), 0, 0, 0],
237+
[0, 0, 0, 0],
238+
[-(32/27), 0, 0, 0]])
239+
Hu = np.array([[-(16/9), 0, 0, 0, 0],
240+
[0, 0, 0, 0, 0],
241+
[-(160/9), 0, 0, 0, 0],
242+
[0, 0, 0, 0, 0]])
243+
Hd = np.array([[8/9, 0, 0, 0, 0],
244+
[0, 0, 0, 0, 0],
245+
[80/9, 0, 0, 0, 0],
246+
[0, 0, 0, 0, 0]])
247+
Zu = np.array([[32/9, 0, 0, 0],
248+
[0, 0, 0, 0],
249+
[320/9, 0, 0, 0],
250+
[0, 0, 0, 0]])
251+
Zd = np.array([[-(16/9), 0, 0, 0],
252+
[0, 0, 0, 0],
253+
[-(160/9), 0, 0, 0],
254+
[0, 0, 0, 0]])
255+
Dmat = np.array([[28/27, 0, 0, 0, 0],
256+
[304/27, 0, 0, 0, 0],
257+
[-(2/27), 0, 0, 0, 0],
258+
[0, 0, 0, 0, 0],
259+
[-(32/27), 0, 0, 0, 0]])
260+
Lu = np.array([[-(16/9), 0, 0, 0],
261+
[-(160/9), 0, 0, 0],
262+
[0, 0, 0, 0],
263+
[0, 0, 0, 0],
264+
[0, 0, 0, 0]])
265+
Ld = np.array([[8/9, 0, 0, 0],
266+
[80/9, 0, 0, 0],
267+
[0, 0, 0, 0],
268+
[0, 0, 0, 0],
269+
[0, 0, 0, 0]])
270+
matQ = np.array([[8/9, 0, 0, 0, 0],
271+
[80/9, 0, 0, 0, 0],
272+
[0, 0, 0, 0, 0],
273+
[0, 0, 0, 0, 0],
274+
[0, 0, 0, 0, 0]])
275+
Nd = np.array([[8/3, 0, 0, 0, 0],
276+
[0, 0, 0, 0, 0],
277+
[80/3, 0, 0, 0, 0],
278+
[0, 0, 0, 0, 0]])
279+
Nu = np.array([[-(16/3), 0, 0, 0, 0],
280+
[0, 0, 0, 0, 0],
281+
[-(160/3), 0, 0, 0, 0],
282+
[0, 0, 0, 0, 0]])
283+
Pmat = np.array([[28/9, 0, 0, 0, 0],
284+
[304/9, 0, 0, 0, 0],
285+
[-(2/9), 0, 0, 0, 0],
286+
[0, 0, 0, 0, 0],
287+
[-(32/9), 0, 0, 0, 0]])
288+
G = np.zeros((57, 57))
289+
G[0:4, 0:4] = G[20:24, 20:24] = Au
290+
G[10:14, 10:14] = Ad
291+
G[4:10, 4:10] = G[24:30, 24:30] = Bu
292+
G[14:20, 14:20] = Bd
293+
G[30:35, 30:35] = G[35:40, 35:40] = Cmat
294+
G[40:42, 40:42] = Emat
295+
G[42:47, 42:47] = G[47:52, 47:52] = G[52:57, 52:57] = Fmat
296+
G[42:47, 47:52] = G[42:47, 52:57] = G[52:57, 47:52] = G[52:57, 42:47] = G[47:52, 42:47] = G[47:52, 52:57] = Gmat
297+
G[30:35, 0:4] = G[30:35, 20:24] = G[35:40, 0:4] = G[35:40, 20:24] = Iu
298+
G[30:35, 10:14] = G[35:40, 10:14] = Id
299+
G[0:4, 30:35] = G[0:4, 35:40] = G[20:24, 30:35] = G[20:24, 35:40] = Hu
300+
G[10:14, 30:35] = G[10:14, 35:40] = Hd
301+
G[0:4, 10:14] = G[10:14, 20:24] = G[10:14, 0:4] = G[20:24, 10:14] = Zd
302+
G[20:24, 0:4] = G[0:4, 20:24] = Zu
303+
G[30:35, 35:40] = G[35:40, 30:35] = Dmat
304+
G[42:47, 0:4] = G[47:52, 0:4] = G[52:57, 0:4] = G[42:47, 20:24] = G[47:52, 20:24] = G[52:57, 20:24] = Lu
305+
G[42:47, 10:14] = G[47:52, 10:14] = G[52:57, 10:14] = Ld
306+
G[42:47, 30:35] = G[42:47, 35:40] = G[47:52, 30:35] = G[47:52, 35:40] = G[52:57, 30:35] = G[52:57, 35:40] = matQ
307+
G[10:14, 42:47] = G[10:14, 47:52] = G[10:14, 52:57] = Nd
308+
G[0:4, 42:47] = G[0:4, 47:52] = G[0:4, 52:57] = G[20:24, 42:47] = G[20:24, 47:52] = G[20:24, 52:57] = Nu
309+
G[30:35, 42:47] = G[30:35, 47:52] = G[30:35, 52:57] = G[35:40, 42:47] = G[35:40, 47:52] = G[35:40, 52:57] = Pmat
310+
return G
311+
312+
313+
def adm_s_Vdb(f, m_u, m_d, m_s, m_c, m_b, m_e, m_mu, m_tau):
314+
# s->d, d->s
315+
return adm_s_Vsb(f, m_u=m_u, m_d=m_s, m_s=m_d, m_c=m_c, m_b=m_b,
316+
m_e=m_e, m_mu=m_mu, m_tau=m_tau)
317+
318+
319+
def adm_e_Vdb(f, m_u, m_d, m_s, m_c, m_b, m_e, m_mu, m_tau):
320+
# s->d, d->s
321+
return adm_e_Vsb(f, m_u=m_u, m_d=m_s, m_s=m_d, m_c=m_c, m_b=m_b,
322+
m_e=m_e, m_mu=m_mu, m_tau=m_tau)
323+
324+
def adm_s_Vds(f, m_u, m_d, m_s, m_c, m_b, m_e, m_mu, m_tau):
325+
# b->s, s->d, d->b
326+
return adm_s_Vsb(f, m_u=m_u, m_d=m_b, m_s=m_d, m_c=m_c, m_b=m_s,
327+
m_e=m_e, m_mu=m_mu, m_tau=m_tau)
328+
329+
330+
def adm_e_Vds(f, m_u, m_d, m_s, m_c, m_b, m_e, m_mu, m_tau):
331+
# b->s, s->d, d->b
332+
return adm_e_Vsb(f, m_u=m_u, m_d=m_b, m_s=m_d, m_c=m_c, m_b=m_s,
333+
m_e=m_e, m_mu=m_mu, m_tau=m_tau)
334+
335+
336+
def adm_s_Vb(*args, **kwargs):
337+
return np.array([[0, 0, 0, 0, 0],
338+
[0, 0, 0, 0, 0],
339+
[0, 0, -8, 0, 0],
340+
[0, 0, 0, 8/3, 0],
341+
[0, 0, 0, -(512/3), -8]])
342+
343+
344+
def adm_e_Vb(*args, **kwargs):
345+
return np.array([[-20/3, 2/3, 0, 0, 0],
346+
[-128/3, 20/3, 0, 0, 0],
347+
[0, 0, -20/3, -2/3, 0],
348+
[0, 0, 32/3, -76/9, -2/3],
349+
[0, 0, -512/3, -128/9, 4]])

wetrunner/classes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ def _get_running_parameters(self, scale, f):
5959
p['m_b'] = qcd.m_b(self.parameters['m_b'], scale, self.f, self.parameters['alpha_s'])
6060
p['m_c'] = qcd.m_c(self.parameters['m_c'], scale, self.f, self.parameters['alpha_s'])
6161
p['m_s'] = qcd.m_s(self.parameters['m_s'], scale, self.f, self.parameters['alpha_s'])
62+
p['m_u'] = qcd.m_s(self.parameters['m_u'], scale, self.f, self.parameters['alpha_s'])
63+
p['m_d'] = qcd.m_s(self.parameters['m_d'], scale, self.f, self.parameters['alpha_s'])
6264
# running ignored for alpha_e and lepton mass
6365
p['alpha_e'] = self.parameters['alpha_e']
66+
p['m_e'] = self.parameters['m_e']
6467
p['m_mu'] = self.parameters['m_mu']
6568
p['m_tau'] = self.parameters['m_tau']
6669
return p
@@ -91,10 +94,7 @@ def run(self, scale_out, sectors='all'):
9194
if sector in definitions.sectors:
9295
if sectors == 'all' or sector in sectors:
9396
C_out.update(rge.run_sector(sector, self.C_in,
94-
Etas, p_i['alpha_s'], p_i['alpha_e'],
95-
p_i['m_b'], p_i['m_c'], p_i['m_s'],
96-
p_i['m_mu'], p_i['m_tau'],
97-
betas))
97+
Etas, self.f, p_i))
9898
C_out = {k: v for k, v in C_out.items()
9999
if v != 0 and k in wcxf.Basis[self.eft, 'Bern'].all_wcs}
100100
return wcxf.WC(eft=self.eft, basis='Bern',

wetrunner/definitions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def listdict():
7373
# e.g. 1sbee
7474
_C += ['{}{}{}{}'.format(i, p, qq, 2 * l)
7575
for i in range(1, 11, 2)] # 1, 3, 5, 7, 9
76-
sectors[sname]['V'].append(_C)
76+
sectors[sname]['V' + qq].append(_C)
7777

7878
# class 5b
7979
for qq in ['sb', 'db', 'ds']:

0 commit comments

Comments
 (0)