sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.46k stars 485 forks source link

Implement Algebra of Words and some linear operators #16179

Open bc9eee3a-171b-423e-8ec5-1c11eaa42e98 opened 10 years ago

bc9eee3a-171b-423e-8ec5-1c11eaa42e98 commented 10 years ago

Implement the algebra R for a ring R and an alphabet A. We also implement linear operators e, f, sigma and zeta as defined in [Lothaire, M. (2011), Algebraic combinatorics on words, Encyclopedia of Mathematics and Its Applications 90, Cambridge University Press].

CC: @seblabbe @anneschilling @nthiery @videlec @tscrim

Component: combinatorics

Author: virmaux

Branch/Commit: u/virmaux/16179 @ 5e4168c

Issue created by migration from https://trac.sagemath.org/ticket/16179

bc9eee3a-171b-423e-8ec5-1c11eaa42e98 commented 10 years ago

New commits:

aea1c8fbeginning of work on words_algebra
fc66439refactorization in a category, added operators e, f, sigma, zeta on words algebra
5e4168cdocumentation
bc9eee3a-171b-423e-8ec5-1c11eaa42e98 commented 10 years ago

Branch: u/virmaux/16179

bc9eee3a-171b-423e-8ec5-1c11eaa42e98 commented 10 years ago

Commit: 5e4168c

videlec commented 10 years ago
comment:4

Hi Aladin,

You did good about the tests in the documentation! As I am (as well as many others) not familiar with algebras it would be nice to explain what are the e, f, zeta and sigma operators in the docstring of the methods. (I like learning math by digging in Sage documentation but hate having to guess what are the specifications of a function)

For the design, most piece of code related to categories (which intend to be generic code) must go inside sage/categories or for some rare case in sage/structure. You decided to implement the category of your object as a subclass of itself... which means that the code is not generic. So I would not put that as category code but directly inside the Element. If you have a strong argument about creating a category for the FreeAlgebra please explain it on both this ticket and the file where the code belongs to. On the other hand, in his axioms related peregrinations in #10963, Nicolas proposed to have a .Free() (meaning that I would be able to do Groups().Free() to choose my category). So your code might move to somewhere more appropriate in the future.

There already is a FreeAlgebra in sage.algebras.free_algebra. What I would naturally do is to move your ElementMethods as methods of FreeAlgebraElement in sage.algebras.free_algebra_element. If you are not happy with the current FreeAlgebra which is rather old, it would be nice to refresh it a bit.

Vincent

tscrim commented 10 years ago
comment:6

FYI #14848 makes FreeAlgebra into a subclass of CombinatorialFreeModule.

I do have a question. Are you considering infinite words as elements of this algebra? If not, then I think you should add methods/functionality directly to FreeAlgebra (where the arg names gives the alphabet).

bc9eee3a-171b-423e-8ec5-1c11eaa42e98 commented 10 years ago
comment:7

Thank you for the comments, I will play with FreeAlgebra and will try to use it.