Re: BZDEV: Re: Initial thoughts about tensors

From: Steve Karmesin (karmesin@lanl.gov)
Date: Wed Jun 17 1998 - 19:03:57 EST


Thanks for the info, Boris.

At 06:06 PM 6/17/98 -0400, jeremic@sokocalo.cee.clarkson.edu wrote:
>Hello All,
>
>Maybe I should put some more light on the inner workings of nDarray
>classes.
>
>Consider:
>
>tensor test = A("ijkl") * B("jklm") * C("mrpq");
>
>internally a temporary will be created from A * B
>and it will be a tensor of order 2 with two indices "im",
>and then that temorary will be multipiled with C and the result, tensor
>test will be a tensor of order 4 with indices "irpq".

I think this is the same behavior that we would want in the fully inlined
case as well.

[snip]

>Indices are parsed very efficiently (couple of lines of integer and
>char operations) so that should not be a concern regarding the
>actual extra memory or efficiency.

This I'm not as sure of. We would have arrays of millions of these things
and we would be looping over them hoping for uncompromizing efficiency.
Clearly the importance of the overhead depends on the size of the tensors
involved. What has your experience been with the size of these tensors per
dimension?

If each component counts over {1..N} then the fully general tensor of rank
R has pow(N,R) elements, which gets big fast. If there are symmetries
though it is (prod_{i=0}^{R-1}(N+i))/factorial(R), which can be tractable
if you take full advantage of the symmetries. N=3 and R=4 is then just 15
elements instead of 81.

The goal then is to have the tensor products evaluate with zero overhead
compared to writing it out by hand, including taking advantage of symmetries.

>There are no extra expansion and then contraction with Kronecker deltas
>or Levi-Civita permutation tensors.

I think this could also be done with the compile time style.

-Steve Karmesin

======================================================================
Pooma Team Leader
karmesin@lanl.gov
phone: (505)665-6019
fax : (505)667-4939
For PGP public key, send message with subject line: SEND PUBLIC KEY
======================================================================
--------------------- blitz-dev list --------------------------------
* To subscribe/unsubscribe: mail to majordomo@oonumerics.org, with
"subscribe blitz-dev" or "unsubscribe blitz-dev" in the body of the message
* Blitz++ web page: http://oonumerics.org/blitz/



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 04:30:05 EST