MathGroup Archive 1992

[Date Index] [Thread Index] [Author Index]

Search the Archive

About NonCommutativeMultiply

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: About NonCommutativeMultiply
  • From: <flaminio at math.ufl.edu>
  • Date: Fri, 31 Jan 92 14:23:54 EST

In an attempt to define a non commutative algebra over the complex by  
using NonCommutativeMultiply I defined

Unprotect[NonCommutativeMultiply]

NonCommutativeMultiply[ a_ + b_ ,c_ ]:=
NonCommutativeMultiply[ a  ,c] +
NonCommutativeMultiply[  b ,c] 


NonCommutativeMultiply[ a_ , b_ + c_]:=
NonCommutativeMultiply[ a  ,b] +
NonCommutativeMultiply[  a ,c] 


NonCommutativeMultiply[ Times[a_ ,b_] , Times[d_ ,c_]]:=
Times[Times[a, d] ,NonCommutativeMultiply[  b ,  c]] /; NumberQ[a] &&   
NumberQ[d]

But this does not produces the semplifications I wanted. For example  
setting:

brac[a_, b_]:= a**b - b**a
mplus= (x - I y) /2
mminus= (x+ I y)/2
brac[mplus, mminus]

produces the following output


x ** x + x ** (I y) + (-I y) ** x + y ** y
------------------------------------------
                    4

where the semplifications x ** (I y) = I x ** y and (-I y) ** x = -I  
y ** x have not been carried out. Any clue of why that is the case?

By the way the (mathematically) equivalent definition 


mplus= x/2 - I y/2
mminus= x/2 + I y/2

do produce all the sempligfication I wanted.

livio flaminio


 








  • Prev by Date: more switching with lists
  • Next by Date: ReplaceAll bug
  • Previous by thread: more switching with lists
  • Next by thread: ReplaceAll bug