Discussion: new operators for numerical computation

Robin Becker robin at jessikat.fsnet.co.uk
Thu Jul 20 14:32:15 EDT 2000


In article <slrn8nefig.rb.hzhu at localhost.localdomain>, Huaiyu Zhu
<hzhu at localhost.localdomain> writes
>On Thu, 20 Jul 2000 17:06:03 +0100, Robin Becker
><robin at jessikat.fsnet.co.uk> wrote: 
>>
>>the kronecker product is also called the matrix direct product
>>
>>
>>A ox B = [a11 B a12 B]
>>         [a12 B a22 B]
>>
>>seems to me to be like a tensor outer product; but I ain't no
>>mathematician ;)
>
>In matlab/octave, this is called kron(A,B).  I don't think it deserves an
>infix operators, because it is just a special case of matrix multiplication.
>You can define a sparse matrix Kron(A) so that
>
>kron(A,B) == Kron(A)*B

I'd be interested in how you define either Kron and * to achieve the
result you claim without modifying the p x r matrix B; after all it
cannot involve sums of elements of B so * isn't the matrix multiply. I
could use an element wise multiply, but only if I use the end desired
shape as the second element.

>
>For such specializations it is best to explicitly spell out the names of
>operators.  This is also true of unitary functions.  + - have symbols but
>sin, cos, ... do not.
>
>>the lie product (or bracket) has applications in sensitivity analysis
>>and other more exotic stuff in differential geometry
>>
>>[A,B] = AB - BA
>
>def lie(a,b): return a*b-b*a
>
>On the other hand, the difference between elementwise and matrix operators
>are much more fundamental.  They result from the different views of vectors,
>either as a simple collection of numbers, or as a point in a linear space
>that happens to be represent by an array of numbers.
>

-- 
Robin Becker



More information about the Python-list mailing list