]> www.ginac.de Git - ginac.git/blobdiff - ginac/clifford.cpp
dirac_slash should give something with non-zero metric.
[ginac.git] / ginac / clifford.cpp
index 67aa2c97343fe4d643fd36e4b86edd4284036c33..e166d0847bac8b273d1f4e1fa4cc456ec25827fc 100644 (file)
@@ -206,6 +206,21 @@ ex & clifford::let_op(size_t i)
                return inherited::let_op(i);
 }
 
+ex clifford::subs(const exmap & m, unsigned options) const
+{
+       ex subsed = inherited::subs(m, options);
+       if(is_a<clifford>(subsed)) {
+               ex prevmetric = ex_to<clifford>(subsed).metric;
+               ex newmetric = prevmetric.subs(m, options);
+               if(!are_ex_trivially_equal(prevmetric, newmetric)) {
+                       clifford c = ex_to<clifford>(subsed);
+                       c.metric = newmetric;
+                       subsed = c;
+               }
+       }
+       return subsed;
+}
+
 int clifford::compare_same_type(const basic & other) const
 {
        GINAC_ASSERT(is_a<clifford>(other));
@@ -815,7 +830,10 @@ ex dirac_slash(const ex & e, const ex & dim, unsigned char rl)
        // Slashed vectors are actually stored as a clifford object with the
        // vector as its base expression and a (dummy) index that just serves
        // for storing the space dimensionality
-       return clifford(e, varidx(0, dim), 0, rl);
+
+       static varidx xi((new symbol)->setflag(status_flags::dynallocated), dim),
+               chi((new symbol)->setflag(status_flags::dynallocated), dim);
+   return clifford(e, varidx(0, dim), indexed((new minkmetric)->setflag(status_flags::dynallocated), symmetric2(), xi, chi), rl, true);
 }
 
 /** Check whether a given tinfo key (as returned by return_type_tinfo()