Cartesian product functorial construction

class sage.categories.cartesian_product.CartesianProductCategory(category, name=None)

Bases: sage.categories.cartesian_product.CategoryWithCartesianProduct

An abstract base class for all CartesianProductCategory’s defined in CategoryWithCartesianProduct’s.

cartesian_product_category()

Returns the category of cartesian products of self

By associativity of cartesian products, this is self (a cartesian_product of cartesian_products of A‘s is a cartesian product of A‘s)

EXAMPLES:

sage: ModulesWithBasis(QQ).cartesian_product_category().cartesian_product_category()
Category of cartesian products of modules with basis over Rational Field
class sage.categories.cartesian_product.CartesianProductFunctor

Bases: sage.categories.category.CovariantFunctorialConstruction

A singleton class for the cartesian_product functor

FunctorialCategory
alias of CategoryWithCartesianProduct
class sage.categories.cartesian_product.CategoryWithCartesianProduct(s=None)

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 C of CClass is a category.

CClass must implement a method cartesian_product_category() which returns the category of cartesian products of parents in C. With the default implementation of cartesian_product_category(), it is sufficient to provide a class CClass.CartesianProductCategory whose constructor takes as parameter the category C and returns the desired category.

If C is a subcategory of another category with cartesian product D, C.cartesian_product_category() is automatically considered as a subcategory of D.cartesian_product_category()`.

See also CovariantFunctorialConstruction.

TESTS:

sage: TestSuite(CategoryWithCartesianProduct()).run() # mostly to silence sage -coverage on this abstract class
class ElementMethods
cartesian_product(*elements)

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?

class CategoryWithCartesianProduct.ParentMethods
cartesian_product(*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
CategoryWithCartesianProduct.cartesian_product_category(*args, **kwds)

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

Previous topic

Functors

Next topic

Tensor product functorial construction

This Page