Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
r""" Finite Fields """ #***************************************************************************** # Copyright (C) 2005 David Kohel <kohel@maths.usyd.edu> # William Stein <wstein@math.ucsd.edu> # 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr> # 2008-2009 Nicolas M. Thiery <nthiery at users.sf.net> # # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #******************************************************************************
from sage.categories.category_with_axiom import CategoryWithAxiom from sage.categories.enumerated_sets import EnumeratedSets
class FiniteFields(CategoryWithAxiom): """ The category of finite fields.
EXAMPLES::
sage: K = FiniteFields(); K Category of finite enumerated fields
A finite field is a finite monoid with the structure of a field; it is currently assumed to be enumerated::
sage: K.super_categories() [Category of fields, Category of finite commutative rings, Category of finite enumerated sets]
Some examples of membership testing and coercion::
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
TESTS::
sage: K is Fields().Finite() True sage: TestSuite(K).run() """
def extra_super_categories(self): r""" Any finite field is assumed to be endowed with an enumeration.
TESTS::
sage: Fields().Finite().extra_super_categories() [Category of finite enumerated sets] sage: FiniteFields().is_subcategory(FiniteEnumeratedSets()) True """
def __contains__(self, x): """ EXAMPLES::
sage: GF(4, "a") in FiniteFields() True sage: QQ in FiniteFields() False sage: IntegerModRing(4) in FiniteFields() False """
# As is, this does no more than the usual __call__ of Category, but for the error message def _call_(self, x): """ EXAMPLES::
sage: FiniteFields()(GF(4, "a")) Finite Field in a of size 2^2 sage: FiniteFields()(RationalField()) # indirect doctest Traceback (most recent call last): ... TypeError: unable to canonically associate a finite field to Rational Field """ # TODO: local dvr ring?
class ParentMethods: pass
class ElementMethods: pass |