Unital algebras#

class sage.categories.unital_algebras.UnitalAlgebras(base_category)#

Bases: CategoryWithAxiom_over_base_ring

The category of non-associative algebras over a given base ring.

A non-associative algebra over a ring \(R\) is a module over \(R\) which is also a unital magma.

Warning

Until github issue #15043 is implemented, Algebras is the category of associative unital algebras; thus, unlike the name suggests, UnitalAlgebras is not a subcategory of Algebras but of MagmaticAlgebras.

EXAMPLES:

sage: from sage.categories.unital_algebras import UnitalAlgebras
sage: C = UnitalAlgebras(ZZ); C
Category of unital algebras over Integer Ring
class CartesianProducts(category, *args)#

Bases: CartesianProductsCategory

The category of unital algebras constructed as Cartesian products of unital algebras.

This construction gives the direct product of algebras. See discussion on:

class ParentMethods#

Bases: object

one()#

Return the multiplicative unit element.

EXAMPLES:

sage: S2 = simplicial_complexes.Sphere(2)
sage: H = S2.cohomology_ring(QQ)
sage: C = cartesian_product([H, H])
sage: one = C.one()
sage: one
B[(0, (0, 0))] + B[(1, (0, 0))]
sage: one == one * one
True
sage: all(b == b * one for b in C.basis())
True
extra_super_categories()#

A Cartesian product of algebras is endowed with a natural unital algebra structure.

EXAMPLES:

sage: from sage.categories.unital_algebras import UnitalAlgebras
sage: C = UnitalAlgebras(QQ).CartesianProducts()
sage: C.extra_super_categories()
[Category of unital algebras over Rational Field]
sage: sorted(C.super_categories(), key=str)
[Category of Cartesian products of distributive magmas and additive magmas,
 Category of Cartesian products of unital magmas,
 Category of Cartesian products of vector spaces over Rational Field,
 Category of unital algebras over Rational Field]
class ParentMethods#

Bases: object

from_base_ring(r)#

Return the canonical embedding of r into self.

INPUT:

  • r – an element of self.base_ring()

EXAMPLES:

sage: A = AlgebrasWithBasis(QQ).example(); A                            # needs sage.combinat sage.modules
An example of an algebra with basis:
 the free algebra on the generators ('a', 'b', 'c') over Rational Field
sage: A.from_base_ring(1)                                               # needs sage.combinat sage.modules
B[word: ]
class WithBasis(base_category)#

Bases: CategoryWithAxiom_over_base_ring

class ParentMethods#

Bases: object

from_base_ring()#
from_base_ring_from_one_basis(r)#

Implement the canonical embedding from the ground ring.

INPUT:

  • r – an element of the coefficient ring

EXAMPLES:

sage: # needs sage.combinat sage.modules
sage: A = AlgebrasWithBasis(QQ).example()
sage: A.from_base_ring_from_one_basis(3)
3*B[word: ]
sage: A.from_base_ring(3)
3*B[word: ]
sage: A(3)
3*B[word: ]
one()#

Return the multiplicative unit element.

EXAMPLES:

sage: A = AlgebrasWithBasis(QQ).example()                           # needs sage.combinat sage.modules
sage: A.one_basis()                                                 # needs sage.combinat sage.modules
word:
sage: A.one()                                                       # needs sage.combinat sage.modules
B[word: ]
one_basis()#

When the one of an algebra with basis is an element of this basis, this optional method can return the index of this element. This is used to provide a default implementation of one(), and an optimized default implementation of from_base_ring().

EXAMPLES:

sage: # needs sage.combinat sage.modules
sage: A = AlgebrasWithBasis(QQ).example()
sage: A.one_basis()
word:
sage: A.one()
B[word: ]
sage: A.from_base_ring(4)
4*B[word: ]
one_from_one_basis()#

Return the one of the algebra, as per Monoids.ParentMethods.one()

By default, this is implemented from one_basis(), if available.

EXAMPLES:

sage: # needs sage.combinat sage.modules
sage: A = AlgebrasWithBasis(QQ).example()
sage: A.one_basis()
word:
sage: A.one_from_one_basis()
B[word: ]
sage: A.one()
B[word: ]