maxima programming questions



Greetings!  I've written a little code to generate multiplication
tables and matrix forms for discrete Weyl/Heisenberg operators on a
torus.  I'm not too familiar with maxima, and would like to solicit
advice from the experts.

Perhaps just to start with one item.  Say l is a 2*nth root of unity.  

declare (l,constant);
declare (l,complex);
declare (lb,constant); /* lb=1/l */
declare (lb,complex);
algebraic:true;
tellrat(l^(2*n)-1);
tellrat(l^n+1);
tellrat(lb^(2*n)-1);
tellrat(lb^n+1);

This takes care of factors of l^n, leaving terms like l^m, -1/l^m.

Now say I want to simplify all monomials in l,lb to result in 1, -1,
l^m or lb^m, n>m>0.  In other words, l^(n+m) -> lb^(n-m).  tellrat()
does not take an expression in two variables anymore unlike what is
said in the docs (bug?).  I've written a hack of a function using log
to basically accomplish this, but I think there should be a better
way.

BTW:

powers(1/lb,'lb);

The second argument of "$powers" must be a symbol, instead found lb
 -- an error. To debug this try: debugmode(true);
(%i50) 

Take care,
-- 
Camm Maguire			     		    camm at maguirefamily.org
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah