Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
r""" Examples of algebras with basis """ #***************************************************************************** # Copyright (C) 2008-2009 Nicolas M. Thiery <nthiery at users.sf.net> # # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #*****************************************************************************
r""" An example of an algebra with basis: the free algebra
This class illustrates a minimal implementation of an algebra with basis. """
""" 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: TestSuite(A).run()
"""
""" EXAMPLES::
sage: AlgebrasWithBasis(QQ).example() # indirect doctest An example of an algebra with basis: the free algebra on the generators ('a', 'b', 'c') over Rational Field """
def one_basis(self): """ Returns the empty word, which index the one of this algebra, as per :meth:`AlgebrasWithBasis.ParentMethods.one_basis`.
EXAMPLES::r
sage: A = AlgebrasWithBasis(QQ).example() sage: A.one_basis() word: sage: A.one() B[word: ] """
r""" Product of basis elements, as per :meth:`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] """
def algebra_generators(self): r""" Return the generators of this algebra, as per :meth:`~.magmatic_algebras.MagmaticAlgebras.ParentMethods.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]) """ # FIXME: use this once the keys argument of FiniteFamily will be honoured # for the specifying the order of the elements in the family #return Family(self._alphabet, lambda a: self.term(self.basis().keys()(a)))
|