[no subject]

• To: mathgroup at yoda.physics.unc.edu
• From: John Lee <lee at math.washington.edu>
• Date: Sun, 2 Feb 92 11:35:33 -0800

```In <9201311923.AA02621 at fubini.math.ufl.edu>, livio flaminio writes:

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

... (* some definitions omitted *)

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

...

... 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?

The problem is that your pattern requires _both_ factors of
NonCommutativeMultiply to be multiplied by constants.  Try the following:

In[1]:= Unprotect[NonCommutativeMultiply];

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

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

In[4]:= NonCommutativeMultiply[ b_ , Times[d_ ,c_]]:=
Times[ d, NonCommutativeMultiply[ b, c]] /; NumberQ[d]

In[5]:= NonCommutativeMultiply[ Times[a_ ,b_] , c_]:=
Times[a, NonCommutativeMultiply[  b ,  c]] /; NumberQ[a]

In[6]:= brac[a_, b_]:= a**b - b**a

In[7]:= mplus= (x - I y) /2;

In[8]:= mminus= (x+ I y)/2;

In[9]:= brac[mplus, mminus]

-(x ** x - I x ** y + I (y ** x - I y ** y))
Out[9]= -------------------------------------------- +
4

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

In[10]:= %//Expand

I          I
Out[10]= - x ** y - - y ** x
2          2

Jack Lee
Dept. of Mathematics
University of Washington

```

• Prev by Date: Can I make MatrixForm the default in Mma?
• Next by Date: data transfer from Mma
• Previous by thread: Can I make MatrixForm the default in Mma?
• Next by thread: data transfer from Mma