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
28extern mpfr::mpreal mpPi, mpEuler;
29extern std::complex<mpfr::mpreal> mpiEpsilon;
30
31namespace HepLib::SD {
32
33 using namespace HepLib;
34
35 /*-----------------------------------------------------*/
36 // Global Functions
37 /*-----------------------------------------------------*/
38 exvector get_xy_from(ex pol);
39 exvector get_x_from(ex pol);
40 exvector get_y_from(ex pol);
41 exvector get_z_from(ex pol);
42 exvector get_pl_from(ex pol);
43 int epsRank(ex,ex);
44 int vsRank(ex);
45 int x_free_index(ex expr);
46 int y_free_index(ex expr);
47 ex Factor(const ex expr);
48 ex FactorOutX(const ex expr);
49 ex FactorFT(const ex & expr);
50 ex exp_simplify(const ex);
51 ex pow_simplify(const ex);
52 ex xyz_pow_simplify(const ex expr);
53
54 /*-----------------------------------------------------*/
55 // Customized GiNaC Function
56 /*-----------------------------------------------------*/
57 DECLARE_FUNCTION_1P(fabs)
58 DECLARE_FUNCTION_1P(PL)
59 DECLARE_FUNCTION_1P(CT)
60 DECLARE_FUNCTION_2P(FTX)
61 DECLARE_FUNCTION_2P(VE)
62 DECLARE_FUNCTION_2P(VEO)
63 DECLARE_FUNCTION_2P(VEO2)
64 DECLARE_FUNCTION_2P(CV) // not used internally, for user use only
65 DECLARE_FUNCTION_1P(WRA) // for wick rotation
66 extern int VEO_Digits;
67
79 ex Prefactor = 1;
80 bool isQuasi = false;
81 bool isAsy = false;
82 };
83
87 struct XIntegrand {
91 lst Deltas;
92 bool isAsy = false;
93 };
94
98 class SecDecBase {
99 public:
100 virtual ~SecDecBase() { }
101 virtual vector<exmap> x2y(const ex &xpol) =0;
102 vector<exmap> x2y(const lst &xpols);
104 static bool VerifySD(vector<exmap> vmap, bool quick = true);
105 static ex XMonomials(const ex & expr);
106 };
107
111 class SecDecG : public SecDecBase {
112 public:
113 vector<exmap> x2y(const ex &xpol) override;
114 static vector<vector<int>> RunQHull(const matrix &pts);
115 private:
116 vector<matrix> ZeroFaces(const matrix &pts);
117 matrix NormalVectors(const vector<matrix> &zfs);
118 matrix DualCone(const matrix &pts);
119 vector<matrix> SimplexCones(matrix pts);
120 };
121
122 /*-----------------------------------------------------*/
123 // Integrator Classes
124 /*-----------------------------------------------------*/
125
126 typedef long double dREAL;
127 typedef complex<dREAL> dCOMPLEX;
128 typedef __float128 qREAL;
129 typedef __complex128 qCOMPLEX;
130 typedef mpfr::mpreal mpREAL;
131 typedef complex<mpREAL> mpCOMPLEX;
132
137 public:
138 virtual ~IntegratorBase() { }
139
140 typedef int (*SDD_Type) (const unsigned int xn, const dREAL x[], const unsigned int yn, dREAL y[], const dREAL pl[], const dREAL las[]);
141 typedef int (*SDQ_Type) (const unsigned int xn, const qREAL x[], const unsigned int yn, qREAL y[], const qREAL pl[], const qREAL las[]);
142 typedef int (*SDMP_Type) (const unsigned int xn, const mpREAL x[], const unsigned int yn, mpREAL y[], const mpREAL pl[], const mpREAL las[]);
143 typedef qREAL (*FT_Type) (const qREAL xx[], const qREAL pl[]);
144 virtual ex Integrate(size_t n=0) =0;
145
146 FT_Type FT = NULL;
156 int XDim;
157 int YDim = 2;
158
159 qREAL EpsAbs = 1E-5;
161 int ReIm = 3; // 1-Re, 2-Im, 3-ReIm
162 int MPDigits = 64;
163 size_t NEval = 0;
164 protected:
165 time_t StartTimer; // used internally
166 size_t RunTime = 0;
167 };
168
172 class HCubature : public IntegratorBase {
173 public:
174 static int Wrapper(unsigned int xdim, size_t npts, const qREAL *x, void *fdata, unsigned int ydim, qREAL *y);
175
176 typedef void (*PrintHookerType) (qREAL*, qREAL*, size_t *, void *);
177
178 virtual ex Integrate(size_t n=0) override;
179 static void DefaultPrintHooker(qREAL*, qREAL*, size_t *, void*);
181 bool use_last = false;
182
183 int DQMP = 0;
184 int QXDim = 0;
185 int MPXDim = 0;
186 qREAL QXLimit = 1E-6Q;
190 size_t RunMAX = 100;
191 size_t RunPTS = 100000;
192 size_t MinPTS = 0;
193 size_t MaxPTS; // used internally
194 unsigned int Threads = 0;
195 private:
196 int NANMax = 250;
197 int nNAN = 0;
198 size_t lastNRUN = 0;
199 vector<qREAL> LastResult;
200 vector<qREAL> LastAbsErr;
201 int lastnNAN = 0;
202 int LastState = 0;
203
204 int XDQMP(qREAL const *x);
205 };
206
211 public:
212 static int Wrapper(unsigned int xdim, size_t npts, const mpREAL *x, void *fdata, unsigned int ydim, mpREAL *y);
213 typedef void (*PrintHookerType) (mpREAL*, mpREAL*, size_t *, void *);
214 virtual ex Integrate(size_t n=0) override;
215 static void DefaultPrintHooker(mpREAL*, mpREAL*, size_t *, void*);
217 size_t RunMAX = 100;
218 size_t RunPTS = 100000;
219 size_t MinPTS = 0;
220 size_t MaxPTS; // used internally
221 unsigned int Threads = 0;
222 private:
223 ex mp2ex(const mpREAL & num);
224 int NANMax = 250;
225 int nNAN = 0;
226 bool use_last = false;
227 size_t lastNRUN = 0;
228 vector<mpREAL> LastResult;
229 vector<mpREAL> LastAbsErr;
230 int lastnNAN = 0;
231 int LastState = 0;
232 };
233
237 class TanhSinhMP : public IntegratorBase {
238 public:
239 static int Wrapper(unsigned ydim, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata);
240 typedef void (*PrintHookerType) (mpREAL *, mpREAL *, size_t *, void *);
241 virtual ex Integrate(size_t n=0) override;
242 static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *);
244 TanhSinhMP(size_t k=10);
245 private:
246 ex mp2ex(const mpREAL & num);
247 size_t K = 10;
248 };
249
253 class QuadMP : public IntegratorBase {
254 public:
255 static int Wrapper(unsigned yn, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata);
256 typedef void (*PrintHookerType) (mpREAL*, mpREAL*, size_t *, void *);
257 virtual ex Integrate(size_t n=0) override;
258 static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *);
260 QuadMP() { }
261 QuadMP(size_t m) : mGK(m) { }
262 size_t nGK = 100;
263 size_t mGK = 10;
264 private:
265 ex mp2ex(const mpREAL & num);
266 };
267
271 class QuadMP_vec : public IntegratorBase {
272 public:
273 static int Wrapper(unsigned yn, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata);
274 typedef void (*PrintHookerType) (mpREAL*, mpREAL*, size_t *, void *);
275 virtual ex Integrate(size_t n=0) override;
276 static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *);
279 QuadMP_vec(size_t m) : mGK(m) { }
280 size_t nGK = 100;
281 size_t mGK = 10;
282 private:
283 ex mp2ex(const mpREAL & num);
284 };
285
286 typedef long double dREAL;
291 public:
292 typedef dREAL (*FunctionType)(int nvars, dREAL* x, dREAL* pl, dREAL *las);
293 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;
294 dREAL ZeroValue = -1E-20;
295 virtual void Minimize(int nvars, FunctionType func, dREAL *ip)=0;
296 virtual void ForceStop()=0;
297 };
298
302 class HookeJeeves : public MinimizeBase {
303 public:
304 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;
305 bool Exit = false;
306 virtual void Minimize(int nvars, FunctionType func, dREAL *ip) override;
307 virtual void ForceStop() override;
308
309 private:
310 dREAL best_nearby(dREAL* delta, dREAL* point, dREAL prevbest, int nvars);
311 int hooke(int nvars, dREAL* startpt, dREAL* endpt, dREAL rho, dREAL epsilon, int itermax);
312 dREAL ObjectWrapper(int nvars, dREAL* x);
313 FunctionType ObjectFunction;
314 dREAL UpperBound[50];
315 dREAL LowerBound[50];
316 dREAL *PL;
317 dREAL *LAS;
318 };
319
323 class CppFormat : public print_csrc_cl_N {
324 GINAC_DECLARE_PRINT_CONTEXT(CppFormat, print_csrc_cl_N)
325 public:
326 CppFormat(ostream &os, const string & s = "L", unsigned opt = 0);
327 string suffix;
328 string MQuote = "\"";
329
330 template<class T> const CppFormat & operator << (const T & v) const {
331 s << v;
332 return *this;
333 };
334 const CppFormat & operator << (const basic & v) const;
335 const CppFormat & operator << (const ex & v) const;
336 const CppFormat & operator << (const lst & v) const;
337 const CppFormat & operator<<(std::ostream& (*v)(std::ostream&)) const;
338
339 #ifndef DOXYGEN_SKIP
340 class _init {
341 public: _init();
342 };
343 #endif
344 private:
345 #ifndef DOXYGEN_SKIP
346 static _init CppFormat_init;
347 #endif
348 static void print_integer(const CppFormat & c, const cln::cl_I & x);
349 static void print_real(const CppFormat & c, const cln::cl_R & x);
350 static void print_numeric(const numeric & p, const CppFormat & c, unsigned level);
351 };
352
353 class ExFormat : public print_dflt {
354 GINAC_DECLARE_PRINT_CONTEXT(ExFormat, print_dflt)
355 public:
356 ExFormat(ostream &os, const string & s = "L", unsigned opt = 0);
357 string suffix;
358 string type = "ex";
359 string MQuote = "\"";
360
361 template<class T> const ExFormat & operator << (const T & v) const {
362 s << v;
363 return *this;
364 };
365 const ExFormat & operator << (const basic & v) const;
366 const ExFormat & operator << (const ex & v) const;
367 const ExFormat & operator << (const lst & v) const;
368 const ExFormat & operator<<(std::ostream& (*v)(std::ostream&)) const;
369
370 class _init {
371 public: _init();
372 };
373 private:
374 static _init ExFormat_init;
375 static void print_integer(const ExFormat & c, const cln::cl_I & x);
376 static void print_real(const ExFormat & c, const cln::cl_R & x);
377 static void print_numeric(const numeric & p, const ExFormat & c, unsigned level);
378 };
379
380 /*-----------------------------------------------------*/
381 // VE
382 /*-----------------------------------------------------*/
383 ex VESimplify(ex expr);
384 ex VEResult(ex expr);
385 ex VEResult2(ex expr); // keep two digits in error
386 ex VEMaxErr(ex expr);
387
391 class ErrMin {
392 public:
394 static qREAL *paras;
397 static size_t MaxRND;
398 static size_t RunRND;
400 static dREAL *lambda;
401 static dREAL hjRHO;
402 static ex lastResErr;
403 static dREAL IntError(int nvars, dREAL *las, dREAL *n1, dREAL *n2);
404 };
405
409 class ChengWu {
410 public:
411 static bool isProjective(const ex fe, const ex delta);
412 static void Projectivize(ex &fe, const ex delta, const ex xsum=0);
413 static void Scalelize(ex &fe, const lst xs, const ex cy);
414 static void Scalelize(ex &fe, const ex xi, const ex cy);
415 static exvector Binarize(ex const fe, ex const eqn);
416 static void Binarize(ex const fe, ex const eqn, exvector & ovec);
417 static bool isLinearizable(const ex ft, const ex delta, lst & xcs);
418 static void Linearize(const lst xcs, ex & fe, ex & ft);
419 static bool isPartilizable(const ex ft, const ex delta, lst &xcs, int mode=0);
420 static void Partilize(const lst xcs, const lst delta, const ex fe, exvector & ret_lst);
421
422 static exvector Evaluate(const ex & fe);
423 static exvector WickRotation(const exvector & fe_vec);
424 static exvector Apply(const exvector & fe_vec, const ex & ft=0);
425 inline static exvector Apply(const ex & fe, const ex & ft=0) {
426 exvector fe_vec;
427 fe_vec.push_back(fe);
428 return Apply(fe_vec, ft);
429 }
430 };
431
435 class SecDec {
436
437 public:
438 static bool use_dlclose;
439 static string cpp;
440
441 lst eps_lst = { lst{eps,0}, lst{ep,0} }; // { {epi, epiN}, ... }
442 int vsN = 0;
444 bool vs_before_ep = false;
445 bool use_XMonomials = true;
446 bool disable_Contour = false;
448 exvector FunExp; // each item : { {f1,f2,...}, {n1,n2,...}, { delta_list1, delta_list2 } }
449 exvector Integrands;
450 exvector expResult;
455 bool IsZero = false;
456 bool CheckEnd = false;
457 bool use_ErrMin = false;
458 bool use_las = false;
459 bool save_las = false;
460 int IBF = 0; // 0 - not use IBF
461 bool use_Normalizes = true;
462 bool use_XReOrders = false;
463 int MPDigits = 0; // digits in mpREAL for MP
464 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 };
465
466 map<int, numeric> Parameter; // used Contours and Integrates, use PL in Prepares part
467
468 // used in Contours
469 bool CTMaxF = true;
470 dREAL CTLaMax = 10; // CTLaMax<0 for explict REAL mode
471 int CTTryPTS = 3;
472 int CTSavePTS = 3;
473
474 size_t LambdaSplit = 5;
476 int CTryM = 1; // try lambda in Middle
477 int CTryL = 1; // try lambda in Left
478 int CTryR = 1; // try lambda in Right
479 size_t CTryI = 10000; // integrator limit in CTry
481 int soLimit = 10000;
482
483 qREAL EpsAbs = 1E-4;
484 int ReIm = 3; // 1-Re, 2-Im, 3-ReIm
485
487 void Initialize(XIntegrand xint);
488 void BiSection(ex xi, ex x0);
489 void Normalizes();
490 void Scalelesses();
491 void SDPrepares();
492 void EpsExpands();
493 void RemoveDeltas();
494 void XReOrders();
495 void XTogethers();
496 void XExpands();
497 void Evaluate(const string & key="");
498 void KillPowers(int bits=1+2);
499 bool IsBad(ex f, vector<exmap> vmap);
500 exvector AutoEnd(ex po_ex);
501 void CIPrepares(const string & key = "");
502 void Contours(const string & key = "", const string & pkey = "");
503 void Integrates(const string & key="", const string & pkey="", int kid=0);
504 void ReIntegrates(const string & key, const string & pkey, qREAL err);
505 void Evaluate(FeynmanParameter fpi, const string & key = "");
506 void Evaluate(XIntegrand xint, const string & key = "");
507 void Evaluate(const exvector & FunExp, const string & key = "");
508 void MB();
509 void XEnd();
510 void ChengWu(const ex & ft=0);
511
512 static bool VerifySD(vector<exmap> vmap, bool quick = true);
513 static ex XRefined(ex const & ft);
514 static lst XRefined_lst(ex const & ft);
515 static ex PrefactorFIESTA(int nLoop);
516 ex VEResult(const ex & chop_err = 0);
517 void VEPrint(bool endlQ=true);
518 static ex PExpand(ex xpol, bool delta=true);
519 static int PRank(matrix m);
520 static ex ContinuousWRA(ex expr_in, int nc=15);
521
522 ~SecDec();
523
524 private:
525 exvector DS(const ex po_ex);
526 lst Normalize(const ex &input);
527 void DoAsy();
528 bool KillPowerD(ex fe, int kpi);
529 bool KillPower(ex fe, int kpi, int bits);
530
531 void CompileMatDet();
532 vector<lst> ciResult;
533 lst FT_N_XN; // list of { ft, n, xn }
534 exmap LambdaMap;
535
536 };
537
541 class cseParser {
542 public:
543 ex Parse(ex expr, bool reset=true);
544 string oc = "o";
545 int on();
546 vector<pair<int, ex>> os();
547 private:
548 map<ex, ex, ex_is_less> ex_var_map;
549 int no = 0;
550 vector<pair<int, ex>> o_ex_vec;
551 map<int, int> used;
552 };
553
554 class cse_Parser { // just a bit try
555 public:
556 ex Parse(ex expr) { return Parse(expr, true); }
557 string v = "v";
558 int vn();
559 const vector<pair<int,ex>> & vs();
560 private:
561 ex Parse(ex expr, bool reset);
562 map<ex, int, ex_is_less> exn;
563 int no = 0;
564 exvector exv;
565 map<int, int> used;
566 vector<pair<int,ex>> on_ex_vec;
567 };
568
569 vector<matrix> Triangularize(const lst & fs_in, const ex & xs_in, const lst & nsubs={});
570 void Triangularize(exvector & FunExp, const lst & fs_in, const ex & xs_in, const lst & nsubs={});
571
572 inline void set_mpfr_prec(int prec) {
573 mpfr_free_cache();
574 auto pbit = mpfr::digits2bits(prec);
575 if(mpfr::mpreal::get_default_prec()!=pbit) mpfr::mpreal::set_default_prec(pbit);
576 mpPi = mpfr::const_pi();
577 mpEuler = mpfr::const_euler();
578 mpiEpsilon = complex<mpREAL>(0,mpfr::machine_epsilon()*100);
579 }
580}
581
582
Basic header file.
mpREAL mpEuler
Definition SD.h:28
mpCOMPLEX mpiEpsilon
mpREAL mpPi
mpfr::mpreal mpEuler
Definition SD.h:28
mpfr::mpreal mpPi
namespace for Numerical integration with Sector Decomposition method
std::complex< mpfr::mpreal > mpiEpsilon
class to manipulate with Cheng-Wu theorem
Definition SD.h:409
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:425
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:323
const CppFormat & operator<<(const T &v) const
Definition SD.h:330
ErrMin with HookeJeeves.
Definition SD.h:391
static ex lastResErr
Definition SD.h:402
static IntegratorBase * Integrator
Definition SD.h:393
static size_t RunRND
Definition SD.h:398
static dREAL err_max
Definition SD.h:395
static MinimizeBase * miner
Definition SD.h:399
static qREAL * paras
Definition SD.h:394
static dREAL IntError(int nvars, dREAL *las, dREAL *n1, dREAL *n2)
Definition ErrMin.cpp:22
static dREAL * lambda
Definition SD.h:400
static size_t MaxRND
Definition SD.h:397
static dREAL hjRHO
Definition SD.h:401
static dREAL err_min
Definition SD.h:396
string suffix
Definition SD.h:357
const ExFormat & operator<<(const T &v) const
Definition SD.h:361
string MQuote
Definition SD.h:359
numerical integrator using HCubatureMP
Definition SD.h:210
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:213
unsigned int Threads
Definition SD.h:221
PrintHookerType PrintHooker
Definition SD.h:216
numerical integrator using HCubature
Definition SD.h:172
virtual ex Integrate(size_t n=0) override
static void DefaultPrintHooker(qREAL *, qREAL *, size_t *, void *)
PrintHookerType PrintHooker
Definition SD.h:180
unsigned int Threads
Definition SD.h:194
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:176
class to minimize a function using HookeJeeves
Definition SD.h:302
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:136
SDMP_Type IntegrandMP
Definition SD.h:149
const dREAL * dParameter
Definition SD.h:151
qREAL(* FT_Type)(const qREAL xx[], const qREAL pl[])
Definition SD.h:143
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:140
const dREAL * dLambda
Definition SD.h:150
const mpREAL * mpLambda
Definition SD.h:154
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:141
const qREAL * qParameter
Definition SD.h:153
virtual ~IntegratorBase()
Definition SD.h:138
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:142
const mpREAL * mpParameter
Definition SD.h:155
const qREAL * qLambda
Definition SD.h:152
base for class to minimize a function
Definition SD.h:290
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:292
virtual void ForceStop()=0
almost the same as QuadMP, using vector to avoid stack overflow for large dimension in Y
Definition SD.h:271
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
Definition SD.h:274
PrintHookerType PrintHooker
Definition SD.h:277
QuadMP_vec(size_t m)
Definition SD.h:279
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
virtual ex Integrate(size_t n=0) override
static int Wrapper(unsigned yn, mpREAL *y, mpREAL *e, unsigned xdim, const mpREAL *x, void *fdata)
numerical integrator using QuadMP
Definition SD.h:253
size_t nGK
Definition SD.h:262
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
Definition QuadMP.cpp:112
size_t mGK
Definition SD.h:263
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:261
virtual ex Integrate(size_t n=0) override
Definition QuadMP.cpp:174
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
Definition SD.h:256
PrintHookerType PrintHooker
Definition SD.h:259
base class of SecDec
Definition SD.h:98
virtual ~SecDecBase()
Definition SD.h:100
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:111
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:435
size_t LambdaSplit
Definition SD.h:474
exvector expResult
Definition SD.h:450
void KillPowers(int bits=1+2)
Kill Powers will call KillPowerD or KillPower.
exmap nReplacement
Definition SD.h:447
void VEPrint(bool endlQ=true)
Definition Helpers.cpp:242
bool IsBad(ex f, vector< exmap > vmap)
Check the x-END.
Definition SecDec.cpp:174
bool use_ErrMin
Definition SD.h:457
dREAL CTryRRatio
Definition SD.h:480
qREAL IntLaMax
Definition SD.h:475
void Evaluate(const string &key="")
Definition InitEval.cpp:569
map< int, numeric > Parameter
Definition SD.h:466
static bool VerifySD(vector< exmap > vmap, bool quick=true)
Definition SecDec.cpp:123
dREAL CTLaMax
Definition SD.h:470
static ex PExpand(ex xpol, bool delta=true)
PExpand from asy2.1.1.m.
Definition AsyMB.cpp:39
qREAL EpsAbs
Definition SD.h:483
MinimizeBase * Minimizer
Definition SD.h:453
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:459
IntegratorBase * Integrator
Definition SD.h:452
exvector AutoEnd(ex po_ex)
Auto BiSection.
Definition SecDec.cpp:223
bool use_XReOrders
Definition SD.h:462
static bool use_dlclose
Definition SD.h:438
void Initialize(FeynmanParameter fpi)
Definition InitEval.cpp:28
static lst XRefined_lst(ex const &ft)
Definition Helpers.cpp:418
bool use_Normalizes
Definition SD.h:461
static int PRank(matrix m)
PRank from FIESTA.
Definition AsyMB.cpp:17
static ex XRefined(ex const &ft)
Definition Helpers.cpp:395
static ex PrefactorFIESTA(int nLoop)
Definition Helpers.cpp:387
static string cpp
Definition SD.h:439
bool vs_before_ep
Definition SD.h:444
exvector FunExp
Definition SD.h:448
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:446
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:456
int PoleRequested
Definition SD.h:443
size_t CTryI
Definition SD.h:479
bool use_XMonomials
Definition SD.h:445
void BiSection(ex xi, ex x0)
Definition SecDec.cpp:1046
exvector Integrands
Definition SD.h:449
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:464
ex VEResult(const ex &chop_err=0)
Definition Helpers.cpp:225
numerical integrator using TanhSinhMP
Definition SD.h:237
static void DefaultPrintHooker(mpREAL *, mpREAL *, size_t *, void *)
PrintHookerType PrintHooker
Definition SD.h:243
void(* PrintHookerType)(mpREAL *, mpREAL *, size_t *, void *)
Definition SD.h:240
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:541
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:556
const vector< pair< int, ex > > & vs()
Definition cseParser.cpp:55
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:291
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:362
ex exp_simplify(const ex expr_in)
Definition Helpers.cpp:328
int x_free_index(ex expr)
Definition Helpers.cpp:165
complex< dREAL > dCOMPLEX
Definition SD.h:127
int vsRank(ex expr_in)
Definition Helpers.cpp:211
__float128 qREAL
Definition SD.h:128
ex VEResult(ex expr)
Definition Helpers.cpp:123
ex FactorFT(const ex &expr)
Definition Helpers.cpp:315
long double dREAL
Definition SD.h:126
int VEO_Digits
Definition Init.cpp:186
ex VESimplify(ex expr)
Definition Helpers.cpp:92
ex VEMaxErr(ex expr)
Definition Helpers.cpp:131
complex< mpREAL > mpCOMPLEX
Definition SD.h:131
exvector get_pl_from(ex pol)
Definition Helpers.cpp:74
exvector get_y_from(ex pol)
Definition Helpers.cpp:44
void set_mpfr_prec(int prec)
Definition SD.h:572
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:129
mpfr::mpreal mpREAL
Definition SD.h:130
int epsRank(ex expr_in, ex epi)
Definition Helpers.cpp:195
ex Factor(const ex expr_in)
Definition Helpers.cpp:257
ex VEResult2(ex expr)
Definition Helpers.cpp:127
ex pow_simplify(const ex expr_in)
Definition Helpers.cpp:343
HepLib namespace.
Definition BASIC.cpp:17
const Symbol ep
const Symbol eps
wrap parameters for loop integrals
Definition SD.h:71
wrap parameters for generic parameter integrals
Definition SD.h:87
exmap nReplacement
Definition SD.h:90