Einstein summation for multidimensional arrays

Abstract One of the most common data structures, at least in scientific computing, is the multidimensional array. Some numerical algorithms may conveniently be expressed as a generalized matrix multiplication, which computes a multidimensional array from two other multidimensional arrays. By adopting index notation with the Einstein summation convention, an elegant tool for expressing generalized matrix multiplications is obtained. Index notation is the succinct and compact notation primarily used in tensor calculus. In this paper, we develop computer support for index notation as a domain specific language. Grammar and semantics are proposed, yielding an unambiguous interpretation algorithm. An object-oriented implementation of a C++ library that supports index notation is described. A key advantage with computer support of index notation is that the notational gap between a mathematical index notation algorithm and its implementation in a computer language is avoided. This facilitates program construction as well as program understanding. Program examples that demonstrate the close resemblance between code and the original mathematical formulation are presented.

[1]  Ann K. Stehney,et al.  Geometrical Methods of Mathematical Physics by Bernard F. Schutz , 1980 .

[2]  J. G. Papastavridis Tensor calculus and analytical dynamics , 1998 .

[3]  Magne Haveraaen,et al.  On the Role of Mathematical Abstractions for Scientific Computing , 2000, The Architecture of Scientific Software.

[4]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[5]  J. Craggs Applied Mathematical Sciences , 1973 .

[6]  Ivar Jacobson,et al.  The unified modeling language reference manual , 2010 .

[7]  Ronald F. Boisvert,et al.  The Architecture of Scientific Software , 2001, IFIP — The International Federation for Information Processing.

[8]  Daniel J. Quinlan,et al.  Library for architecture-independent development of structured grid applications , 1992, SIGP.

[9]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[10]  M. Hazewinkel Encyclopaedia of mathematics , 1987 .

[11]  Krister Åhlander Supporting tensor symmetries in EinSum , 2003 .

[12]  Hans Petter Langtangen,et al.  On the Numerical Efficiency of C++ in Scientific Computing , 1997 .

[13]  Edward W. Bolton,et al.  A simple notation for differential vector expressions in orthogonal curvilinear coordinates , 1993 .

[14]  Gregory V. Wilson,et al.  Parallel Programming Using C , 1996 .

[15]  Daniel J. Quinlan,et al.  P++, a Parallel C++ Array Class Library for Architecture-Independent Development of Structured Grid , 1992 .

[16]  William E. Lorensen,et al.  Object-Oriented Modeling and Design , 1991, TOOLS.

[17]  R. Abraham,et al.  Manifolds, Tensor Analysis, and Applications , 1983 .