Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/rings/field.py
4057 views
1
"""
2
Abstract base class for fields
3
"""
4
5
#*****************************************************************************
6
# Copyright (C) 2005 William Stein <[email protected]>
7
#
8
# Distributed under the terms of the GNU General Public License (GPL)
9
#
10
# This code is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
# General Public License for more details.
14
#
15
# The full text of the GPL is available at:
16
#
17
# http://www.gnu.org/licenses/
18
#*****************************************************************************
19
20
from sage.rings.ring import Field, is_Field
21
22
def is_PrimeField(R):
23
from finite_field.constructor import is_FiniteField
24
from rational_field import is_RationalField
25
if is_RationalField(R):
26
return True
27
if is_FiniteField(R):
28
return R.degree() == 1
29
return False
30
31