symforce.ops.group_ops module

class GroupOps[source]

Bases: StorageOps

API for mathematical groups.

A group is an algebraic structure consisting of a set of elements equipped with an operation that combines any two elements to form a third element and that satisfies four conditions called the group axioms - closure, associativity, identity and invertibility.

Reference:

static identity(a)[source]

Identity element of the given type’s group.

This method does not rely on the value of a, only the type.

Returns:

b such that a @ b = a

Return type:

Element

Parameters:

a (Union[Any, Type]) –

static compose(a, b)[source]

Composition of two elements in the group.

Returns:

a @ b

Return type:

Element

Parameters:
  • a (Any) –

  • b (Any) –

static inverse(a)[source]

Inverse of the element a.

Returns:

b such that a @ b = identity

Return type:

Element

Parameters:

a (Any) –

static between(a, b)[source]

Returns the element that when composed with a produces b. For vector spaces it is b - a.

Implementation is simply compose(inverse(a), b).

Returns:

c such that a @ c = b

Return type:

Element

Parameters:
  • a (Any) –

  • b (Any) –