Examples of magmas¶
-
sage.categories.examples.magmas.
Example
¶
-
class
sage.categories.examples.magmas.
FreeMagma
(alphabet='a', 'b', 'c', 'd')¶ Bases:
sage.structure.unique_representation.UniqueRepresentation
,sage.structure.parent.Parent
An example of magma.
The purpose of this class is to provide a minimal template for implementing a magma.
EXAMPLES:
sage: M = Magmas().example(); M An example of a magma: the free magma generated by ('a', 'b', 'c', 'd')
This is the free magma generated by:
sage: M.magma_generators() Family ('a', 'b', 'c', 'd') sage: a, b, c, d = M.magma_generators()
and with a non-associative product given by:
sage: a * (b * c) * (d * a * b) '((a*(b*c))*((d*a)*b))' sage: a * (b * c) == (a * b) * c False
-
class
Element
¶ Bases:
sage.structure.element_wrapper.ElementWrapper
The class for elements of the free magma.
-
wrapped_class
¶ alias of
builtins.str
-
-
an_element
()¶ Return an element of the magma.
EXAMPLES:
sage: F = Magmas().example() sage: F.an_element() '(((a*b)*c)*d)'
-
magma_generators
()¶ Return the generators of the magma.
EXAMPLES:
sage: F = Magmas().example() sage: F.magma_generators() Family ('a', 'b', 'c', 'd')
-
product
(x, y)¶ Return the product of
x
andy
in the magma, as perMagmas.ParentMethods.product()
.EXAMPLES:
sage: F = Magmas().example() sage: F('a') * F.an_element() '(a*(((a*b)*c)*d))'
-
class