]> www.ginac.de Git - ginac.git/commitdiff
synced to HEAD (canonicalize_clifford() and the amazing invisible ONEs)
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 30 Jan 2004 17:58:03 +0000 (17:58 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 30 Jan 2004 17:58:03 +0000 (17:58 +0000)
check/exam_clifford.cpp
doc/tutorial/ginac.texi
ginac/clifford.cpp

index 9ff05f4b01e479eb4c15f303862a081112c9e6ce..f76ea1d68da4c616b661a011a73c782edce7dbb2 100644 (file)
@@ -232,7 +232,7 @@ static unsigned clifford_check5(void)
        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));
+       result += check_equal(canonicalize_clifford(e), 2*dirac_ONE()*lorentz_g(mu, nu));
 
        e = (dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(lam)
           + dirac_gamma(nu) * dirac_gamma(lam) * dirac_gamma(mu)
index e30578f7d57bebdfeb576089f149f30bd87bc510..d62661e5ff74b8735051df0ee1a837e0d41967ca 100644 (file)
@@ -2816,7 +2816,7 @@ You can use this to compare two expressions or for further simplifications:
 
     e = canonicalize_clifford(e);
     cout << e << endl;
-     // -> 2*eta~mu~nu
+     // -> 2*ONE*eta~mu~nu
 @}
 @end example
 
index c5e99add502914530f042a8786c8dad4a9bdf40d..3a3b84df4f39a6c4c3890977dfde3b5e31d7dda3 100644 (file)
@@ -728,7 +728,7 @@ ex canonicalize_clifford(const ex & e)
                                        base_and_index(it[0], b1, i1);
                                        base_and_index(it[1], b2, i2);
                                        it[0] = (lorentz_g(i1, i2) * b1 * b2).simplify_indexed();
-                                       it[1] = _ex2;
+                                       it[1] = v.size() == 2 ? _ex2 * dirac_ONE(ex_to<clifford>(it[1]).get_representation_label()) : _ex2;
                                        ex sum = ncmul(v);
                                        it[0] = save1;
                                        it[1] = save0;