On 11/25/10, Edwin Woollett <woollett at charter.net> wrote:
> The defrule code produces a zero matrix result, while
> the formal expansion formula produces the
> correct answer ( 2*%i * Sig[1] ).
Good catch, Ted. I wrote the product rules incorrectly.
Here is a patch. Please try it again and let us know how it turns out.
best
Robert Dodier
PS.
@@ -51,8 +51,8 @@
nctimesp (e) := not atom(e) and op(e) = ".";
matchdeclare (aa, nctimesp);
matchdeclare (cc, all);
-defrule (rcommp1, comm (aa, cc), first (aa) . comm (rest (aa), cc) +
comm (rest (aa, -1), cc) . last (aa));
-defrule (rcommp2, comm (cc, aa), first (aa) . comm (cc, rest (aa)) +
comm (cc, rest (aa, -1)) . last (aa));
+defrule (rcommp1, comm (aa, cc), first (aa) . comm (rest (aa), cc) +
comm (first (aa), cc) . rest (aa));
+defrule (rcommp2, comm (cc, aa), first (aa) . comm (cc, rest (aa)) +
comm (cc, first (aa)) . rest (aa));
matchdeclare (aa, nonscalarp);
matchdeclare (nn, integerp);