Group#
- class libcasm.group.Group(
- elements: list[Any] | None = None,
- multiplication_table: list[list[int]] | None = None,
- head_group: Group | None = None,
- head_group_index: set[int] | None = None,
Bases:
GenericGroupA group with user specified elements.
Constructor
Notes
To construct a head group, provide elements and multiplication_table. To construct a subgroup, provide head_group and head_group_index and optionally, elements.
Examples
Construct a head group with 4 elements and the following multiplication table:
elements = ["e", "a", "b", "c"] multiplication_table = [ [0, 1, 2, 3], # e * e = e, e * a = a, e * b = b, e * c = c [1, 0, 3, 2], # a * e = a, a * a = e, a * b = c, a * c = b [2, 3, 0, 1], # b * e = b, b * a = c, b * b = e, b * c = a [3, 2, 1, 0], # c * e = c, c * a = b, c * b = a, c * c = e ] group = Group( elements=elements, multiplication_table=multiplication_table, )
Construct a subgroup of the above group with head group indices {0, 2}, corresponding to the elements [“e”, “b”].
subgroup = group.make_subgroup( head_group_indices={0, 2} )
If the original group represents a factor group, then the subgroup can be represented as a subgroup of the factor group with the same head group indices, but with different elements, for instance [“e”, “b’”] where b’ is a different member of the same coset as b in the original group.
subgroup = group.make_subgroup( head_group_indices={0, 2}, elements=["e", "b'"], )
- Parameters:
elements (Optional[list[Any]] = None) – The group elements. The type of the elements is not specified, but they should be compatible with the multiplication table. The first element must be the identity element.
multiplication_table (Optional[list[list[int]]] = None) –
The multiplication table element
multiplication_table[i][j] == krepresents thatnp.allclose(elements[k], elements[i] @ elements[j]) == True.The multiplication table must be square, represent a closed group, and be consistent with having identity operation as the first element.
head_group (Optional[GenericGroup] = None) – The head group if this is a subgroup, else None. If None, then this is a head group.
head_group_index (Optional[set[int]] = None) – Indices of elements in the head group (which may or may not be self) to include in a subgroup. Only used if head_group is not None.
Methods
class_of(…)Returns the index of the conjugacy class containing an element
Returns the conjugacy classes
from_dict(…)Construct a GenericGroup from a Python dict.
inv(…)Returns the index of the inverse of an element
Make a subgroup of this group with the specified head group indices.
mult(…)Returns the index of the element product.
size(…)Returns the size of the group
to_dict(…)Represent the GenericGroup as a Python dict
Attributes
The head group if this is a subgroup, else None.
The list of head group indices (guaranteed sorted)
The list of inverse indices
True if this is a subgroup, False otherwise.
The multiplication table.
The group elements.