Module: sage.categories.category
Author: David Kohel and William Stein
Every SAGE object lies in a category. Categories in SAGE are modeled on the mathematical idea of category, and are distinct from Python classes, which are a programming construct.
In most cases, typing x.category()
returns the category to
which
belongs. If
is a category and
is any object,
tries to make an object in
from
.
We create a couple of categories.
sage: Sets() Category of sets sage: GSets(AbelianGroup([2,4,9])) Category of G-sets for Multiplicative Abelian Group isomorphic to C2 x C4 x C9 sage: Semigroups() Category of semigroups sage: VectorSpaces(FiniteField(11)) Category of vector spaces over Finite Field of size 11 sage: Ideals(IntegerRing()) Category of ring ideals in Integer Ring
The default category for elements
of an objects
is the
category of all objects of
. For example,
sage: V = VectorSpace(RationalField(), 3) sage: x = V.gen(1) sage: x.category() Category of elements of Vector space of dimension 3 over Rational Field
Module-level Functions
[X=None]) |
x) |
Returns True if x is a category.
Class: AbelianCategory
Functions: is_abelian
Class: AbelianGroups
sage: AbelianGroups() Category of abelian groups
Special Functions: __reduce__
self) |
sage: C = AbelianGroups() sage: loads(C.dumps()) == C True
Class: AbelianMonoids
sage: AbelianMonoids() Category of abelian monoids
Special Functions: __reduce__
self) |
sage: C = AbelianMonoids() sage: loads(C.dumps()) == C True
Class: AbelianSemigroups
sage: AbelianSemigroups() Category of abelian semigroups
Special Functions: __reduce__
self) |
sage: C = AbelianSemigroups() sage: loads(C.dumps()) == C True
Class: AlgebraIdeals
sage: C = AlgebraIdeals(FreeAlgebra(QQ,2)) sage: loads(C.dumps()) == C True
self, A) |
Functions: algebra
Special Functions: __reduce__
Class: AlgebraModules
self, A) |
Functions: algebra
Special Functions: __reduce__
self) |
sage: C = AlgebraModules(FreeAlgebra(QQ,2)) sage: loads(C.dumps()) == C True
Class: Algebras
Functions: base_field
self) |
Return the base field over which the algebras of this category are all defined.
Special Functions: __contains__,
__reduce__
self) |
sage: C = Algebras(ZZ) sage: loads(C.dumps()) == C True
Class: CommutativeAlgebraIdeals
self, A) |
Functions: algebra
Special Functions: __reduce__
self) |
Class: CommutativeAlgebras
sage: M = CommutativeAlgebras(GF(19)) sage: M Category of commutative algebras over Finite Field of size 19
Special Functions: __reduce__
self) |
sage: C = CommutativeAlgebras(ZZ) sage: loads(C.dumps()) == C True
Class: CommutativeRingIdeals
sage: C = CommutativeRingIdeals(IntegerRing()) sage: C Category of commutative ring ideals in Integer Ring
self, R) |
Special Functions: __reduce__
self) |
sage: C = CommutativeRingIdeals(ZZ) sage: loads(C.dumps()) == C True
Class: CommutativeRings
sage: CommutativeRings() Category of commutative rings
Special Functions: __reduce__
self) |
sage: C = CommutativeRings() sage: loads(C.dumps()) == C True
Class: Elements
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
self, object) |
Functions: object
Special Functions: __reduce__,
_call_,
_latex_,
_repr_
self, x) |
sage: V = VectorSpace(QQ,3) sage: x = V.0 sage: C = x.category() sage: C Category of elements of Vector space of dimension 3 over Rational Field sage: w = C([1,2,3]); w (1, 2, 3) sage: w.category() Category of elements of Vector space of dimension 3 over Rational Field
Class: Fields
sage: K = Fields() sage: K Category of fields sage: K(IntegerRing()) Rational Field sage: K(PolynomialRing(GF(3))) Fraction Field of Univariate Polynomial Ring in x over Finite Field of size 3 sage: K(RealField()) Real Field with 53 bits of precision
Special Functions: __call__,
__contains__,
__reduce__
self) |
sage: C = Fields() sage: loads(C.dumps()) == C True
Class: FiniteFields
sage: K = FiniteFields() sage: K Category of finite fields sage: FiniteField(17) in K True sage: RationalField() in K False sage: K(RationalField()) Traceback (most recent call last): ... TypeError: unable to canonically associate a finite field to Rational Field
Special Functions: __call__,
__contains__,
__reduce__
self) |
sage: C = FiniteFields() sage: loads(C.dumps()) == C True
Class: FreeModules
sage: FreeModules(IntegerRing()) Category of free modules over Integer Ring
self, R) |
Functions: is_abelian
Special Functions: __call__,
__reduce__
self) |
sage: C = FreeModules(ZZ) sage: loads(C.dumps()) == C True
Class: GroupAlgebras
sage: GroupAlgebras(IntegerRing()) Category of group algebras over Integer Ring
Special Functions: __reduce__
self) |
sage: C = GroupAlgebras(ZZ) sage: loads(C.dumps()) == C True
Class: Groups
sage: Groups() Category of groups
Special Functions: __reduce__
self) |
sage: C = Groups() sage: loads(C.dumps()) == C True
Class: GSets
sage: S = SymmetricGroup(3) sage: GSets(S) Category of G-sets for Symmetric group of order 3! as a permutation group
self, G) |
Special Functions: __reduce__,
__repr__
self) |
sage: S8 = SymmetricGroup(8) sage: C = GSets(S8) sage: loads(C.dumps()) == C True
Class: HeckeModules
A Hecke module is a module
over the anemic Hecke
algebra, i.e., the Hecke algebra generated by Hecke operators
with
coprime to the level of
. (Every Hecke module
defines a level function, which is a positive integer.) The
reason we require that
only be a module over the anemic Hecke
algebra is that many natural maps, e.g., degeneracy maps,
Atkin-Lehner operators, etc., are
-module homomorphisms; but
they are homomorphisms over the anemic Hecke algebra.
We create the category of Hecke modules over
.
sage: C = HeckeModules(RationalField()); C Category of Hecke modules over Rational Field
Note that the base ring can be an arbitrary commutative ring.
sage: HeckeModules(IntegerRing()) Category of Hecke modules over Integer Ring sage: HeckeModules(FiniteField(5)) Category of Hecke modules over Finite Field of size 5
The base ring doesn't have to be a principal ideal domain.
sage: HeckeModules(PolynomialRing(IntegerRing())) Category of Hecke modules over Univariate Polynomial Ring in x over Integer Ring
self, R) |
Special Functions: __reduce__
self) |
sage: C = HeckeModules(ZZ) sage: loads(C.dumps()) == C True
Class: Ideals
sage: Ideals(Integers(200)) Category of ring ideals in Ring of integers modulo 200 sage: C = Ideals(IntegerRing()); C Category of ring ideals in Integer Ring sage: I = C([8,12,18]) sage: I Principal ideal (2) of Integer Ring
self, R) |
Special Functions: __reduce__
self) |
sage: C = RingIdeals(ZZ) sage: loads(C.dumps()) == C True
Class: MatrixAlgebras
sage: MatrixAlgebras(RationalField()) Category of matrix algebras over Rational Field
Special Functions: __reduce__
self) |
sage: C = MatrixAlgebras(ZZ) sage: loads(C.dumps()) == C True
Class: Modules
sage: Modules(RationalField()) Category of ring modules over Rational Field
sage: Modules(Integers(9)) Category of ring modules over Ring of integers modulo 9
Special Functions: __reduce__
self) |
sage: C = RingModules(ZZ) sage: loads(C.dumps()) == C True
Class: MonoidAlgebras
sage: MonoidAlgebras(GF(2)) Category of monoid algebras over Finite Field of size 2
Special Functions: __reduce__
self) |
sage: C = MonoidAlgebras(ZZ) sage: loads(C.dumps()) == C True
Class: Monoids
sage: Monoids() Category of monoids
Special Functions: __reduce__
self) |
sage: C = Monoids() sage: loads(C.dumps()) == C True
Class: NumberFields
We create the category of number fields.
sage: C = NumberFields() sage: C Category of number fields
Notice that the rational numbers
are not considered as
an object in this category.
sage: RationalField() in C False
However, we can define a degree 1 extension of
, which is in
this category.
sage: x = PolynomialRing(RationalField()).gen() sage: K = NumberField(x - 1); K Number Field in a with defining polynomial x - 1 sage: K in C True
We can also coerce
into the category of number fields.
sage: C(RationalField()) Number Field in a with defining polynomial x - 1
Number fields all lie in this category, irregardless of the name of the variable.
sage: K = NumberField(x^2 + 1, name='a') sage: K in C True
Special Functions: __call__,
__contains__,
__reduce__
self) |
sage: C = NumberFields() sage: loads(C.dumps()) == C True
Class: Objects
sage: Objects() Category of objects
Special Functions: __contains__,
__reduce__
Class: RingIdeals
sage: Ideals(Integers(200)) Category of ring ideals in Ring of integers modulo 200 sage: C = Ideals(IntegerRing()); C Category of ring ideals in Integer Ring sage: I = C([8,12,18]) sage: I Principal ideal (2) of Integer Ring
self, R) |
Special Functions: __reduce__
self) |
sage: C = RingIdeals(ZZ) sage: loads(C.dumps()) == C True
Class: RingModules
sage: Modules(RationalField()) Category of ring modules over Rational Field
sage: Modules(Integers(9)) Category of ring modules over Ring of integers modulo 9
Special Functions: __reduce__
self) |
sage: C = RingModules(ZZ) sage: loads(C.dumps()) == C True
Class: Rings
sage: Rings() Category of rings
Special Functions: __reduce__
self) |
sage: C = Rings() sage: loads(C.dumps()) == C True
Class: Schemes_abstract
sage: Schemes() Category of Schemes
self) |
Special Functions: __call__,
__reduce__
self, x) |
Fetch the category of schemes.
sage: S = Schemes(); S Category of Schemes
We create a scheme from a ring.
sage: X = S(ZZ); X Spectrum of Integer Ring
We create a scheme from a scheme (do nothing).
sage: S(X) Spectrum of Integer Ring
We create a scheme morphism from a ring homomorphism.x
sage: phi = Z.hom(Q); phi Coercion morphism: From: Integer Ring To: Rational Field sage: f = S(phi); f Affine Scheme morphism: From: Spectrum of Rational Field To: Spectrum of Integer Ring Defn: Coercion morphism: From: Integer Ring To: Rational Field
sage: f.domain() Spectrum of Rational Field sage: f.codomain() Spectrum of Integer Ring sage: S(f) Affine Scheme morphism: From: Spectrum of Rational Field To: Spectrum of Integer Ring Defn: Coercion morphism: From: Integer Ring To: Rational Field
Class: Schemes_over_base
sage: Schemes(Spec(ZZ)) Category of schemes over Spectrum of Integer Ring
self, Y) |
Functions: base_scheme
Special Functions: __reduce__,
_repr_
self) |
sage: C = Schemes(ZZ) sage: loads(C.dumps()) == C True
Class: Semigroups
sage: Semigroups() Category of semigroups
Special Functions: __reduce__
self) |
sage: C = Semigroups() sage: loads(C.dumps()) == C True
Class: Sequences
sage: v = Sequence([1,2,3]); v [1, 2, 3] sage: C = v.category(); C Category of sequences in Integer Ring sage: loads(C.dumps()) == C True sage: Sequences(ZZ) is C True
self, object) |
Functions: object
Special Functions: __reduce__,
_call_,
_latex_,
_repr_
self, x) |
sage: v = Sequence([1,2,3]); v [1, 2, 3] sage: C = v.category(); C Category of sequences in Integer Ring sage: w = C([2/1, 3/1, GF(2)(5)]); w [2, 3, 1] sage: w.category() Category of sequences in Integer Ring
Class: Sets
sage: Sets() Category of sets
Special Functions: __call__,
__reduce__
Class: VectorSpaces
sage: VectorSpaces(RationalField()) Category of vector spaces over Rational Field
self, K) |
Functions: base_field
Special Functions: __call__,
__reduce__
self) |
sage: C = QQ^10 # vector space sage: loads(C.dumps()) == C True
See About this document... for information on suggesting changes.