]> www.ginac.de Git - ginac.git/blobdiff - ginac/clifford.cpp
canonicalize_clifford() was omitting some ONEs
[ginac.git] / ginac / clifford.cpp
index 7d4596d04682e3df479d5a97a8e5ce7f6d5eba2a..e6f9c2914be0a638f0e76cabf4879ca2f18fb727 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's clifford algebra (Dirac gamma) objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -484,6 +484,21 @@ ex clifford::thiscontainer(std::auto_ptr<exvector> vp) const
        return clifford(representation_label, vp);
 }
 
+ex diracgamma5::conjugate() const
+{      
+       return _ex_1 * (*this);
+}
+
+ex diracgammaL::conjugate() const
+{
+       return (new diracgammaR)->setflag(status_flags::dynallocated);
+}
+
+ex diracgammaR::conjugate() const
+{
+       return (new diracgammaL)->setflag(status_flags::dynallocated);
+}
+
 //////////
 // global functions
 //////////
@@ -742,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;