Yesterday, I try to define some rules for non-communicative multiplication, here. I find some quite helpful rules, but things still do not work properly; the distributive rule can't be applied (e.g.: -a**(b + c) = -a**b - a**c
), and the identity is not recongnized (e.g.: 1**a
should be equal to a
). Then I try to solve all these problem by removing the attribute Orderless
from the built-in operator Times
.
Any way, then I have some expression as (some term omitted):
ClearAttributes[Times, Orderless]
fab = a b + a b c + c a b + a^2 b^2 + a^3 b c + c a b^3
(It should be noted that a b
is not equal to b a
in my case).
I want to apply the relation a b = 1
and b a = 1
with the following rule:
rule ={a b -> 1, b a -> 1, a^i_ b^i_ -> 1 b^i_ a^i_ -> 1}
Sadly, It seems that the above rule doesn't work.