From 20466971843965316dba5afb7510e6337276f752 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Tue, 24 Apr 2001 17:21:16 +0000 Subject: [PATCH] added first trace check --- check/exam_clifford.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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; -- 2.44.0