On Tue, Jun 30, 2009 at 2:02 PM, David Goldsmith <[email protected]>wrote:
> > No, but my guess is that it might be useful in numerical General > Relativity, e.g., as well as pedagogically in teaching differential geometry > and tensor algebra. > > DG > It shouldn't be difficult to generate all the permutations of the indices and assign +/-1 as appropriate. The rest of the entries would be zero. There was a discussion about generating permutations a while back... Hmm, using one of the recursive routines it looks like it shouldn't be too difficult to track even and odd permutations. But for general relativity, four indices with four values, it would probably be quickest to just write down the 24 permutations and use a singleton array, i.e., generate the array once and just return references or copies. Chuck
_______________________________________________ Numpy-discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
