New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New methods for WordMorphism #18119
Comments
Branch: u/gh-mrejmon/18119 |
comment:4
Hello, the pushed branch contains an implementation of the algorithm from the following paper An algorithm for enumerating all infinite repetitions in a D0L-system, using which it is easy to answer the While implementing the above I also added a method for simplifying non-injective morphisms and a method for finding the minimal conjugate of a finite word. New commits:
|
Commit: |
Changed author from Štěpán Starosta to Martin Rejmon |
comment:5
I looked at the code. Here are few comments: 1 - I would suggest to move the import of -from itertools import chain
+from collections import Counter
+from itertools import chain, count 2 - I think we want to create a class for a morphic word (see ticket #31378 on which we are currently working on with Jana) or for the language of a morphic word. And then many of the methods implemented here would go in that class. Or maybe you really want to consider Every method saying "should be an endomorphism" and taking What is the typical case you have in mind? + Return whether the language `\{m^n(w) | n \ge 0\}` is pushy,
+ where `m` is this morphism and `w` is a word inputted as a parameter.
+
+ Requires this morphism to be an endomorphism. |
comment:6
Replying to @seblabbe:
I am unsure what would be the right object at this point. In the more general settings, all are properties of a D0L-system. Do we want to have a class for it? I think there are many general methods that require an endomorphism, and there is no special class for them, is there?
I think there should be the factorial closure of |
Changed branch from u/gh-mrejmon/18119 to u/slabbe/18119 |
comment:8
Replying to @staroste:
No, for these methods there isn't. I mostly only added the
The factors are mentioned in the paragraph right below that:
Would you still prefer to mention them also in the first sentence in the docs? Replying to @seblabbe:
Thanks! Sorry for the long delay before answering, thankfully Štěpán already responded to your second comment. I also added a commit adding a test and slightly refactoring one method. New commits:
|
Changed branch from u/slabbe/18119 to u/gh-mrejmon/18119 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
Replying to @seblabbe:
I just wanted to reply to myself here. While I still think some of the methods added here could go in another class (LanguageMorphicWord for instance), I do not want to uphold this ticket. I am not contributing at a high frequency right now, so I prefer adding those methods in SageMath as proposed and, later, if we want to move them elsewhere, it is never too late. Continue your good work. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
comment:15
I see that few more methods are added in this ticket:
Would it be possible to update the description of the ticket with this complete list? |
This comment has been minimized.
This comment has been minimized.
comment:16
In particular, I am unsure about the choice of |
comment:17
Replying to @seblabbe:
The term simplification is used by A. Ehrenfeucht and G. Rozenberg, and maybe earlier. I'd prefer to keep it unless we find a much better name (I can't think of anything simple). |
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:20
I "solved" the |
Thank you, the updated description helps me to have an easier overview of what it added. I have few suggestions about the name of the methods. See below. It is important to choose them well, because they are harder to change once in sage because of backward compatibility. Replying to new description:
okay
okay
okay
okay
I rather suggest
I would suggest to rename those two methods as hidden methods
Of course, you will need to also add documentation about this new argument
I would suggest to rename it to
I suggest to rename it to Review done during the Sage Thursdays in Bordeaux at https://wiki.sagemath.org/thursdaysbdx. |
Reviewer: Sébastien Labbé |
comment:24
Thank you for the suggestions. I implemented all of them, except I named the parameter |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:26
Positive review! Thanks for your work on this. Sorry for the delay. |
Changed branch from u/gh-mrejmon/18119 to |
Add the following methods to the
WordMorphism
class:is_injective()
- injectivity testis_unboundedly_repetitive()
- whether the morphism is unboundedly repetitive, i.e. has a periodic point containing an unbounded letter, that is also a periodic wordis_pushy()
- whether the morphism is pushy (its language contains an infinite amount of words with no growing letters)is_repetitive()
- whether the morphism (its language) contains arbitrarily large repetitionsinfinite_repetitions_primitive_roots()
- finds the set of all words which are primitive roots of arbitrarily large repetitions in the language of the morphismsimplify_alphabet_size()
- returns a simplification of the morphismsimplify_until_injective()
- repeateadly calls simplify_alphabet_size() until the result is injectiveAlso adds the following method to the
FiniteWord_class
:minimal_conjugate()
- returns the lexicographically smallest conjugate of this wordCC: @seblabbe @videlec @sagetrac-tmonteil @staroste
Component: combinatorics
Keywords: sd66
Author: Martin Rejmon
Branch/Commit:
0d5f94a
Reviewer: Sébastien Labbé
Issue created by migration from https://trac.sagemath.org/ticket/18119
The text was updated successfully, but these errors were encountered: