]> www.ginac.de Git - ginac.git/commitdiff
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 c1a2b22ff58da2f5f8a968a37fe5f176d4963bd0..b6ec71e455317bccb9b56eed2e96372f35ac47a3 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);
        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)
 
        e = (dirac_gamma(mu) * dirac_gamma(nu) * dirac_gamma(lam)
           + dirac_gamma(nu) * dirac_gamma(lam) * dirac_gamma(mu)
index 0427540be2b2e834f7b95708c3f80d1252a3da69..beae21b448a4b4835fcad395270899e88375f91c 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;
 
     e = canonicalize_clifford(e);
     cout << e << endl;
-     // -> 2*eta~mu~nu
+     // -> 2*ONE*eta~mu~nu
 @}
 @end example
 
 @}
 @end example
 
index 679def3a737ad5bf003852f940ea5d012f7f9ef5..e6f9c2914be0a638f0e76cabf4879ca2f18fb727 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();
                                        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;
                                        ex sum = ncmul(v);
                                        it[0] = save1;
                                        it[1] = save0;