HepLib
Namespaces | Classes | Typedefs | Functions | Variables
HepLib Namespace Reference

HepLib namespace. More...

Namespaces

 QGRAF
 namespace for generating Feynman diagrams or amplitudes.
 
 SD
 namespace for Numerical integration with Sector Decomposition method
 

Classes

class  Symbol
 class extended to GiNaC symbol class, represent a positive symbol More...
 
class  iSymbol
 class extended to GiNaC symbol class, pure imaginary symbol More...
 
class  Error
 class used to wrap error message More...
 
class  lstHelper
 class as lst Helper More...
 
class  MapFunction
 class to wrap map_function of GiNaC More...
 
class  Parser
 class to parse for string or file, helpful with Symbol class More...
 
class  XIntegral
 XIntegral Class, preface to SecDec. More...
 
class  Fermat
 interface to communicate with Fermat program More...
 
class  Form
 interface to communicate with Form program More...
 
class  MMAFormat
 class for Mathematica Format Output More...
 
class  Server
 
class  FormFormat
 class for FormFormat Output More...
 
class  FCFormat
 class for FCFormat Output More...
 
class  Index
 class for index object More...
 
class  Vector
 class for vector object More...
 
class  SUNT
 class for SUNT object More...
 
class  SUNF
 class for SUNF object More...
 
class  SUNF4
 class for SUNF4 object More...
 
class  Pair
 class for Pair object More...
 
class  Eps
 class for Levi-Civita object https://onlinelibrary.wiley.com/doi/pdf/10.1002/9783527630097.app3 to make Tr(g5, g1, g2, g3, g4) is the same in both HepLib & FORM, require that Eps(a,b,c,d) = i_ * e_(a,b,c,d) (we use the convention as in FeynCalc, Tr[5,a,b,c,d]=(- i) 4 Eps(a,b,c,d)=4 eps_(a,b,c,d)), and Eps^{0123}=+1, and g5=i g^{0123}=(-i) Eps(a,b,c,d) gamma(a,b,c,d)/4! Eps is real in HepLib, while e_ is imaginary in FORM. More...
 
class  DGamma
 class for Dirac Gamma object More...
 
struct  AIOption
 
class  IBP
 IBP base class for IBP reduction. More...
 
class  FIRE
 IBP reduction using FIRE program. More...
 
class  KIRA
 IBP reduction using KIRA program. More...
 
class  UKIRA
 IBP reduction using KIRA program with user-defined equations. More...
 
class  Direct
 IBP reduction using Direc method. More...
 
class  Laporta
 
class  Solver
 IBP reduction using Solver method. More...
 

Typedefs

typedef vector< pair< ex, ex > > epvec_t
 
typedef pair< ex, epvec_tco_epvec_t
 
typedef std::initializer_list< ex > init_list
 
typedef map< int, map< int, ex > > SparseMatrix
 

Functions

exvector GiNaC_Parallel (int ntotal, std::function< ex(int)> f, const string &key)
 GiNaC Parallel Evaluation using fork. More...
 
std::vector< std::string > split (const std::string &s, char delimiter)
 split the string into serveral part, separated by the delimiter More...
 
string now (bool use_date)
 date/time string More...
 
lst gather_symbols (const ex &e)
 get all symbols from input expression More...
 
lst gather_symbols (const exvector &ve)
 get all symbols from input expression More...
 
string RunOS (const string &cmd)
 run symtem command and return the output as string More...
 
void garRead (const string &garfn, map< string, ex > &resMap)
 garRead from file, and output in a map More...
 
ex garRead (const string &garfn, const char *key)
 garRead from file, only the element w.r.t. key More...
 
ex garRead (const string &garfn)
 garRead from file, only the element w.r.t. key "res", note inner check will be performed More...
 
void garWrite (const string &garfn, const map< string, ex > &resMap)
 garWrite to write the string-key map to the archive More...
 
void garWrite (const string &garfn, const ex &res)
 garWrite to write the expression to the archive, with key: "res", including a check key will be written More...
 
ex str2ex (const string &expr, symtab stab)
 convert string to ex expression, using Parser internally More...
 
ex str2ex (const string &expr)
 convert string to ex expression, using Parser internally More...
 
lst str2lst (const string &expr, symtab stab)
 convert string to the lst, using Parser internally More...
 
lst str2lst (const string &expr)
 convert string to the lst, using Parser internally More...
 
string ex2str (const ex &expr)
 convert ex to output string, the defalut printer format will be used More...
 
string ex2str (const exvector &expr)
 convert exvec to output string, the defalut printer format will be used More...
 
matrix lst2mat (const lst &ls)
 convert 2Dim lst to matrix More...
 
string ex2str (const exmap &expr)
 convert exmap to output string, the defalut printer format will be used More...
 
string ex2str (const exset &expr)
 convert exset to output string, the defalut printer format will be used More...
 
string file2str (string filename)
 read file content to string More...
 
void str2file (const string &ostr, string filename)
 export string to a file More...
 
void str2file (char *buff, FILE *fh)
 
vector< string > file2strvec (string filename, bool skip_empty)
 read file content to string vector More...
 
ex file2ex (string filename)
 read file content to ex More...
 
ex file2ex (string filename, symtab st)
 read file content to ex More...
 
void ex2file (const ex &expr, string filename)
 export expression file More...
 
void ex2file (string filename, const ex &expr)
 export expression file More...
 
ex q2ex (__float128 num)
 __float128 to ex More...
 
__float128 ex2q (ex num)
 ex of numeric to __float128 More...
 
int ex2int (ex num)
 ex to integer More...
 
lst vec2lst (const exvector &ev)
 convert exvector to lst More...
 
exvector lst2vec (const lst &alst)
 convert lst to exvector More...
 
lst add2lst (const ex &expr)
 convert add to lst More...
 
lst mul2lst (const ex &expr)
 convert mul to lst More...
 
lst xlst (int bi, int ei)
 return a lst: x(bi), x(bi+1), ..., x(ei) More...
 
lst xlst (int ei)
 return a lst: x(0), x(1), ..., x(ei) More...
 
ex series_ex (ex const &expr_in, ex const &s0, int sn0)
 the series like Mathematica, include s^n More...
 
ex series_ex (ex const &expr_in, symbol const &s0, int sn0)
 the series like Mathematica, include s^n More...
 
ex diff_ex (ex const expr, ex const xp, unsigned nth, bool expand)
 the differential like Mathematica More...
 
co_epvec_t power_expand_2 (const co_epvec_t &co_epv, int n)
 
pair< ex, epvec_tinner_expand_collect (ex const &expr_in, std::function< bool(const ex &)> has_func, int depth=0)
 
ex expand_ex (ex const &expr_in, std::function< bool(const ex &)> has_func)
 the expand like Mathematica More...
 
ex collect_ex (ex const &expr_in, std::function< bool(const ex &)> has_func, int opt)
 the collect function like Mathematica More...
 
lst collect_lst (ex const &expr_in, std::function< bool(const ex &)> has_func, int opt)
 the collect function like Mathematica, reture the lst { {c1,v1}, {c2,v2}, ... } More...
 
ex EvalF (ex expr)
 the nuerical evaluation, Digits=100 will be used More...
 
ex EvalL (ex expr)
 
ex EvalQ (ex expr)
 
ex EvalMP (ex expr)
 
ex NN (ex expr, int digits)
 the nuerical evaluation More...
 
bool xPositive (ex const expr)
 check the expr is xPositive, i.e., each x-monomial item is postive More...
 
int xSign (ex const expr)
 the always sign for expr More...
 
void let_op_append (ex &ex_in, const ex item)
 append item into expression More...
 
void let_op_prepend (ex &ex_in, const ex item)
 preppend item into expression More...
 
void let_op_remove_last (ex &ex_in)
 remove last from expression More...
 
void let_op_remove_first (ex &ex_in)
 remove first from expression More...
 
void let_op_append (ex &ex_in, int index, ex const item)
 append item into index-th of expression More...
 
void let_op_append (lst &ex_in, int index, ex const item)
 append item into index-th of expression More...
 
void let_op_append (ex &ex_in, int index1, int index2, ex const item)
 append item into index1-th.index2-th of expression More...
 
void let_op_append (lst &ex_in, int index1, int index2, ex const item)
 append item into index1-th.index2-th of expression More...
 
void let_op_prepend (ex &ex_in, int index, ex const item)
 prepend item into index-th of expression More...
 
void let_op_prepend (lst &ex_in, int index, ex const item)
 prepend item into index-th of expression More...
 
void let_op_prepend (ex &ex_in, int index1, int index2, ex const item)
 prepend item into index1-th.index2-th of expression More...
 
void let_op_prepend (lst &ex_in, int index1, int index2, ex const item)
 prepend item into index1-th.index2-th of expression More...
 
void let_op_remove_last (ex &ex_in, int index)
 remove the last in index-th of expression More...
 
void let_op_remove_last (lst &ex_in, int index)
 remove the last in index-th of expression More...
 
void let_op_remove_last (ex &ex_in, int index1, int index2)
 remove the last in index1-th.index2-th of expression More...
 
void let_op_remove_last (lst &ex_in, int index1, int index2)
 remove the last in index1-th.index2-th of expression More...
 
void let_op_remove_first (ex &ex_in, int index)
 remove the first in index-th of expression More...
 
void let_op_remove_first (lst &ex_in, int index)
 remove the first in index-th of expression More...
 
void let_op_remove_first (ex &ex_in, int index1, int index2)
 remove the first in index1-th.index2-th of expression More...
 
void let_op_remove_first (lst &ex_in, int index1, int index2)
 remove the first in index1-th.index2-th of expression More...
 
void let_op (ex &ex_in, int index1, int index2, const ex item)
 update index1-th.index2-th of expression with item More...
 
void let_op (lst &ex_in, int index1, int index2, const ex item)
 update index1-th.index2-th of expression with item More...
 
void let_op (ex &ex_in, int index1, int index2, int index3, const ex item)
 update index1-th.index2-th.index3-th of expression with item More...
 
void let_op (lst &ex_in, int index1, int index2, int index3, const ex item)
 update index1-th.index2-th.index3-th of expression with item More...
 
ex get_op (const ex ex_in, int index1, int index2)
 return index1-th.index2-th of expression More...
 
ex get_op (const lst ex_in, int index1, int index2)
 return index1-th.index2-th of expression More...
 
ex get_op (const ex ex_in, int index1, int index2, int index3)
 return index1-th.index2-th.index3-th of expression More...
 
ex get_op (const lst ex_in, int index1, int index2, int index3)
 return index1-th.index2-th.index3-th of expression More...
 
int CpuCores ()
 return the cpu cores using OpenMP More...
 
ex normal_fermat (const ex &expr, bool dfactor)
 return the normalizatied expression, using fermat_numer_denom More...
 
ex collect_factors (const ex &expr)
 a wrapper for collect_common_factors, catch errors More...
 
ex exfactor (const ex &expr, int opt)
 factorize a expression More...
 
ex exexpand (const ex &expr, int opt)
 factorize a expression More...
 
ex exnormal (const ex &expr, int opt)
 normalize a expression More...
 
ex exnd (const ex &expr, int opt)
 num_den a expression More...
 
ex form_eval (const ex &expr)
 
ex inner_factor_form (const ex &expr)
 
ex factor_form (const ex &expr, bool nd)
 factorize a expression using FORM More...
 
void garWrite (const exvector &exv, string garfn)
 
void garRead (exvector &exv, string garfn)
 
ex add_collect_normal (const exvector &exv, ex const &pats, int opt)
 
ex add_collect_normal (const exvector &exv, init_list const &pats, int opt)
 
ex add_collect_normal (const exvector &exv, lst const &pats, int opt)
 
ex add_collect_normal (const ex &e, ex const &pats, int opt)
 
ex add_collect_normal (const ex &e, lst const &pats, int opt)
 
ex add_collect_normal (const ex &e, init_list const &pats, int opt)
 
bool has_w (const ex &e)
 
