clesto.symmetric: Symmetric group and ring¶
-
class
clesto.symmetric.symmetric.SymmetricGroup_element(iterable=(), /)[source]¶ Element in a finite symmetric group.
Create a
SymmetricGroup_elementfrom an iterable representing a permutation of (1,2,…,r) thought of as an automorphism of {1,…,r}.>>> print(SymmetricGroup_element((1,3,2))) (1,3,2)
-
property
sign¶ Returns the sign of self.
The sign is defined as the mod 2 number of transpositions required to express the element.
>>> SymmetricGroup_element((5,2,4,3,1)).sign 1
-
property
arity¶ Arity of self
The arity of a symmetric group element is defined as the cardinality of its domain.
>>> SymmetricGroup_element((5,2,4,3,1)).arity 5
-
inverse()[source]¶ Multiplicative inverse: self^{-1}.
>>> pi = SymmetricGroup_element((2,3,1)) >>> print(pi.inverse()) (3,1,2)
-
__mul__(other)[source]¶ Product: self * other.
This product agrees with the composition of bijections: self o other.
>>> x = SymmetricGroup_element((1,3,2)) >>> y = SymmetricGroup_element((2,3,1)) >>> print(y * x) (2,1,3)
-
property
-
class
clesto.symmetric.symmetric.SymmetricRing_element(data=None, torsion=None)[source]¶ Elements in the (modular) integral group ring of finite symmetric groups.
-
property
arity¶ Return the arity of self if homogeneous and
Noneotherwise.self is said to be homogeneous if all basis elements belong to the same arity.
>>> SymmetricRing_element({(5,2,4,3,1): 1}).arity 5 >>> SymmetricRing_element({(2,3,1): 1, (1,2): 1}).arity
-
__mul__(other)[source]¶ Linear product in the symmetric group ring: self * other.
>>> p = SymmetricRing_element({(4,3,2,1): 1, (1,2,3,4): 2}) >>> print(3 * p) 3(4,3,2,1) + 6(1,2,3,4) >>> q = SymmetricRing_element({(4,1,2,3): 1}) >>> print(p * q) (1,4,3,2) + 2(4,1,2,3)
-
property