commutative ring

Commutative Ring

Commutative Ring

Mathematically a Commutative Ring is a Ring whose multiplication is commutative.

Important

Contract: Ring initializer parameters must have

  • add closed, commutative and associative on reps

  • mult closed, commutative and associative on reps

  • one an identity on reps, rep*one == rep == one*rep

  • zero an identity on reps, rep+zero == rep == zero+rep

  • negate maps rep -> -rep, rep + negate(rep) == zero

  • zero != one

class boring_math.abstract_algebra.algebras.commutative_ring.CommutativeRing

Bases: Ring, Generic

__init__(mult: Callable[[H, H], H], add: Callable[[H, H], H], one: H, zero: H, negate: Callable[[H], H], narrow: Callable[[H], H] | None = None)
Parameters:
  • mult – Closed associative function reps.

  • add – Closed commutative and associative function reps.

  • one – Representation for multiplicative identity.

  • zero – Representation for additive identity.

  • negate – Function mapping element representation to the representation of corresponding negated element.

  • narrow – Narrow the rep type, many-to-one function. Like choosing an element from a coset of a group.

class boring_math.abstract_algebra.algebras.commutative_ring.CommutativeRingElement

Bases: RingElement, Generic

__init__(rep: H, algebra: CommutativeRing[H]) → None
__str__() → str
Returns:

str(self) = CommutativeRingElement<rep>