void subs_w (exmap &repl)
 
void subs_w (lst &repl)
 
void ReShare (const ex &e)
 
void ReShare (const lst &es)
 
void ReShare (const ex &e1, const ex &e2)
 
void ReShare (const ex &e1, const ex &e2, const ex &e3)
 
void ReShare (const exvector &ev)
 
void ReShare (const exvector &ev1, const exvector &ev2)
 
ex nextprime (const ex &n)
 
ex nextprime (int n)
 
ex Rationalize (const ex &e, int dn)
 
void set_precision (long prec, bool push)
 
void reset_precision ()
 
long get_precision ()
 
void arg2map (int argc, char **argv, const char *optstring, std::map< char, std::string > &kv)
 
bool has_symbol (const ex &e)
 
ex subs (const ex &e, init_list sl)
 
bool has_any (ex expr, lst ps)
 
bool has_all (ex expr, lst ps)
 
bool is_equal_any (ex expr, lst ps)
 
bool match_any (ex expr, lst ps)
 
bool match_all (ex expr, lst ps)
 
vector< std::string > split (const string &s, char delimiter)
 
bool file_remove (string fn)
 
bool file_exists (string fn)
 
bool key_exists (const exmap &map, const ex &key)
 
bool dir_exists (string dir)
 
void garWrite (const map< string, ex > &resMap, const string &garfn)
 
void garWrite (const ex &res, const string &garfn)
 
string in2str (int i)
 
ex expand_ex (const ex &expr)
 
ex expand_ex (ex const &expr, lst const &pats)
 
ex expand_ex (ex const &expr, ex const &pat)
 
ex collect_ex (const ex &expr, init_list const &pats, int opt=o_none)
 
ex collect_ex (const ex &expr, lst const &pats, int opt=o_none)
 
ex collect_ex (const ex &expr, ex const &pat, int opt=o_none)
 
lst collect_lst (const ex &expr, init_list const &pats, int opt=o_none)
 
lst collect_lst (const ex &expr, lst const &pats, int opt=o_none)
 
lst collect_lst (const ex &expr, ex const &pat, int opt=o_none)
 
ex fermat_eval (const ex &expr)
 return the numerator and denominator after normalization More...
 
ex numer_denom_fermat (const ex &expr, bool dfactor)
 return the numerator and denominator after normalization More...
 
ex numer_fermat (const ex &expr)
 
ex fermat_numer_denom (const ex &expr, bool dfactor=false)
 
ex fermat_normal (const ex &expr, bool dfactor=false)
 
ex normal_flint (const ex &expr, int opt=o_flint)
 
ex factor_flint (const ex &e, bool nd=true)
 
ex form_factor (const ex &expr, bool nd=true)
 
std::function< GiNaC::function(const ex &)> GiNaC_Function_1 (const string name)
 
std::function< GiNaC::function(const ex &, const ex &)> GiNaC_Function_2 (const string name)
 
std::function< GiNaC::function(const ex &, const ex &, const ex &)> GiNaC_Function_3 (const string name)
 
std::function< GiNaC::function(const ex &, const ex &, const ex &, const ex &)> GiNaC_Function_4 (const string name)
 
bool isFunction (const ex &e, string func_name)
 
bool isFunction (const ex &e, string func_name, int nargs)
 
bool has_function (const ex &expr)
 
void PreTree (const ex &e, std::function< void(const ex &)> f)
 
void PostTree (const ex &e, std::function< void(const ex &)> f)
 
void string_replace_all (string &str, const string &from, const string &to)
 
void string_trim (string &str)
 
bool string_start_with (const string &fstr, const string &sstr)
 
bool string_end_with (const string &fstr, const string &estr)
 
bool string_contain (const string &fstr, const string &mstr)
 
void Combinations (int n, int m, std::function< void(const int *)> f)
 
void CombinationsR (int n, int m, std::function< void(const int *)> f)
 
void Permutations (int n, std::function< void(const int *)> f)
 
void Permutations (int n, int m, std::function< void(const int *)> f)
 
void PermutationsR (int n, int m, std::function< void(const int *)> f)
 
bool isSorted (const lst &exs)
 
bool isSorted (int n, const ex exs[])
 
int ACSort (lst &exs)
 
int ACSort (int n, ex exs[])
 
long long node_number (const ex &expr, int level=0)
 
bool ex_less (const ex &a, const ex &b)
 
void sort_lst (lst &ilst, bool less)
 sort the list in less order, or the reverse More...
 
void sort_lst_by (lst &ilst, int ki, bool less)
 sort the list in less order, or the reverse More...
 
void sort_vec (exvector &ivec, bool less)
 sort the list in less order, or the reverse More...
 
void sort_vec_by (exvector &ivec, int ki, bool less)
 sort the list in less order, or the reverse More...
 
void append_to (const exvector &exv, lst &alst)
 
void append_to (const lst &alst, exvector &exv)
 
lst CoPat (const ex &e, std::function< bool(const ex &)> f)
 
void garWrite (string garfn, const exvector &exv)
 
void garRead (string garfn, exvector &exv)
 
numeric RationalReconstruct (numeric a, numeric p)
 
numeric mulInv (numeric a, numeric b)
 
numeric ChineseRemainder (std::vector< numeric > a, std::vector< numeric > n)
 
numeric RationalReconstruct (vector< numeric > aa, vector< numeric > pp)
 
ex Thiele (const exvector &keys, const exvector &values, const ex &d)
 
ex Newton (const exvector &keys, const exvector &values, const ex &d, const ex factor=1)
 
matrix fermat_Redrowech (const matrix &mat)
 
matrix fermat_Redrowech_Sparse (const matrix &mat)
 
ex fermat_Det (const matrix &mat)
 
ex fermat_Det_Sparse (const matrix &mat)
 
matrix fermat_inv (const matrix &mat)
 
matrix fermat_mul (const matrix &m1, const matrix &m2)
 
matrix fermat_pow (const matrix &mat_in, int n)
 
void fermat_mat (const matrix &mat_in, const string &name)
 
matrix fermat_mat (const string &name)
 
void fermat_eval (const string &fcmd="@[**]")
 
ex A0 (const ex m2, int n, ex d)
 scalar integral A0, devided by (2pi)^(4-2ep) More...
 
ex ApartIR2ex (const ex &expr_in)
 convert ApartIR to ex More...
 
ex ApartIR2F (const ex &expr_in)
 convert ApartIR to F(ps, ns), ns is like FIRE convention More...
 
ex air2pn (ex air)
 
ex pn2mat (ex ps, ex ns, ex vars)
 
bool is_subset (const ex &e1, const ex &e2)
 
ex pn2p (ex pn)
 
exmap ApartRules (const exvector &airs, bool irc)
 
ex Apart (const matrix &mat)
 Apart on matrix. More...
 
ex Apart (const ex &expr_ino, const lst &vars_in, exmap smap)
 Apart on ex. More...
 
ex Apart (const ex &expr_ino, const lst &loops, const lst &extps, exmap smap)
 Apart on ex. More...
 
ex ApartIRC (const ex &expr_in)
 complete the ApartIR elements More...
 
ex F2ex (const ex &expr_in)
 convert F(ps, ns) to normal ex, ns is like FIRE convention More...
 
void ApartIBP (exvector &air_vec, AIOption aio)
 perform IBP reduction on the Aparted input More...
 
void ApartIBP (exvector &air_vec, int IBPmethod, const lst &loops, const lst &exts, const lst &cut_props, std::function< lst(const IBP &, const ex &)> uf)
 perform IBP reduction on the Aparted input More...
 
ex MatrixContract (const ex &expr_in)
 make contract on matrix, i.e., Matrix(a,i1,i2)*Matrix(b,i2,i3) -> Matrix(a*b,i1,i3) More...
 
 REGISTER_FUNCTION (Matrix, do_not_evalf_params().print_func< FCFormat >(&Matrix_fc_print).conjugate_func(mat_conj).set_return_type(return_types::commutative)) bool IsZero(const ex &e)
 
ex ToCF (const ex &e)
 
ex ca_neg_pow_sub (const ex &expr)
 
ex ToCACF (const ex &e)
 
ex HomCACF (const ex &e)
 
ex DoColor (const ex &expr, const ex &pref, int method)
 
 REGISTER_FUNCTION (TR, do_not_evalf_params(). conjugate_func(tr_conj). print_func< FormFormat >(&TR_form_print). print_func< FCFormat >(&TR_fc_print). set_return_type(return_types::commutative). expl_derivative_func(expl_TR_diff))
 
 REGISTER_FUNCTION (TTR, do_not_evalf_params(). conjugate_func(ttr_conj). print_func< FormFormat >(&TTR_form_print). print_func< FCFormat >(&TTR_fc_print))
 
 REGISTER_FUNCTION (HF, do_not_evalf_params())
 
ex GAS (const ex &expr, unsigned rl)
 function similar to GAD/GSD in FeynClac More...
 
ex LC (ex pi1, ex pi2, ex pi3, ex pi4)
 function similar to LCD in FeynCalc More...
 
ex form (const ex &iexpr, int verb)
 evalulate expr in form program, see also the form_trace_mode and form_expand_mode More...
 
ex charge_conjugate (const ex &expr)
 make the charge conjugate operaton, M -> C^{-1} . M^T . C w.r.t. a Matrix object More...
 
ex SP (const ex &a, bool use_map=false)
 
ex SP (const ex &a, const ex &b, bool use_map)
 Function similar to SPD/FVD in FeynCalc. More...
 
ex sp (const ex &a, const ex &b)
 translated the vector dot a.b to a*b, useful in SecDec More...
 
ex sp (const ex &a)
 
ex & letSP (const ex &p1, const ex &p2)
 return the reference of p1.p2 More...
 
ex & letSP (const ex &p)
 return the reference of p.p More...
 
void clearSP (const ex &p1, const ex &p2)
 delete the assignment of p1.p2 More...
 
void clearSP (const ex &p)
 delete the assignment of p.p More...
 
void clearSP ()
 delete all assignment in SP_map More...
 
ex SP2sp (const ex &exin)
 convert SP(a,b) to sp(a,b) More...
 
exmap sp_map ()
 the SP_map with SP(a,b) replaced to sp(a,b) More...
 
ex GAS (const Vector &p, unsigned rl=0)
 
ex GAS (const Index &i, unsigned rl=0)
 
ex UnContract (const ex expr, const lst &loop_ps, const lst &ext_ps=lst{})
 
ex TIR (const ex &expr_in, const lst &loop_ps, const lst &ext_ps)
 Tensor Index Reduction, note that we only handle numerator. More...
 
void ApartIBP (int IBPmethod, exvector &io_vec, const lst &loops, const lst &exts, const lst &cut_props=lst{}, std::function< lst(const IBP &, const ex &)> uf=LoopUF)
 
bool IsZero (const ex &e)
 
 REGISTER_FUNCTION (a, do_not_evalf_params().print_func< print_dflt >(a_print)) void IBP
 
exmap SortPermutation (const ex &in_expr, const lst &xs)
 Sort for all permuations, and return xs w.r.t. 1st permutation. More...
 
lst LoopUF (const IBP &ibp, const ex &idx)
 UF function. More...
 
lst UF (const ex &props, const ex &ns, const ex &loops, const ex &tloops, const ex &lsubs, const ex &tsubs)
 UF function, from FIRE.m. More...
 
pair< exmap, lst > FindRules (vector< IBP * > fs, bool mi, std::function< lst(const IBP &, const ex &)> uf)
 Find Rules for Integral or Master Integral. More...
 
ex GPolynomial (const IBP &ibp)
 
void GPermutation (const ex &uf, const lst &xs)
 
pair< exmap, lst > FindRules (IBP &ibp, bool mi=true, std::function< lst(const IBP &, const ex &)> uf=LoopUF)
 
const Symbol NA ("NA")
 
const Symbol NF ("NF")
 
const Symbol TF ("TF")
 
const Symbol CA ("CA")
 
const Symbol CF ("CF")
 
