HepLib
Loading...
Searching...
No Matches
SD.h
Go to the documentation of this file.
1
6#pragma once
7
8extern "C" {
9 #include <quadmath.h>
10}
11
12#include <dlfcn.h>
13#include <string>
14#include <signal.h>
15#include <sys/syscall.h>
16#include <sys/wait.h>
17#include <sstream>
18#include <ios>
19#include <regex>
20#include <complex>
21#include "mpreal.h"
22#include "BASIC.h"
23
27namespace HepLib::SD {
28
29 using namespace HepLib;
30
31 /*-----------------------------------------------------*/
32 // Global Functions
33 /*-----------------------------------------------------*/
34 exvector get_xy_from(ex pol);
35 exvector get_x_from(ex pol);
36 exvector get_y_from(ex pol);
37 exvector get_z_from(ex pol);
38 exvector get_pl_from(ex pol);
39 int epsRank(ex,ex);
40 int vsRank(ex);
41 int x_free_index(ex expr);
42 int y_free_index(ex expr);
43 ex Factor(const ex expr);
44 ex FactorOutX(const ex expr);
45 ex FactorFT(const ex & expr);
46 ex exp_simplify(const ex);
47 ex pow_simplify(const ex);
48 ex xyz_pow_simplify(const ex expr);
49
50 /*-----------------------------------------------------*/
51 // Customized GiNaC Function
52 /*-----------------------------------------------------*/
53 DECLARE_FUNCTION_1P(fabs)
54 DECLARE_FUNCTION_1P(PL)
55 DECLARE_FUNCTION_1P(CT)
56 DECLARE_FUNCTION_2P(FTX)
57 DECLARE_FUNCTION_2P(VE)
58 DECLARE_FUNCTION_2P(VEO)
59 DECLARE_FUNCTION_2P(VEO2)
60 DECLARE_FUNCTION_2P(CV) // not used internally, for user use only
61 DECLARE_FUNCTION_1P(WRA) // for wick rotation
62 extern int VEO_Digits;
63
75 ex Prefactor = 1;
76 bool isQuasi = false;
77 bool isAsy = false;
78 };
79
83 struct XIntegrand {
87 lst Deltas;
88 bool isAsy = false;
89 };
90
94 class SecDecBase {
95 public:
96 virtual ~SecDecBase() { }
97 virtual vector<exmap> x2y(const ex &xpol) =0;
98 vector<exmap> x2y(const lst &xpols);
100 static bool VerifySD(vector<exmap> vmap, bool quick = true);
101 static ex XMonomials(const ex & expr);
102 };
103
107 class SecDecG : public SecDecBase {
108 public:
109 vector<exmap> x2y(const ex &xpol) override;
110 static vector<vector<int>> RunQHull(const matrix &pts);
111 private:
112 vector<matrix> ZeroFaces(const matrix &pts);
113 matrix NormalVectors(const vector<matrix> &zfs);
114 matrix DualCone(const matrix &pts);
115 vector<matrix> SimplexCones(matrix pts);
116 };
117
118 /*-----------------------------------------------------*/
119 // Integrator Classes
120 /*-----------------------------------------------------*/
121
122 typedef long double dREAL;
123 typedef complex<dREAL> dCOMPLEX;
124 typedef __float128 qREAL;
125 typedef __complex128 qCOMPLEX;
126 typedef mpfr::mpreal mpREAL;
127 typedef complex<mpREAL> mpCOMPLEX;
128
133 public:
134 virtual ~IntegratorBase() { }
135
136 typedef int (*SDD_Type) (const unsigned int xn, const dREAL x[], const unsigned int yn, dREAL y[], const dREAL pl[], const dREAL las[]);
137 typedef int (*SDQ_Type) (const unsigned int xn, const qREAL x[], const unsigned int yn, qREAL y[], const qREAL pl[], const qREAL las[]);
138 typedef int (*SDMP_Type) (const unsigned int xn, const mpREAL x[], const unsigned int yn, mpREAL y[], const mpREAL pl[], const mpREAL las[]);
139 typedef qREAL (*FT_Type) (const qREAL xx[], const qREAL pl[]);
140 virtual ex Integrate(size_t n=0) =0;
141
142 FT_Type FT = NULL;
152 int XDim;
153
154 qREAL EpsAbs = 1E-5;
156 int ReIm = 3; // 1-Re, 2-Im, 3-ReIm
157 int MPDigits = 64;
158 size_t NEval = 0;
159 protected:
160 time_t StartTimer; // used internally
161 size_t RunTime = 0;
162 };
163
167 class HCubature : public IntegratorBase {
168 public:
169 static int Wrapper(unsigned int xdim, size_t npts, const qREAL *x, void *fdata, unsigned int ydim, qREAL *y);
170
171 typedef void (*PrintHookerType) (qREAL*, qREAL*, size_t *, void *);
172
173 virtual ex Integrate(size_t n=0) override;
174 static void DefaultPrintHooker(qREAL*, qREAL*, size_t *, void*);
176 bool use_last = false;
177
178 int DQMP = 0;
179 int QXDim = 0;
180 int MPXDim = 0;
181 qREAL QXLimit = 1E-6Q;
185 size_t RunMAX = 100;
186 size_t RunPTS = 100000;
187 size_t MinPTS = 0;
188 size_t MaxPTS; // used internally
189 unsigned int Threads = 0;
190 private:
191 int NANMax = 250;
192 int nNAN = 0;
193 size_t lastNRUN = 0;
194 qREAL LastResult[2];
195 qREAL LastAbsErr[2];
196 int lastnNAN = 0;
197 int LastState = 0;
198
199 int inDQMP(qREAL const *x);
200 };
201
206 public:
207 static int Wrapper(unsigned int xdim, size_t npts, const mpREAL *x, void *fdata, unsigned int ydim, mpREAL *y);
208 typedef void (*PrintHookerType) (mpREAL*, mpREAL*, size_t *, void *);
209 virtual ex Integrate(size_t n=0) override;
210 static void DefaultPrintHooker(mpREAL*, mpREAL*, size_t *, void*);
212 size_t RunMAX = 100;
213 size_t RunPTS = 100000;
214 size_t MinPTS = 0;
215 size_t MaxPTS; // used internally
216 unsigned int Threads = 0;
217 private:
218 ex mp2ex(const mpREAL & num);
219 int NANMax = 250;
220 int nNAN = 0;
221 bool use_last = false;
222 size_t lastNRUN = 0;
223 mpREAL LastResult[2];
224 mpREAL LastAbsErr[2];
225 int lastnNAN = 0;
226 int LastState = 0;
227
228 int inDQMP(qREAL const *x);
229 };
230
234 class TanhSinhMP : public IntegratorBase {
235 public:
236 static int Wrapper(unsigned ydim, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata);
237 typedef void (*PrintHookerType) (mpREAL *, mpREAL *, size_t *, void *);
238 virtual ex Integrate(size_t n=0) override;
239 static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *);
241 TanhSinhMP(size_t k=10);
242 private:
243 ex mp2ex(const mpREAL & num);
244 size_t K = 10;
245 };
246
250 class QuadMP : public IntegratorBase {
251 public:
252 static int Wrapper(unsigned yn, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata);
253 typedef void (*PrintHookerType) (mpREAL*, mpREAL*, size_t *, void *);
254 virtual ex Integrate(size_t n=0) override;
255 static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *);
257 QuadMP() { }
258 QuadMP(size_t m) : mGK(m) { }
259 size_t nGK = 100;
260 size_t mGK = 10;
261 private:
262 ex mp2ex(const mpREAL & num);
263 };
264
265 typedef long double dREAL;
270 public:
271 typedef dREAL (*FunctionType)(int nvars, dREAL* x, dREAL* pl, dREAL *las);
272 virtual dREAL FindMinimum(int nvars, FunctionType func, dREAL *PL = NULL, dREAL *las = NULL, dREAL *UB = NULL, dREAL *LB = NULL, dREAL *IP = NULL, bool compare0 = false, int TryPTS=0, int SavePTS=0) =0;
273 dREAL ZeroValue = -1E-20;
274 virtual void Minimize(int nvars, FunctionType func, dREAL *ip)=0;
275 virtual void ForceStop()=0;
276 };
277
281 class HookeJeeves : public MinimizeBase {
282 public:
283 virtual dREAL FindMinimum(int nvars, FunctionType func, dREAL *PL = NULL, dREAL *las = NULL, dREAL *UB = NULL, dREAL *LB = NULL, dREAL *IP = NULL, bool compare0 = false, int TryPTS=0, int SavePTS=0) override;
284 bool Exit = false;
285 virtual void Minimize(int nvars, FunctionType func, dREAL *ip) override;
286 virtual void ForceStop() override;
287
288 private:
289 dREAL best_nearby(dREAL* delta, dREAL* point, dREAL prevbest, int nvars);
290 int hooke(int nvars, dREAL* startpt, dREAL* endpt, dREAL rho, dREAL epsilon, int itermax);
291 dREAL ObjectWrapper(int nvars, dREAL* x);
292 FunctionType ObjectFunction;
293 dREAL UpperBound[50];
294 dREAL LowerBound[50];
295 dREAL *PL;
296 dREAL *LAS;
297 };
298
302 class CppFormat : public print_csrc_cl_N {
303 GINAC_DECLARE_PRINT_CONTEXT(CppFormat, print_csrc_cl_N)
304 public:
305 CppFormat(ostream &os, const string & s = "L", unsigned opt = 0);
306 string suffix;
307 string MQuote = "\"";
308
309 template<class T> const CppFormat & operator << (const T & v) const {
310 s << v;
311 return *this;
312 };
313 const CppFormat & operator << (const basic & v) const;
314 const CppFormat & operator << (const ex & v) const;
315 const CppFormat & operator << (const lst & v) const;
316 const CppFormat & operator<<(std::ostream& (*v)(std::ostream&)) const;
317
318 #ifndef DOXYGEN_SKIP
319 class _init {
320 public: _init();
321 };
322 #endif
323 private:
324 #ifndef DOXYGEN_SKIP
325 static _init CppFormat_init;
326 #endif
327 static void print_integer(const CppFormat & c, const cln::cl_I & x);
328 static void print_real(const CppFormat & c, const cln::cl_R & x);
329 static void print_numeric(const numeric & p, const CppFormat & c, unsigned level);
330 };
331
332 class ExFormat : public print_dflt {
333 GINAC_DECLARE_PRINT_CONTEXT(ExFormat, print_dflt)
334 public:
335 ExFormat(ostream &os, const string & s = "L", unsigned opt = 0);
336 string suffix;
337 string type = "ex";
338 string MQuote = "\"";
339
340 template<class T> const ExFormat & operator << (const T & v) const {
341 s << v;
342 return *this;
343 };
344 const ExFormat & operator << (const basic & v) const;
345 const ExFormat & operator << (const ex & v) const;
346 const ExFormat & operator << (const lst & v) const;
347 const ExFormat & operator<<(std::ostream& (*v)(std::ostream&)) const;
348
349 class _init {
350 public: _init();
351 };
352 private:
353 static _init ExFormat_init;
354 static void print_integer(const ExFormat & c, const cln::cl_I & x);
355 static void print_real(const ExFormat & c, const cln::cl_R & x);
356 static void print_numeric(const numeric & p, const ExFormat & c, unsigned level);
357 };
358
359 /*-----------------------------------------------------*/
360 // VE
361 /*-----------------------------------------------------*/
362 ex VESimplify(ex expr);
363 ex VEResult(ex expr);
364 ex VEResult2(ex expr); // keep two digits in error
365 ex VEMaxErr(ex expr);
366
370 class ErrMin {
371 public:
373 static qREAL *paras;
376 static size_t MaxRND;
377 static size_t RunRND;
379 static dREAL *lambda;
380 static dREAL hjRHO;
381 static ex lastResErr;
382 static dREAL IntError(int nvars, dREAL *las, dREAL *n1, dREAL *n2);
383 };
384
388 class ChengWu {
389 public:
390 static bool isProjective(const ex fe, const ex delta);
391 static void Projectivize(ex &fe, const ex delta, const ex xsum=0);
392 static void Scalelize(ex &fe, const lst xs, const ex cy);
393 static void Scalelize(ex &fe, const ex xi, const ex cy);
394 static exvector Binarize(ex const fe, ex const eqn);
395 static void Binarize(ex const fe, ex const eqn, exvector & ovec);
396 static bool isLinearizable(const ex ft, const ex delta, lst & xcs);
397 static void Linearize(const lst xcs, ex & fe, ex & ft);
398 static bool isPartilizable(const ex ft, const ex delta, lst &xcs, int mode=0);
399 static void Partilize(const lst xcs, const lst delta, const ex fe, exvector & ret_lst);
400
401 static exvector Evaluate(const ex & fe);
402 static exvector WickRotation(const exvector & fe_vec);
403 static exvector Apply(const exvector & fe_vec, const ex & ft=0);
404 inline static exvector Apply(const ex & fe, const ex & ft=0) {
405 exvector fe_vec;
406 fe_vec.push_back(fe);
407 return Apply(fe_vec, ft);
408 }
409 };
410
414 class SecDec {
415
416 public:
417 static bool use_dlclose;
418 static string cpp;
419
420 lst eps_lst = { lst{eps,0}, lst{ep,0} }; // { {epi, epiN}, ... }
421 int vsN = 0;
423 bool vs_before_ep = false;
424 bool use_XMonomials = true;
425 bool disable_Contour = false;
427 exvector FunExp; // each item : { {f1,f2,...}, {n1,n2,...}, { delta_list1, delta_list2 } }
428 exvector Integrands;
429 exvector expResult;
434 bool IsZero = false;
435 bool CheckEnd = false;
436 bool use_ErrMin = false;
437 bool use_las = false;
438 bool save_las = false;
439 int IBF = 0; // 0 - not use IBF
440 bool use_Normalizes = true;
441 bool use_XReOrders = false;
442 int MPDigits = 0; // digits in mpREAL for MP
443 lst BisectionPoints = lst { ex(1)/13, ex(1)/19, ex(1)/29, ex(1)/59, ex(1)/41, ex(1)/37, ex(1)/43, ex(1)/53 };
444
445 map<int, numeric> Parameter; // used Contours and Integrates, use PL in Prepares part
446
447 // used in Contours
448 bool CTMaxF = true;
449 dREAL CTLaMax = 10; // CTLaMax<0 for explict REAL mode
450 int CTTryPTS = 3;
451 int CTSavePTS = 3;
452
453 size_t LambdaSplit = 5;
455 int CTryM = 1; // try lambda in Middle
456 int CTryL = 1; // try lambda in Left
457 int CTryR = 1; // try lambda in Right
458 size_t CTryI = 10000; // integrator limit in CTry
460 int soLimit = 10000;
461
462 qREAL EpsAbs = 1E-4;
463 int ReIm = 3; // 1-Re, 2-Im, 3-ReIm
464
466 void Initialize(XIntegrand xint);
467 void BiSection(ex xi, ex x0);
468 void Normalizes();
469 void Scalelesses();
470 void SDPrepares();
471 void EpsExpands();
472 void RemoveDeltas();
473 void XReOrders();
474 void XTogethers();
475 void XExpands();
476 void KillPowers(int bits=1+2);
477 bool IsBad(ex f, vector<exmap> vmap);
478 exvector AutoEnd(ex po_ex);
479 void CIPrepares(const string & key = "");
480 void Contours(const string & key = "", const string & pkey = "");
481 void Integrates(const string & key="", const string & pkey="", int kid=0);
482 void ReIntegrates(const string & key, const string & pkey, qREAL err);
483 void Evaluate(FeynmanParameter fpi, const string & key = "");
484 void Evaluate(XIntegrand xint, const string & key = "");
485 void Evaluate(const exvector & FunExp, const string & key = "");
486 void MB();
487 void XEnd();
488 void ChengWu(const ex & ft=0);
489
490 static bool VerifySD(vector<exmap> vmap, bool quick = true);
491 static ex XRefined(ex const & ft);
492 static lst XRefined_lst(ex const & ft);
493 static ex PrefactorFIESTA(int nLoop);
494 ex VEResult();
495 void VEPrint(bool endlQ=true);
496 static ex PExpand(ex xpol, bool delta=true);
497 static int PRank(matrix m);
498 static ex ContinuousWRA(ex expr_in, int nc=15);
499
500 ~SecDec();
501
502 private:
503 exvector DS(const ex po_ex);
504 lst Normalize(const ex &input);
505 void DoAsy();
506 bool KillPowerD(ex fe, int kpi);
507 bool KillPower(ex fe, int kpi, int bits);
508
509 void CompileMatDet();
510 vector<lst> ciResult;
511 lst FT_N_XN; // list of { ft, n, xn }
512 exmap LambdaMap;
513
514 };
515
519 class cseParser {
520 public:
521 ex Parse(ex expr, bool reset=true);
522 string oc = "o";
523 int on();
524 vector<pair<int, ex>> os();
525 private:
526 map<ex, ex, ex_is_less> ex_var_map;
527 int no = 0;
528 vector<pair<int, ex>> o_ex_vec;
529 map<int, int> used;
530 };
531
532 class cse_Parser { // just a bit try
533 public:
534 ex Parse(ex expr) { return Parse(expr, true); }
535 string v = "v";
536 int vn();
537 const vector<pair<int,ex>> & vs();
538 private:
539 ex Parse(ex expr, bool reset);
540 map<ex, int, ex_is_less> exn;
541 int no = 0;
542 exvector exv;
543 map<int, int> used;
544 vector<pair<int,ex>> on_ex_vec;
545 };
546
547 vector<matrix> Triangularize(const lst & fs_in, const ex & xs_in, const lst & nsubs={});
548 void Triangularize(exvector & FunExp, const lst & fs_in, const ex & xs_in, const lst & nsubs={});
549
550}
551
552
Basic header file.
class to manipulate with Cheng-Wu theorem
Definition SD.h:388
static bool isPartilizable(const ex ft, const ex delta, lst &xcs, int mode=0)
isPartilize w.r.t. F-term, generized to isLinearizable
Definition ChengWu.cpp:409
static bool isLinearizable(const ex ft, const ex delta, lst &xcs)
Linearize w.r.t. F-term.
Definition ChengWu.cpp:313
static exvector Apply(const exvector &fe_vec, const ex &ft=0)
ChengWu-rized on the vector of fe, note that 1st element of the output, which needs to be droped,...
Definition ChengWu.cpp:61
static exvector Binarize(ex const fe, ex const eqn)
Binarize the input fe, w.r.t. the linear eqn.
Definition ChengWu.cpp:232
static exvector Apply(const ex &fe, const ex &ft=0)
Definition SD.h:404
static void Projectivize(ex &fe, const ex delta, const ex xsum=0)
to Projectivize the input fe, the fe will be updated
Definition ChengWu.cpp:119
static void Partilize(const lst xcs, const lst delta, const ex fe, exvector &ret_lst)
Partilize function, generized to Linearize.
Definition ChengWu.cpp:501
static void Scalelize(ex &fe, const lst xs, const ex cy)
to Scalelize the input fe, the fe will be updated
Definition ChengWu.cpp:182
static bool isProjective(const ex fe, const ex delta)
to check the input fe is Projective or NOT w.r.t. delta
Definition ChengWu.cpp:95
static exvector Evaluate(const ex &fe)
ChengWu Internal, make sure ft in the first term, ONLY appear in ChengWu.cpp.
Definition ChengWu.cpp:665
static void Linearize(const lst xcs, ex &fe, ex &ft)
Linearize w.r.t. xcs_in.
Definition ChengWu.cpp:340
static exvector WickRotation(const exvector &fe_vec)
WickRotation, just check WRA exist or NOT to see successful or NOT. Still Experimental.
Definition ChengWu.cpp:760
class to export GiNaC expression to cpp format
Definition SD.h:302
const CppFormat & operator<<(const T &v) const
Definition SD.h:309
ErrMin with HookeJeeves.
Definition SD.h:370
static ex lastResErr
Definition SD.h:381
static IntegratorBase * Integrator
Definition SD.h:372
static size_t RunRND
Definition SD.h:377
static dREAL err_max
Definition SD.h:374
static MinimizeBase * miner
Definition SD.h:378
static qREAL * paras
Definition SD.h:373
static dREAL IntError(int nvars, dREAL *las, dREAL *n1, dREAL *n2)
Definition ErrMin.cpp:22
static dREAL * lambda
Definition SD.h:379
static size_t MaxRND
Definition SD.h:376
static dREAL hjRHO
Definition SD.h:380
static dREAL err_min
Definition SD.h:375
string suffix
Definition SD.h:336
const ExFormat & operator<<(const T &v) const
Definition SD.h:340
string MQuote
Definition SD.h:338
numerical integrator using HCubatureMP
Definition SD.h:205
static int Wrapper(unsigned int xdim, size_t npts, const mpREAL *x, void *fdata, unsigned int ydim, mpREAL *y)
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
virtual ex Integrate(size_t n=0) override
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
Definition SD.h:208
unsigned int Threads
Definition SD.h:216
PrintHookerType PrintHooker
Definition SD.h:211
numerical integrator using HCubature
Definition SD.h:167
virtual ex Integrate(size_t n=0) override
static void DefaultPrintHooker(qREAL *, qREAL *, size_t *, void *)
PrintHookerType PrintHooker
Definition SD.h:175
unsigned int Threads
Definition SD.h:189
static int Wrapper(unsigned int xdim, size_t npts, const qREAL *x, void *fdata, unsigned int ydim, qREAL *y)
Definition HCubature.cpp:34
void(* PrintHookerType)(qREAL *, qREAL *, size_t *, void *)
Definition SD.h:171
class to minimize a function using HookeJeeves
Definition SD.h:281
virtual void Minimize(int nvars, FunctionType func, dREAL *ip) override
virtual dREAL FindMinimum(int nvars, FunctionType func, dREAL *PL=NULL, dREAL *las=NULL, dREAL *UB=NULL, dREAL *LB=NULL, dREAL *IP=NULL, bool compare0=false, int TryPTS=0, int SavePTS=0) override
virtual void ForceStop() override
base for numerical integrator
Definition SD.h:132
SDMP_Type IntegrandMP
Definition SD.h:145
const dREAL * dParameter
Definition SD.h:147
qREAL(* FT_Type)(const qREAL xx[], const qREAL pl[])
Definition SD.h:139
int(* SDD_Type)(const unsigned int xn, const dREAL x[], const unsigned int yn, dREAL y[], const dREAL pl[], const dREAL las[])
Definition SD.h:136
const dREAL * dLambda
Definition SD.h:146
const mpREAL * mpLambda
Definition SD.h:150
int(* SDQ_Type)(const unsigned int xn, const qREAL x[], const unsigned int yn, qREAL y[], const qREAL pl[], const qREAL las[])
Definition SD.h:137
const qREAL * qParameter
Definition SD.h:149
virtual ~IntegratorBase()
Definition SD.h:134
virtual ex Integrate(size_t n=0)=0
int(* SDMP_Type)(const unsigned int xn, const mpREAL x[], const unsigned int yn, mpREAL y[], const mpREAL pl[], const mpREAL las[])
Definition SD.h:138
const mpREAL * mpParameter
Definition SD.h:151
const qREAL * qLambda
Definition SD.h:148
base for class to minimize a function
Definition SD.h:269
virtual void Minimize(int nvars, FunctionType func, dREAL *ip)=0
virtual dREAL FindMinimum(int nvars, FunctionType func, dREAL *PL=NULL, dREAL *las=NULL, dREAL *UB=NULL, dREAL *LB=NULL, dREAL *IP=NULL, bool compare0=false, int TryPTS=0, int SavePTS=0)=0
dREAL(* FunctionType)(int nvars, dREAL *x, dREAL *pl, dREAL *las)
Definition SD.h:271
virtual void ForceStop()=0
numerical integrator using TanhSinhMP
Definition SD.h:250
size_t nGK
Definition SD.h:259
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
Definition QuadMP.cpp:112
size_t mGK
Definition SD.h:260
static int Wrapper(unsigned yn, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata)
Definition QuadMP.cpp:95
QuadMP(size_t m)
Definition SD.h:258
virtual ex Integrate(size_t n=0) override
Definition QuadMP.cpp:157
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
Definition SD.h:253
PrintHookerType PrintHooker
Definition SD.h:256
base class of SecDec
Definition SD.h:94
virtual ~SecDecBase()
Definition SD.h:96
bool use_XMonomials
Definition SD.h:99
static bool VerifySD(vector< exmap > vmap, bool quick=true)
Verify the Sector Decompostion is valid.
Definition SecDec.cpp:88
virtual vector< exmap > x2y(const ex &xpol)=0
static ex XMonomials(const ex &expr)
XMonomials.
Definition SecDec.cpp:18
SecDec by geometric method.
Definition SD.h:107
vector< exmap > x2y(const ex &xpol) override
Definition SecDecG.cpp:393
static vector< vector< int > > RunQHull(const matrix &pts)
Definition SecDecG.cpp:176
SecDec the main class to use Sector Decompostion method.
Definition SD.h:414
size_t LambdaSplit
Definition SD.h:453
exvector expResult
Definition SD.h:429
void KillPowers(int bits=1+2)
Kill Powers will call KillPowerD or KillPower.
exmap nReplacement
Definition SD.h:426
void VEPrint(bool endlQ=true)
Definition Helpers.cpp:229
bool IsBad(ex f, vector< exmap > vmap)
Check the x-END.
Definition SecDec.cpp:174
bool use_ErrMin
Definition SD.h:436
dREAL CTryRRatio
Definition SD.h:459
qREAL IntLaMax
Definition SD.h:454
map< int, numeric > Parameter
Definition SD.h:445
static bool VerifySD(vector< exmap > vmap, bool quick=true)
Definition SecDec.cpp:123
dREAL CTLaMax
Definition SD.h:449
static ex PExpand(ex xpol, bool delta=true)
PExpand from asy2.1.1.m.
Definition AsyMB.cpp:39
qREAL EpsAbs
Definition SD.h:462
MinimizeBase * Minimizer
Definition SD.h:432
void Contours(const string &key="", const string &pkey="")
Contours, note that here we need to provide the specific Parameter.
Definition Contours.cpp:17
bool save_las
Definition SD.h:438
IntegratorBase * Integrator
Definition SD.h:431
exvector AutoEnd(ex po_ex)
Auto BiSection.
Definition SecDec.cpp:223
bool use_XReOrders
Definition SD.h:441
static bool use_dlclose
Definition SD.h:417
void Initialize(FeynmanParameter fpi)
Definition InitEval.cpp:28
static lst XRefined_lst(ex const &ft)
Definition Helpers.cpp:405
bool use_Normalizes
Definition SD.h:440
static int PRank(matrix m)
PRank from FIESTA.
Definition AsyMB.cpp:17
static ex XRefined(ex const &ft)
Definition Helpers.cpp:382
static ex PrefactorFIESTA(int nLoop)
Definition Helpers.cpp:374
static string cpp
Definition SD.h:418
bool vs_before_ep
Definition SD.h:423
exvector FunExp
Definition SD.h:427
void Integrates(const string &key="", const string &pkey="", int kid=0)
Contours, note that here we need to provide the specific Parameter.
bool disable_Contour
Definition SD.h:425
static ex ContinuousWRA(ex expr_in, int nc=15)
ContinuousWRA, note that here we need to provide the specific Parameter.
void ReIntegrates(const string &key, const string &pkey, qREAL err)
Contours, note that here we need to provide the specific Parameter.
bool CheckEnd
Definition SD.h:435
void Evaluate(FeynmanParameter fpi, const string &key="")
Definition InitEval.cpp:525
int PoleRequested
Definition SD.h:422
size_t CTryI
Definition SD.h:458
bool use_XMonomials
Definition SD.h:424
void BiSection(ex xi, ex x0)
Definition SecDec.cpp:1046
exvector Integrands
Definition SD.h:428
void CIPrepares(const string &key="")
Prepare for the Contours and Integrates calls .so will be generated, for more detailed exported funct...
lst BisectionPoints
Definition SD.h:443
numerical integrator using TanhSinhMP
Definition SD.h:234
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
PrintHookerType PrintHooker
Definition SD.h:240
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
Definition SD.h:237
virtual ex Integrate(size_t n=0) override
static int Wrapper(unsigned ydim, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata)
class for Common SubExpression Parser
Definition SD.h:519
ex Parse(ex expr, bool reset=true)
Definition cseParser.cpp:13
vector< pair< int, ex > > os()
Definition cseParser.cpp:11
ex Parse(ex expr)
Definition SD.h:534
const vector< pair< int, ex > > & vs()
Definition cseParser.cpp:55
namespace for Numerical integration with Sector Decomposition method
Definition AsyMB.cpp:10
vector< matrix > Triangularize(const lst &fs_in, const ex &xs_in, const lst &nsubs={})
to Triangularize the domain with each xi from 0 to +infinity
ex FactorOutX(const ex expr)
Definition Helpers.cpp:278
exvector get_z_from(ex pol)
Definition Helpers.cpp:59
exvector get_xy_from(ex pol)
Definition Helpers.cpp:14
ex xyz_pow_simplify(const ex expr_in)
Definition Helpers.cpp:349
ex exp_simplify(const ex expr_in)
Definition Helpers.cpp:315
int x_free_index(ex expr)
Definition Helpers.cpp:165
complex< dREAL > dCOMPLEX
Definition SD.h:123
int vsRank(ex expr_in)
Definition Helpers.cpp:211
__float128 qREAL
Definition SD.h:124
ex VEResult(ex expr)
Definition Helpers.cpp:123
ex FactorFT(const ex &expr)
Definition Helpers.cpp:302
long double dREAL
Definition SD.h:122
int VEO_Digits
Definition Init.cpp:182
ex VESimplify(ex expr)
Definition Helpers.cpp:92
ex VEMaxErr(ex expr)
Definition Helpers.cpp:131
complex< mpREAL > mpCOMPLEX
Definition SD.h:127
exvector get_pl_from(ex pol)
Definition Helpers.cpp:74
exvector get_y_from(ex pol)
Definition Helpers.cpp:44
exvector get_x_from(ex pol)
Definition Helpers.cpp:29
int y_free_index(ex expr)
Definition Helpers.cpp:180
__complex128 qCOMPLEX
Definition SD.h:125
mpfr::mpreal mpREAL
Definition SD.h:126
int epsRank(ex expr_in, ex epi)
Definition Helpers.cpp:195
ex Factor(const ex expr_in)
Definition Helpers.cpp:244
ex VEResult2(ex expr)
Definition Helpers.cpp:127
ex pow_simplify(const ex expr_in)
Definition Helpers.cpp:330
HepLib namespace.
Definition BASIC.cpp:17
const Symbol ep
const Symbol eps
wrap parameters for loop integrals
Definition SD.h:67
wrap parameters for generic parameter integrals
Definition SD.h:83
exmap nReplacement
Definition SD.h:86