abelian group¶
Abelian Group
Mathematically an Abelian Group is a Commutative Monoid G all of whose elements have additive inverses.
Note
Addition is used for the group operation.
Important
Contract: AbelianGroup initializer parameters must have
add closed, associative and commutative on reps
zero additive identity on reps,
rep.add(zero) == rep == zero.add(rep)negate must me idempotent:
neg(neg(rep)) == rep
- class boring_math.abstract_algebra.algebras.abelian_group.AbelianGroup(add: ~collections.abc.Callable[[H, H], H], zero: H, negate: ~collections.abc.Callable[[H], H], process: ~collections.abc.Callable[[H], H] = <function AbelianGroup.<lambda>>)¶
- Parameters:
add – Closed, commutative and associative function on reps.
zero – Representation for additive identity.
negate – Function mapping element representation to the representation of corresponding negated element.
- __init__(add: ~collections.abc.Callable[[H, H], H], zero: H, negate: ~collections.abc.Callable[[H], H], process: ~collections.abc.Callable[[H], H] = <function AbelianGroup.<lambda>>)¶
- Parameters:
add – Closed, commutative and associative function on reps.
zero – Representation for additive identity.
negate – Function mapping element representation to the representation of corresponding negated element.
- __call__(rep: H) AbelianGroupElement¶
Add the unique element to the abelian 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.abelian_group.AbelianGroupElement(rep: H, algebra: AbelianGroup[H], process: ~collections.abc.Callable[[H], H] = <function AbelianGroupElement.<lambda>>)¶
- __init__(rep: H, algebra: AbelianGroup[H], process: ~collections.abc.Callable[[H], H] = <function AbelianGroupElement.<lambda>>) None¶
- __mul__(n: Self | int) Self¶
Multiplying additive group element by an integer
n>=0is the same as repeated addition.- Parameters:
n – Add abelian group element to itself
n >= 0times.- Returns:
The sum of the group element n times.
- Raises:
TypeError – if given an element instead of an
int.ValueError – If add method was not defined on the group.
- __neg__() Self¶
Negate the abelian group element.
- Returns:
The unique additive inverse element to
self.- Raises:
ValueError – If algebra fails to have additive inverses.