Examples of algebras with basis#

sage.categories.examples.algebras_with_basis.Example#

alias of sage.categories.examples.algebras_with_basis.FreeAlgebra

class sage.categories.examples.algebras_with_basis.FreeAlgebra(R, alphabet=('a', 'b', 'c'))#

Bases: sage.combinat.free_module.CombinatorialFreeModule

An example of an algebra with basis: the free algebra

This class illustrates a minimal implementation of an algebra with basis.

algebra_generators()#

Return the generators of this algebra, as per algebra_generators().

EXAMPLES:

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

Returns the empty word, which index the one of this algebra, as per AlgebrasWithBasis.ParentMethods.one_basis().

EXAMPLES::r

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

product_on_basis(w1, w2)#

Product of basis elements, as per AlgebrasWithBasis.ParentMethods.product_on_basis().

EXAMPLES:

sage: A = AlgebrasWithBasis(QQ).example()
sage: Words = A.basis().keys()
sage: A.product_on_basis(Words("acb"), Words("cba"))
B[word: acbcba]
sage: (a,b,c) = A.algebra_generators()
sage: a * (1-b)^2 * c
B[word: abbc] - 2*B[word: abc] + B[word: ac]