Right, what I was trying to say is that I needed a way to properly define a commutator for the covariant derivative defined as D[-i]u = P[-i][u] + [A[-i], u]. The problem was that the 'times' product was commutative, so the commutator kept giving me zero. I found that I can define a product like this to get around it:
<< xAct`xTensor`;
DefManifold[Mint, 4, {a, b, c, d, f, h}];
DefMetric[-1, \[Eta][-a, -b], PD, PrintAs -> "\[Eta]", FlatMetric -> True];
DefTensor[GenJ[-a], {Mint}, PrintAs -> "J"];
DefProduct[prod, {
AssociativeProductQ -> True,
IdentityElementOfProduct -> 1,
CommutativityOfProduct -> None,
GradedProductQ -> False,
GradeOfProduct -> 0,
ScalarsOfProduct -> NumericQ,
PrintAs -> " "}];
Now though, when I try using MakeRule:
Rule1 = MakeRule[{prod[GenJ[-b], GenJ[-a]], prod[GenJ[-a], GenJ[-b]]},
MetricOn -> All];
prod[GenJ[-a], GenJ[-b]] - prod[GenJ[-b], GenJ[-a]] /. Rule1 // ToCanonical
It returns:
-(prod[GenJ[-a], GenJ[-b]]) + prod[GenJ[-b], GenJ[-a]]
hich should be zero. The rule doesn't apply to the whole expression—but when it's just a single term, it does.
Do you know any way to handle this?
Thank you
Alex