canonicalize_clifford() was omitting some ONEs
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 30 Jan 2004 17:54:53 +0000 (17:54 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Fri, 30 Jan 2004 17:54:53 +0000 (17:54 +0000)
check/exam_clifford.cpp
doc/tutorial/ginac.texi
ginac/clifford.cpp

index c1a2b22..b6ec71e 100644 (file)
@@ -232,7 +232,7 @@ static unsigned clifford_check5()
        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 0427540..beae21b 100644 (file)
@@ -2828,7 +2828,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 679def3..e6f9c29 100644 (file)
@@ -757,7 +757,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;