Skip to content

Commit 8584a55

Browse files
committed
Documentation update w/examples
- Adding docstrings for the random generator functions - Adding comments to the example automorphisms - Including the examples created by @nbarkercmep
1 parent 5f23f00 commit 8584a55

31 files changed

+166
-22
lines changed

docs/thompson.examples.rst

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1-
thompson.examples module
2-
========================
1+
Examples
2+
========
3+
4+
This module provides a number of explicit examples for use in doctests. Additionally, functions to generate random automorphisms are provided.
5+
6+
Explict named examples
7+
----------------------
8+
9+
A list of named examples is loaded from the ``.aut`` files in `the examples folder <https://github.com/DMRobertson/thompsons_v/tree/master/thompson/examples>`_. This includes all the examples given in AJD and NB's paper.
10+
11+
.. todo:: Make Sphinx show these examples here?
312

413
.. automodule:: thompson.examples
514
:members:
615
:undoc-members:
716
:show-inheritance:
17+
:exclude-members: random_signature, random_simple_word, random_basis, random_automorphism, random_conjugate_pair, random_conjugate_factors, random_conjugate_periodic_factors, random_conjugate_infinite_factors
18+
19+
Randomly generated examples
20+
---------------------------
21+
22+
.. autofunction:: random_signature
23+
.. autofunction:: random_simple_word
24+
.. autofunction:: random_basis
25+
.. autofunction:: random_automorphism
26+
.. autofunction:: random_conjugate_pair
27+
.. autofunction:: random_conjugate_factors
28+
.. autofunction:: random_conjugate_periodic_factors
29+
.. autofunction:: random_conjugate_infinite_factors

thompson/automorphism.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,22 @@ def test_conjugate_to(self, other):
736736
>>> psi * rho == rho * phi
737737
True
738738
739+
..doctest::
740+
:hide:
741+
742+
>>> rho = nathan_pond_example.test_conjugate_to(nathan1_example)
743+
>>> rho is None
744+
True
745+
>>> rho = nathan2_example.test_conjugate_to(nathan3_example)
746+
>>> rho is not None
747+
True
748+
>>> nathan2_example * rho == rho * nathan3_example
749+
True
750+
>>> rho = nathan4_example
751+
>>> nathan2_example * rho == rho * nathan3_example
752+
True
753+
754+
739755
.. seealso:: This is an implementation of Algorithm 5.6 in the paper. It depends on Algorithms 5.13 and 5.27; these are the :meth:`periodic <thompson.factors.PeriodicFactor.test_conjugate_to>` and :meth:`infinite <thompson.factors.InfiniteFactor.test_conjugate_to>` tests for conjugacy.
740756
"""
741757
#TODO Doctest: try assembling a conjugator from factors

thompson/examples/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
"""A list of examples for use in doctests."""
1+
"""
2+
.. testsetup::
3+
4+
from thompson.examples import *
5+
"""
26

37
import pkg_resources
48
import string

thompson/examples/alphabet_size_two.aut

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ x1 a2 -> x1 a2 a3
55
x1 a3 -> x2
66
x2 a1 -> x1 a3
77
x2 a2 -> x1 a2 a2
8-
x2 a3 -> x1 a2 a1
8+
x2 a3 -> x1 a2 a1
9+
A toy example to test that the program works with :math:`n > 2` and :math:`r > 1`.

thompson/examples/arity_four.aut

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ x1 a3 -> x1 a3 a3
99
x1 a4 a1 -> x1 a3 a4
1010
x1 a4 a2 -> x1 a2
1111
x1 a4 a3 -> x1 a3 a1
12-
x1 a4 a4 -> x1 a4
12+
x1 a4 a4 -> x1 a4
13+
An example created to test that the package works with examples of arity four.

thompson/examples/arity_three_order_inf.aut

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ x1 a1 a3 -> x1 a3 a1
66
x1 a2 -> x1 a3 a2
77
x1 a3 a1 -> x1 a3 a3 a3
88
x1 a3 a2 -> x1 a3 a3 a2
9-
x1 a3 a3 -> x1 a3 a3 a1
9+
x1 a3 a3 -> x1 a3 a3 a1
10+
A toy example created to test the beahviour of the program with automorphisms of arity 3. This automorphism is of infinite order and is (I think? TODO: check this) purely infinite.

thompson/examples/cyclic_order_six.aut

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ x a1 a2 a1 -> x a1 a2 a2 a2
55
x a1 a2 a2 a1 -> x a2 a1
66
x a1 a2 a2 a2 -> x a2 a2
77
x a2 a1 -> x a1 a2 a2 a1
8-
x a2 a2 -> x a1 a2 a1
8+
x a2 a2 -> x a1 a2 a1
9+
An introductory example drawn on the board by NB. It is purely periodic, of order six.

thompson/examples/example_4_11.aut

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
(2,1) -> (2,1)
33
x a1 a1 -> x a1
44
x a1 a2 -> x a2 a1
5-
x a2 -> x a2 a2
5+
x a2 -> x a2 a2
6+
This example is used in the paper to illustrate the meaning of a semi-normal form.

thompson/examples/example_4_12.aut

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
(2,1) -> (2,1)
33
x a1 a1 -> x a2 a2
44
x a1 a2 -> x a2 a1
5-
x a2 -> x a1
5+
x a2 -> x a1
6+
This example is used in the paper to illustrate the meaning of a semi-normal form. This example needs to be expanded from its minimal representation (above) to find a semi-normal (in fact quasi-normal) form.

thompson/examples/example_4_25.aut

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ x a1 -> x a1 a1 a1
44
x a2 a1 -> x a1 a1 a2
55
x a2 a2 a1 a1 -> x a2 a2
66
x a2 a2 a1 a2 -> x a1 a2
7-
x a2 a2 a2 -> x a2 a1
7+
x a2 a2 a2 -> x a2 a1
8+
This example is used in the paper to illustrate the process of finding the :meth:`~thompson.automorphism.Automorphism.quasinormal_basis`.

0 commit comments

Comments
 (0)