Accessors
This page contains the documentation of the various member functions of the
ToddCoxeter
class that can be used to access the state of an instance.
Those functions with the prefix current_
do not perform any further
enumeration.
- ToddCoxeter.current_spanning_tree(self: ToddCoxeter) Forest
Get the current possible spanning tree of the underlying word graph.
This function returns the current value of a possible spanning tree (a
Forest
) for the underlyingWordGraph
(returned bycurrent_word_graph
). This spanning tree is only populated during calls tostandardize
and as such might contain nothing, or a spanning tree of a previous value ofcurrent_word_graph
. Some care should be used with the return value of this function, and it might be better to use the functionspanning_tree
, which has none of these limitation. IfRunner.finished
returnsTrue
, andstandardize
has been called prior to a call to this function, then the returnedForest
will represent a valid spanning tree for theWordGraph
returned bycurrent_word_graph
orword_graph
.
- ToddCoxeter.current_word_graph(self: ToddCoxeter) WordGraph
Get the current word graph.
In some sense, the purpose of the Todd-Coxeter algorithm is to produce a
WordGraph
of the action of a set of generators on the classes of a congruence. This function can be used to obtain thatWordGraph
as it currently exists within aToddCoxeter
instance. This function does not trigger any enumeration.TheWordGraph
returned by this function may be in a rather complicated state. No guarantees are given: about the values of the active nodes (i.e. they may be any non-negative integers in any order); that the number of nodes (including those that are inactive) should coincide with the number of active nodes; that the graph is complete; or that the graph is compatible with the relations of thepresentation
or with the generating_pairs. The functionsstandardize
andshrink_to_fit
can be used to modify the returned word graph in-place to have (possibly) more reasonable characteristics.
- ToddCoxeter.is_standardized(*args, **kwargs)
Overloaded function.
- is_standardized(self: ToddCoxeter) bool
Check if the word graph is currently standardized with respect to any order. This function returns
True
if thecurrent_word_graph
has been standardized with respect to the anyOrder
other thanOrder.none
.- Returns:
Whether or not the current word graph is standardized with respect to any order.
- Return type:
- is_standardized(self: ToddCoxeter, val: Order) bool
Check if the word graph is currently standardized with respect to a given order.
This function returns
True
if thecurrent_word_graph
has been standardized with respect to the order val ; andFalse
if not.
- ToddCoxeter.spanning_tree(self: ToddCoxeter) Forest
Get the spanning tree of the underlying word graph. This function returns a spanning tree (a
Forest
) for the underlyingWordGraph
(returned byword_graph
) with the nodes appearing in short-lex order. This function triggers a full congruence enumeration.
- ToddCoxeter.standardization_order(self: ToddCoxeter) Order
Get the current standardization order of the underlying word graph.
This function returns the standardization order currently used in the underlying word graph. The return value of this function will be the argument of the most recent call to
standardize
; orOrder.none
.The return value of this function indicates the following:
Order.none
implies that no standardization has been performed and:the return value of
reduce
will essentially arbitrary;the return values of
todd_coxeter.normal_forms
ortodd_coxeter.normal_forms
will be essentially arbitrary;the classes of the congruence will be indexed in an arbitrary order;
Order.shortlex
implies that:the return value of
reduce
will be the short-lex least word belonging to a given congruence class;the return values of
todd_coxeter.normal_forms
andtodd_coxeter.normal_forms
will be in short-lex order;the classes of the congruence will be indexed in short-lex order on the short-lex least word;
Order.lex
implies that:the return values of
todd_coxeter.normal_forms
andtodd_coxeter.normal_forms
will be ordered lexicographically.the return values of
reduce
and the indexes of class are essentially arbitrary because there is not necessarily a lexicographically least word in every class;
Order.recursive
implies that:the return value of
reduce
will be the recursive path least word belonging to a given congruence class;the return values of
todd_coxeter.normal_forms
andtodd_coxeter.normal_forms
will be ordered by the recursive path order;the classes of the congruence will be indexed in recursive path order on the recursive path least word.
- Returns:
The current standardization order.
- Return type:
- ToddCoxeter.word_graph(self: ToddCoxeter) WordGraph
Get the word graph after performing a full congruence enumeration.
In some sense, the purpose of the Todd-Coxeter algorithm is to produce a
WordGraph
of the action of a set of generators on the classes of a congruence. This function can be used to obtain thatWordGraph
instance. This function triggers a full enumeration.TheWordGraph
returned by this function may be in a rather complicated state. The active nodes (and nodes) will be \(\{0, \ldots, n - 1\}\) where \(n\) is the number of classes in the congruence ifpresentation
contains the empty word; or the number of classes plus one ifpresentation
does not contain the empty word. The returnedWordGraph
is also short-lex standardized. The returnedWordGraph
will usually be complete and compatible with the relations of thepresentation
and with theToddCoxeter.generating_pairs
. TheWordGraph
may not be complete or compatible for some values of the settings. For example, if the settinglower_bound
is used but is not the same as the number of classes in the congruence, then theWordGraph
returned by this function may not be compatible with the relations ofpresentation
orToddCoxeter.generating_pairs
.