semigroup¶
Semigroup¶
Semigroup
Mathematically a Semigroup is a set S along with an
associative binary operation * such that
(∀x ∈ S)(∀y ∈ S)(∀z ∈ S) => (x*(y*z)) = ((x*y)*z)
Important
Contract: Semigroup initializer parameters must have
mult closed and associative on reps
- class boring_math.abstract_algebra.algebras.semigroup.Semigroup¶
- class boring_math.abstract_algebra.algebras.semigroup.SemigroupElement¶
Bases:
BaseElement,Generic- __init__(rep: H, algebra: Semigroup[H]) None¶
abstract base class for algebra element
- param rep:
Coset element to be narrowed to a representative.
- param algebra:
Algebra to which element belongs
- __str__() str¶
user string
Construct the string ‘SemigroupElement<rep_str>’ where rep_str = str(rep).
- returns:
A string meaningful to an end user.
- __mul__(right: object) Self¶
mul
Multiply two elements of the same concrete algebra together.
- param right:
An element within the same concrete algebra or a right action.
- returns:
The product
self * rightotherwiseNotImplemented.- raises ValueError:
If
selfandrightare same type but different concrete algebras.