| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168731Image: ubuntu2004
This worksheet describes a set of functions that deal with the free algebra where with the stuffle product (which will be denoted here by ).
Before getting started, you need to make sure that the functions are loaded in this session. To do so, evaluate the following commands (the result of the second one should be 'True')
Before getting started, you need to make sure that the functions are loaded in this session. To do so, evaluate the following commands (the result of the second one should be 'True')
True
The alphabet in this context is . The free algebra is endowed with the stuffle product defined by the following recursion :
;
.
for all and for all .
We define on a gradation with values in given by an integer valued weight function on . It is a morphism of monoids given on the letters by . Thus
.
First, we need to be able to define words. The non commutative variables , are the elements of the list F.gens() (F is a Free Monoid used only to provide the variables) :
.
y4
The set of words over these variable is called Mo
Words over Ordered Alphabet [y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19]
You can call a single word using the following command (We form the Word defined by the list of letters and then precise that this word belongs to the set Mots) :
word: y4,y3,y2
A lot of functions relative to words are already defined in sage. For example, it is easy to know if a word is a Lyndon word, using the following :
False
Each letter has a weight which is given by its index in the list F.gens()
4
The weight of a word is returned by the function weight_word :
9
The set of all words of a given weight is returned by Mots_n :
[word: y1,y1,y1,y1,y1, word: y1,y1,y1,y2, word: y1,y1,y2,y1, word: y1,y2,y1,y1, word: y2,y1,y1,y1, word: y1,y1,y3, word: y1,y2,y2, word: y1,y3,y1, word: y2,y1,y2, word: y2,y2,y1, word: y3,y1,y1, word: y1,y4, word: y2,y3, word: y3,y2, word: y4,y1, word: y5]
[5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5]
The free algebra on is defined as a Combinatorial Free Module with basis the set Mots called Module
Free module generated by Words over Ordered Alphabet [y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14, y15, y16, y17, y18, y19] over Rational Field
The function toA converts words into elements of Module :
B[word: y4,y3,y2]
The stuffle product of two words is computed with the function stuffle_words :
B[word: y2,y1,y2] + 2*B[word: y2,y2,y1] + B[word: y2,y3] + B[word: y4,y1]
The tensor product (denoted by ) of with itself is implemented with the function TensorProduct :
8*B[word: y1,y2] # B[word: y3] + 10*B[word: y1,y2] # B[word: y5] + 12*B[word: y4] # B[word: y3] + 15*B[word: y4] # B[word: y5]
Its algebra structure is given by prod_TP which computes the product of two tensor products :
48*B[word: y1,y2,y1,y2] # B[word: y3] + 60*B[word: y1,y2,y1,y2] # B[word: y5] + 72*B[word: y1,y2,y4] # B[word: y3] + 90*B[word: y1,y2,y4] # B[word: y5] + 72*B[word: y4,y1,y2] # B[word: y3] + 90*B[word: y4,y1,y2] # B[word: y5] + 108*B[word: y4,y4] # B[word: y3] + 135*B[word: y4,y4] # B[word: y5]
The stuffle algebra has a bialgebra structure. The coproduct is defined by :
and extended as a morphism of algebras to .
Here, the coproduct is called Delta_stuffle for both words and series :
B[word: ] # B[word: y3] + B[word: y1] # B[word: y2] + B[word: y2] # B[word: y1] + B[word: y3] # B[word: ]
B[word: ] # B[word: y3] + B[word: y1] # B[word: y2] + B[word: y2] # B[word: y1] + B[word: y3] # B[word: ]
This gives birth to a test of the primitivity of an element, is_primitive :
False
The usual scalar product (which returns the coefficient of a word in a polynomial) is called ScalProd :
(2, 3, 0, 0)
It is extended through the function SP_Series to :
8
We are now in position to add the stuffle product of two series which is computed as follows :
To compute the stuffle product of two series, use the function StuffSeries_Delta :
2*B[word: y1,y2,y3] + 3*B[word: y1,y3] + 2*B[word: y1,y3,y2] + 2*B[word: y1,y5] + 3*B[word: y3,y1] + 2*B[word: y3,y1,y2] + 3*B[word: y4] + 2*B[word: y4,y2]
We implemented the basis of the stuffle algebra equivalent to the basis of Reutenauer (see Reutenauer, Free Lie algebras, Clarendon Press, 1993). It is defined as follows :
;
if is a Lyndon word ;
if is the Lyndon factorization of w,
and called Sbasis :
if is a Lyndon word ;
if is the Lyndon factorization of w,
B[word: y2,y3] + B[word: y3,y2] + B[word: y5]