Macaulay2 » Documentation
Packages » PathSignatures :: lyndonShuffle
next | previous | forward | backward | up | index | toc

lyndonShuffle -- compute the representation of a tensor as a shuffle polynomial in Lyndon words

Description

The free associative algebra $k \langle \texttt{1}, \dots, \texttt{d} \rangle$ is isomorphic to the free commutative algebra over the Lyndon words when equipped with the shuffle product $\char"29E2$. This method represents the corresponding isomorphism $$k \langle \texttt{1}, \dots, \texttt{d} \rangle_{\char"29E2} \to k[x_w \ | \ w \text{ Lyndon}].$$

i1 : A3 = wordAlgebra(3);
i2 : T = [3,2,1]_A3;
i3 : f = lyndonShuffle(T)

o3 = HashTable{HashTable{[1, 2, 3] => 1} => 1}
               HashTable{[1, 2] => 1} => -1
                         [3] => 1
               HashTable{[1] => 1   } => -1
                         [2, 3] => 1
               HashTable{[1] => 1} => 1
                         [2] => 1
                         [3] => 1

o3 : HashTable

The polynomial is represented as in standard form, with the variable index replaced by the respective Lyndon word. One easily obtains an actual polynomial from this:

i4 : var = new Array from apply(lyndonWords(3,3), i->x_i)

o4 = [x   , x         , x         , x      , x         , x         , x      ,
       [1]   [1, 1, 2]   [1, 1, 3]   [1, 2]   [1, 2, 2]   [1, 2, 3]   [1, 3] 
     ------------------------------------------------------------------------
     x         , x         , x   , x         , x      , x         , x   ]
      [1, 3, 2]   [1, 3, 3]   [2]   [2, 2, 3]   [2, 3]   [2, 3, 3]   [3]

o4 : Array
i5 : R = QQ var;
i6 : pol = sum(pairs f, (term,coef) -> coef * product(pairs term, (word,ex)-> x_word^ex))

o6 = x   x   x    - x   x       - x      x    + x
      [1] [2] [3]    [1] [2, 3]    [1, 2] [3]    [1, 2, 3]

o6 : R

Indeed, we check:

i7 : ([1]_A3**[2]_A3**[3]_A3 - [1]_A3**[2,3]_A3 - [1,2]_A3**[3]_A3 + [1,2,3]_A3) // wordFormat

o7 = [3, 2, 1]

In general, one can "shuffle out" a polynomial like $\texttt{pol}$ in two steps as follows:

i8 : polh = applyKeys(standardForm pol, i-> applyKeys(i,j-> last baseName R_j));
i9 : sum(pairs polh, (term,coef) -> coef * fold(flatten apply(pairs term, (word,ex)-> toList (ex:(word_A3))),(i,j)->i**j)) // wordFormat

o9 = [3, 2, 1]

Ways to use lyndonShuffle:

  • lyndonShuffle(NCRingElement)

For the programmer

The object lyndonShuffle is a method function.


The source of this document is in PathSignatures/documentation.m2:918:0.