How to Install HepLib
Download and extract the
all-in-onearchivewget https://heplib.github.io/download/Install.tar.gz tar xfv Install.tar.gzInstall using
install.shcd Install INSTALL_PATH=<Path to Install> jn=8 ./install.sh # INSTALL_PATH=<Path to Install> jn=8 ./install-M1.sh # Apple Silicon Chip
Try a simple example
Prepare a
C++file namedtrace.cppwith the following content#include "HepLib.h" using namespace HepLib; int main(int argc, char** argv) { Index mu("mu"), nu("nu"); Vector p1("p1"), p2("p2"); Symbol m("m"); //note GAS(1) in gline, corresponds to the identity matrix ex gline = GAS(p1)*GAS(mu)*(GAS(p2)+m*GAS(1))*GAS(mu); ex trace = form(TR(gline)); cout << trace << endl; return 0; }Compile
trace.cppusingheplib++fromHepLibINSTALL_PATH/bin/heplib++ -o trace trace.cppRun
traceto get the trace for./trace # -4*d*p2.p1+8*p2.p1