Geometric Algebra implementtation



Hi,
I'm trying to implement a Geometric Algebra simplification using Maxima.
Geometric Product is defined as: ab = a^b + a<<b, if a is perpendicular of
b then ab = a^b. One advantage of geometric product to make many rotations
over matrix implementation is the ability to simplify some operations and
get a result with less calculations.

I consider the init_atensor(3,0,0); but didn't write.
To make Maxima simplify i used this code:
expand(((sqrt(3)-e[2] . e[3]-e[3] . e[1]-e[1] . e[2])/6)*(R*e[2] .
e[3]+G*e[3] . e[1]+B*e[1] . e[2])*((sqrt(3)+e[2] . e[3]+e[3] . e[1]+e[1] .
e[2])/6));
xthru(%);
scsimp(%,e[1]*e[1]=1,e[2]*e[2]=1,e[3]*e[3]=1,
(e[1].e[2])*(e[1].e[2])=-1,(e[2].e[3])*(e[2].e[3])=-1,(e[3].e[1])*(e[3].e[1])=-1,
(e[1].e[2])*(e[2].e[3])=-e[3].e[1],(e[1].e[2])*(e[3].e[1])=e[2].e[3],
(e[2].e[3])*(e[1].e[2])=e[3].e[1],(e[2].e[3])*(e[3].e[1])=-e[1].e[2],
(e[3].e[1])*(e[1].e[2])=-e[2].e[3],(e[3].e[1])*(e[2].e[3])=e[1].e[2]
);

First expand multiplication over sum (expand), after make all have the same
denominator (xthru) and finally simplify the geometric algebra products
(scsimp).

I'm not absolutely certain about the result correctness. But I want to
write a share/tensor/geometric_product.[dem/mac] to Maxima.

I'll examine a little more the code, in while can someone tell how write
scssimp(%,...) better. I want to define the following:
e[x].e[x]=1
e[y].e[x]=-e[x].e[y], if x != y

The . is the operation to matrix multiplication, but it appears to work
here to.
Where is the source code of expand?

Thank you,
Ricardo.