Hi Luis,

"einops" stands for (in part) "Einstein inspired notation" (for doing 
dimension-manipulation in n-dimensional arrays, currently in Python). It would 
be a good idea to read that quite concise web-page by its creator, since it's 
interesting stuff; what it isn't is directly using Einstein summation.

Best regards,
Ed

________________________________
From: Luis Mochan <moc...@icf.unam.mx>
Sent: 14 January 2025 04:55
To: Ed . <ej...@hotmail.com>
Cc: Ingo Schmid <ingo...@gmx.at>; pdl-general@lists.sourceforge.net 
<pdl-general@lists.sourceforge.net>
Subject: Re: [Pdl-general] [Pdl-devel] Pdlpp modules

Hi Ed,

On Tue, Jan 14, 2025 at 02:44:36AM +0000, Ed . wrote:
> Hi Luis,
>
> I did in fact look at ApplyDim when you posted it on CPAN, because on the IRC 
> channel we have a bot that reports whenever a module starting with "PDL" is 
> uploaded to CPAN. Please believe me when I say I know extremely well that 
> it's not currently possible to skip mv/reorder/whatever. What I'm saying is 
> it ought to be possible to tell PDL to just do its "*over" operation along a 
> different dimension.

I don't know how PDL actually moves dimensions around. Would doing *over
operations along different dimensions be less expensive than
reordering and performing over the first dimensions?

> This evening, it occurred to me a possible answer to the problem of how to 
> express such a thing might lie in "einops" 
> (https://github.com/arogozhnikov/einops). That would certainly also offer 
> ideas in how to express dim-naming stuff also.

Einstein's notation is compact and expressive. It is great generally,
but not always, and it is cumbersome where it can't be used directly. For
example, making a weighted sum of products of elements of a and b with
weights w, sum_i(h_i a_i b_i) is written in Einstein's notation as
g_{ij} a_i b_j  where g_{ij} is a special metric, a matrix with diagonal
elements h_i and zeroes elsewhere. I guess computationally you wouldn't want
to do that (multiply every a_i by every b_j and then the result by
g_{ij} which is mostly zeroes and do a double sum over i and j).
I haven't looked though at any details of einops yet.

Best regards,
Luis


>
> Best regards,
> Ed
>
> ________________________________
> From: Luis Mochan <moc...@icf.unam.mx>
> Sent: 14 January 2025 02:23
> To: Ed . <ej...@hotmail.com>
> Cc: Ingo Schmid <ingo...@gmx.at>; pdl-general@lists.sourceforge.net 
> <pdl-general@lists.sourceforge.net>
> Subject: Re: [Pdl-general] [Pdl-devel] Pdlpp modules
>
> On Mon, Jan 13, 2025 at 07:33:34PM +0000, Ed . wrote:
> > I have some awareness of PDL::Dims...
> >
> > And on the subject of capabilities I think should be stolen into core PDL, 
> > I believe "apply an operation over dims other than 0" is another.
>
> Have you looked at PDL::ApplyDim? It doesn't skip the mv nor reorder
> operations, it just hides them away so the user doesn't have to keep
> track of how the dimensions were shuffled before applying an operation
> nor how to unshuffle them afterwards. He just have to state which
> dimension(s) should come to the front or to the back before applying
> the operation.
>
> Regards,
> Luis
>
>
> --
>
>                                                                   o
> W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
> Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
> Av. Universidad s/n CP 62210         |                           (*)/\/  \
> Cuernavaca, Morelos, México          | moc...@fis.unam.mx   /\_/\__/
> GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16  C2DF 5F0A C52B 791E B9EB

--

                                                                  o
W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
Av. Universidad s/n CP 62210         |                           (*)/\/  \
Cuernavaca, Morelos, México          | moc...@fis.unam.mx   /\_/\__/
GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16  C2DF 5F0A C52B 791E B9EB
_______________________________________________
pdl-general mailing list
pdl-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to