[Numpy-discussion] permutation symbol

Charles R Harris charlesr.harris at gmail.com
Tue Jun 30 16:17:52 EDT 2009


On Tue, Jun 30, 2009 at 2:02 PM, David Goldsmith <d_l_goldsmith at yahoo.com>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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090630/9ff69d75/attachment.html>


More information about the NumPy-Discussion mailing list