EinSum examples
The following examples show some of the capabilities EinSum have to express index notation expressions.
- Example1 shows how Gram-Schmidt orthogonalization may be expressed in a general metric.
- Example2 shows how a cross product may be expressed with the anti-symmetric Levi-Civita symbol.
- Example3 shows how coordinate transformations of tensors may be expressed with index notation.
- Example4 shows how the trapezoidal rule may be generalized to two dimensions using index notation.
- Example5 shows how data in tensors may be set using loops over indices.
- Example6 shows how associated tensors may be treated
- Example7 shows how two-point tensors may be treated
The following examples illustrate the symmetry support in EinSum.
- ExampleS1 shows a general symmetry projection.
- ExampleS2 shows how a cross product may be expressed with the anti-symmetric Levi-Civita symbol, this time exploiting symmetries.
- ExampleS3 shows how the Hodge star operation may be coded.
- ExampleS4 shows how the Frobenius norm may be computed, utilizing symmetries.