From 43e0a8f5ca5e1c48cef5daaf014acdbca4e44568 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Thu, 26 Apr 2001 19:36:07 +0000 Subject: [PATCH 1/1] - dirac_trace() handles arbitrary expressions (even unexpanded), including gamma5 - implemented color_trace() - eps0123() creates a 4-dimensional epsilon tensor without checking the indices (so they may be D-dimensional); this may become a different class soon, but for now all the implemented properties of the standard epsilon tensor also apply to eps0123 --- ginac/clifford.cpp | 55 ++++++++++++++++++++++------- ginac/clifford.h | 13 +++++-- ginac/color.cpp | 87 ++++++++++++++++++++++++++++++++++++++++++++++ ginac/color.h | 6 ++++ ginac/tensor.cpp | 12 +++++++ ginac/tensor.h | 12 +++++++ 6 files changed, 170 insertions(+), 15 deletions(-) diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index d346c44a..8a8bfe09 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -24,6 +24,7 @@ #include "ex.h" #include "idx.h" #include "ncmul.h" +#include "symbol.h" #include "print.h" #include "archive.h" #include "debugmsg.h" @@ -301,7 +302,20 @@ ex dirac_gamma5(unsigned char rl) return clifford(diracgamma5(), rl); } -ex dirac_trace(const ex & e, unsigned char rl = 0) +ex dirac_slash(const ex & e, const ex & dim, unsigned char rl) +{ + varidx mu((new symbol)->setflag(status_flags::dynallocated), dim); + return indexed(e, mu.toggle_variance()) * dirac_gamma(mu, rl); +} + +/** Check whether a given tinfo key (as returned by return_type_tinfo() + * is that of a clifford object with the specified representation label. */ +static bool is_clifford_tinfo(unsigned ti, unsigned char rl) +{ + return ti == (TINFO_clifford + rl); +} + +ex dirac_trace(const ex & e, unsigned char rl) { if (is_ex_of_type(e, clifford)) { @@ -325,12 +339,8 @@ ex dirac_trace(const ex & e, unsigned char rl = 0) ex prod = _ex1(); for (unsigned i=0; isetflag(status_flags::dynallocated), dim), + mu2((new symbol)->setflag(status_flags::dynallocated), dim), + mu3((new symbol)->setflag(status_flags::dynallocated), dim), + mu4((new symbol)->setflag(status_flags::dynallocated), dim); + exvector v; + v.reserve(num + 3); + v.push_back(dirac_gamma(mu1, rl)); + v.push_back(dirac_gamma(mu2, rl)); + v.push_back(dirac_gamma(mu3, rl)); + v.push_back(dirac_gamma(mu4, rl)); + for (int i=1; isetflag(status_flags::dynallocated), 8); + + exvector v1; + v1.reserve(num - 2); + for (int i=0; i