const Symbol gs ("gs")
 
const Symbol as ("as")
 
const Symbol mu ("mu")
 
const Symbol nL ("nL")
 
const Symbol nH ("nH")
 
const Symbol eps ("eps")
 
const Symbol vs ("vs")
 
const Symbol vz ("vz")
 
const Symbol epz ("epz")
 
const Symbol NaN ("NaN")
 
const Symbol ep ("ep")
 
const Symbol d ("d")
 
const Symbol iet ("iet")
 
const iSymbol iEpsilon ("iEpsilon")
 
MMAFormat mout (cout)
 
FCFormat fcout (cout)
 

Variables

const char * ErrColor = RED
 
const char * WarnColor = MAGENTA
 
const char * Color_HighLight = WHITE
 
std::stack< cln::float_format_t > cln_prec_stack
 
std::stack< long > digits_stack
 
string Version = "1.5 @2024-04-28"
 
unsigned nopat = GiNaC::subs_options::no_pattern
 
const int o_none = (_o_++)
 
const int o_normal = (_o_++)
 
const int o_fermat = (_o_++)
 
const int o_fermatfD = (_o_++)
 
const int o_fermatN = (_o_++)
 
const int o_form = (_o_++)
 
const int o_flint = (_o_++)
 
const int o_flintf = (_o_++)
 
const int o_flintfD = (_o_++)
 
const int o_normal_fermat = (_o_++)
 
const int o_normal_form = (_o_++)
 
const int o_fermat_form = (_o_++)
 
bool In_GiNaC_Parallel = false
 
int GiNaC_Parallel_Process = -1
 
map< string, int > GiNaC_Parallel_Verb
 
map< string, int > GiNaC_Parallel_NP
 
int GiNaC_Parallel_Batch = 0
 
map< string, int > GiNaC_Parallel_NB
 
map< string, bool > GiNaC_Parallel_RM
 
map< string, bool > GiNaC_Parallel_ReWR
 
map< string, string > GiNaC_Parallel_PRE
 
bool using_cache = true
 
long long cache_limit = -1
 
int fermat_using_array = 0
 
map< ex, long long, ex_is_less > fermat_weight
 
int NNDigits = 100
 
ex w = wild()
 
ex w0 = wild(0)
 
ex w1 = wild(1)
 
ex w2 = wild(2)
 
ex w3 = wild(3)
 
ex w4 = wild(4)
 
ex w5 = wild(5)
 
ex w6 = wild(6)
 
ex w7 = wild(7)
 
ex w8 = wild(8)
 
ex w9 = wild(9)
 
string InstallPrefix = install_prefix()
 
string INC_FLAGS = "-I'"+InstallPrefix+"/include' " + "@INC_FLAGS@"
 
string LIB_FLAGS = "-L'"+InstallPrefix+"/lib' -Wl,-rpath,'"+InstallPrefix+"'/lib " + "@LIB_FLAGS@"
 
const iSymbol iEpsilon
 
const ex iEpsilonN = I*pow(ex(10), -50)
 
int Verbose = 0
 
string PRE = " "
 
bool Debug = false
 
MMAFormat mout
 
const Symbol NA
 
const Symbol NF
 
const Symbol TF
 
const Symbol CA
 
const Symbol CF
 
const Symbol gs
 
const Symbol as
 
const Symbol mu
 
const Symbol nL
 
const Symbol nH
 
const Symbol iet
 
const Symbol d
 
const Symbol ep
 
const Symbol eps
 
const Symbol vs
 
const Symbol vz
 
const Symbol epz
 
const Symbol NaN
 
exmap SP_map
 
int form_trace_mode = form_trace_auto
 
const int form_trace_auto = 0
 
const int form_trace_all = 1
 
const int form_trace_each_all = 2
 
const int form_trace_each_each = 3
 
int form_expand_mode = form_expand_tr
 
const int form_expand_none = 0
 
const int form_expand_tr = 1
 
const int form_expand_ci = 2
 
const int form_expand_li = 3
 
const int form_expand_all = 4
 
bool Apart_using_fermat = true
 
bool form_using_su3 = false
 
bool form_using_dim4 = false
 
bool form_using_gamma5 = false
 
FCFormat fcout
 
exmap MapPreSP
 
int _o_ = 0
 
slong error_pass_dp = 100
 

Detailed Description

HepLib namespace.

namespace for IBP reduction

Typedef Documentation

◆ co_epvec_t

typedef pair<ex,epvec_t> HepLib::co_epvec_t

Definition at line 1076 of file BASIC.cpp.

◆ epvec_t

typedef vector<pair<ex,ex> > HepLib::epvec_t

Definition at line 1075 of file BASIC.cpp.

◆ init_list

typedef std::initializer_list<ex> HepLib::init_list

Definition at line 47 of file BASIC.h.

◆ SparseMatrix

typedef map<int,map<int,ex> > HepLib::SparseMatrix

Definition at line 178 of file Solver.cpp.

Function Documentation

◆ A0()

ex HepLib::A0 ( const ex  m2,
int  n,
ex  d 
)

scalar integral A0, devided by (2pi)^(4-2ep)

Parameters
m2mass squared
nexponent for the propagator l^2-m^2
Returns
A0

Definition at line 17 of file ABCD.cpp.

◆ ACSort() [1/2]

int HepLib::ACSort ( int  n,
ex  exs[] 
)

Definition at line 304 of file Functions.cpp.

◆ ACSort() [2/2]

int HepLib::ACSort ( lst &  exs)

Definition at line 289 of file Functions.cpp.

◆ add2lst()

lst HepLib::add2lst ( const ex &  expr)

convert add to lst

Parameters
exprinput expression
Returns
lst

Definition at line 921 of file BASIC.cpp.

◆ add_collect_normal() [1/6]

ex HepLib::add_collect_normal ( const ex &  e,
ex const &  pats,
int  opt 
)

Definition at line 2205 of file BASIC.cpp.

◆ add_collect_normal() [2/6]

ex HepLib::add_collect_normal ( const ex &  e,
init_list const &  pats,
int  opt 
)

Definition at line 2217 of file BASIC.cpp.

◆ add_collect_normal() [3/6]

ex HepLib::add_collect_normal ( const ex &  e,
lst const &  pats,
int  opt 
)

Definition at line 2211 of file BASIC.cpp.

◆ add_collect_normal() [4/6]

ex HepLib::add_collect_normal ( const exvector &  exv,
ex const &  pats,
int  opt 
)

Definition at line 2163 of file BASIC.cpp.

◆ add_collect_normal() [5/6]

ex HepLib::add_collect_normal ( const exvector &  exv,
init_list const &  pats,
int  opt 
)

Definition at line 2177 of file BASIC.cpp.

◆ add_collect_normal() [6/6]

ex HepLib::add_collect_normal ( const exvector &  exv,
lst const &  pats,
int  opt 
)

Definition at line 2191 of file BASIC.cpp.

◆ air2pn()

ex HepLib::air2pn ( ex  air)
inline

Definition at line 89 of file Apart.cpp.

◆ Apart() [1/3]

ex HepLib::Apart ( const ex &  expr_ino,
const lst &  loops,
const lst &  extps,
exmap  smap 
)

Apart on ex.

Parameters
expr_inoinput expression
loopslist of loop Vector
extpslist of external Vector
smapthe sign map
Returns
sum of coefficient * ApartIR

Definition at line 859 of file Apart.cpp.

◆ Apart() [2/3]

ex HepLib::Apart ( const ex &  expr_ino,
const lst &  vars_in,
exmap  smap 
)

Apart on ex.

Parameters
expr_inonormal expresion, product of [ linear w.r.t. vars ]^n
vars_inindependent variables
smapthe sign map
Returns
sum of coefficient * ApartIR

Definition at line 616 of file Apart.cpp.

◆ Apart() [3/3]

ex HepLib::Apart ( const matrix &  mat)

Apart on matrix.

Parameters
mateach column: [c1,...,cn,c0,n] -> (c1 x1+...+cn xn+c0)^n
Returns
sum of coefficient * ApartIR

Definition at line 280 of file Apart.cpp.

◆ ApartIBP() [1/3]

void HepLib::ApartIBP ( exvector &  air_vec,
AIOption  aio 
)

perform IBP reduction on the Aparted input

Parameters
IBPmethodibp method used, 0-No IBP, 1-FIRE, 2-KIRA
air_vecvector contains aparted input, ApartIRC will be call internally
aioAIOption for ApartIBP input
Returns
nothing returned, the input air_vec will be updated

Definition at line 109 of file ApartIBP.cpp.

◆ ApartIBP() [2/3]

void HepLib::ApartIBP ( exvector &  air_vec,
int  IBPmethod,
const lst &  loops,
const lst &  exts,
const lst &  cut_props,
std::function< lst(const IBP &, const ex &)>  uf 
)

perform IBP reduction on the Aparted input

Parameters
IBPmethodibp method used, 0-No IBP, 1-FIRE, 2-KIRA
air_vecvector contains aparted input, ApartIRC will be call internally
loopsloop vectors
extsexternal vectors
cut_propscut propagators, default is { }
ufthe function to compute UF polynomial
Returns
nothing returned, the input air_vec will be updated

Definition at line 614 of file ApartIBP.cpp.

◆ ApartIBP() [3/3]

void HepLib::ApartIBP ( int  IBPmethod,
exvector &  io_vec,
const lst &  loops,
const lst &  exts,
const lst &  cut_props = lst{},
std::function< lst(const IBP &, const ex &)>  uf = LoopUF 
)
inline

Definition at line 514 of file HEP.h.

◆ ApartIR2ex()

ex HepLib::ApartIR2ex ( const ex &  expr_in)

convert ApartIR to ex

Parameters
expr_inexpression contains ApartIR
Returns
ApartIR converted into normal ex

Definition at line 35 of file Apart.cpp.

◆ ApartIR2F()

ex HepLib::ApartIR2F ( const ex &  expr_in)

convert ApartIR to F(ps, ns), ns is like FIRE convention

Parameters
expr_inexpression contains ApartIR
Returns
ApartIR converted into F(ps, ns)

Definition at line 61 of file Apart.cpp.

◆ ApartIRC()

ex HepLib::ApartIRC ( const ex &  expr_in)

complete the ApartIR elements

Parameters
expr_ininput expression
Returns
ApartIR with complete matrix rank, ready for IBP reduction

Definition at line 914 of file Apart.cpp.

◆ ApartRules()

exmap HepLib::ApartRules ( const exvector &  airs,
bool  irc 
)

Definition at line 156 of file Apart.cpp.

◆ append_to() [1/2]

void HepLib::append_to ( const exvector &  exv,
lst &  alst 
)
inline

Definition at line 723 of file BASIC.h.

◆ append_to() [2/2]

void HepLib::append_to ( const lst &  alst,
exvector &  exv 
)
inline

Definition at line 724 of file BASIC.h.

◆ arg2map()

void HepLib::arg2map ( int  argc,
char **  argv,
const char *  optstring,
std::map< char, std::string > &  kv 
)

Definition at line 2327 of file BASIC.cpp.

◆ as()

const Symbol HepLib::as ( "as"  )

◆ CA()

const Symbol HepLib::CA ( "CA"  )

◆ ca_neg_pow_sub()

ex HepLib::ca_neg_pow_sub ( const ex &  expr)

Definition at line 767 of file Basic.cpp.

◆ CF()

const Symbol HepLib::CF ( "CF"  )

◆ charge_conjugate()

ex HepLib::charge_conjugate ( const ex &  expr)

make the charge conjugate operaton, M -> C^{-1} . M^T . C w.r.t. a Matrix object

Parameters
exprthe input expression
Returns
returned charge conjugated expression

Definition at line 637 of file Form.cpp.

◆ ChineseRemainder()

numeric HepLib::ChineseRemainder ( std::vector< numeric >  a,
std::vector< numeric >  n 
)

Definition at line 53 of file Rational.cpp.

◆ clearSP() [1/3]

void HepLib::clearSP ( )

