-
-
Notifications
You must be signed in to change notification settings - Fork 721
Open
Labels
Description
Wolfgang Steiner wrote to me:
J'ai un problème très étrange avec SageMath :
L'évaluation de WordMorphism({0:[0,1],1:[1]}).fixed_point(0) ne termine
pas alors que WordMorphism({1:[1,0],0:[0]}).fixed_point(1) ou
WordMorphism({0:[0,1],1:[1,1]}).fixed_point(0) marche sans problème.
Le problème apparaît donc uniquement quand la lettre du point fixe
s'appelle 0 et l'autre lettre ne croît pas.Amitiés,
Wolfgang
I confirm this is okay :
sage: m = WordMorphism({1:[1,0],0:[0]})
sage: m.fixed_point(1)
word: 1000000000000000000000000000000000000000...
Exchanging 0 and 1 does this:
sage: m2 = WordMorphism({0:[0,1],1:[1]})
sage: m2.fixed_point(0) # this hangs !!!
The problem is in the method is_growing :
sage: m.is_growing(0)
False
sage: m.is_growing(1)
True
sage: m2.is_growing(0) # this should return True
False
sage: m2.is_growing(1)
False
The issue is in this line:
sage/src/sage/combinat/words/morphism.py
Line 3053 in 0fc8ed5
| if not letter: |
which is supposed to test whether
letter is None. But this evaluates to True when letter is 0...
It should be replaced by if letter is None.