atensor problems/usage



Hello Viktor, thanks for the help and for the atensor package. It
finally does what I want it to do:
(%i1) load("atensor");
(%o1)      /usr/local/share/maxima/5.19post/share/tensor/atensor.mac
(%i2) init_atensor(clifford, 2);
(%o2)                                done
(%i3) declare([a,x,y,z],scalar);
(%o3)                                done
(%i4)
atensimp(trigreduce(expand((cos(a/2)-sin(a/2)*v[1].v[2]).(x*v[1]+y*v[2]+z*v[1].v[2]).(cos(a/2)+sin(a/2)*v[1].v[2]))));
(%o4) (v  . v ) z - v  sin(a) y + v  cos(a) y + v  sin(a) x + v  cos(a)x
        1    2       1             2             2             1

Regards

Am Samstag, den 14.11.2009, 22:34 -0500 schrieb Viktor T. Toth:
> Jan-David,
> 
> The (built-in) functions sf(), af() and av() are actually evaluated only
> when their arguments are base vectors. For example:
> 
> (%i1) load(atensor);
> (%o1)          /usr/share/maxima/5.15.0/share/tensor/atensor.mac
> (%i2) init_atensor(clifford,0,0,2);
> (%o2)                                done
> (%i3) atensimp(U.V-V.U);
> (%o3)                       2 (U . V) - 2 sf(U, V)
> (%i4) U:v[1]+v[2];
> (%o4)                               v  + v
>                                      2    1
> (%i5) V:3*v[1]-2*v[2];
> (%o5)                             3 v  - 2 v
>                                      1      2
> (%i6) atensimp(U.V-V.U);
> (%o6)       - 5 (v  . v ) - 3 (v  . v  - 1) + 2 (- v  . v  - 1) - 1
>                   1    2        1    2              1    2
> (%i7) factor(%);
> (%o7)                           - 10 (v  . v )
>                                        1    2
> 
> (I was using capital U and V to distinguish these symbols, notably V, from
> the default symbol for the base vector, lower-case v.)
> 
> As a general rule, it is best not to use atensimp() until the entire
> expression can be written out in terms of base vectors; otherwise, you may
> end up with terms like sf(U,V) that cannot be simplified further even after
> substitution:
> 
> (%i1) load(atensor);
> (%o1)          /usr/share/maxima/5.15.0/share/tensor/atensor.mac
> (%i2) init_atensor(clifford,0,0,2);
> (%o2)                                done
> (%i3) atensimp(U.V-V.U);
> (%o3)                       2 (U . V) - 2 sf(U, V)
> (%i4) %,U=v[1]+v[2],V=3*v[1]-2*v[2];
> (%o4) 2 (- 2 (v  . v ) + 3 (v  . v ) - 2 (v  . v ) + 3 (v  . v ))
>                2    2        2    1        1    2        1    1
>                                               - 2 sf(v  + v , 3 v  - 2 v )
>                                                       2    1     1      2
> (%i5) atensimp(%);
> (%o5)         2 (- 5 (v  . v ) - 1) - 2 sf(v  + v , 3 v  - 2 v )
>                        1    2               2    1     1      2
> 
> This limitation is due to the fact that the built-in versions of sf(), af(),
> and av() are not smart enough to deal with expressions, as opposed to base
> vectors, and atensimp() in turn is not smart enough to simplify the
> arguments of these three functions either.
> 
> 
> Viktor
> 
> 
>  
> 
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
> On Behalf Of Jan-David Schlenker
> Sent: Saturday, November 14, 2009 7:00 PM
> To: maxima at math.utexas.edu
> Subject: atensor problems/usage
> 
> Hello, Im quite new to Maxima and I want to use the atensor package to
> do some clifford algebra calculations but it doesnt evalute certain
> expressions. I started the demo and this is the output:
> 
> (%i1) demo(atensor);
> batching #p/usr/share/maxima/5.13.0/share/tensor/atensor.dem
>  At the _ prompt, type ';' followed by enter to get next demo
> (%i2) if get('atensor,'version)=false then load(atensor)
> (%o2) /usr/share/maxima/5.13.0/share/tensor/atensor.mac_;
> (%i3) ATENSOR can simplify noncommutative products in various
> algebras._;
> (%i4) Let us begin with a Clifford algebra_;
> (%i5) init_atensor(clifford)
> (%o5) done_;
> (%i6) atensimp(u.u)
> (%o6) sf(u,u)_;
> (%i7) atensimp(u.v-v.u)
> (%o7) 2*(u.v)-2*sf(u,v)_;
> 
> where I expected something like 1 and 2u.v . Seems like the sf(,) doesnt
> get evaluated? Im using wxMaxima 0.7.1 and atensor v20041203.
> 
> Regards
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima