Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1992

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

Search the Archive

About NonCommutativeMultiply

  • To: mathgroup at
  • Subject: About NonCommutativeMultiply
  • From: <flaminio at>
  • 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


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] &&   

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

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

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