'.' is behaving not as I expect



hi Vadim

I like feeling map style ,so we shoud implement innermap(map_op,list,list),I
think.
But this case,we can this.
(%i5) map(lambda([x,y],x.y),gg,dpsi_)$
(%i6) apply("+",%);
(%o6) gam  . [d3psi0, d3psi1, d3psi2, d3psi3]
     3
 + gam  . [d2psi0, d2psi1, d2psi2, d2psi3]
      2
 + gam  . [d1psi0, d1psi1, d1psi2, d1psi3]
      1
 + gam  . [d0psi0, d0psi1, d0psi2, d0psi3]
      0
maxima is correct,because gg is list of 4x4,dpsi_ is 4x4
so,return list 4x4 matrix.
thanks
Gosei


2007/7/8, Vadim <vadim at vkonovalov.ru>:
>
> Hello, all.
>
> I have a list of 4 matrices, each is 4x4:
>
>   gg:[gam[0],gam[1],gam[2],gam[3]];
>
> When I write some vector consisting of 4 elements:
>
>   aa:[a[0],a[1],a[2],a[3]];
>
> the product
>
> gg . aa;
>
> gives me expected result: it is a[0]*gam[0] + ... + a[3]*gam[3], which
> appears to be 4x4 matrix
>
> Now if I have a list of 4 vectors,
>
> dpsi_:[[d0psi0,d0psi1,d0psi2,d0psi3],
> [d1psi0,d1psi1,d1psi2,d1psi3],[d2psi0,d2psi1,d2psi2,d2psi3],
> [d3psi0,d3psi1,d3psi2,d3psi3]];
>
> the product gg . dpsi_ gives me also 4x4 matrix, which is not what I
> expect.
>
> I expect the reulst to be 4-vector, namely
> gg[1] . dpsi_[1]+gg[2].dpsi_[2]+gg[3].dpsi_[3]+gg[4].dpsi_[4];
>
> Can you please advise me how can I achieve the expected behaviour?
>
> Thanks in advance,
> Vadim.
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>