From: Christian Bauer Date: Fri, 18 May 2001 00:52:05 +0000 (+0000) Subject: added checks for dummy index renaming and canonicalize_clifford() X-Git-Tag: release_0-9-0~52 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=8a5bcc703e54153669eb60ff4d2c3bd64cd2af0c added checks for dummy index renaming and canonicalize_clifford() --- diff --git a/check/exam_clifford.cpp b/check/exam_clifford.cpp index 2d538354..dadd9e16 100644 --- a/check/exam_clifford.cpp +++ b/check/exam_clifford.cpp @@ -210,6 +210,34 @@ static unsigned clifford_check4(void) return result; } +static unsigned clifford_check5(void) +{ + // canonicalize_clifford() checks + + unsigned result = 0; + + symbol dim("D"); + varidx mu(symbol("mu"), dim), nu(symbol("nu"), dim), lam(symbol("lam"), dim); + ex e; + + e = dirac_gamma(mu) * dirac_gamma(nu) + dirac_gamma(nu) * dirac_gamma(mu); + result += check_equal(canonicalize_clifford(e), 2*lorentz_g(mu, nu)); + + e = (dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(lam) + + dirac_gamma(nu) * dirac_gamma(lam) * dirac_gamma(mu) + + dirac_gamma(lam) * dirac_gamma(mu) * dirac_gamma(nu) + - dirac_gamma(nu) * dirac_gamma(mu) * dirac_gamma(lam) + - dirac_gamma(lam) * dirac_gamma(nu) * dirac_gamma(mu) + - dirac_gamma(mu) * dirac_gamma(lam) * dirac_gamma(nu)) / 6 + + lorentz_g(mu, nu) * dirac_gamma(lam) + - lorentz_g(mu, lam) * dirac_gamma(nu) + + lorentz_g(nu, lam) * dirac_gamma(mu) + - dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(lam); + result += check_equal(canonicalize_clifford(e), 0); + + return result; +} + unsigned exam_clifford(void) { unsigned result = 0; @@ -221,6 +249,7 @@ unsigned exam_clifford(void) result += clifford_check2(); cout << '.' << flush; result += clifford_check3(); cout << '.' << flush; result += clifford_check4(); cout << '.' << flush; + result += clifford_check5(); cout << '.' << flush; if (!result) { cout << " passed " << endl; diff --git a/check/exam_indexed.cpp b/check/exam_indexed.cpp index bbbbf427..e1ee1eb1 100644 --- a/check/exam_indexed.cpp +++ b/check/exam_indexed.cpp @@ -307,6 +307,26 @@ static unsigned spinor_check(void) return result; } +static unsigned dummy_check(void) +{ + // check dummy index renaming + + unsigned result = 0; + + symbol p("p"), q("q"); + idx i(symbol("i"), 3), j(symbol("j"), 3), n(symbol("n"), 3); + ex e; + + e = indexed(p, i) * indexed(q, i) - indexed(p, j) * indexed(q, j); + result += check_equal_simplify(e, 0); + + e = indexed(p, i) * indexed(p, i) * indexed(q, j) * indexed(q, j) + - indexed(p, n) * indexed(p, n) * indexed(q, j) * indexed(q, j); + result += check_equal_simplify(e, 0); + + return result; +} + unsigned exam_indexed(void) { unsigned result = 0; @@ -321,6 +341,7 @@ unsigned exam_indexed(void) result += scalar_product_check(); cout << '.' << flush; result += edyn_check(); cout << '.' << flush; result += spinor_check(); cout << '.' << flush; + result += dummy_check(); cout << '.' << flush; if (!result) { cout << " passed " << endl;