delete all assignment in SP_map

Definition at line 293 of file Pair.cpp.

◆ clearSP() [2/3]

void HepLib::clearSP ( const ex &  p)

delete the assignment of p.p

Parameters
pvector/index

Definition at line 284 of file Pair.cpp.

◆ clearSP() [3/3]

void HepLib::clearSP ( const ex &  p1,
const ex &  p2 
)

delete the assignment of p1.p2

Parameters
p1the 1st vector/index
p2the 2nd vector/index

Definition at line 274 of file Pair.cpp.

◆ collect_ex() [1/4]

ex HepLib::collect_ex ( const ex &  expr,
ex const &  pat,
int  opt = o_none 
)
inline

Definition at line 429 of file BASIC.h.

◆ collect_ex() [2/4]

ex HepLib::collect_ex ( const ex &  expr,
init_list const &  pats,
int  opt = o_none 
)
inline

Definition at line 415 of file BASIC.h.

◆ collect_ex() [3/4]

ex HepLib::collect_ex ( const ex &  expr,
lst const &  pats,
int  opt = o_none 
)
inline

Definition at line 422 of file BASIC.h.

◆ collect_ex() [4/4]

ex HepLib::collect_ex ( ex const &  expr_in,
std::function< bool(const ex &)>  has_func,
int  opt 
)

the collect function like Mathematica

Parameters
expr_ininput expression
has_funconly collect the element e, when has_func(e) is true
opt0: do nothing, 1: using exnormal, 2: using exfactor on the coefficient
Returns
the collected expression

Definition at line 1202 of file BASIC.cpp.

◆ collect_factors()

ex HepLib::collect_factors ( const ex &  expr)

a wrapper for collect_common_factors, catch errors

Parameters
exprthe input expression
Returns
collect_common_factors result

Definition at line 1841 of file BASIC.cpp.

◆ collect_lst() [1/4]

lst HepLib::collect_lst ( const ex &  expr,
ex const &  pat,
int  opt = o_none 
)
inline

Definition at line 449 of file BASIC.h.

◆ collect_lst() [2/4]

lst HepLib::collect_lst ( const ex &  expr,
init_list const &  pats,
int  opt = o_none 
)
inline

Definition at line 435 of file BASIC.h.

◆ collect_lst() [3/4]

lst HepLib::collect_lst ( const ex &  expr,
lst const &  pats,
int  opt = o_none 
)
inline

Definition at line 442 of file BASIC.h.

◆ collect_lst() [4/4]

lst HepLib::collect_lst ( ex const &  expr_in,
std::function< bool(const ex &)>  has_func,
int  opt 
)

the collect function like Mathematica, reture the lst { {c1,v1}, {c2,v2}, ... }

Parameters
expr_ininput expression
has_funconly collect the element e, when has_func(e) is true
opt0: do nothing, 1: using exnormal, 2: using exfactor on the coefficient
Returns
the collected expression in lst

Definition at line 1222 of file BASIC.cpp.

◆ Combinations()

void HepLib::Combinations ( int  n,
int  m,
std::function< void(const int *)>  f 
)

Definition at line 184 of file Functions.cpp.

◆ CombinationsR()

void HepLib::CombinationsR ( int  n,
int  m,
std::function< void(const int *)>  f 
)

Definition at line 197 of file Functions.cpp.

◆ CoPat()

lst HepLib::CoPat ( const ex &  e,
std::function< bool(const ex &)>  f 
)
inline

Definition at line 725 of file BASIC.h.

◆ CpuCores()

int HepLib::CpuCores ( )

return the cpu cores using OpenMP

Returns
the cpu cores

Definition at line 1820 of file BASIC.cpp.

◆ d()

const Symbol HepLib::d ( "d"  )

◆ diff_ex()

ex HepLib::diff_ex ( ex const  expr,
ex const  xp,
unsigned  nth,
bool  expand 
)

the differential like Mathematica

Parameters
exprinput expression
xpthe variable, can be an expression, will replace by a symbol and back again
nthnth-derivative
expandtrue to call collect_ex before diff
Returns
the corresponding nth-derivative

Definition at line 1063 of file BASIC.cpp.

◆ dir_exists()

bool HepLib::dir_exists ( string  dir)
inline

Definition at line 297 of file BASIC.h.

◆ DoColor()

ex HepLib::DoColor ( const ex &  expr,
const ex &  pref,
int  method 
)

Definition at line 845 of file Basic.cpp.

◆ ep()

const Symbol HepLib::ep ( "ep"  )

◆ eps()

const Symbol HepLib::eps ( "eps"  )

◆ epz()

const Symbol HepLib::epz ( "epz"  )

◆ EvalF()

ex HepLib::EvalF ( ex  expr)

the nuerical evaluation, Digits=100 will be used

Parameters
exprinput expression
Returns
the nuerical expression

Definition at line 1245 of file BASIC.cpp.

◆ EvalL()

ex HepLib::EvalL ( ex  expr)

Definition at line 1256 of file BASIC.cpp.

◆ EvalMP()

ex HepLib::EvalMP ( ex  expr)

Definition at line 1266 of file BASIC.cpp.

◆ EvalQ()

ex HepLib::EvalQ ( ex  expr)

Definition at line 1261 of file BASIC.cpp.

◆ ex2file() [1/2]

void HepLib::ex2file ( const ex &  expr,
string  filename 
)

export expression file

Parameters
exprthe input expression
filenamefile name
Returns
the file content in ex

Definition at line 845 of file BASIC.cpp.

◆ ex2file() [2/2]

void HepLib::ex2file ( string  filename,
const ex &  expr 
)

export expression file

Parameters
filenamefile name
exprthe input expression
Returns
the file content in ex

Definition at line 858 of file BASIC.cpp.

◆ ex2int()

int HepLib::ex2int ( ex  num)

ex to integer

Parameters
numan integer in ex
Returns
the integer for the number

Definition at line 893 of file BASIC.cpp.

◆ ex2q()

__float128 HepLib::ex2q ( ex  num)

ex of numeric to __float128

Parameters
numa ex number
Returns
a __float128 object for the number

Definition at line 879 of file BASIC.cpp.

◆ ex2str() [1/4]

string HepLib::ex2str ( const ex &  expr)

convert ex to output string, the defalut printer format will be used

Parameters
expra expression
Returns
the output string

Definition at line 715 of file BASIC.cpp.

◆ ex2str() [2/4]

string HepLib::ex2str ( const exmap &  expr)

convert exmap to output string, the defalut printer format will be used

Parameters
expra exvec expression
Returns
the output string

Definition at line 753 of file BASIC.cpp.

◆ ex2str() [3/4]

string HepLib::ex2str ( const exset &  expr)

convert exset to output string, the defalut printer format will be used

Parameters
expra exvec expression
Returns
the output string

Definition at line 764 of file BASIC.cpp.

◆ ex2str() [4/4]

string HepLib::ex2str ( const exvector &  expr)

convert exvec to output string, the defalut printer format will be used

Parameters
expra exvec expression
Returns
the output string

Definition at line 726 of file BASIC.cpp.

◆ ex_less()

bool HepLib::ex_less ( const ex &  a,
const ex &  b 
)

Definition at line 10 of file Sort.cpp.

◆ exexpand()

ex HepLib::exexpand ( const ex &  expr,
int  opt 
)

factorize a expression

Parameters
exprthe input expression
opt1 to use FORM, otherwise using GiNaC for factorization
Returns
factorized result

Definition at line 1867 of file BASIC.cpp.

◆ exfactor()

ex HepLib::exfactor ( const ex &  expr,
int  opt 
)

factorize a expression

Parameters
exprthe input expression
opt1 to use FORM, otherwise using GiNaC for factorization
Returns
factorized result

Definition at line 1854 of file BASIC.cpp.

◆ exnd()

ex HepLib::exnd ( const ex &  expr,
int  opt 
)

num_den a expression

Parameters
exprthe input expression
opt1 to use factor_form, 2 to use Fermat, otherwise using GiNaC for numer_denom
Returns
lst of { num, den }

Definition at line 1922 of file BASIC.cpp.

◆ exnormal()

ex HepLib::exnormal ( const ex &  expr,
int  opt 
)

normalize a expression

Parameters
exprthe input expression
opt1 to use Fermat, otherwise using GiNaC for normalization
Returns
factorized result

Definition at line 1906 of file BASIC.cpp.

◆ expand_ex() [1/4]

ex HepLib::expand_ex ( const ex &  expr)
inline

Definition at line 398 of file BASIC.h.

◆ expand_ex() [2/4]

ex HepLib::expand_ex ( ex const &  expr,
ex const &  pat 
)
inline

Definition at line 409 of file BASIC.h.

◆ expand_ex() [3/4]

ex HepLib::expand_ex ( ex const &  expr,
lst const &  pats 
)
inline

Definition at line 402 of file BASIC.h.

◆ expand_ex() [4/4]

ex HepLib::expand_ex ( ex const &  expr_in,
std::function< bool(const ex &)>  has_func 
)

the expand like Mathematica

Parameters
expr_ininput expression
has_funconly expand the element e, when has_func(e) is true
Returns
the expanded expression

Definition at line 1188 of file BASIC.cpp.

◆ F2ex()

ex HepLib::F2ex ( const ex &  expr_in)

convert F(ps, ns) to normal ex, ns is like FIRE convention

Parameters
expr_inexpression contains F
Returns
F(ps, ns) converted into normal expression

Definition at line 87 of file ApartIBP.cpp.

◆ factor_flint()

ex HepLib::factor_flint ( const ex &  e,
bool  nd = true 
)

◆ factor_form()

ex HepLib::factor_form ( const ex &  expr,
bool  nd 
)

factorize a expression using FORM

Parameters
exprthe input expression
Returns
factorized result

Definition at line 2038 of file BASIC.cpp.

◆ fcout()

FCFormat HepLib::fcout ( cout  )

◆ fermat_Det()

ex HepLib::fermat_Det ( const matrix &  mat)

Definition at line 650 of file Fermat.cpp.

◆ fermat_Det_Sparse()

ex HepLib::fermat_Det_Sparse ( const matrix &  mat)

Definition at line 757 of file Fermat.cpp.

◆ fermat_eval() [1/2]

ex HepLib::fermat_eval ( const ex &  expr)

return the numerator and denominator after normalization

Parameters
exprthe input expression
Returns
fermat evaluated expression

Definition at line 317 of file Fermat.cpp.

◆ fermat_eval() [2/2]

void HepLib::fermat_eval ( const string &  fcmd = "@[**]")

Definition at line 1343 of file Fermat.cpp.

◆ fermat_inv()

matrix HepLib::fermat_inv ( const matrix &  mat)

Definition at line 880 of file Fermat.cpp.

◆ fermat_mat() [1/2]

void HepLib::fermat_mat ( const matrix &  mat_in,
const string &  name 
)

Definition at line 1224 of file Fermat.cpp.

◆ fermat_mat() [2/2]

matrix HepLib::fermat_mat ( const string &  name)

Definition at line 1301 of file Fermat.cpp.

◆ fermat_mul()

matrix HepLib::fermat_mul ( const matrix &  m1,
const matrix &  m2 
)

Definition at line 987 of file Fermat.cpp.

◆ fermat_normal()

ex HepLib::fermat_normal ( const ex &  expr,
bool  dfactor = false 
)
inline

Definition at line 465 of file BASIC.h.

◆ fermat_numer_denom()

ex HepLib::fermat_numer_denom ( const ex &  expr,
bool  dfactor = false 
)
inline

Definition at line 461 of file BASIC.h.

◆ fermat_pow()

matrix HepLib::fermat_pow ( const matrix &  mat_in,
int  n 
)

Definition at line 1112 of file Fermat.cpp.

◆ fermat_Redrowech()

matrix HepLib::fermat_Redrowech ( const matrix &  mat)

Definition at line 409 of file Fermat.cpp.

◆ fermat_Redrowech_Sparse()

matrix HepLib::fermat_Redrowech_Sparse ( const matrix &  mat)

