Specific category classes

This is placed in a separate file from categories.py to avoid circular imports (as morphisms must be very low in the hierarchy with the new coercion model).

class sage.categories.category_types.AbelianCategory[source]

Bases: Category

is_abelian()[source]

Return True as self is an abelian category.

EXAMPLES:

sage: CommutativeAdditiveGroups().is_abelian()
True
>>> from sage.all import *
>>> CommutativeAdditiveGroups().is_abelian()
True
class sage.categories.category_types.Category_ideal(ambient, name=None)[source]

Bases: Category_in_ambient

classmethod an_instance()[source]

Return an instance of this class.

EXAMPLES:

sage: AlgebraIdeals.an_instance()
Category of algebra ideals in Univariate Polynomial Ring in x over Rational Field
>>> from sage.all import *
>>> AlgebraIdeals.an_instance()
Category of algebra ideals in Univariate Polynomial Ring in x over Rational Field
ring()[source]

Return the ambient ring used to describe objects self.

EXAMPLES:

sage: C = Ideals(IntegerRing())
sage: C.ring()
Integer Ring
>>> from sage.all import *
>>> C = Ideals(IntegerRing())
>>> C.ring()
Integer Ring
class sage.categories.category_types.Category_in_ambient(ambient, name=None)[source]

Bases: Category

Initialize self.

The parameter name is ignored.

EXAMPLES:

sage: C = Ideals(IntegerRing())
sage: TestSuite(C).run()
>>> from sage.all import *
>>> C = Ideals(IntegerRing())
>>> TestSuite(C).run()
ambient()[source]

Return the ambient object in which objects of this category are embedded.

EXAMPLES:

sage: C = Ideals(IntegerRing())
sage: C.ambient()
Integer Ring
>>> from sage.all import *
>>> C = Ideals(IntegerRing())
>>> C.ambient()
Integer Ring
class sage.categories.category_types.Category_module(base, name=None)[source]

Bases: AbelianCategory, Category_over_base_ring

class sage.categories.category_types.Category_over_base(base, name=None)[source]

Bases: CategoryWithParameters

A base class for categories over some base object.

INPUT:

  • base – a category \(C\) or an object of such a category

Assumption: the classes for the parents, elements, morphisms, of self should only depend on \(C\). See Issue #11935 for details.

EXAMPLES:

sage: Algebras(GF(2)).element_class is Algebras(GF(3)).element_class
True

sage: C = GF(2).category()
sage: Algebras(GF(2)).parent_class is Algebras(C).parent_class
True

sage: C = ZZ.category()
sage: Algebras(ZZ).element_class is Algebras(C).element_class
True
>>> from sage.all import *
>>> Algebras(GF(Integer(2))).element_class is Algebras(GF(Integer(3))).element_class
True

>>> C = GF(Integer(2)).category()
>>> Algebras(GF(Integer(2))).parent_class is Algebras(C).parent_class
True

>>> C = ZZ.category()
>>> Algebras(ZZ).element_class is Algebras(C).element_class
True
classmethod an_instance()[source]

Return an instance of this class.

EXAMPLES:

sage: Algebras.an_instance()
Category of algebras over Rational Field
>>> from sage.all import *
>>> Algebras.an_instance()
Category of algebras over Rational Field
base()[source]

Return the base over which elements of this category are defined.

EXAMPLES:

sage: C = Algebras(QQ)
sage: C.base()
Rational Field
>>> from sage.all import *
>>> C = Algebras(QQ)
>>> C.base()
Rational Field
class sage.categories.category_types.Category_over_base_ring(base, name=None)[source]

Bases: Category_over_base

Initialize self.

EXAMPLES:

sage: C = Algebras(GF(2)); C
Category of algebras over Finite Field of size 2
sage: TestSuite(C).run()
>>> from sage.all import *
>>> C = Algebras(GF(Integer(2))); C
Category of algebras over Finite Field of size 2
>>> TestSuite(C).run()
base_ring()[source]

Return the base ring over which elements of this category are defined.

EXAMPLES:

sage: C = Algebras(GF(2))
sage: C.base_ring()
Finite Field of size 2
>>> from sage.all import *
>>> C = Algebras(GF(Integer(2)))
>>> C.base_ring()
Finite Field of size 2
class sage.categories.category_types.Elements(object)[source]

Bases: Category

The category of all elements of a given parent.

EXAMPLES:

sage: a = IntegerRing()(5)
sage: C = a.category(); C
Category of elements of Integer Ring
sage: a in C
True
sage: 2/3 in C
False
sage: loads(C.dumps()) == C
True
>>> from sage.all import *
>>> a = IntegerRing()(Integer(5))
>>> C = a.category(); C
Category of elements of Integer Ring
>>> a in C
True
>>> Integer(2)/Integer(3) in C
False
>>> loads(C.dumps()) == C
True
classmethod an_instance()[source]

Return an instance of this class.

EXAMPLES:

sage: Elements.an_instance()
Category of elements of Rational Field
>>> from sage.all import *
>>> Elements.an_instance()
Category of elements of Rational Field
object()[source]

EXAMPLES:

sage: Elements(ZZ).object()
Integer Ring
>>> from sage.all import *
>>> Elements(ZZ).object()
Integer Ring
super_categories()[source]

EXAMPLES:

sage: Elements(ZZ).super_categories()
[Category of objects]
>>> from sage.all import *
>>> Elements(ZZ).super_categories()
[Category of objects]

Todo

Check that this is what we want.