In this package, tensors are represented as elements of free associative algebras, using the package NCAlgebra. More precisely, the free associative algebra on the alphabet $\{\texttt 1,...,\texttt d\}$ is isomorphic to the tensor algebra $T(\mathbb R^d)$ via the algebra homomorphism induced by $\texttt i \mapsto e_i$. This allows us to interpret tensors as non-commutative polynomials, or equivalently, linear combinations of words. Given an alphabet $l$, the free associative algebra over it can be obtained by using wordAlgebra, where the letter corresponding to $x \in l$ is represented by $\texttt{Lt}_x$.
|
|
|
|
|
|
|
The algebra B in the example can also be directly obtained for a given d using wordAlgebra(ZZ):
|
|
By default, wordAlgebra creates a non-commutative algebra over QQ. The coefficient ring can be changed via the CoefficientRing option:
|
|
|
An element of the algebra can be obtained by using the generator symbols, or (more conveniently) by using word notation, see Array _ NCPolynomialRing:
|
|
|
|
Note that for two words (equivalently, monomials) $\texttt{w}$ and $\texttt{v}$, $\texttt{w} * \texttt{v}$ is the concatenation.
To display a non-commutative polynomial in word notation, one can use wordFormat or wordString:
|
|
There are more interesting algebraic structures on non-associative algebras; of particular importance in the context of path signatures is the shuffle product and the half-shuffle product:
|
|
|
See NCRingElement ** NCRingElement and NCRingElement >> NCRingElement for more information on the shuffle and half-shuffle product.
The object wordAlgebra is a method function with options.
The source of this document is in PathSignatures/documentation.m2:918:0.