Definition at line 516 of file Fermat.cpp.

◆ file2ex() [1/2]

ex HepLib::file2ex ( string  filename)

read file content to ex

Parameters
filenamefile name
Returns
the file content in ex

Definition at line 825 of file BASIC.cpp.

◆ file2ex() [2/2]

ex HepLib::file2ex ( string  filename,
symtab  st 
)

read file content to ex

Parameters
filenamefile name
stsymtab
Returns
the file content in ex

Definition at line 835 of file BASIC.cpp.

◆ file2str()

string HepLib::file2str ( string  filename)

read file content to string

Parameters
filenamefile name
Returns
the file content in string

Definition at line 775 of file BASIC.cpp.

◆ file2strvec()

vector< string > HepLib::file2strvec ( string  filename,
bool  skip_empty 
)

read file content to string vector

Parameters
filenamefile name
skip_emptyskip blank lines
Returns
the file content in string vector, lines in vector

Definition at line 809 of file BASIC.cpp.

◆ file_exists()

bool HepLib::file_exists ( string  fn)
inline

Definition at line 289 of file BASIC.h.

◆ file_remove()

bool HepLib::file_remove ( string  fn)
inline

Definition at line 285 of file BASIC.h.

◆ FindRules() [1/2]

pair<exmap,lst> HepLib::FindRules ( IBP ibp,
bool  mi = true,
std::function< lst(const IBP &, const ex &)>  uf = LoopUF 
)
inline

Definition at line 231 of file IBP.h.

◆ FindRules() [2/2]

pair< exmap, lst > HepLib::FindRules ( vector< IBP * >  fs,
bool  mi,
std::function< lst(const IBP &, const ex &)>  uf 
)

Find Rules for Integral or Master Integral.

Parameters
fsvector of IBP pointer object
mitrue for Master Integals
ufthe function to compute the UF polynomial
Returns
rules replacement and left integrals or left master integrals

Definition at line 566 of file IBP.cpp.

◆ form()

ex HepLib::form ( const ex &  iexpr,
int  verb 
)

evalulate expr in form program, see also the form_trace_mode and form_expand_mode

Parameters
exprthe input expression
verbfor verb output
Returns
result with index contract, trace performed, etc.

Definition at line 563 of file Form.cpp.

◆ form_eval()

ex HepLib::form_eval ( const ex &  expr)

Definition at line 1928 of file BASIC.cpp.

◆ form_factor()

ex HepLib::form_factor ( const ex &  expr,
bool  nd = true 
)
inline

Definition at line 472 of file BASIC.h.

◆ garRead() [1/5]

ex HepLib::garRead ( const string &  garfn)

garRead from file, only the element w.r.t. key "res", note inner check will be performed

Parameters
garfnginac archive filename
Returns
the expression w.r.t. key "res"

Definition at line 623 of file BASIC.cpp.

◆ garRead() [2/5]

ex HepLib::garRead ( const string &  garfn,
const char *  key 
)

garRead from file, only the element w.r.t. key

Parameters
garfnginac archive filename
keythe archive key, note (const char *) type, match unarchive_ex in GiNaC
Returns
the expression w.r.t. key

Definition at line 609 of file BASIC.cpp.

◆ garRead() [3/5]

void HepLib::garRead ( const string &  garfn,
map< string, ex > &  resMap 
)

garRead from file, and output in a map

Parameters
garfnginac archive filename
resMapwill be update, a string key map

Definition at line 591 of file BASIC.cpp.

◆ garRead() [4/5]

void HepLib::garRead ( exvector &  exv,
string  garfn 
)

Definition at line 2144 of file BASIC.cpp.

◆ garRead() [5/5]

void HepLib::garRead ( string  garfn,
exvector &  exv 
)
inline

Definition at line 866 of file BASIC.h.

◆ garWrite() [1/6]

void HepLib::garWrite ( const ex &  res,
const string &  garfn 
)
inline

Definition at line 326 of file BASIC.h.

◆ garWrite() [2/6]

void HepLib::garWrite ( const exvector &  exv,
string  garfn 
)

Definition at line 2133 of file BASIC.cpp.

◆ garWrite() [3/6]

void HepLib::garWrite ( const map< string, ex > &  resMap,
const string &  garfn 
)
inline

Definition at line 324 of file BASIC.h.

◆ garWrite() [4/6]

void HepLib::garWrite ( const string &  garfn,
const ex &  res 
)

garWrite to write the expression to the archive, with key: "res", including a check key will be written

Parameters
garfnginac archive filename for output
resthe output expression

Definition at line 654 of file BASIC.cpp.

◆ garWrite() [5/6]

void HepLib::garWrite ( const string &  garfn,
const map< string, ex > &  resMap 
)

garWrite to write the string-key map to the archive

Parameters
garfnginac archive filename for output
resMapa key-valued map

Definition at line 639 of file BASIC.cpp.

◆ garWrite() [6/6]

void HepLib::garWrite ( string  garfn,
const exvector &  exv 
)
inline

Definition at line 864 of file BASIC.h.

◆ GAS() [1/3]

ex HepLib::GAS ( const ex &  expr,
unsigned  rl 
)

function similar to GAD/GSD in FeynClac

Parameters
exprmomentum/index or 1,5,6,7
rlthe represent line number
Returns
expanded/translasted to Dirac Gamma objects

Definition at line 246 of file DGamma.cpp.

◆ GAS() [2/3]

ex HepLib::GAS ( const Index i,
unsigned  rl = 0 
)
inline

Definition at line 496 of file HEP.h.

◆ GAS() [3/3]

ex HepLib::GAS ( const Vector p,
unsigned  rl = 0 
)
inline

Definition at line 495 of file HEP.h.

◆ gather_symbols() [1/2]

lst HepLib::gather_symbols ( const ex &  e)

get all symbols from input expression

Parameters
einput expression
Returns
all symbols in the input

Definition at line 539 of file BASIC.cpp.

◆ gather_symbols() [2/2]

lst HepLib::gather_symbols ( const exvector &  ve)

get all symbols from input expression

Parameters
veinput expression vector
Returns
all symbols in the input

Definition at line 554 of file BASIC.cpp.

◆ get_op() [1/4]

ex HepLib::get_op ( const ex  ex_in,
int  index1,
int  index2 
)

return index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the index
index2the index
Returns
the element

Definition at line 1606 of file BASIC.cpp.

◆ get_op() [2/4]

ex HepLib::get_op ( const ex  ex_in,
int  index1,
int  index2,
int  index3 
)

return index1-th.index2-th.index3-th of expression

Parameters
ex_ininput expression will be update
index1the index
index2the index
index3the index
Returns
the element

Definition at line 1629 of file BASIC.cpp.

◆ get_op() [3/4]

ex HepLib::get_op ( const lst  ex_in,
int  index1,
int  index2 
)

return index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the index
index2the index
Returns
the element

Definition at line 1617 of file BASIC.cpp.

◆ get_op() [4/4]

ex HepLib::get_op ( const lst  ex_in,
int  index1,
int  index2,
int  index3 
)

return index1-th.index2-th.index3-th of expression

Parameters
ex_ininput expression will be update
index1the index
index2the index
index3the index
Returns
the element

Definition at line 1641 of file BASIC.cpp.

◆ get_precision()

long HepLib::get_precision ( )

Definition at line 2323 of file BASIC.cpp.

◆ GiNaC_Function_1()

std::function<GiNaC::function(const ex &)> HepLib::GiNaC_Function_1 ( const string  name)
inline

Definition at line 600 of file BASIC.h.

◆ GiNaC_Function_2()

std::function<GiNaC::function(const ex &,const ex &)> HepLib::GiNaC_Function_2 ( const string  name)
inline

Definition at line 607 of file BASIC.h.

◆ GiNaC_Function_3()

std::function<GiNaC::function(const ex &,const ex &,const ex &)> HepLib::GiNaC_Function_3 ( const string  name)
inline

Definition at line 614 of file BASIC.h.

◆ GiNaC_Function_4()

std::function<GiNaC::function(const ex &,const ex &,const ex &,const ex &)> HepLib::GiNaC_Function_4 ( const string  name)
inline

Definition at line 621 of file BASIC.h.

◆ GiNaC_Parallel()

exvector HepLib::GiNaC_Parallel ( int  ntotal,
std::function< ex(int)>  f,
const string &  key 
)

GiNaC Parallel Evaluation using fork.

Parameters
ntotalthe number of total items, 0 for non-parallel version
ffunction to be applied on the index, from 0 to (ntotal-1)
keykey used in archive file name and display message
rmdefault true, and false will keep the archive file
prethe pre-string in the print message
Returns
return the ntotal-element vector, i.e., [f(0), ..., f(ntotal-1)]

Definition at line 260 of file BASIC.cpp.

◆ GPermutation()

void HepLib::GPermutation ( const ex &  uf,
const lst &  xs 
)

Definition at line 1022 of file IBP.cpp.

◆ GPolynomial()

ex HepLib::GPolynomial ( const IBP ibp)

Definition at line 984 of file IBP.cpp.

◆ gs()

const Symbol HepLib::gs ( "gs"  )

◆ has_all()

bool HepLib::has_all ( ex  expr,
lst  ps 
)
inline

Definition at line 59 of file BASIC.h.

◆ has_any()

bool HepLib::has_any ( ex  expr,
lst  ps 
)
inline

Definition at line 55 of file BASIC.h.

◆ has_function()

bool HepLib::has_function ( const ex &  expr)
inline

Definition at line 668 of file BASIC.h.

◆ has_symbol()

bool HepLib::has_symbol ( const ex &  e)

Definition at line 2343 of file BASIC.cpp.

◆ has_w()

bool HepLib::has_w ( const ex &  e)

Definition at line 2223 of file BASIC.cpp.

◆ HomCACF()

ex HepLib::HomCACF ( const ex &  e)

Definition at line 803 of file Basic.cpp.

◆ iEpsilon()

const iSymbol HepLib::iEpsilon ( "iEpsilon"  )

◆ iet()

const Symbol HepLib::iet ( "iet"  )

◆ in2str()

string HepLib::in2str ( int  i)
inline

Definition at line 346 of file BASIC.h.

◆ inner_expand_collect()

pair<ex,epvec_t> HepLib::inner_expand_collect ( ex const &  expr_in,
std::function< bool(const ex &)>  has_func,
int  depth = 0 
)

Definition at line 1121 of file BASIC.cpp.

◆ inner_factor_form()

ex HepLib::inner_factor_form ( const ex &  expr)

Definition at line 1974 of file BASIC.cpp.

◆ is_equal_any()

bool HepLib::is_equal_any ( ex  expr,
lst  ps 
)
inline

Definition at line 64 of file BASIC.h.

◆ is_subset()

bool HepLib::is_subset ( const ex &  e1,
const ex &  e2 
)
inline

Definition at line 130 of file Apart.cpp.

◆ isFunction() [1/2]

bool HepLib::isFunction ( const ex &  e,
string  func_name 
)
inline

Definition at line 658 of file BASIC.h.

◆ isFunction() [2/2]

bool HepLib::isFunction ( const ex &  e,
string  func_name,
int  nargs 
)
inline

Definition at line 661 of file BASIC.h.

◆ isSorted() [1/2]

bool HepLib::isSorted ( const lst &  exs)

Definition at line 273 of file Functions.cpp.

◆ isSorted() [2/2]

bool HepLib::isSorted ( int  n,
const ex  exs[] 
)

Definition at line 281 of file Functions.cpp.

◆ IsZero()

bool HepLib::IsZero ( const ex &  e)

◆ key_exists()

bool HepLib::key_exists ( const exmap &  map,
const ex &  key 
)
inline

Definition at line 293 of file BASIC.h.

◆ LC()

ex HepLib::LC ( ex  pi1,
ex  pi2,
ex  pi3,
ex  pi4 
)

function similar to LCD in FeynCalc

