You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assert not isinstance(left_infinite, Orbit), "Orbit is not periodic going forward but is going backward."
435
+
# print('left_infinite:', left_infinite)
440
436
441
437
if right_infinite and left_infinite:
442
438
return Orbit.complete_infinite
@@ -449,10 +445,12 @@ def _orbit_type(self, y, basis):
449
445
450
446
#TODO maybe this should return characteristics as well
451
447
def _test_semi_infinite(self, y, basis, backward=False):
452
-
"""Computes the orbit type of *y* with respect to *basis* in the forward direction. (Use ``backward=True`` to go backwards.)"""
453
-
i = 0
448
+
"""Computes the orbit type of *y* with respect to *basis* in the forward direction. (Use ``backward=True`` to go backwards.) Returns Orbit.complete_finite if a periodic orbit in X<A> is found; otherwise returns True or false to say if the orbit in X<A> is semi-infinite in the given direction."""
454
449
image = y
455
450
images = [y]
451
+
#y is the starting element
452
+
#image is the ith image under self of y
453
+
#images is the list of previous images, starting at y = image #0 and ending at image #i-1
456
454
while True:
457
455
#Compute the image y\phi^i as y\phi^{i-1} \phi
458
456
image = self.image(image, inverse=backward)
@@ -463,22 +461,36 @@ def _test_semi_infinite(self, y, basis, backward=False):
463
461
464
462
#2. Look for basis elements which are prefixes of the new image
465
463
prefixes = [gen for gen in basis if gen.is_above(image)]
466
-
464
+
# print('From the basis, we found potential {} prefix(es) for ``image``'.format(len(prefixes)))
465
+
# print(prefixes)
466
+
# print('Previous images were', images)
467
467
#3. For each previous image:
468
468
for previous in images:
469
+
# print('previous image', previous)
469
470
#Is this the same as the word we've just computed?
470
471
if previous == image:
471
472
return Orbit.complete_finite #Perodic and infinite in both directions.
472
-
#Otherwise, is there a generator which is an initial segment of both the previous and current images?
473
+
#Check all the basis elements above the current image.
474
+
#Is there a generator above any previous images?
473
475
for generator in prefixes:
474
-
tail = generator.test_above(image)
476
+
tail = generator.test_above(previous)
475
477
if tail is not None:
476
478
#We've found a match: both *image* and *previous* start with *generator*
477
479
return True #IS semi_infinite in the given direction
478
-
images.append(y)
480
+
images.append(image)
479
481
480
482
481
483
#TODO. Compose and invert automorphisms. Basically move all the functionality from TreePair over to this class and ditch trree pair.
482
484
#TODO method to decide if the automorphism is in (the equivalent of) F, T, or V.
483
485
#TODO the named elements A, B, C, X_n of Thompson's V.
484
486
487
+
def orbit_types(aut, basis=None, words=None):
488
+
r"""Prints the classification of the orbits under *aut* of each word in *words* with respect to *basis*. If *basis* is omitted, it is taken to be the minimal expansion given by :meth:`~thompson.automorphism._minimal_expansion`. If *words* is omited, it is taken to be the same as *basis*. See the docstring for :meth:`~thompson.automorphism._orbit_type`"""
0 commit comments