]> www.ginac.de Git - ginac.git/blobdiff - check/exam_indexed.cpp
added one more check
[ginac.git] / check / exam_indexed.cpp
index bbbbf4278f388718b29f580549a81f41fea0a441..10eb3d01e0b65b5dba44a18f4013cd264c918490 100644 (file)
@@ -307,6 +307,30 @@ 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);
+       varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4);
+       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);
+
+       e = indexed(p, mu, mu.toggle_variance()) - indexed(p, nu, nu.toggle_variance());
+       result += check_equal_simplify(e, 0);
+
+       return result;
+}
+
 unsigned exam_indexed(void)
 {
        unsigned result = 0;
@@ -321,6 +345,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;