AlgebrasWithBasis

class sage.categories.algebras_with_basis.AlgebrasWithBasis(base, name=None)

Bases: sage.categories.category_types.Category_over_base_ring, sage.categories.cartesian_product.CategoryWithCartesianProduct, sage.categories.tensor.CategoryWithTensorProduct

The category of algebras with a distinguished basis

EXAMPLES:

sage: C = AlgebrasWithBasis(QQ); C
Category of algebras with basis over Rational Field
sage: C.super_categories()
[Category of modules with basis over Rational Field, Category of algebras over Rational Field]

We construct a typical parent in this category, and do some computations with it:

sage: A = C.example(); A
An example of an algebra with basis: the free algebra on the generators ('a', 'b', 'c') over Rational Field

sage: A.category()
Category of algebras with basis over Rational Field

sage: A.one_basis()
word: 
sage: A.one()
B[word: ]

sage: A.base_ring()
Rational Field
sage: A.basis().keys()
Words over Ordered Alphabet ['a', 'b', 'c']

sage: (a,b,c) = A.algebra_generators()
sage: a^3, b^2
(B[word: aaa], B[word: bb])
sage: a*c*b
B[word: acb]

sage: A.product
Generic endomorphism of An example of an algebra with basis: the free algebra on the generators ('a', 'b', 'c') over Rational Field
sage: A.product(a*b,b)
B[word: abb]

sage: TestSuite(A).run(verbose=True)
running ._test_additive_associativity() . . . pass
running ._test_an_element() . . . pass
running ._test_associativity() . . . pass
running ._test_category() . . . pass
running ._test_elements() . . .
  Running the test suite of self.an_element()
  running ._test_category() . . . pass
  running ._test_not_implemented_methods() . . . pass
  running ._test_pickling() . . . pass
  pass
running ._test_not_implemented_methods() . . . pass
running ._test_one() . . . pass
running ._test_pickling() . . . pass
running ._test_prod() . . . pass
running ._test_some_elements() . . . pass
running ._test_zero() . . . pass
sage: A.__class__
<class 'sage.categories.examples.algebras_with_basis.FreeAlgebra_with_category'>
sage: A.element_class
<class 'sage.combinat.free_module.FreeAlgebra_with_category.element_class'>

Please see the source code of A (with A??) for how to implement other algebras with basis.

TESTS:

sage: TestSuite(AlgebrasWithBasis(QQ)).run()
class CartesianProductCategory(category, name=None)

Bases: sage.categories.cartesian_product.CartesianProductCategory

The category of algebras with basis constructed by cartesian products of algebras with basis

FIXME: what’s implemented here is actually about direct products of algebras. See comment in Algebras.CartesianProductCategory

ParentMethods
alias of CartesianProductCategory.ParentMethods
super_categories(*args, **kwds)

EXAMPLES:

sage: AlgebrasWithBasis(QQ).cartesian_product_category().super_categories()
[Category of algebras with basis over Rational Field]
class AlgebrasWithBasis.ElementMethods
class AlgebrasWithBasis.ParentMethods
from_base_ring()

TESTS:

sage: A = AlgebrasWithBasis(QQ).example()
sage: A.from_base_ring(3)
3*B[word: ]
from_base_ring_from_one_basis(r)

INPUTS:

  • r: an element of the coefficient ring

Implements the canonical embeding from the ground ring.

EXAMPLES:

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()

EXAMPLES:

sage: A = AlgebrasWithBasis(QQ).example()
sage: A.one_basis()
word: 
sage: A.one()
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: 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()

Returns the one of the algebra, as per Monoids.ParentMethods.one

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

EXAMPLES:

sage: A = AlgebrasWithBasis(QQ).example()
sage: A.one_basis()
word: 
sage: A.one_from_one_basis()
B[word: ]
sage: A.one()
B[word: ]
product()

The product of the algebra, as per Algebras.ParentMethods.product

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

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

Returns the product of the two corresponding basis elements

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]
class AlgebrasWithBasis.TensorCategory(category, name=None)

Bases: sage.categories.tensor.TensorCategory

The category of algebras with basis constructed by tensor product of algebras with basis

ElementMethods
alias of TensorCategory.ElementMethods
ParentMethods
alias of TensorCategory.ParentMethods
super_categories(*args, **kwds)

EXAMPLES:

sage: AlgebrasWithBasis(QQ).tensor_category().super_categories()
[Category of algebras with basis over Rational Field]
AlgebrasWithBasis.example(alphabet=('a', 'b', 'c'))

Returns an example of algebra with basis:

sage: AlgebrasWithBasis(QQ).example()
An example of an algebra with basis: the free algebra on the generators ('a', 'b', 'c') over Rational Field

An other set of generators can be specified as optional argument:

sage: AlgebrasWithBasis(QQ).example((1,2,3))
An example of an algebra with basis: the free algebra on the generators (1, 2, 3) over Rational Field
AlgebrasWithBasis.super_categories(*args, **kwds)

EXAMPLES:

sage: AlgebrasWithBasis(QQ).super_categories()
[Category of modules with basis over Rational Field, Category of algebras over Rational Field]

Previous topic

Algebras

Next topic

Bialgebras

This Page