group¶
Group
Mathematically a Group is a Monoid G all of whose elements have multiplicative inverses.
Caution
No assumptions are made whether or not the group is Abelian. See CommunitiveGroup.
Important
Contract: Group initializer parameters must have
mult closed and associative on reps
one an identity on reps,
rep*one == rep == one*repinv must me idempotent:
inv(inv(rep)) == rep
- class boring_math.abstract_algebra.algebras.group.Group(mult: ~collections.abc.Callable[[H, H], H], one: H, invert: ~collections.abc.Callable[[H], H], process: ~collections.abc.Callable[[H], H] = <function Group.<lambda>>)¶
- Parameters:
mult – Associative function
H X H -> Hon representations.one – Representation for multiplicative identity.
invert – Function
H -> Hmapping element representation to the representation of corresponding inverse element.
- Returns:
A group algebra.
- __init__(mult: ~collections.abc.Callable[[H, H], H], one: H, invert: ~collections.abc.Callable[[H], H], process: ~collections.abc.Callable[[H], H] = <function Group.<lambda>>)¶
- Parameters:
mult – Associative function
H X H -> Hon representations.one – Representation for multiplicative identity.
invert – Function
H -> Hmapping element representation to the representation of corresponding inverse element.
- Returns:
A group algebra.
- __call__(rep: H) GroupElement¶
Add the unique element to the group 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.group.GroupElement(rep: H, algebra: Group[H])¶
-
- __pow__(n: int) Self¶
Raise the group element to the power of
n.- Parameters:
n – The
intpower to raise the element to.- Returns:
The element (or its inverse) raised to an
intpower.- Raises:
ValueError – If element’s algebra
ValueError – If
selfandotherare same type but different concrete groups.ValueError – If algebra fails to have an identity or elements not invertible.