Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
Math.py
Go to the documentation of this file.
1"""
2Python wrapper for C++ bindings generated using Pybind11.
3Each function corresponds to a mathematical or numerical utility available in the C++ backend.
4"""
5
6from pyhyperiso.phyperiso.pyhyperiso import math as mb
7from pyhyperiso.core.Math.Scalar import Scalar
8# Math functions
9
10
11def Li2(x: float) -> float:
12 """Compute the dilogarithm function.
13
14 Args:
15 x: A real number.
16
17 Returns:
18 The value of Li2(x).
19 """
20 return mb.Li2(x)
21
22
23def Li3(x: float) -> float:
24 """Compute the trilogarithm function.
25
26 Args:
27 x: A real number.
28
29 Returns:
30 The value of Li3(x).
31 """
32 return mb.Li3(x)
33
34
35def CLi2(x: Scalar) -> complex:
36 """Compute the complex dilogarithm function.
37
38 Args:
39 x: A complex number.
40
41 Returns:
42 Complex dilogarithm value.
43 """
44 if isinstance(x, complex):
45 x = Scalar.from_complex(x)
46
47 return Scalar.from_cpp(mb.CLi2(x._cpp_obj))
48
49
50def Cl2(x: float) -> float:
51 """Compute the Clausen function Cl2.
52
53 Args:
54 x: A real number.
55
56 Returns:
57 Value of Cl2(x).
58 """
59 return mb.Cl2(x)
60
61
62def H2(x: float, y: float) -> float:
63 """Compute the H2(x, y) special function.
64
65 Args:
66 x: First input value.
67 y: Second input value.
68
69 Returns:
70 Value of H2(x, y).
71 """
72 return mb.H2(x, y)
73
74
75def B(m1: float, m2: float, Q: float) -> float:
76 """Compute the B-function of two masses and a scale Q.
77
78 Args:
79 m1: First mass.
80 m2: Second mass.
81 Q: Renormalization scale.
82
83 Returns:
84 Value of B(m1, m2, Q).
85 """
86 return mb.B(m1, m2, Q)
87
88
89def kron(x: int, y: int) -> int:
90 """Kronecker delta function.
91
92 Args:
93 x: First integer.
94 y: Second integer.
95
96 Returns:
97 1 if x == y, else 0.
98 """
99 return mb.kron(x, y)
100
101
102def integrate(f, l: float, u: float, prec: float = 1e-6) -> float:
103 """Integrate a real-valued function f from l to u.
104
105 Args:
106 f: Callable real function.
107 l: Lower integration bound.
108 u: Upper integration bound.
109 prec: Desired precision.
110
111 Returns:
112 Integral value.
113 """
114 return mb.integrate(f, l, u, prec)
115
116
117def c_integrate(f, l: float, u: float, prec: float = 1e-6) -> Scalar:
118 """Integrate a complex-valued function f over [l, u].
119
120 Args:
121 f: Callable complex function.
122 l: Lower bound.
123 u: Upper bound.
124 prec: Precision.
125
126 Returns:
127 Complex integral value.
128 """
129 return Scalar.from_cpp(mb.c_integrate(f, l, u, prec))
130
131
132def psi(n: int) -> float:
133 """Compute the digamma function ψ(n) for integer input.
134
135 Args:
136 n: Integer input (n > 0).
137
138 Returns:
139 Value of ψ(n).
140 """
141 return mb.psi(n)
142
143
144# Constants
145PI = mb.PI
146E = mb.E
147ZETA3 = mb.ZETA3
148GAMMA = mb.GAMMA
149
150
151# Wilson coefficients
152def A0t(x: float) -> float:
153 """Wilson coefficient A0t.
154
155 Args:
156 x: A real parameter.
157
158 Returns:
159 Value of A0t(x).
160 """
161 return mb.A0t(x)
162
163
164def F0t(x: float) -> float:
165 """Wilson coefficient F0t."""
166 return mb.F0t(x)
167
168
169def B0t(x: float) -> float:
170 """Wilson coefficient B0t."""
171 return mb.B0t(x)
172
173
174def C0t(x: float) -> float:
175 """Wilson coefficient C0t."""
176 return mb.C0t(x)
177
178
179def D0t(x: float) -> float:
180 """Wilson coefficient D0t."""
181 return mb.D0t(x)
182
183
184def E0t(x: float) -> float:
185 """Wilson coefficient E0t."""
186 return mb.E0t(x)
187
188
189def T(x: float) -> float:
190 """Wilson coefficient T."""
191 return mb.T(x)
192
193
194def A1t(x: float, l: float) -> float:
195 """Wilson coefficient A1t.
196
197 Args:
198 x: A real parameter.
199 l: Logarithmic scale.
200
201 Returns:
202 Value of A1t(x, l).
203 """
204 return mb.A1t(x, l)
205
206
207def B1t(x: float, l: float) -> float:
208 """Wilson coefficient B1t.
209
210 Args:
211 x: A real parameter.
212 l: Logarithmic scale.
213
214 Returns:
215 Value of B1t(x, l).
216 """
217 return mb.B1t(x, l)
218
219
220def C1t(x: float, l: float) -> float:
221 """Wilson coefficient C1t.
222
223 Args:
224 x: A real parameter.
225 l: Logarithmic scale.
226
227 Returns:
228 Value of C1t(x, l).
229 """
230 return mb.C1t(x, l)
231
232
233def D1t(x: float, l: float) -> float:
234 """Wilson coefficient D1t.
235
236 Args:
237 x: A real parameter.
238 l: Logarithmic scale.
239
240 Returns:
241 Value of D1t(x, l).
242 """
243 return mb.D1t(x, l)
244
245
246def E1t(x: float, l: float) -> float:
247 """Wilson coefficient E1t.
248
249 Args:
250 x: A real parameter.
251 l: Logarithmic scale.
252
253 Returns:
254 Value of E1t(x, l).
255 """
256 return mb.E1t(x, l)
257
258
259def F1t(x: float, l: float) -> float:
260 """Wilson coefficient F1t.
261
262 Args:
263 x: A real parameter.
264 l: Logarithmic scale.
265
266 Returns:
267 Value of F1t(x, l).
268 """
269 return mb.F1t(x, l)
270
271
272def G1t(x: float, l: float) -> float:
273 """Wilson coefficient G1t.
274
275 Args:
276 x: A real parameter.
277 l: Logarithmic scale.
278
279 Returns:
280 Value of G1t(x, l).
281 """
282 return mb.G1t(x, l)
283
284
285def C7t2mt(x: float) -> float:
286 """Wilson coefficient C7t at 2m_t scale.
287
288 Args:
289 x: A real parameter.
290
291 Returns:
292 Value of C7t2mt(x).
293 """
294 return mb.C7t2mt(x)
295
296
297def C7c2MW(x: float) -> float:
298 """Wilson coefficient C7c at M_W scale.
299
300 Args:
301 x: A real parameter.
302
303 Returns:
304 Value of C7c2MW(x).
305 """
306 return mb.C7c2MW(x)
307
308
309def C8t2mt(x: float) -> float:
310 """Wilson coefficient C8t at 2m_t scale.
311
312 Args:
313 x: A real parameter.
314
315 Returns:
316 Value of C8t2mt(x).
317 """
318 return mb.C8t2mt(x)
319
320
321def C8c2MW(x: float) -> float:
322 """Wilson coefficient C8c at M_W scale.
323
324 Args:
325 x: A real parameter.
326
327 Returns:
328 Value of C8c2MW(x).
329 """
330 return mb.C8c2MW(x)
331
332
333def F7_1(x: float) -> float:
334 """Wilson coefficient F7_1.
335
336 Args:
337 x: A real parameter.
338
339 Returns:
340 Value of F7_1(x).
341 """
342 return mb.F7_1(x)
343
344
345def F7_2(x: float) -> float:
346 """Wilson coefficient F7_2.
347
348 Args:
349 x: A real parameter.
350
351 Returns:
352 Value of F7_2(x).
353 """
354 return mb.F7_2(x)
355
356
357def F8_1(x: float) -> float:
358 """Wilson coefficient F8_1.
359
360 Args:
361 x: A real parameter.
362
363 Returns:
364 Value of F8_1(x).
365 """
366 return mb.F8_1(x)
367
368
369def F8_2(x: float) -> float:
370 """Wilson coefficient F8_2.
371
372 Args:
373 x: A real parameter.
374
375 Returns:
376 Value of F8_2(x).
377 """
378 return mb.F8_2(x)
379
380
381def G3H(x: float, lu: float) -> float:
382 """Wilson coefficient G3H.
383
384 Args:
385 x: A real parameter.
386 lu: Logarithmic scale.
387
388 Returns:
389 Value of G3H(x, lu).
390 """
391 return mb.G3H(x, lu)
392
393
394def G4H(x: float, lu: float) -> float:
395 """Wilson coefficient G4H.
396
397 Args:
398 x: A real parameter.
399 lu: Logarithmic scale.
400
401 Returns:
402 Value of G4H(x, lu).
403 """
404 return mb.G4H(x, lu)
405
406
407def G7H(x: float, lu: float, ld: float) -> float:
408 """Wilson coefficient G7H.
409
410 Args:
411 x: A real parameter.
412 lu: Upper log scale.
413 ld: Lower log scale.
414
415 Returns:
416 Value of G7H(x, lu, ld).
417 """
418 return mb.G7H(x, lu, ld)
419
420
421def G8H(x: float, lu: float, ld: float) -> float:
422 """Wilson coefficient G8H.
423
424 Args:
425 x: A real parameter.
426 lu: Upper log scale.
427 ld: Lower log scale.
428
429 Returns:
430 Value of G8H(x, lu, ld).
431 """
432 return mb.G8H(x, lu, ld)
433
434
435def EH(x: float, lu: float) -> float:
436 """Wilson coefficient EH.
437
438 Args:
439 x: A real parameter.
440 lu: Logarithmic scale.
441
442 Returns:
443 Value of EH(x, lu).
444 """
445 return mb.EH(x, lu)
446
447
448def D9H0(x: float, lu: float) -> float:
449 """Wilson coefficient D9H0.
450
451 Args:
452 x: A real parameter.
453 lu: Logarithmic scale.
454
455 Returns:
456 Value of D9H0(x, lu).
457 """
458 return mb.D9H0(x, lu)
459
460
461def D9H1(x: float, lu: float, L: float) -> float:
462 """Wilson coefficient D9H1.
463
464 Args:
465 x: A real parameter.
466 lu: Logarithmic scale.
467 L: Additional parameter.
468
469 Returns:
470 Value of D9H1(x, lu, L).
471 """
472 return mb.D9H1(x, lu, L)
473
474
475def Delta3H(x: float, lu: float) -> float:
476 """Wilson coefficient Delta3H.
477
478 Args:
479 x: A real parameter.
480 lu: Logarithmic scale.
481
482 Returns:
483 Value of Delta3H(x, lu).
484 """
485 return mb.Delta3H(x, lu)
486
487
488def Delta4H(x: float, lu: float) -> float:
489 """Wilson coefficient Delta4H.
490
491 Args:
492 x: A real parameter.
493 lu: Logarithmic scale.
494
495 Returns:
496 Value of Delta4H(x, lu).
497 """
498 return mb.Delta4H(x, lu)
499
500
501def Delta7H(x: float, lu: float, ld: float) -> float:
502 """Wilson coefficient Delta7H.
503
504 Args:
505 x: A real parameter.
506 lu: Upper log scale.
507 ld: Lower log scale.
508
509 Returns:
510 Value of Delta7H(x, lu, ld).
511 """
512 return mb.Delta7H(x, lu, ld)
513
514
515def Delta8H(x: float, lu: float, ld: float) -> float:
516 """Wilson coefficient Delta8H.
517
518 Args:
519 x: A real parameter.
520 lu: Upper log scale.
521 ld: Lower log scale.
522
523 Returns:
524 Value of Delta8H(x, lu, ld).
525 """
526 return mb.Delta8H(x, lu, ld)
527
528
529def C9llH0(x: float, y: float, lu: float) -> float:
530 """Wilson coefficient C9llH0.
531
532 Args:
533 x: First real parameter.
534 y: Second real parameter.
535 lu: Logarithmic scale.
536
537 Returns:
538 Value of C9llH0(x, y, lu).
539 """
540 return mb.C9llH0(x, y, lu)
541
542
543def C9llH1(x: float, y: float, lu: float, L: float) -> float:
544 """Wilson coefficient C9llH1.
545
546 Args:
547 x: First real parameter.
548 y: Second real parameter.
549 lu: Logarithmic scale.
550 L: Additional scale.
551
552 Returns:
553 Value of C9llH1(x, y, lu, L).
554 """
555 return mb.C9llH1(x, y, lu, L)
556
557
558def C10Wt2mt(x: float) -> float:
559 """Wilson coefficient C10Wt at 2m_t scale.
560
561 Args:
562 x: A real parameter.
563
564 Returns:
565 Value of C10Wt2mt(x).
566 """
567 return mb.C10Wt2mt(x)
568
569
570def C10Wc2MW(x: float) -> float:
571 """Wilson coefficient C10Wc at M_W scale.
572
573 Args:
574 x: A real parameter.
575
576 Returns:
577 Value of C10Wc2MW(x).
578 """
579 return mb.C10Wc2MW(x)
580
581
582def C10Zt2mt(x: float) -> float:
583 """Wilson coefficient C10Zt at 2m_t scale.
584
585 Args:
586 x: A real parameter.
587
588 Returns:
589 Value of C10Zt2mt(x).
590 """
591 return mb.C10Zt2mt(x)
592
593
594def C10Z2tri(x: float) -> float:
595 """Wilson coefficient C10Z from triangle diagrams.
596
597 Args:
598 x: A real parameter.
599
600 Returns:
601 Value of C10Z2tri(x).
602 """
603 return mb.C10Z2tri(x)
604
605
606def F0SP(xt: float) -> float:
607 """Wilson coefficient F0SP.
608
609 Args:
610 xt: A real parameter.
611
612 Returns:
613 Value of F0SP(xt).
614 """
615 return mb.F0SP(xt)
float Li3(float x)
Definition Math.py:23
float C9llH1(float x, float y, float lu, float L)
Definition Math.py:543
float C10Wt2mt(float x)
Definition Math.py:558
complex CLi2(Scalar x)
Definition Math.py:35
float F0SP(float xt)
Definition Math.py:606
float A1t(float x, float l)
Definition Math.py:194
float C10Z2tri(float x)
Definition Math.py:594
float C9llH0(float x, float y, float lu)
Definition Math.py:529
float Delta3H(float x, float lu)
Definition Math.py:475
float D9H1(float x, float lu, float L)
Definition Math.py:461
float Delta4H(float x, float lu)
Definition Math.py:488
float B1t(float x, float l)
Definition Math.py:207
float F7_2(float x)
Definition Math.py:345
float G1t(float x, float l)
Definition Math.py:272
float H2(float x, float y)
Definition Math.py:62
float G4H(float x, float lu)
Definition Math.py:394
float E1t(float x, float l)
Definition Math.py:246
float C1t(float x, float l)
Definition Math.py:220
float D1t(float x, float l)
Definition Math.py:233
float T(float x)
Definition Math.py:189
Scalar c_integrate(f, float l, float u, float prec=1e-6)
Definition Math.py:117
float C10Wc2MW(float x)
Definition Math.py:570
float G3H(float x, float lu)
Definition Math.py:381
float F0t(float x)
Definition Math.py:164
float F8_2(float x)
Definition Math.py:369
float Delta8H(float x, float lu, float ld)
Definition Math.py:515
float C0t(float x)
Definition Math.py:174
float Cl2(float x)
Definition Math.py:50
float Delta7H(float x, float lu, float ld)
Definition Math.py:501
float G8H(float x, float lu, float ld)
Definition Math.py:421
float D0t(float x)
Definition Math.py:179
float F8_1(float x)
Definition Math.py:357
float A0t(float x)
Definition Math.py:152
float D9H0(float x, float lu)
Definition Math.py:448
float F7_1(float x)
Definition Math.py:333
float EH(float x, float lu)
Definition Math.py:435
int kron(int x, int y)
Definition Math.py:89
float C10Zt2mt(float x)
Definition Math.py:582
float C7c2MW(float x)
Definition Math.py:297
float C7t2mt(float x)
Definition Math.py:285
float C8t2mt(float x)
Definition Math.py:309
float G7H(float x, float lu, float ld)
Definition Math.py:407
float F1t(float x, float l)
Definition Math.py:259
float psi(int n)
Definition Math.py:132
float C8c2MW(float x)
Definition Math.py:321
float B0t(float x)
Definition Math.py:169
float Li2(float x)
Definition Math.py:11
float integrate(f, float l, float u, float prec=1e-6)
Definition Math.py:102
float E0t(float x)
Definition Math.py:184