curver.kernel.mappingclassgroup module

A module for representing triangulations along with laminations and mapping classes on them.

class curver.kernel.mappingclassgroup.MappingClassGroup(pos_mapping_classes=None, curves=None, arcs=None)[source]

Bases: object

This represents a triangulation along with a collection of named mapping classes on it.

It can also be given a list of curves and arcs, in which case the twists and half-twists about these are also added to the list of known mapping classes. Most importantly this object can construct a mapping class from a string descriptor. See self.mapping_class for additional information.

decompose_word(word)[source]

Return a list of mapping_classes keys whose concatenation is word and the keys are chosen greedly.

Raises a TypeError if the greedy decomposition fails.

lamination(geometric)[source]

Return a new lamination on this surface assigning the specified weight to each edge.

mapping_class(word)[source]

Return the mapping class corresponding to the given word or a random one of given length if given an integer.

The given word is decomposed using self.decompose_word and the composition of the mapping classes involved is returned.

Raises a TypeError if the word does not correspond to a mapping class.

random_word(length, positive=True, negative=True, letters=None)[source]

Return a random word of the required length.

The letters to choose from can be specified or, alternatively, the set of positive, negative or all (default) mapping classes can be used by using the flags postive and negative.