EinSum

Supporting tensor symmetries in EinSum. Exploiting symmetries are important in numerical mathematics, both with respect to efficient memory usage and with respect to symmetry exploiting algorithms. In this paper, the symmetries of tensors are in focus. A convenient notation for describing coordinate-free tensor symmetries is established, based on sets of permutations. Completely symmetric and antisymmetric tensors are included as special cases. The extensions to multidimensional arrays with other kinds of symmetries or invariant features are also treated.par The symmetry information is used to represent tensors with symmetries more economically with respect to memory. In addition, three algorithms that exploit symmetries are presented. First, a Frobenius norm computation is derived. Second, a projection to an index space with general symmetries is shown, and proven to be optimal in the Frobenius norm. Third, a symmetry utilizing formula for a dual mapping between completely antisymmetric index spaces is shown.par The implementation of symmetry support in EinSum is discussed. EinSum is a C++ package primarily intended for tensor algebra, capable of supporting the Einstein summation convention. Details on the symmetry part of the implementation are explained. Code for the implementation of the Frobenius norm, the general projection, and the dual mapping is shown, illustrating how symmetry aware software may decrease both the memory usage and the number of arithmetic operations.