[Numpy-discussion] einsum

Joshua Holbrook josh.holbrook at gmail.com
Wed Jan 26 23:29:38 EST 2011

>> The only disadvantage I see, is that choosing the axes to operate on
>> in a program or function requires string manipulation.
> One possibility would be for the Python exposure to accept lists or tuples
> of integers.  The subscript 'ii' could be [(0,0)], and 'ij,jk->ik' could be
> [(0,1), (1,2), (0,2)].  Internally it would convert this directly to a
> C-string to pass to the API function.
> -Mark

What if you made objects i, j, etc. such that i*j = (0, 1) and
etcetera? Maybe you could generate them with something like (i, j, k)
= einstein((1, 2, 3)) .

Feel free to disregard me since I haven't really thought too hard
about things and might not even really understand what the problem is
*anyway*. I'm just trying to help brainstorm. :)


More information about the NumPy-Discussion mailing list