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*rep

  • inv 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 -> H on representations.

  • one – Representation for multiplicative identity.

  • invert – Function H -> H mapping 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 -> H on representations.

  • one – Representation for multiplicative identity.

  • invert – Function H -> H mapping 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])
__init__(rep: H, algebra: Group[H]) None
__pow__(n: int) Self

Raise the group element to the power of n.

Parameters:

n – The int power to raise the element to.

Returns:

The element (or its inverse) raised to an int power.

Raises:
  • ValueError – If element’s algebra

  • ValueError – If self and other are same type but different concrete groups.

  • ValueError – If algebra fails to have an identity or elements not invertible.