### Navigation

- index
- modules |
- next |
- previous |
- Category Theory »

# Non-unital non-associative algebras

class `sage.categories.magmatic_algebras.``MagmaticAlgebras`(base, name=None)

  Bases: `sage.categories.category_types.Category_over_base_ring`

  The category of algebras over a given base ring.

  An algebra over a ring \(R\) is a module over \(R\) endowed with a bilinear multiplication.

  Warning

  `MagmaticAlgebras` will eventually replace the current `Algebras` for consistency with e.g. Wikipedia article Algebras which assumes neither associativity nor the existence of a unit (see trac ticket #15043).

  EXAMPLES:

      sage: from sage.categories.magmatic_algebras import MagmaticAlgebras
      sage: C = MagmaticAlgebras(ZZ); C
      Category of magmatic algebras over Integer Ring
      sage: C.super_categories()
      [Category of additive commutative additive associative additive unital distributive magmas and additive magmas,
       Category of modules over Integer Ring]

  TESTS:

      sage: TestSuite(C).run()

  `Associative`

    alias of `AssociativeAlgebras`

  class `ParentMethods`
    `algebra_generators`()

      Return a family of generators of this algebra.

      EXAMPLES:

          sage: F = AlgebrasWithBasis(QQ).example(); F
          An example of an algebra with basis: the free algebra on the generators ('a', 'b', 'c') over Rational Field
          sage: F.algebra_generators()
          Family (B[word: a], B[word: b], B[word: c])

  `MagmaticAlgebras.``Unital`

    alias of `UnitalAlgebras`

  class `MagmaticAlgebras.``WithBasis`(base_category)

    Bases: `sage.categories.category_with_axiom.CategoryWithAxiom_over_base_ring`

    TESTS:

        sage: C = Modules(ZZ).FiniteDimensional(); C
        Category of finite dimensional modules over Integer Ring
        sage: type(C)
        <class 'sage.categories.modules.Modules.FiniteDimensional_with_category'>
        sage: type(C).__base__.__base__
        <class 'sage.categories.category_with_axiom.CategoryWithAxiom_over_base_ring'>

        sage: TestSuite(C).run()

    class `ParentMethods`
      `product`()

        The product of the algebra, as per `Magmas.ParentMethods.product()`

        By default, this is implemented using one of the following methods, in the specified order:

        - `product_on_basis()`
        - `_multiply()` or `_multiply_basis()`
        - `product_by_coercion()`

        EXAMPLES:

            sage: A = AlgebrasWithBasis(QQ).example()
            sage: a, b, c = A.algebra_generators()
            sage: A.product(a + 2*b, 3*c)
            3*B[word: ac] + 6*B[word: bc]

      `product_on_basis`(i, j)

        The product of the algebra on the basis (optional).

        INPUT:

        - `i`, `j` – the indices of two elements of the basis of `self`

        Return the product of the two corresponding basis elements indexed by `i` and `j`.

        If implemented, `product()` is defined from it by bilinearity.

        EXAMPLES:

            sage: A = AlgebrasWithBasis(QQ).example()
            sage: Word = A.basis().keys()
            sage: A.product_on_basis(Word("abc"),Word("cba"))
            B[word: abccba]

  `MagmaticAlgebras.``additional_structure`()

    Return `None`.

    Indeed, the category of (magmatic) algebras defines no new structure: a morphism of modules and of magmas between two (magmatic) algebras is a (magmatic) algebra morphism.

    See also

    `Category.additional_structure()`

    Todo

    This category should be a `CategoryWithAxiom`, the axiom specifying the compability between the magma and module structure.

    EXAMPLES:

        sage: from sage.categories.magmatic_algebras import MagmaticAlgebras
        sage: MagmaticAlgebras(ZZ).additional_structure()

  `MagmaticAlgebras.``super_categories`()

    EXAMPLES:

        sage: from sage.categories.magmatic_algebras import MagmaticAlgebras
        sage: MagmaticAlgebras(ZZ).super_categories()
        [Category of additive commutative additive associative additive unital distributive magmas and additive magmas, Category of modules over Integer Ring]

        sage: from sage.categories.additive_semigroups import AdditiveSemigroups
        sage: MagmaticAlgebras(ZZ).is_subcategory((AdditiveSemigroups() & Magmas()).Distributive())
        True

### Navigation

- index
- modules |
- next |
- previous |
- Category Theory »