Discussion: new operators for numerical computation

Gregory Lielens gregory.lielens at fft.be
Thu Jul 20 12:17:22 EDT 2000


Tim Hochberg wrote:
> 
> Robin Becker <robin at jessikat.fsnet.co.uk> writes:
> 
> > people keep talking about matrix operations as though there is only one
> > way to do one kind of matrix multiply; I use at least two (inner, outer)
> > commonly, but others eg Kronecker or Lie are certainly in use. I don't
> > think any proposal which doesn't address this is likely to get my vote.
> 
> Well Konrad mentioned [x] or (x) which gives you a lot more symbolic
> room. For instance one could use [x] for outer products since you can
> take an outer "product" with essentially any operation. (*) would be
> matrix multiply, (/) would be matrix "divide", we'd still be searching
> for a solve operator though. (.) Could be some other inner product.

I like the parethese a lot! except for ° which is probably out of
question, 
this is the prettier way to do it, but (alwas a but :-( )

- the solve operator indeed...The only thing i can come with is the ugly
(%)
  or the pretty but out-of-question (\)
- patching the parser to deal with that looks a lot more difficult than
@ or even
  . variants (this is doable - in fact, this is already done...) because
I think
  (){}[] are treated in a more specific way by the Grammar...I think to
implement that
  we need a real Grammar guru!

> Although, there's a fair amount of "symbol" space in this kind of operator
> scheme, but there's still an issue in that for dimensions greater than
> two, there's no way to specify which axis to apply the inner products
> on. I'm not sure there's any good way to do that with infix notation though.

Check my previous post...This could be improved, though, because there
is no way to
specify the order for matching the dummy indices in the two arrays.
Being able to
change the order of the indices for the result should also be looked
for, and
if any clean way to express that is found, we would be able to express
anything which is doable
using einsteinian convention, i.e. a lot of thing (all thing)...This
would rule imho!

maybe something as (I adopt (*) for matrix product, may the parser do
the same!)

a = b.i(1,2,-1,-2) (*) c.i(4,-2,3,-1)

for

a_ijkl = b_ijmn c_lnkm

Then having two "inner products" would allow to default one to
contracting the last index of b with the first of c, making a fine
matrix multiply, the other to make no contration (making a fine outer
product), when no i markers are provided, i.e.

b (*) c is a "default" inner product, matrix product if Nd =2 for b and
c
b[*] c is an outer product, no contraction



I personally like it a lot, the only problem (escept for the parser, but
probably someone could do it if I fail)
is the solve...maybe we could go without, with the help of transposes,
as if I make no mistakes, using / for div , \ for solve
and .H for transpose-conjugate

c = a\b =  (b.H/a.H).H

...if transpose conjugate is cheap, i could be a (not perfect) solution


Greg.



More information about the Python-list mailing list