QCDLoop
One-loop scalar Feynman integrals
tools.h
1 //
2 // QCDLoop 2016
3 //
4 // Authors: Stefano Carrazza: stefano.carrazza@cern.ch
5 // Keith Ellis: keith.ellis@durham.ac.uk
6 // Giulia Zanderighi: giulia.zanderighi@cern.ch
7 
8 #pragma once
9 
10 #include "types.h"
11 #include <vector>
12 using std::vector;
13 
14 namespace ql
15 {
21  template<typename TOutput = complex, typename TMass = double, typename TScale = double>
22  class Tools
23  {
24  public:
25  Tools();
26  ~Tools();
27 
29  bool iszero(TMass const& psq) const;
30 
31  /* Logarithm functions*/
33  TOutput cLn(TOutput const& z, TScale const& isig) const;
34  TOutput cLn(TScale const& x, TScale const& isig) const;
35 
37  TOutput fndd(int const& n, TOutput const& x, TScale const& iep) const;
38 
40  TOutput Lnrat(TOutput const& x, TOutput const& y) const;
41  TOutput Lnrat(TScale const& x, TScale const& y) const;
42 
43  /* Polylog functions & variations */
45  TMass ddilog(TMass const& x) const;
46 
48  TOutput denspence(TOutput const& z, TScale const& isig) const;
49 
51  TOutput spencer(TOutput const& zrat1, TOutput const& zrat2, TScale const&ieps1, TScale const&ieps2) const;
52 
54  TOutput xspence(TOutput const (&z1)[2], TScale const (&im1)[2], TOutput const& z2, TScale const& im2) const;
55 
57  TOutput cspence(TOutput const& z1, TScale const& im1, TOutput const& z2, TScale const& im2) const;
58 
60  TOutput Li2omrat(TScale const& x, TScale const& y) const;
61  TOutput Li2omrat(TOutput const& x, TOutput const& y, TScale const& ieps1 = -1, TScale const& ieps2 = -1) const;
62 
64  TOutput Li2omx2(TScale const& v, TScale const& w, TScale const& x, TScale const& y) const;
65  TOutput Li2omx2(TOutput const& v, TOutput const& w, TOutput const& x, TOutput const& y, TScale const& ieps1 = -1, TScale const& ieps2 = -1) const;
66  TOutput cLi2omx2(TOutput const& z1, TOutput const& z2, TScale const& ieps1 = -1, TScale const& ieps2 = -1) const;
67 
69  TOutput Li2omx(TMass const& x1, TMass const& x2, TScale const& ieps1, TScale const& ieps2) const;
70 
72  TOutput cLi2omx3(TOutput const& z1, TOutput const& z2, TOutput const& z3, TScale const& ieps1, TScale const& ieps2, TScale const& ieps3) const;
73 
74  /* Special Li2 functions */
75  TOutput L0(TMass const& x, TMass const& y) const;
76  TOutput L1(TMass const& x, TMass const& y) const;
77  TOutput R3int(TOutput const& p, TOutput const& s1, TOutput const& s2, TOutput const& t1) const;
78  TOutput R3int(TOutput const& p, TOutput const& s1, TOutput const& s2, TOutput const& t1, TOutput const& t2, TOutput const& t3, TOutput const& t4) const;
79  TOutput R2int(TOutput const& a, TOutput const& b, TOutput const& y0) const;
80  TOutput Rint(TOutput const& y, TOutput const& z, TScale const& ieps) const;
81  void R(TOutput &r, TOutput &d, TOutput const& q) const;
82  TOutput Zlogint(TOutput const& z, TScale const& ieps) const;
83 
84  /* Auxiliary Li2 functions */
85  TOutput ltspence(int const& i_in, TOutput const& z_in, TScale const& s) const;
86  TOutput li2series(TOutput const& z, TScale const& isig) const;
87  TOutput ltli2series(TOutput const& z1, TScale const& s) const;
88 
89  /* eta functions */
90  TOutput eta2(TOutput const& a,TOutput const& b) const;
91  TOutput eta3(TOutput const& a,TOutput const& b, TOutput const& c) const;
92  TOutput eta5(TOutput const& a,TOutput const& b, TOutput const& c, TOutput const& d, TOutput const& e) const;
93  TOutput xetatilde(TOutput const (&z1)[2], TScale const (&im1)[2], TOutput const& z2, TScale const& im2, TOutput const (&l1)[2]) const;
94  TOutput xeta(TOutput const (&z1)[2], TScale const (&im1)[2], TOutput const& z2, TScale const& im2, TScale const& im12, TOutput const (&l1)[2]) const;
95  int eta(TOutput const& z1, TScale const& s1, TOutput const& z2, TScale const& s2, TScale const& s12) const;
96  int etatilde(TOutput const& c1, TScale const& im1x, TOutput const& c2, TScale const& im2x) const;
97 
98  /* Extra functions */
100  void kfn(TOutput (&res)[3], TScale& ieps, TMass const& xpi, TMass const& xm, TMass const& xmp) const;
101 
103  void solveabc(TMass const& a, TMass const&b, TMass const& c, TOutput (&z)[2]) const;
104 
106  void solveabcd(TOutput const& a, TOutput const&b, TOutput const& c, TOutput const& d, TOutput (&z)[2]) const;
107  void solveabcd(TOutput const& a, TOutput const&b, TOutput const& c, TOutput (&z)[2]) const;
108 
110  void ratgam(TOutput &ratp, TOutput &ratm, TScale &ieps, TMass const& p3sq, TMass const& m3sq, TMass const& m4sq) const;
111 
113  void ratreal(TMass const& si, TMass const& ta, TMass &rat, TScale &ieps) const;
114 
115  private:
117  TScale _qlonshellcutoff;
118 
120  vector<TScale> _C;
121 
123  vector<TScale> _B;
124 
125  protected:
126  // Pi constants
127  TScale _pi;
128  TScale _pi2;
129  TScale _pio3;
130  TScale _pio6;
131  TScale _pi2o3;
132  TScale _pi2o6;
133  TScale _pi2o12;
134 
135  // Real constants
136  TScale _zero;
137  TScale _half;
138  TScale _one;
139  TScale _two;
140  TScale _three;
141  TScale _four;
142  TScale _five;
143  TScale _six;
144  TScale _ten;
145 
146  // Real Epsilons
147  TScale _eps;
148  TScale _eps4;
149  TScale _eps7;
150  TScale _eps10;
151  TScale _eps14;
152  TScale _eps15;
153  TScale _xloss;
154  TScale _neglig;
155  TScale _reps;
156 
157  // Pi complex contants
158  TOutput _2ipi;
159  TOutput _ipio2;
160  TOutput _ipi;
161 
162  // Complex constants
163  TOutput _czero;
164  TOutput _chalf;
165  TOutput _cone;
166  TOutput _ctwo;
167  TOutput _cthree;
168  TOutput _cfour;
169 
170  // Complex epsilons
171  TOutput _ieps;
172  TOutput _ieps2;
173  TOutput _ieps50;
174  };
175 
182  class Splash
183  {
184  public:
186  static void Show() { getInstance(); }
187 
188  private:
189  Splash();
190 
192  static Splash* getInstance()
193  {
194  if (!_instance)
195  _instance = new Splash();
196  return _instance;
197  }
198  static Splash* _instance;
199  };
200 }
TOutput R3int(TOutput const &p, TOutput const &s1, TOutput const &s2, TOutput const &t1) const
Definition: tools.cc:752
void R(TOutput &r, TOutput &d, TOutput const &q) const
Tools::R.
Definition: tools.cc:868
TOutput cLi2omx2(TOutput const &z1, TOutput const &z2, TScale const &ieps1=-1, TScale const &ieps2=-1) const
Definition: tools.cc:563
The Splash class.
Definition: tools.h:182
TOutput Li2omx2(TScale const &v, TScale const &w, TScale const &x, TScale const &y) const
Expression for dilog(1-(v-i*ep)*(w-i*ep)/(x-i*ep)/(y-i*ep)).
Definition: tools.cc:511
TOutput cspence(TOutput const &z1, TScale const &im1, TOutput const &z2, TScale const &im2) const
Complex Spence's function.
Definition: tools.cc:445
TOutput L0(TMass const &x, TMass const &y) const
Definition: tools.cc:669
TOutput denspence(TOutput const &z, TScale const &isig) const
Spence's function.
Definition: tools.cc:355
TOutput fndd(int const &n, TOutput const &x, TScale const &iep) const
The fndd function.
Definition: tools.cc:239
TOutput Li2omx(TMass const &x1, TMass const &x2, TScale const &ieps1, TScale const &ieps2) const
Calculate Li[2](1-(x1+ieps1)*(x2+ieps2))
Definition: tools.cc:598
TOutput eta3(TOutput const &a, TOutput const &b, TOutput const &c) const
Definition: tools.cc:1023
TOutput cLn(TOutput const &z, TScale const &isig) const
Log of complex argument with explicit sign for imag part.
Definition: tools.cc:199
TOutput Li2omrat(TScale const &x, TScale const &y) const
Expression for dilog(1-(x-i*ep)/(y-i*ep)).
Definition: tools.cc:475
TOutput R2int(TOutput const &a, TOutput const &b, TOutput const &y0) const
Definition: tools.cc:800
Definition: box.cc:14
void solveabcd(TOutput const &a, TOutput const &b, TOutput const &c, TOutput const &d, TOutput(&z)[2]) const
Solution of the quadratic equation passing the discriminant.
Definition: tools.cc:1243
TOutput xeta(TOutput const (&z1)[2], TScale const (&im1)[2], TOutput const &z2, TScale const &im2, TScale const &im12, TOutput const (&l1)[2]) const
Definition: tools.cc:1079
TOutput Rint(TOutput const &y, TOutput const &z, TScale const &ieps) const
Definition: tools.cc:828
TMass ddilog(TMass const &x) const
Computes the dilog function for real argument.
Definition: tools.cc:288
Tools()
The Constructor.
Definition: tools.cc:21
TOutput cLi2omx3(TOutput const &z1, TOutput const &z2, TOutput const &z3, TScale const &ieps1, TScale const &ieps2, TScale const &ieps3) const
Calculate Li[2](1-(z1+ieps1)*(z2+ieps2)*(z3+ieps3))
Definition: tools.cc:630
void ratgam(TOutput &ratp, TOutput &ratm, TScale &ieps, TMass const &p3sq, TMass const &m3sq, TMass const &m4sq) const
Ratio function.
Definition: tools.cc:1318
TOutput spencer(TOutput const &zrat1, TOutput const &zrat2, TScale const &ieps1, TScale const &ieps2) const
Spence's function for ratio arguments.
Definition: tools.cc:389
TOutput xetatilde(TOutput const (&z1)[2], TScale const (&im1)[2], TOutput const &z2, TScale const &im2, TOutput const (&l1)[2]) const
Definition: tools.cc:1066
bool iszero(TMass const &psq) const
Check for zeros.
Definition: tools.cc:186
TOutput Lnrat(TOutput const &x, TOutput const &y) const
Computes the ratio of logs.
Definition: tools.cc:267
TOutput ltli2series(TOutput const &z1, TScale const &s) const
Definition: tools.cc:985
TOutput Zlogint(TOutput const &z, TScale const &ieps) const
Tools::qlZlogint.
Definition: tools.cc:909
TOutput li2series(TOutput const &z, TScale const &isig) const
Definition: tools.cc:962
int eta(TOutput const &z1, TScale const &s1, TOutput const &z2, TScale const &s2, TScale const &s12) const
Definition: tools.cc:1094
void kfn(TOutput(&res)[3], TScale &ieps, TMass const &xpi, TMass const &xm, TMass const &xmp) const
The K-function.
Definition: tools.cc:1152
TOutput xspence(TOutput const (&z1)[2], TScale const (&im1)[2], TOutput const &z2, TScale const &im2) const
Difference of complex Spence's function.
Definition: tools.cc:432
TOutput eta2(TOutput const &a, TOutput const &b) const
Definition: tools.cc:1008
void solveabc(TMass const &a, TMass const &b, TMass const &c, TOutput(&z)[2]) const
Solution of the quadratic equation.
Definition: tools.cc:1184
static void Show()
Prints splash screen.
Definition: tools.h:186
Standard Tools for the library.
Definition: tools.h:22
void ratreal(TMass const &si, TMass const &ta, TMass &rat, TScale &ieps) const
Ratio function.
Definition: tools.cc:1334
TOutput L1(TMass const &x, TMass const &y) const
Definition: tools.cc:687
TOutput ltspence(int const &i_in, TOutput const &z_in, TScale const &s) const
Definition: tools.cc:922
~Tools()
The Destructor.
Definition: tools.cc:174
int etatilde(TOutput const &c1, TScale const &im1x, TOutput const &c2, TScale const &im2x) const
Definition: tools.cc:1120