예제 #1
0
def is_PrimeField(R):
    r"""
    Determine if ``R`` is a field that is equal to its own prime subfield.

    INPUT:

    - ``R`` -- a ring or field

    OUTPUT:

    - ``True`` if R is `\QQ` or a finite field `\GF{p}` for `p` prime,
      ``False`` otherwise.

    EXAMPLES::

        sage: import sage.rings.field
        doctest:...: DeprecationWarning: the module sage.rings.field is deprecated and will be removed
        See http://trac.sagemath.org/18108 for details.
        sage: sage.rings.field.is_PrimeField(QQ)
        True
        sage: sage.rings.field.is_PrimeField(GF(7))
        True
        sage: sage.rings.field.is_PrimeField(GF(7^2,'t'))
        False
    """
    from finite_rings.constructor import is_FiniteField
    from rational_field import is_RationalField

    if is_RationalField(R):
        return True
    if is_FiniteField(R):
        return R.degree() == 1
    return False
예제 #2
0
def is_PrimeField(R):
    r"""
    Determine if ``R`` is a field that is equal to its own prime subfield.

    INPUT:

    - ``R`` -- a ring or field

    OUTPUT:

    - ``True`` if R is `\QQ` or a finite field `\GF{p}` for `p` prime,
      ``False`` otherwise.

    EXAMPLES::

        sage: sage.rings.field.is_PrimeField(QQ)
        True
        sage: sage.rings.field.is_PrimeField(GF(7))
        True
        sage: sage.rings.field.is_PrimeField(GF(7^2,'t'))
        False
    """
    from finite_rings.constructor import is_FiniteField
    from rational_field import is_RationalField

    if is_RationalField(R):
        return True
    if is_FiniteField(R):
        return R.degree() == 1
    return False
예제 #3
0
파일: field.py 프로젝트: ProgVal/sage
def is_PrimeField(R):
    r"""
    Determine if ``R`` is a field that is equal to its own prime subfield.

    INPUT:

    - ``R`` -- a ring or field

    OUTPUT:

    - ``True`` if R is `\QQ` or a finite field `\GF{p}` for `p` prime,
      ``False`` otherwise.

    EXAMPLES::

        sage: import sage.rings.field
        doctest:...: DeprecationWarning: the module sage.rings.field is deprecated and will be removed
        See http://trac.sagemath.org/18108 for details.
        sage: sage.rings.field.is_PrimeField(QQ)
        True
        sage: sage.rings.field.is_PrimeField(GF(7))
        True
        sage: sage.rings.field.is_PrimeField(GF(7^2,'t'))
        False
    """
    from finite_rings.finite_field_constructor import is_FiniteField
    from rational_field import is_RationalField

    if is_RationalField(R):
        return True
    if is_FiniteField(R):
        return R.degree() == 1
    return False
예제 #4
0
파일: field.py 프로젝트: CETHop/sage
def is_PrimeField(R):
    r"""
    Determine if ``R`` is a field that is equal to its own prime subfield.

    INPUT:

    - ``R`` -- a ring or field

    OUTPUT:

    - ``True`` if R is `\QQ` or a finite field `\GF{p}` for `p` prime,
      ``False`` otherwise.

    EXAMPLES::

        sage: sage.rings.field.is_PrimeField(QQ)
        True
        sage: sage.rings.field.is_PrimeField(GF(7))
        True
        sage: sage.rings.field.is_PrimeField(GF(7^2,'t'))
        False
    """
    from finite_rings.constructor import is_FiniteField
    from rational_field import is_RationalField

    if is_RationalField(R):
        return True
    if is_FiniteField(R):
        return R.degree() == 1
    return False
예제 #5
0
def is_PrimeField(R):
    from finite_field.constructor import is_FiniteField
    from rational_field import is_RationalField
    if is_RationalField(R):
        return True
    if is_FiniteField(R):
        return R.degree() == 1
    return False
예제 #6
0
파일: field.py 프로젝트: sageb0t/testsage
def is_PrimeField(R):
    """
    Determine if R is a field that is equal to its own prime subfield.

    INPUT:

    - R - a ring or field

    OUTPUT:

    - True - if R is `\QQ` or a finite field `GF(p)` for p prime.
    - False - otherwise

    EXAMPLES::

        sage: sage.rings.field.is_PrimeField(QQ)
        True

    ::

        sage: sage.rings.field.is_PrimeField(GF(7))
        True

    ::

        sage: sage.rings.field.is_PrimeField(GF(7^2,'t'))
        False
    """
    from finite_rings.constructor import is_FiniteField
    from rational_field import is_RationalField

    if is_RationalField(R):
        return True
    if is_FiniteField(R):
        return R.degree() == 1
    return False
예제 #7
0
def is_PrimeField(R):
    """
    Determine if R is a field that is equal to its own prime subfield.

    INPUT:

    - R - a ring or field

    OUTPUT:

    - True - if R is `\QQ` or a finite field `GF(p)` for p prime.
    - False - otherwise

    EXAMPLES::

        sage: sage.rings.field.is_PrimeField(QQ)
        True

    ::

        sage: sage.rings.field.is_PrimeField(GF(7))
        True

    ::

        sage: sage.rings.field.is_PrimeField(GF(7^2,'t'))
        False
    """
    from finite_rings.constructor import is_FiniteField
    from rational_field import is_RationalField

    if is_RationalField(R):
        return True
    if is_FiniteField(R):
        return R.degree() == 1
    return False