Parameters
pi1vector/index in the 1st position
pi2vector/index in the 2nd position
pi3vector/index in the 3rd position
pi4vector/index in the 4th position
Returns
expanded/translated to Eps objects

Definition at line 179 of file Eps.cpp.

◆ let_op() [1/4]

void HepLib::let_op ( ex &  ex_in,
int  index1,
int  index2,
const ex  item 
)

update index1-th.index2-th of expression with item

Parameters
ex_ininput expression will be update
index1the index
index2the index
itemthe new item

Definition at line 1560 of file BASIC.cpp.

◆ let_op() [2/4]

void HepLib::let_op ( ex &  ex_in,
int  index1,
int  index2,
int  index3,
const ex  item 
)

update index1-th.index2-th.index3-th of expression with item

Parameters
ex_ininput expression will be update
index1the index
index2the index
index3the index
itemthe new item

Definition at line 1583 of file BASIC.cpp.

◆ let_op() [3/4]

void HepLib::let_op ( lst &  ex_in,
int  index1,
int  index2,
const ex  item 
)

update index1-th.index2-th of expression with item

Parameters
ex_ininput expression will be update
index1the index
index2the index
itemthe new item

Definition at line 1571 of file BASIC.cpp.

◆ let_op() [4/4]

void HepLib::let_op ( lst &  ex_in,
int  index1,
int  index2,
int  index3,
const ex  item 
)

update index1-th.index2-th.index3-th of expression with item

Parameters
ex_ininput expression will be update
index1the index
index2the index
index3the index
itemthe new item

Definition at line 1595 of file BASIC.cpp.

◆ let_op_append() [1/5]

void HepLib::let_op_append ( ex &  ex_in,
const ex  item 
)

append item into expression

Parameters
ex_ininput expression will be update
itemelement to be appended to ex_in

Definition at line 1324 of file BASIC.cpp.

◆ let_op_append() [2/5]

void HepLib::let_op_append ( ex &  ex_in,
int  index,
ex const  item 
)

append item into index-th of expression

Parameters
ex_ininput expression will be update
indexthe index, index-th should be lst, and item will be append into it
itemelement to be appended to index-th of ex_in

Definition at line 1367 of file BASIC.cpp.

◆ let_op_append() [3/5]

void HepLib::let_op_append ( ex &  ex_in,
int  index1,
int  index2,
ex const  item 
)

append item into index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the first index
index2the second index
itemelement to be appended to index1-th.index2-th of ex_in

Definition at line 1392 of file BASIC.cpp.

◆ let_op_append() [4/5]

void HepLib::let_op_append ( lst &  ex_in,
int  index,
ex const  item 
)

append item into index-th of expression

Parameters
ex_ininput expression will be update
indexthe index, index-th should be lst, and item will be append into it
itemelement to be appended to index-th of ex_in

Definition at line 1379 of file BASIC.cpp.

◆ let_op_append() [5/5]

void HepLib::let_op_append ( lst &  ex_in,
int  index1,
int  index2,
ex const  item 
)

append item into index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the first index
index2the second index
itemelement to be appended to index1-th.index2-th of ex_in

Definition at line 1405 of file BASIC.cpp.

◆ let_op_prepend() [1/5]

void HepLib::let_op_prepend ( ex &  ex_in,
const ex  item 
)

preppend item into expression

Parameters
ex_ininput expression will be update
itemelement to be prepended to ex_in

Definition at line 1335 of file BASIC.cpp.

◆ let_op_prepend() [2/5]

void HepLib::let_op_prepend ( ex &  ex_in,
int  index,
ex const  item 
)

prepend item into index-th of expression

Parameters
ex_ininput expression will be update
indexthe index, index-th should be lst, and item will be append into it
itemelement to be prepended to index-th of ex_in

Definition at line 1417 of file BASIC.cpp.

◆ let_op_prepend() [3/5]

void HepLib::let_op_prepend ( ex &  ex_in,
int  index1,
int  index2,
ex const  item 
)

prepend item into index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the first index
index2the second index
itemelement to be prepend to index1-th.index2-th of ex_in

Definition at line 1442 of file BASIC.cpp.

◆ let_op_prepend() [4/5]

void HepLib::let_op_prepend ( lst &  ex_in,
int  index,
ex const  item 
)

prepend item into index-th of expression

Parameters
ex_ininput expression will be update
indexthe index, index-th should be lst, and item will be append into it
itemelement to be prepended to index-th of ex_in

Definition at line 1429 of file BASIC.cpp.

◆ let_op_prepend() [5/5]

void HepLib::let_op_prepend ( lst &  ex_in,
int  index1,
int  index2,
ex const  item 
)

prepend item into index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the first index
index2the second index
itemelement to be prepend to index1-th.index2-th of ex_in

Definition at line 1455 of file BASIC.cpp.

◆ let_op_remove_first() [1/5]

void HepLib::let_op_remove_first ( ex &  ex_in)

remove first from expression

Parameters
ex_ininput lst and will be update, first element will be remove

Definition at line 1355 of file BASIC.cpp.

◆ let_op_remove_first() [2/5]

void HepLib::let_op_remove_first ( ex &  ex_in,
int  index 
)

remove the first in index-th of expression

Parameters
ex_ininput expression will be update
indexthe index

Definition at line 1512 of file BASIC.cpp.

◆ let_op_remove_first() [3/5]

void HepLib::let_op_remove_first ( ex &  ex_in,
int  index1,
int  index2 
)

remove the first in index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the index
index2the index

Definition at line 1535 of file BASIC.cpp.

◆ let_op_remove_first() [4/5]

void HepLib::let_op_remove_first ( lst &  ex_in,
int  index 
)

remove the first in index-th of expression

Parameters
ex_ininput expression will be update
indexthe index

Definition at line 1523 of file BASIC.cpp.

◆ let_op_remove_first() [5/5]

void HepLib::let_op_remove_first ( lst &  ex_in,
int  index1,
int  index2 
)

remove the first in index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the index
index2the index

Definition at line 1547 of file BASIC.cpp.

◆ let_op_remove_last() [1/5]

void HepLib::let_op_remove_last ( ex &  ex_in)

remove last from expression

Parameters
ex_ininput lst and will be update, last element will be remove

Definition at line 1345 of file BASIC.cpp.

◆ let_op_remove_last() [2/5]

void HepLib::let_op_remove_last ( ex &  ex_in,
int  index 
)

remove the last in index-th of expression

Parameters
ex_ininput expression will be update
indexthe index

Definition at line 1466 of file BASIC.cpp.

◆ let_op_remove_last() [3/5]

void HepLib::let_op_remove_last ( ex &  ex_in,
int  index1,
int  index2 
)

remove the last in index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the index
index2the index

Definition at line 1489 of file BASIC.cpp.

◆ let_op_remove_last() [4/5]

void HepLib::let_op_remove_last ( lst &  ex_in,
int  index 
)

remove the last in index-th of expression

Parameters
ex_ininput expression will be update
indexthe index

Definition at line 1477 of file BASIC.cpp.

◆ let_op_remove_last() [5/5]

void HepLib::let_op_remove_last ( lst &  ex_in,
int  index1,
int  index2 
)

remove the last in index1-th.index2-th of expression

Parameters
ex_ininput expression will be update
index1the index
index2the index

Definition at line 1501 of file BASIC.cpp.

◆ letSP() [1/2]

ex & HepLib::letSP ( const ex &  p)

return the reference of p.p

Parameters
pthe vector/index
Returns
the refernce of p.p in SP_map, can be used in assignment

Definition at line 263 of file Pair.cpp.

◆ letSP() [2/2]

ex & HepLib::letSP ( const ex &  p1,
const ex &  p2 
)

return the reference of p1.p2

Parameters
p1the 1st vector/index
p2the 2nd vector/index
Returns
the refernce of p1.p2 in SP_map, can be used in assignment

Definition at line 252 of file Pair.cpp.

◆ LoopUF()

lst HepLib::LoopUF ( const IBP ibp,
const ex &  idx 
)

UF function.

Parameters
IBPthe IBP object
idxexponent for the internal Propagator
Returns
lst of {U, F, sign}

Definition at line 310 of file IBP.cpp.

◆ lst2mat()

matrix HepLib::lst2mat ( const lst &  ls)

convert 2Dim lst to matrix

Parameters
lsa 2Dim lst
Returns
the matrix

Definition at line 737 of file BASIC.cpp.

◆ lst2vec()

exvector HepLib::lst2vec ( const lst &  alst)

convert lst to exvector

Parameters
alstinput lst
Returns
exvector

Definition at line 911 of file BASIC.cpp.

◆ match_all()

bool HepLib::match_all ( ex  expr,
lst  ps 
)
inline

Definition at line 73 of file BASIC.h.

◆ match_any()

bool HepLib::match_any ( ex  expr,
lst  ps 
)
inline

Definition at line 69 of file BASIC.h.

◆ MatrixContract()

ex HepLib::MatrixContract ( const ex &  expr_in)

make contract on matrix, i.e., Matrix(a,i1,i2)*Matrix(b,i2,i3) -> Matrix(a*b,i1,i3)

Parameters
expr_inexpression contains Matrix
Returns
contracted expression

Definition at line 599 of file Basic.cpp.

◆ mout()

MMAFormat HepLib::mout ( cout  )

◆ mu()

const Symbol HepLib::mu ( "mu"  )

◆ mul2lst()

lst HepLib::mul2lst ( const ex &  expr)

convert mul to lst

Parameters
exprinput expression
Returns
lst

Definition at line 933 of file BASIC.cpp.

◆ mulInv()

numeric HepLib::mulInv ( numeric  a,
numeric  b 
)

Definition at line 31 of file Rational.cpp.

◆ NA()

const Symbol HepLib::NA ( "NA"  )

◆ NaN()

const Symbol HepLib::NaN ( "NaN"  )

◆ Newton()

ex HepLib::Newton ( const exvector &  keys,
const exvector &  values,
const ex &  d,
const ex  factor = 1 
)

Definition at line 105 of file Rational.cpp.

◆ nextprime() [1/2]

ex HepLib::nextprime ( const ex &  n)

Definition at line 2274 of file BASIC.cpp.

◆ nextprime() [2/2]

ex HepLib::nextprime ( int  n)

Definition at line 2278 of file BASIC.cpp.

◆ NF()

const Symbol HepLib::NF ( "NF"  )

◆ nH()

const Symbol HepLib::nH ( "nH"  )

◆ nL()

const Symbol HepLib::nL ( "nL"  )

◆ NN()

ex HepLib::NN ( ex  expr,
int  digits 
)

the nuerical evaluation

Parameters
exprinput expression
digitsprecision digits
Returns
the nuerical expression

Definition at line 1278 of file BASIC.cpp.

◆ node_number()

long long HepLib::node_number ( const ex &  expr,
int  level = 0 
)

◆ normal_fermat()

ex HepLib::normal_fermat ( const ex &  expr,
bool  dfactor 
)

return the normalizatied expression, using fermat_numer_denom

Parameters
exprthe input expression
dfactortrue for factorize on the denominator
Returns
the normalized expression: numer/denom

Definition at line 1831 of file BASIC.cpp.

◆ normal_flint()

ex HepLib::normal_flint ( const ex &  expr,
int  opt = o_flint 
)

◆ now()

string HepLib::now ( bool  use_date)

date/time string

Parameters
use_datedefualt true to include the date in the string
Returns
return date/time string

Definition at line 525 of file BASIC.cpp.

◆ numer_denom_fermat()

ex HepLib::numer_denom_fermat ( const ex &  expr,
bool  dfactor 
)

return the numerator and denominator after normalization

Parameters
exprthe input expression
dfactortrue for factorize on the denominator
Returns
a list of { numer, denom }

Definition at line 23 of file Fermat.cpp.

◆ numer_fermat()

ex HepLib::numer_fermat ( const ex &  expr)

Definition at line 170 of file Fermat.cpp.

◆ Permutations() [1/2]

void HepLib::Permutations ( int  n,
int  m,
std::function< void(const int *)>  f 
)

Definition at line 220 of file Functions.cpp.

◆ Permutations() [2/2]

void HepLib::Permutations ( int  n,
std::function< void(const int *)>  f 
)

Definition at line 213 of file Functions.cpp.

◆ PermutationsR()

void HepLib::PermutationsR ( int  n,
int  m,
std::function< void(const int *)>  f 
)

Definition at line 268 of file Functions.cpp.

◆ pn2mat()

ex HepLib::pn2mat ( ex  ps,
ex  ns,
ex  vars 
)
inline

Definition at line 109 of file Apart.cpp.

◆ pn2p()

ex HepLib::pn2p ( ex  pn)
inline

Definition at line 145 of file Apart.cpp.

◆ PostTree()

void HepLib::PostTree ( const ex &  e,
std::function< void(const ex &)>  f 
)
inline

Definition at line 679 of file BASIC.h.

◆ power_expand_2()

co_epvec_t HepLib::power_expand_2 ( const co_epvec_t co_epv,
int  n 
)

Definition at line 1077 of file BASIC.cpp.

◆ PreTree()

void HepLib::PreTree ( const ex &  e,
std::function< void(const ex &)>  f 
)
inline

Definition at line 676 of file BASIC.h.

◆ q2ex()

ex HepLib::q2ex ( __float128  num)

__float128 to ex

Parameters
numa __float128 number
Returns
a ex object for the number

Definition at line 867 of file BASIC.cpp.

◆ Rationalize()

ex HepLib::Rationalize ( const ex &  e,
int  dn 
)

Definition at line 2283 of file BASIC.cpp.

◆ RationalReconstruct() [1/2]

numeric HepLib::RationalReconstruct ( numeric  a,
numeric  p 
)

Definition at line 8 of file Rational.cpp.

◆ RationalReconstruct() [2/2]

numeric HepLib::RationalReconstruct ( vector< numeric >  aa,
vector< numeric >  pp 
)

Definition at line 66 of file Rational.cpp.

◆ REGISTER_FUNCTION() [1/5]

HepLib::REGISTER_FUNCTION ( a  ,
do_not_evalf_params().print_func< print_dflt >(a_print)   
)

Definition at line 20 of file IBP.cpp.

◆ REGISTER_FUNCTION() [2/5]

HepLib::REGISTER_FUNCTION ( HF  ,
do_not_evalf_params()   
)

◆ REGISTER_FUNCTION() [3/5]

HepLib::REGISTER_FUNCTION ( Matrix  ,
do_not_evalf_params().print_func< FCFormat > &Matrix_fc_print.conjugate_func(mat_conj).set_return_type(return_types::commutative)   
) const &

Definition at line 715 of file Basic.cpp.

◆ REGISTER_FUNCTION() [4/5]

HepLib::REGISTER_FUNCTION ( TR  ,
do_not_evalf_params(). conjugate_func(tr_conj). print_func< FormFormat > &TR_form_print. print_func< FCFormat > &TR_fc_print. set_return_type(return_types::commutative). expl_derivative_func(expl_TR_diff)   
)

◆ REGISTER_FUNCTION() [5/5]

HepLib::REGISTER_FUNCTION ( TTR  ,
do_not_evalf_params(). conjugate_func(ttr_conj). print_func< FormFormat > &TTR_form_print. print_func< FCFormat > &  TTR_fc_print 
)

◆ reset_precision()

void HepLib::reset_precision ( )

Definition at line 2313 of file BASIC.cpp.

◆ ReShare() [1/6]

void HepLib::ReShare ( const ex &  e)

Definition at line 2240 of file BASIC.cpp.

◆ ReShare() [2/6]

void HepLib::ReShare ( const ex &  e1,
const ex &  e2 
)

Definition at line 2250 of file BASIC.cpp.

◆ ReShare() [3/6]

void HepLib::ReShare ( const ex &  e1,
const ex &  e2,
const ex &  e3 
)

Definition at line 2256 of file BASIC.cpp.

◆ ReShare() [4/6]

void HepLib::ReShare ( const exvector &  ev)

Definition at line 2263 of file BASIC.cpp.

◆ ReShare() [5/6]

void HepLib::ReShare ( const exvector &  ev1,
const exvector &  ev2 
)

Definition at line 2268 of file BASIC.cpp.

◆ ReShare() [6/6]

void HepLib::ReShare ( const lst &  es)

Definition at line 2245 of file BASIC.cpp.

◆ RunOS()

string HepLib::RunOS ( const string &  cmd)

run symtem command and return the output as string

Parameters
cmdsymtem command
Returns
the command output

Definition at line 571 of file BASIC.cpp.

◆ series_ex() [1/2]

ex HepLib::series_ex ( ex const &  expr_in,
ex const &  s0,
int  sn0 
)

the series like Mathematica, include s^n

Parameters
expr_ininput expression
s0the variable
sn0expanded upto sn0 order, include s0^sn0
Returns
the corresponding series

Definition at line 968 of file BASIC.cpp.

◆ series_ex() [2/2]

ex HepLib::series_ex ( ex const &  expr_in,
symbol const &  s0,
int  sn0 
)

the series like Mathematica, include s^n

Parameters
expr_ininput expression
s0the variable
sn0expanded upto sn0 order, include s0^sn0
Returns
the corresponding series

Definition at line 980 of file BASIC.cpp.

◆ set_precision()

void HepLib::set_precision ( long  prec,
bool  push 
)

Definition at line 2304 of file BASIC.cpp.

◆ sort_lst()

void HepLib::sort_lst ( lst &  ilst,
bool  less 
)

sort the list in less order, or the reverse

Parameters
ilstinput lst, will be updated after call
lesstrue for less order

Definition at line 79 of file Sort.cpp.

◆ sort_lst_by()

void HepLib::sort_lst_by ( lst &  ilst,
int  ki,
bool  less 
)

sort the list in less order, or the reverse

Parameters
ilstinput lst, will be updated after call
kithe sort key is at .op(n)
lesstrue for less order

Definition at line 91 of file Sort.cpp.

◆ sort_vec()

void HepLib::sort_vec ( exvector &  ivec,
bool  less 
)

sort the list in less order, or the reverse

Parameters
ivecinput exvector, will be updated after call
lesstrue for less order

Definition at line 54 of file Sort.cpp.

◆ sort_vec_by()

void HepLib::sort_vec_by ( exvector &  ivec,
int  ki,
bool  less 
)

sort the list in less order, or the reverse

Parameters
ivecinput exvector, will be updated after call
kithe sort key is at .op(n)
lesstrue for less order

Definition at line 67 of file Sort.cpp.

◆ SortPermutation()

exmap HepLib::SortPermutation ( const ex &  in_expr,
const lst &  xs 
)

Sort for all permuations, and return xs w.r.t. 1st permutation.

Parameters
in_exprthe input expression, as the sort key, no need of polynormial of xs
xsthe permutation list
Returns
x-replacement

Definition at line 196 of file IBP.cpp.

◆ sp() [1/2]

ex HepLib::sp ( const ex &  a)

Definition at line 241 of file Pair.cpp.

◆ SP() [1/2]

ex HepLib::SP ( const ex &  a,
bool  use_map = false 
)

Definition at line 166 of file Pair.cpp.

◆ sp() [2/2]

ex HepLib::sp ( const ex &  a,
const ex &  b 
)

translated the vector dot a.b to a*b, useful in SecDec

Parameters
athe 1st vector argument or a symbol
bthe 2nd vector or a symbol
Returns
expression with vector name left only

Definition at line 237 of file Pair.cpp.

◆ SP() [2/2]

ex HepLib::SP ( const ex &  a,
const ex &  b,
bool  use_map 
)

Function similar to SPD/FVD in FeynCalc.

Parameters
athe 1st vector/index
bthe 2nd vector/index
use_maptrue for apply the SP_map in the function call
Returns
expanded/translated Pair objects

Definition at line 175 of file Pair.cpp.

◆ SP2sp()

ex HepLib::SP2sp ( const ex &  exin)

convert SP(a,b) to sp(a,b)

Parameters
exinthe input expression
Returns
expression with SP(a,b) replaced to sp(a,b)

Definition at line 302 of file Pair.cpp.

◆ sp_map()

exmap HepLib::sp_map ( )

the SP_map with SP(a,b) replaced to sp(a,b)

Returns
the SP_map with SP(a,b) replaced to sp(a,b)

Definition at line 318 of file Pair.cpp.

◆ split() [1/2]

std::vector<std::string> HepLib::split ( const std::string &  s,
char  delimiter 
)

split the string into serveral part, separated by the delimiter

Parameters
sthe input string
delimiterthe char delimiter
Returns
return separated string vector

Definition at line 499 of file BASIC.cpp.

◆ split() [2/2]

vector<std::string> HepLib::split ( const string &  s,
char  delimiter 
)

◆ str2ex() [1/2]

ex HepLib::str2ex ( const string &  expr)

convert string to ex expression, using Parser internally

Parameters
exprexpression in string format
Returns
the parsed expression

Definition at line 681 of file BASIC.cpp.

◆ str2ex() [2/2]

ex HepLib::str2ex ( const string &  expr,
symtab  stab 
)

convert string to ex expression, using Parser internally

Parameters
exprexpression in string format
stabthe symtab
Returns
the parsed expression

Definition at line 670 of file BASIC.cpp.

◆ str2file() [1/2]

void HepLib::str2file ( char *  buff,
FILE *  fh 
)

Definition at line 795 of file BASIC.cpp.

◆ str2file() [2/2]

void HepLib::str2file ( const string &  ostr,
string  filename 
)

export string to a file

Parameters
ostrthe input string
filenameoutput file name

Definition at line 787 of file BASIC.cpp.

◆ str2lst() [1/2]

lst HepLib::str2lst ( const string &  expr)

convert string to the lst, using Parser internally

Parameters
expra lst in string format
Returns
the parsed expression

Definition at line 704 of file BASIC.cpp.

◆ str2lst() [2/2]

lst HepLib::str2lst ( const string &  expr,
symtab  stab 
)

convert string to the lst, using Parser internally

Parameters
expra lst in string format
stabthe symtab
Returns
the parsed expression

Definition at line 693 of file BASIC.cpp.

◆ string_contain()

bool HepLib::string_contain ( const string &  fstr,
const string &  mstr 
)

Definition at line 180 of file Functions.cpp.

◆ string_end_with()

bool HepLib::string_end_with ( const string &  fstr,
const string &  estr 
)

Definition at line 172 of file Functions.cpp.

◆ string_replace_all()

void HepLib::string_replace_all ( string &  str,
const string &  from,
const string &  to 
)

Definition at line 148 of file Functions.cpp.

◆ string_start_with()

bool HepLib::string_start_with ( const string &  fstr,
const string &  sstr 
)

Definition at line 164 of file Functions.cpp.

◆ string_trim()

void HepLib::string_trim ( string &  str)

Definition at line 156 of file Functions.cpp.

◆ subs()

ex HepLib::subs ( const ex &  e,
init_list  sl 
)
inline

Definition at line 51 of file BASIC.h.

◆ subs_w() [1/2]

void HepLib::subs_w ( exmap &  repl)

Definition at line 2228 of file BASIC.cpp.

◆ subs_w() [2/2]

void HepLib::subs_w ( lst &  repl)

Definition at line 2233 of file BASIC.cpp.

◆ TF()

const Symbol HepLib::TF ( "TF"  )

◆ Thiele()

ex HepLib::Thiele ( const exvector &  keys,
const exvector &  values,
const ex &  d 
)

Definition at line 81 of file Rational.cpp.

◆ TIR()

ex HepLib::TIR ( const ex &  expr_in,
const lst &  loop_ps,
const lst &  ext_ps 
)

Tensor Index Reduction, note that we only handle numerator.

Parameters
expr_inexpression
loop_pslst contains loop vectors
ext_pslst constains external vectors
Returns
TIR result

Definition at line 112 of file TIR.cpp.

◆ ToCACF()

