The SchreierSims class
This class implements a deterministic version of the Schreier-Sims algorithm acting on a relatively small number of points (< 1000).
- Example:
>>> from libsemigroups_pybind11 import SchreierSims, Perm
>>> p1 = Perm([1, 0, 2, 3, 4] + list(range(5, 255)))
>>> p2 = Perm([1, 2, 3, 4, 0] + list(range(5, 255)))
>>> S = SchreierSims([p1, p2])
>>> S.size()
120
Contents
This class implements a deterministic version of the Schreier-Sims algorithm acting on a relatively small number of points (< 1000). |
|
Add a base point to the stabiliser chain. |
|
Add a generator. |
|
Get a base point. |
|
Get the size of the current base. |
|
Test membership of an element. |
|
Copy a |
|
Returns the size of the group represented by this, without running the algorithm. |
|
Test membership of an element without running. |
|
Check if any generators have been added so far. |
|
Check if the stabiliser chain is fully enumerated. |
|
Get a generator. |
|
Reset to the trivial group. |
|
Get an inverse of a transversal element. |
|
The number of generators. |
|
The number of strong generators at a given depth. |
|
Returns the identity permutation. |
|
Check if a point is in the orbit of a basepoint. |
|
Run the Schreier-Sims algorithm. |
|
Sift an element through the stabiliser chain. |
|
Sift an element through the stabiliser chain in-place. |
|
Returns the size of the group represented by self. |
|
Get a strong generator. |
|
Get an transversal element. |
Full API
- class SchreierSims
- __init__(self: SchreierSims, gens: list[Element]) None
Construct from a list of generators.
This function constructs a
SchreierSims
instance with generators in the list gens.- Parameters:
gens (list[Element]) – the list of generators.
- Raises:
LibsemigroupsError – if the generators do not have degree equal to \(255\) or \(511\), or the number of generators exceeds the maximum capacity.
- add_base_point(self: SchreierSims, pt: int) SchreierSims
Add a base point to the stabiliser chain.
- Parameters:
pt (int) – the base point to add.
- Returns:
self.
- Return type:
- Raises:
LibsemigroupsError – if pt is out of range.
LibsemigroupsError – if pt is already a base point.
LibsemigroupsError – if
finished()
returnsTrue
.
- Complexity:
Linear in the current number of base points.
- add_generator(self: SchreierSims, x: Element) bool
Add a generator.
This functions adds the argument x as a new generator if and only if x is not already an element of the group represented by the Schreier-Sims object.
- Parameters:
x (Element) – the generator to add.
- Returns:
True
if x is added as a generator andFalse
if it is not.- Return type:
- Raises:
LibsemigroupsError – if the degree of x is not equal to \(255\) or \(511\), or if self already contains the maximum number of elements.
- Complexity:
Constant
- base(self: SchreierSims, index: int) int
Get a base point.
This function gets the base point with a given index.
- Parameters:
index (int) – the index of the base point.
- Returns:
The base point with index index.
- Return type:
- Raises:
LibsemigroupsError – if index is out of range.
- Complexity:
Constant.
- base_size(self: SchreierSims) int
Get the size of the current base.
- Returns:
The base size.
- Return type:
- Complexity:
Constant.
- contains(self: SchreierSims, x: Element) bool
Test membership of an element.
- Parameters:
x (Element) – the possible element.
- Returns:
True
if element is a contained in theSchreierSims
instance, andFalse
otherwise.- Return type:
- copy(self: SchreierSims) SchreierSims
Copy a
SchreierSims
.- Returns:
A copy.
- Return type:
- current_size(self: SchreierSims) int
Returns the size of the group represented by this, without running the algorithm.
- Returns:
the size of the group.
- Return type:
- currently_contains(self: SchreierSims, x: Element) bool
Test membership of an element without running.
This function tests the membership of an element without running the algorithm.
- Parameters:
x (Element) – the possible element.
- Returns:
True
if x is a contained in theSchreierSims
instance, andFalse
otherwise.- Return type:
- empty(self: SchreierSims) bool
Check if any generators have been added so far.
- Returns:
True
ifnumber_of_generators() == 0
andFalse
otherwise.- Return type:
- Complexity:
Constant.
- finished(self: SchreierSims) bool
Check if the stabiliser chain is fully enumerated.
- Returns:
True
if the stabiliser chain is fully enumerated andFalse
otherwise.- Return type:
- Complexity:
Constant.
- generator(self: SchreierSims, index: int) Element
Get a generator.
This function returns the generator with a given index.
- Parameters:
index (int) – the index of the generator to return.
- Returns:
The generator with index index.
- Return type:
Element
- Raises:
LibsemigroupsError – if the index is out of bounds.
- Complexity:
Constant.
- init(self: SchreierSims) SchreierSims
Reset to the trivial group.
This function removes all generators, and orbits, and resets self so that it represents the trivial group, as if self had been newly constructed.
- Returns:
self.
- Return type:
- Complexity:
Constant.
- inverse_transversal_element(self: SchreierSims, depth: int, pt: int) Element
Get an inverse of a transversal element.
This function returns the transversal element at depth depth which sends pt to the basepoint.
- Parameters:
- Returns:
the inverse transversal element.
- Return type:
Element
- Raises:
LibsemigroupsError – if the depth is out of bounds.
LibsemigroupsError – if pt is not in the orbit of the basepoint.
- Complexity:
Constant.
- number_of_generators(self: SchreierSims) int
The number of generators.
This function returns the number of generators.
- Returns:
The number of generators.
- Return type:
- Complexity:
Constant.
- number_of_strong_generators(self: SchreierSims, depth: int) int
The number of strong generators at a given depth.
This function returns the number of strong generators of the stabiliser chain at a given depth.
- Parameters:
depth (int) – the depth.
- Returns:
The number of strong generators.
- Return type:
- Raises:
LibsemigroupsError – if the depth is out of bounds.
- Complexity:
Constant.
- one(self: SchreierSims) Element
Returns the identity permutation.
This function returns the identity permutation of the same degree as the permutations belonging to a
SchreierSims
object.- Returns:
The identity element.
- Return type:
Element
- orbit_lookup(self: SchreierSims, depth: int, pt: int) bool
Check if a point is in the orbit of a basepoint.
- Parameters:
- Returns:
True
if the point pt is in the orbit of the base point of self at depth depth, andFalse
otherwise.- Return type:
- Raises:
LibsemigroupsError – if the depth*` is out of bounds or if *pt is out of bounds.
- Complexity:
Constant.
- run(self: SchreierSims) None
Run the Schreier-Sims algorithm.
- Complexity:
\(O(N^2\log^3|G|+|T|N^2\log|G|)\) time and \(O(N^2\log|G|+|T|N)\) space, where
N
is the degree of the generators, \(|G|\) is the size of the group and \(|T|\) is the number of generators of the group.
- sift(self: SchreierSims, x: Element) Element
Sift an element through the stabiliser chain.
- Parameters:
x (Element) – A group element.
- Returns:
A sifted element.
- Return type:
Element
- Raises:
LibsemigroupsError – if the degree of x is not equal to the degree of the generators.
- sift_inplace(self: SchreierSims, x: Element) None
Sift an element through the stabiliser chain in-place.
- Parameters:
x (Element) – a group element.
- Raises:
LibsemigroupsError – if the degree of x is not equal to the degree of the generators.
- size(self: SchreierSims) int
Returns the size of the group represented by self.
- Returns:
the size of the group.
- Return type:
- strong_generator(self: SchreierSims, depth: int, index: int) Element
Get a strong generator.
This function returns the generator with a given depth and index.
- Parameters:
- Returns:
The strong generator of at depth depth and with index index.
- Return type:
Element
- Raises:
LibsemigroupsError – if the depth is out of bounds.
LibsemigroupsError – if the index is out of bounds.
- Complexity:
Constant.
- transversal_element(self: SchreierSims, depth: int, pt: int) Element
Get an transversal element.
This function returns the transversal element at depth depth which sends the corresponding basepoint to the point pt.
- Parameters:
- Returns:
The transversal element.
- Return type:
Element
- Raises:
LibsemigroupsError – if depth is out of bounds.
LibsemigroupsError – if pt is not in the orbit of the basepoint.
- Complexity:
Constant.