semigroup¶
Semigroup
Mathematically a Semigroup is a set S along with an associative binary operation mult: S X S -> S.
Important
Contract: Semigroup initializer parameters must have
mult closed and associative on reps
- class boring_math.abstract_algebra.algebras.semigroup.Semigroup(mult: ~collections.abc.Callable[[H, H], H], process: ~collections.abc.Callable[[H], H] = <function Semigroup.<lambda>>)¶
- Parameters:
mult – Associative function
H X H -> Hon representations.- Returns:
A semigroup algebra.
- __init__(mult: ~collections.abc.Callable[[H, H], H], process: ~collections.abc.Callable[[H], H] = <function Semigroup.<lambda>>) None¶
- Parameters:
mult – Associative function
H X H -> Hon representations.- Returns:
A semigroup algebra.
- __call__(rep: H) SemigroupElement¶
Add the unique element to the semigroup with a given rep.
- Parameters:
rep – Representation to add if not already present.
- Returns:
The unique element with that representation.
- class boring_math.abstract_algebra.algebras.semigroup.SemigroupElement(rep: H, algebra: Semigroup[H])¶
-
- __mul__(other: object) Self¶
Multiply two elements of the same concrete semigroup together.
- Parameters:
other – Another element within the same semigroup.
- Returns:
The product
self * other.- Raises:
TypeError – If
selfandotherare different types.ValueError – If
selfandotherare same type but different concrete semigroups.
- __rmul__(other: object) Self¶
When left side of multiplication does not know how to multiply right side.
- Parameters:
other – Left side of the multiplication.
- Returns:
NotImplemented, otherwise
left.__mul__(right)would have worked.- Raises:
TypeError – When multiplying on left by an int.
- __pow__(n: int) Self¶
Raising semigroup element to a positive
intpower is the same as repeated multiplication.- Parameters:
n – Multiply semigroup element to itself
n > 0times.- Returns:
The product of the semigroup element n times.
- Raises:
ValueError – When
n <= 0.ValueError – If for some reason a mult method was not defined on the semigroup.