ex HepLib::ToCACF ( const ex &  e)

Definition at line 776 of file Basic.cpp.

◆ ToCF()

ex HepLib::ToCF ( const ex &  e)

Definition at line 741 of file Basic.cpp.

◆ UF()

lst HepLib::UF ( const ex &  props,
const ex &  ns,
const ex &  loops,
const ex &  tloops,
const ex &  lsubs,
const ex &  tsubs 
)

UF function, from FIRE.m.

Parameters
psthe list of propagator
nsthe list of exponent
loopsthe list of loop momenta
tloopsthe list of transverse/quasi momenta
lsubsthe replacements for loops
tsubsthe replacements for tloops
Returns
lst of {U1, U2, F, sign}

Definition at line 420 of file IBP.cpp.

◆ UnContract()

ex HepLib::UnContract ( const ex  expr,
const lst &  loop_ps,
const lst &  ext_ps = lst{} 
)

Definition at line 43 of file TIR.cpp.

◆ vec2lst()

lst HepLib::vec2lst ( const exvector &  ev)

convert exvector to lst

Parameters
exvecinput exvector
Returns
lst

Definition at line 902 of file BASIC.cpp.

◆ vs()

const Symbol HepLib::vs ( "vs"  )

◆ vz()

const Symbol HepLib::vz ( "vz"  )

◆ xlst() [1/2]

lst HepLib::xlst ( int  bi,
int  ei 
)

return a lst: x(bi), x(bi+1), ..., x(ei)

Parameters
bistart index
eiend index
Returns
the x lst

Definition at line 946 of file BASIC.cpp.

◆ xlst() [2/2]

lst HepLib::xlst ( int  ei)

return a lst: x(0), x(1), ..., x(ei)

Parameters
eiend index
Returns
the x lst

Definition at line 957 of file BASIC.cpp.

◆ xPositive()

bool HepLib::xPositive ( ex const  expr)

check the expr is xPositive, i.e., each x-monomial item is postive

Parameters
exprinput expression
Returns
xPositive or not

Definition at line 1290 of file BASIC.cpp.

◆ xSign()

int HepLib::xSign ( ex const  expr)

the always sign for expr

Parameters
exprinput expression
Returns
1 for xPositive exprs, -1 when -expr is xPositive, 0 for others

Definition at line 1312 of file BASIC.cpp.

Variable Documentation

◆ _o_

int HepLib::_o_ = 0

Definition at line 103 of file Init.cpp.

◆ Apart_using_fermat

bool HepLib::Apart_using_fermat = true

Definition at line 207 of file Init.cpp.

◆ as

const Symbol HepLib::as("as")

◆ CA

const Symbol HepLib::CA("CA")

◆ cache_limit

long long HepLib::cache_limit = -1

Definition at line 154 of file Init.cpp.

◆ CF

const Symbol HepLib::CF("CF")

◆ cln_prec_stack

std::stack< cln::float_format_t > HepLib::cln_prec_stack

Definition at line 350 of file Init.cpp.

◆ Color_HighLight

const char * HepLib::Color_HighLight = WHITE

Definition at line 248 of file BASIC.cpp.

◆ d

const Symbol HepLib::d("d")

◆ Debug

bool HepLib::Debug = false

Definition at line 141 of file Init.cpp.

◆ digits_stack

std::stack< long > HepLib::digits_stack

Definition at line 351 of file Init.cpp.

◆ ep

const Symbol HepLib::ep("ep")

◆ eps

const Symbol HepLib::eps("eps")

◆ epz

const Symbol HepLib::epz("epz")

◆ ErrColor

const char * HepLib::ErrColor = RED

Definition at line 246 of file BASIC.cpp.

◆ error_pass_dp

slong HepLib::error_pass_dp = 100

Definition at line 344 of file Init.cpp.

◆ fcout

FCFormat HepLib::fcout(cout)

◆ fermat_using_array

int HepLib::fermat_using_array = 0

Definition at line 151 of file Init.cpp.

◆ fermat_weight

map< ex, long long, ex_is_less > HepLib::fermat_weight

Definition at line 152 of file Init.cpp.

◆ form_expand_all

const int HepLib::form_expand_all = 4

Definition at line 205 of file Init.cpp.

◆ form_expand_ci

const int HepLib::form_expand_ci = 2

Definition at line 203 of file Init.cpp.

◆ form_expand_li

const int HepLib::form_expand_li = 3

Definition at line 204 of file Init.cpp.

◆ form_expand_mode

int HepLib::form_expand_mode = form_expand_tr

Definition at line 206 of file Init.cpp.

◆ form_expand_none

const int HepLib::form_expand_none = 0

Definition at line 201 of file Init.cpp.

◆ form_expand_tr

const int HepLib::form_expand_tr = 1

Definition at line 202 of file Init.cpp.

◆ form_trace_all

const int HepLib::form_trace_all = 1

Definition at line 196 of file Init.cpp.

◆ form_trace_auto

const int HepLib::form_trace_auto = 0

Definition at line 195 of file Init.cpp.

◆ form_trace_each_all

const int HepLib::form_trace_each_all = 2

Definition at line 197 of file Init.cpp.

◆ form_trace_each_each

const int HepLib::form_trace_each_each = 3

Definition at line 198 of file Init.cpp.

◆ form_trace_mode

int HepLib::form_trace_mode = form_trace_auto

Definition at line 199 of file Init.cpp.

◆ form_using_dim4

bool HepLib::form_using_dim4 = false

Definition at line 209 of file Init.cpp.

◆ form_using_gamma5

bool HepLib::form_using_gamma5 = false

Definition at line 210 of file Init.cpp.

◆ form_using_su3

bool HepLib::form_using_su3 = false

Definition at line 208 of file Init.cpp.

◆ GiNaC_Parallel_Batch

int HepLib::GiNaC_Parallel_Batch = 0

Definition at line 146 of file Init.cpp.

◆ GiNaC_Parallel_NB

map< string, int > HepLib::GiNaC_Parallel_NB

Definition at line 147 of file Init.cpp.

◆ GiNaC_Parallel_NP

map< string, int > HepLib::GiNaC_Parallel_NP

Definition at line 144 of file Init.cpp.

◆ GiNaC_Parallel_PRE

map< string, string > HepLib::GiNaC_Parallel_PRE

Definition at line 149 of file Init.cpp.

◆ GiNaC_Parallel_Process

int HepLib::GiNaC_Parallel_Process = -1

Definition at line 143 of file Init.cpp.

◆ GiNaC_Parallel_ReWR

map< string, bool > HepLib::GiNaC_Parallel_ReWR

Definition at line 150 of file Init.cpp.

◆ GiNaC_Parallel_RM

map< string, bool > HepLib::GiNaC_Parallel_RM

Definition at line 148 of file Init.cpp.

◆ GiNaC_Parallel_Verb

map< string, int > HepLib::GiNaC_Parallel_Verb

Definition at line 145 of file Init.cpp.

◆ gs

const Symbol HepLib::gs("gs")

◆ iEpsilon

const iSymbol HepLib::iEpsilon("iEpsilon")

◆ iEpsilonN

const ex HepLib::iEpsilonN = I*pow(ex(10), -50)

Definition at line 138 of file Init.cpp.

◆ iet

const Symbol HepLib::iet("iet")

◆ In_GiNaC_Parallel

bool HepLib::In_GiNaC_Parallel = false

Definition at line 142 of file Init.cpp.

◆ INC_FLAGS

string HepLib::INC_FLAGS = "-I'"+InstallPrefix+"/include' " + "@INC_FLAGS@"

Definition at line 160 of file Init.cpp.

◆ InstallPrefix

string HepLib::InstallPrefix = install_prefix()

Definition at line 159 of file Init.cpp.

◆ LIB_FLAGS

string HepLib::LIB_FLAGS = "-L'"+InstallPrefix+"/lib' -Wl,-rpath,'"+InstallPrefix+"'/lib " + "@LIB_FLAGS@"

Definition at line 161 of file Init.cpp.

◆ MapPreSP

exmap HepLib::MapPreSP

Definition at line 335 of file Init.cpp.

◆ mout

MMAFormat HepLib::mout(cout)

◆ mu

const Symbol HepLib::mu("mu")

◆ NA

const Symbol HepLib::NA("NA")

◆ NaN

const Symbol HepLib::NaN("NaN")

◆ NF

const Symbol HepLib::NF("NF")

◆ nH

const Symbol HepLib::nH("nH")

◆ nL

const Symbol HepLib::nL("nL")

◆ NNDigits

int HepLib::NNDigits = 100

Definition at line 155 of file Init.cpp.

◆ nopat

unsigned HepLib::nopat = GiNaC::subs_options::no_pattern

Definition at line 88 of file Init.cpp.

◆ o_fermat

const int HepLib::o_fermat = (_o_++)

Definition at line 106 of file Init.cpp.

◆ o_fermat_form

const int HepLib::o_fermat_form = (_o_++)

Definition at line 115 of file Init.cpp.

◆ o_fermatfD

const int HepLib::o_fermatfD = (_o_++)

Definition at line 107 of file Init.cpp.

◆ o_fermatN

const int HepLib::o_fermatN = (_o_++)

Definition at line 108 of file Init.cpp.

◆ o_flint

const int HepLib::o_flint = (_o_++)

Definition at line 110 of file Init.cpp.

◆ o_flintf

const int HepLib::o_flintf = (_o_++)

Definition at line 111 of file Init.cpp.

◆ o_flintfD

const int HepLib::o_flintfD = (_o_++)

Definition at line 112 of file Init.cpp.

◆ o_form

const int HepLib::o_form = (_o_++)

Definition at line 109 of file Init.cpp.

◆ o_none

const int HepLib::o_none = (_o_++)

Definition at line 104 of file Init.cpp.

◆ o_normal

const int HepLib::o_normal = (_o_++)

Definition at line 105 of file Init.cpp.

◆ o_normal_fermat

const int HepLib::o_normal_fermat = (_o_++)

Definition at line 113 of file Init.cpp.

◆ o_normal_form

const int HepLib::o_normal_form = (_o_++)

Definition at line 114 of file Init.cpp.

◆ PRE

string HepLib::PRE = " "

Definition at line 140 of file Init.cpp.

◆ SP_map

exmap HepLib::SP_map

Definition at line 179 of file Init.cpp.

◆ TF

const Symbol HepLib::TF("TF")

◆ using_cache

bool HepLib::using_cache = true

Definition at line 153 of file Init.cpp.

◆ Verbose

int HepLib::Verbose = 0

Definition at line 139 of file Init.cpp.

◆ Version

string HepLib::Version = "1.5 @2024-04-28"

Definition at line 82 of file Init.cpp.

◆ vs

const Symbol HepLib::vs("vs")

◆ vz

const Symbol HepLib::vz("vz")

◆ w

ex HepLib::w = wild()

Definition at line 90 of file Init.cpp.

◆ w0

ex HepLib::w0 = wild(0)

Definition at line 499 of file BASIC.h.

◆ w1

ex HepLib::w1 = wild(1)

Definition at line 499 of file BASIC.h.

◆ w2

ex HepLib::w2 = wild(2)

Definition at line 499 of file BASIC.h.

◆ w3

ex HepLib::w3 = wild(3)

Definition at line 499 of file BASIC.h.

◆ w4

ex HepLib::w4 = wild(4)

Definition at line 499 of file BASIC.h.

◆ w5

ex HepLib::w5 = wild(5)

Definition at line 499 of file BASIC.h.

◆ w6

ex HepLib::w6 = wild(6)

Definition at line 499 of file BASIC.h.

◆ w7

ex HepLib::w7 = wild(7)

Definition at line 499 of file BASIC.h.

◆ w8

ex HepLib::w8 = wild(8)

Definition at line 499 of file BASIC.h.

◆ w9

ex HepLib::w9 = wild(9)

Definition at line 499 of file BASIC.h.

◆ WarnColor

const char * HepLib::WarnColor = MAGENTA

Definition at line 247 of file BASIC.cpp.