Algebras With Basis#

class sage.categories.algebras_with_basis.AlgebrasWithBasis(base_category)#

Bases: CategoryWithAxiom_over_base_ring

The category of algebras with a distinguished basis.

EXAMPLES:

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

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

sage: A = C.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.category()                                                              # needs sage.combinat sage.modules
Category of algebras with basis over Rational Field

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

sage: A.base_ring()                                                             # needs sage.combinat sage.modules
Rational Field
sage: A.basis().keys()                                                          # needs sage.combinat sage.modules
Finite words over {'a', 'b', 'c'}

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

sage: A.product                                                                 # needs sage.combinat sage.modules
<bound method MagmaticAlgebras.WithBasis.ParentMethods._product_from_product_on_basis_multiply 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)                                                       # needs sage.combinat sage.modules
B[word: abb]

sage: TestSuite(A).run(verbose=True)                                            # needs sage.combinat sage.modules
running ._test_additive_associativity() . . . pass
running ._test_an_element() . . . pass
running ._test_associativity() . . . pass
running ._test_cardinality() . . . pass
running ._test_category() . . . pass
running ._test_characteristic() . . . pass
running ._test_construction() . . . pass
running ._test_distributivity() . . . pass
running ._test_elements() . . .
  Running the test suite of self.an_element()
  running ._test_category() . . . pass
  running ._test_eq() . . . pass
  running ._test_new() . . . pass
  running ._test_nonzero_equal() . . . pass
  running ._test_not_implemented_methods() . . . pass
  running ._test_pickling() . . . pass
  pass
running ._test_elements_eq_reflexive() . . . pass
running ._test_elements_eq_symmetric() . . . pass
running ._test_elements_eq_transitive() . . . pass
running ._test_elements_neq() . . . pass
running ._test_eq() . . . pass
running ._test_new() . . . 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__                                                               # needs sage.combinat sage.modules
<class 'sage.categories.examples.algebras_with_basis.FreeAlgebra_with_category'>
sage: A.element_class                                                           # needs sage.combinat sage.modules
<class 'sage.categories.examples.algebras_with_basis.FreeAlgebra_with_category.element_class'>

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

class CartesianProducts(category, *args)#

Bases: CartesianProductsCategory

The category of algebras with basis, constructed as Cartesian products of algebras with basis.

Note: this construction give the direct products of algebras with basis. See comment in Algebras.CartesianProducts

class ParentMethods#

Bases: object

one()#
one_from_cartesian_product_of_one_basis()#

Return the one of this Cartesian product of algebras, as per Monoids.ParentMethods.one

It is constructed as the Cartesian product of the ones of the summands, using their one_basis() methods.

This implementation does not require multiplication by scalars nor calling cartesian_product. This might help keeping things as lazy as possible upon initialization.

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.one_basis()                                                 # needs sage.combinat sage.modules
word:

sage: B = cartesian_product((A, A, A))                              # needs sage.combinat sage.modules
sage: B.one_from_cartesian_product_of_one_basis()                   # needs sage.combinat sage.modules
B[(0, word: )] + B[(1, word: )] + B[(2, word: )]
sage: B.one()                                                       # needs sage.combinat sage.modules
B[(0, word: )] + B[(1, word: )] + B[(2, word: )]

sage: cartesian_product([SymmetricGroupAlgebra(QQ, 3),              # needs sage.combinat sage.modules
....:                    SymmetricGroupAlgebra(QQ, 4)]).one()
B[(0, [1, 2, 3])] + B[(1, [1, 2, 3, 4])]
extra_super_categories()#

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

EXAMPLES:

sage: AlgebrasWithBasis(QQ).CartesianProducts().extra_super_categories()
[Category of algebras with basis over Rational Field]
sage: AlgebrasWithBasis(QQ).CartesianProducts().super_categories()
[Category of algebras with basis over Rational Field,
 Category of Cartesian products of algebras over Rational Field,
 Category of Cartesian products of vector spaces with basis over Rational Field]
class ElementMethods#

Bases: object

Filtered#

alias of FilteredAlgebrasWithBasis

FiniteDimensional#

alias of FiniteDimensionalAlgebrasWithBasis

Graded#

alias of GradedAlgebrasWithBasis

class ParentMethods#

Bases: object

hochschild_complex(M)#

Return the Hochschild complex of self with coefficients in M.

EXAMPLES:

sage: R.<x> = QQ[]
sage: A = algebras.DifferentialWeyl(R)                                  # needs sage.modules
sage: H = A.hochschild_complex(A)                                       # needs sage.modules

sage: SGA = SymmetricGroupAlgebra(QQ, 3)                                # needs sage.combinat sage.modules
sage: T = SGA.trivial_representation()                                  # needs sage.combinat sage.modules
sage: H = SGA.hochschild_complex(T)                                     # needs sage.combinat sage.modules
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: ]
Super#

alias of SuperAlgebrasWithBasis

class TensorProducts(category, *args)#

Bases: TensorProductsCategory

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

class ElementMethods#

Bases: object

Implements operations on elements of tensor products of algebras with basis

class ParentMethods#

Bases: object

implements operations on tensor products of algebras with basis

one_basis()#

Returns the index of the one of this tensor product of algebras, as per AlgebrasWithBasis.ParentMethods.one_basis

It is the tuple whose operands are the indices of the ones of the operands, as returned by their one_basis() methods.

EXAMPLES:

sage: # needs sage.combinat sage.modules
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.one_basis()
word:
sage: B = tensor((A, A, A))
sage: B.one_basis()
(word: , word: , word: )
sage: B.one()
B[word: ] # B[word: ] # B[word: ]
product_on_basis(t1, t2)#

The product of the algebra on the basis, as per AlgebrasWithBasis.ParentMethods.product_on_basis.

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,b,c) = A.algebra_generators()                              # needs sage.combinat sage.modules

sage: x = tensor((a, b, c)); x                                      # needs sage.combinat sage.modules
B[word: a] # B[word: b] # B[word: c]
sage: y = tensor((c, b, a)); y                                      # needs sage.combinat sage.modules
B[word: c] # B[word: b] # B[word: a]
sage: x * y                                                         # needs sage.combinat sage.modules
B[word: ac] # B[word: bb] # B[word: ca]

sage: x = tensor(((a + 2*b), c)); x                                 # needs sage.combinat sage.modules
B[word: a] # B[word: c] + 2*B[word: b] # B[word: c]
sage: y = tensor((c, a)) + 1; y                                     # needs sage.combinat sage.modules
B[word: ] # B[word: ] + B[word: c] # B[word: a]
sage: x * y                                                         # needs sage.combinat sage.modules
B[word: a] # B[word: c] + B[word: ac] # B[word: ca]
 + 2*B[word: b] # B[word: c] + 2*B[word: bc] # B[word: ca]

TODO: optimize this implementation!

extra_super_categories()#

EXAMPLES:

sage: AlgebrasWithBasis(QQ).TensorProducts().extra_super_categories()
[Category of algebras with basis over Rational Field]
sage: AlgebrasWithBasis(QQ).TensorProducts().super_categories()
[Category of algebras with basis over Rational Field,
 Category of tensor products of algebras over Rational Field,
 Category of tensor products of vector spaces with basis over Rational Field]
example(alphabet=('a', 'b', 'c'))#

Return an example of algebra with basis.

EXAMPLES:

sage: AlgebrasWithBasis(QQ).example()                                       # needs sage.combinat sage.modules
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))                                # needs sage.combinat sage.modules
An example of an algebra with basis:
 the free algebra on the generators (1, 2, 3) over Rational Field