From: Christian Bauer Date: Tue, 24 Apr 2001 17:21:16 +0000 (+0000) Subject: added first trace check X-Git-Tag: release_0-8-2~5 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=20466971843965316dba5afb7510e6337276f752 added first trace check --- diff --git a/check/exam_clifford.cpp b/check/exam_clifford.cpp index 2b28be4c..6f1540a7 100644 --- a/check/exam_clifford.cpp +++ b/check/exam_clifford.cpp @@ -94,6 +94,27 @@ static unsigned clifford_check2(void) return result; } +static unsigned clifford_check3(void) +{ + // checks traces + + unsigned result = 0; + + symbol dim("D"), m("m"), q("q"); + varidx mu(symbol("mu"), dim), nu(symbol("nu"), dim); + scalar_products sp; + ex e; + + sp.add(q, q, pow(q, 2)); + + e = pow(m, 2) * indexed(q, mu) * indexed(q, nu) + * dirac_gamma(mu.toggle_variance()) * dirac_gamma(nu.toggle_variance()); + e = dirac_trace(e).simplify_indexed(sp); + result += check_equal(e, 4*pow(m, 2)*pow(q, 2)); + + return result; +} + unsigned exam_clifford(void) { unsigned result = 0; @@ -103,6 +124,7 @@ unsigned exam_clifford(void) result += clifford_check1(); cout << '.' << flush; result += clifford_check2(); cout << '.' << flush; + result += clifford_check3(); cout << '.' << flush; if (!result) { cout << " passed " << endl;