Scalar and Tensor Parameters for Importing the Notation in Differential Geometry into Programming
This paper proposes a method for importing tensor index notation, including Einstein summation notation, into programming. This method involves introducing two types of parameters, i.e, scalar and tensor parameters. As an ordinary function, when a tensor parameter obtains a tensor as an argument, the function treats the tensor argument as a whole. In contrast, when a scalar parameter obtains a tensor as an argument, the function is applied to each component of the tensor. This paper shows that introducing these two types of parameters enables us to apply arbitrary functions to tensor arguments using index notation without requiring an additional description to enable each function to handle tensors. Furthermore, we show this method can be easily extended to define concisely the operators for differential forms such as the wedge product, exterior derivative, and Hodge star operator. It is achieved by providing users the method for controlling the completion of omitted indices.
READ FULL TEXT