Tensor algebra
Definitions and identities of the products TensND implements. Index formulas are those of the OMEinsum contraction codes in src/array_utils.jl; the algebraic identities follow the Echoes manual appendix on tensor algebra.
Components below are written in an orthonormal frame
Tensor products
For
The symmetrized tensor product
so that for two vectors
Box products
Two order-2 tensors combine into an order-4 tensor in two further ways, which are what make the order-4 identity and the deviatoric projector expressible in closed form:
TensND also exposes the intermediate otimesl, with
With
tens_Id4 returns, since every symmetry class in this library lives in the minor-symmetric subspace.
Contractions
| Operation | Definition | Resulting order |
|---|---|---|
Each consumes the last indices of the left operand against the first of the right one — see the warning on Notation about the competing double-contraction convention.
Between two order-4 tensors,
and it is this scalar product that every projection in Projection onto a symmetry class minimizes against.
Transpose of an order-4 tensor
Consistently with the pair-wise double contraction, the transpose exchanges the two index pairs:
A tensor with
Identities
The following hold for order-2
The symmetrized box product does not invert termwise
Identity (e) has no counterpart for
Equality requires
This is why inversion is implemented per symmetry class — closed forms on the
Note also that
Symbolic and numerical evaluation
All of the above is implemented once, generically, on AbstractArrays through OMEinsum contraction codes, and therefore applies unchanged to Float64, ForwardDiff.Dual, SymPy.Sym and Symbolics.Num element types. The structured types (TensISO, TensTI, TensOrtho) override the generic route with closed forms whenever the result stays in the class — see Structured tensors.