Permutations, Signature, and Trace
In "Antisymmetrizing Functions," TMJ, 2 (1), 1992 p. 45, Permutations and Signature were used in the construction of totally antisymmetric functions, that is, functions that change sign under the interchange of any pair of arguments. Jorma Virtamo (email@example.com) suggested the following improved code.
The Signature of a permutation is , where is the number of transpositions of pairs of elements that must be composed to build up the permutation. By including in the definition of Antisymmetrize initially, cyclic and anticyclic permutations are distinguishable.
In "Calculus with Anticommuting Variables," TMJ, 8 (1), 2001 pp. 38-40, ordered determinants are computed using dynamic programming and Laplace expansion. For an interesting discussion of determinants of matrices with noncommutative entries, see . Here is an alternative functional implementation, which is an extension of the code for Antisymmetrize.
For example, the ordered determinant of a general matrix
The code uses the observation that (ordered) terms in the determinant, say , appear as diagonal elements in a permutation of the rows of the transposed matrix.
As an aside, Robert Knapp (firstname.lastname@example.org) writes: Here are two user-defined functions for computing the trace of a matrix.
Note that Tr is much, much faster.
The timings here are small, but if you have an application that requires repeatedly computing a trace, it makes a difference.
Second, Tr generalizes to multiple dimensions.
One can also use Tr to project out the list of diagonal elements.
Here is a cute way to use it to speed up something very common.
Copyright © 2002 Wolfram Media, Inc. All rights reserved.