Bases: sage.categories.cartesian_product.CategoryWithCartesianProduct
An abstract base class for all CartesianProductCategory’s defined in CategoryWithCartesianProduct’s.
Returns the category of cartesian products of self
By associativity of cartesian products, this is self (a
cartesian_product of cartesian_products of ‘s is a cartesian product of
‘s)
EXAMPLES:
sage: ModulesWithBasis(QQ).cartesian_product_category().cartesian_product_category()
Category of cartesian products of modules with basis over Rational Field
Bases: sage.categories.category.CovariantFunctorialConstruction
A singleton class for the cartesian_product functor
Bases: sage.categories.category.Category
A category with cartesian product is a category endowed with a cartesian product functor (operation on its parents and on its elements).
Technically, let CClass be a class inheriting from
CategoryWithCartesianProduct. An instance of CClass is a category.
CClass must implement a method cartesian_product_category()
which returns the category of cartesian products of parents in . With
the default implementation of cartesian_product_category(), it is
sufficient to provide a class CClass.CartesianProductCategory whose
constructor takes as parameter the category
and returns the
desired category.
If is a subcategory of another category with cartesian product
,
C.cartesian_product_category() is automatically considered as a
subcategory of
.
See also CovariantFunctorialConstruction.
TESTS:
sage: TestSuite(CategoryWithCartesianProduct()).run() # mostly to silence sage -coverage on this abstract class
Returns the cartesian product of its arguments, as an element of the cartesian product of the parents of those elements.
EXAMPLES:
sage: C = AlgebrasWithBasis(QQ)
sage: A = C.example()
sage: (a,b,c) = A.algebra_generators()
sage: a.cartesian_product(b, c)
B[(0, word: a)] + B[(1, word: b)] + B[(2, word: c)]
FIXME: is this a policy that we want to enforce on all parents?
Returns the cartesian product of the parents
EXAMPLES:
sage: C = AlgebrasWithBasis(QQ)
sage: A = C.example(); A.rename("A")
sage: A.cartesian_product(A,A)
A (+) A (+) A
The category of cartesian products of parents in self
EXAMPLES:
sage: ModulesWithBasis(QQ).cartesian_product_category()
Category of cartesian products of modules with basis over Rational Field