Volker,
My issue is not with new definitions, but with the result of the built-in
multiplication of lists and matrices, which basically assumes that all list
and matrix elements are scalars. Thereafter, instead of
[a,b].[c,d] -> a.c + b.c,
we get
[a,b].[c,d] -> ac + bc.
The problem with this is that if a, b, c, d are not scalars (numbers) but,
say, spinors or operators, we cannot use built-in lists and matrices to
represent vectors and matrices formed from them. I am of course aware of
many workarounds (some of which I use often), but it'd be just simple and
intuitive if I could write [a,b].[c,d] and get a correct result, even when
a, b, c, and d are not scalar quantities. (Such that for instance,
[a,b].[c,d] - [c,d].[a,b] is not zero.)
I haven't look at the code yet, but I don't expect this to be a difficult
change. However, if someone (like me) started to mess around with a core
feature of Maxima without asking first, chances are that BAD THINGS will
happen. Indeed, it is because of concerns that this might break things that
I thought about using a global variable (say, nonscalar_matelements?) that
controls whether or not matrix and list elements are considered commutative
when the dot product of matrices and lists is calculated.
Viktor
-----Original Message-----
From: van Nek [mailto:van.nek at arcor.de]
Sent: Saturday, November 15, 2008 3:39 PM
To: Viktor T. Toth
Cc: Maxima at math.utexas.edu
Subject: Re: [Maxima] vector times vector; vector^-1?
Using a new definition v: vector(1,2) there is no builtin simplification
which tells you what v.v
should be and you can define what seems to be the best. And in addition
there would be no
need to change the existing dot product. The development of vectors can be
done
separately.
Volker
Am 15 Nov 2008 um 14:59 hat Viktor T. Toth geschrieben:
> On the topic of multiplying vectors and matrices, I've been meaning to
make
> a suggestion: I think it might be a good idea to modify the dot product
> (perhaps tied to a global variable <groan> that determines if this new
> behavior is to be used) to allow the ELEMENTS of the matrices or vectors
> involved to be noncommutative.
>
> At present, for instance, a lot of quantum physics problems cannot be
> tackled in the "natural way" in Maxima, because they involve matrices with
> nonscalar elements, yet Maxima insists on commutative multiplication.
>
> To be clear about it, what I am proposing is that (optionally, perhaps)
>
> [a,b].[c,d]
>
> should return
>
> a.c + b.d
>
> instead of
>
> ac + bd
>
> which it does at present. Of course if, say, both a and b are declared
> scalars, returning ac + bd should be fine.
>
>
> Viktor
>
>
>
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
[mailto:maxima-bounces at math.utexas.edu]
> On Behalf Of Robert Dodier
> Sent: Saturday, November 15, 2008 2:28 PM
> To: van Nek
> Cc: Maxima at math.utexas.edu
> Subject: Re: [Maxima] vector times vector; vector^-1?
>
> On 11/15/08, van Nek <van.nek at arcor.de> wrote:
>
> > I am just coding a new definiton of a vector and some basic vector
> > simplifications and functions.
>
> Thanks for working on this topic. I think it is very important.
>
> > At the moment I wonder what vector * vector and vector ^ -1should be.
>
> If I am not mistaken, these are typically not defined in vector algebra.
> Therefore they should not be defined in Maxima's vector operations either.
> But these should not cause an error; Maxima should just let them be.
>
> There is a lot of temptation to add convenience functions,
> but at least for vectors, we should resist the temptation.
> In the long run it will be more difficult to use Maxima vectors,
> if they do not have the same algebraic properties as mathematical vectors.
>
> By the way, I think that creating a new vector object is the
> right way to proceed, instead of making them lists or matrices,
> which have different properties.
>
> Thanks for your help, & please keep up the good work.
>
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima