Skip to content

False positive for is_prime_field for some finite field extensions #40426

@r-mb

Description

@r-mb

Steps To Reproduce

Launch the following script:

K = GF(4)
A.<x> = K[]
L = K.extension(x+1)
print("It is", L.is_field(), "that L is a field")
print("It has cardinality", L.cardinality())
print("Sage says that it is", L.is_prime_field(), "that L is a field of prime cardinality")
print("This is because L.degree() =", L.degree())

Expected Behavior

You would expect L.is_prime_field() to be False.

Actual Behavior

It is True that L is a field
It has cardinality 4
Sage says that it is True that L is a field of prime cardinality
This is because L.degree() = 1

Additional Information

As a remark, I feel it is dangerous that the method degree can have different meanings for finite fields depending on how they were created.

Environment

  • OS: Debian 12.11
  • Sage Version: SageMath version 10.7.beta8, Release Date: 2025-07-06

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions