Closed Krastanov closed 8 months ago
Thanks for the report. I will have a look.
The problem pops up in is_irreducible
too:
p = 2
l = 4
q = p^l
𝔽q , unit = FiniteField(ZZ(q),1)
R𝔽q, x = PolynomialRing(𝔽q, "x")
julia> roots(2*x^2 + 11*x + 10)
fq[]
julia> is_irreducible(2*x^2 + 11*x + 10)
Exception (fq_inv). Zero is not invertible.
ERROR: Problem in the Flint-Subsystem
Probably not surprising, but wanted to mention it just in case.
Finite fields are created with the arguments (p,l), not the arguments (p^l,1)
Indeed, I just discovered that was the problem.
Is this still a bug though? If the correct way to create the field is FiniteField(2,5)
, then why is FiniteField(ZZ(2^5), 1)
even working? Does FiniteField(ZZ(2^5), 1)
have any meaning or is it just an omission of input sanitation?
FF(4,1) is clearly not working (eventually). We don't throw an error sooner because primality checking is off in the FF constructor.
In that case I believe I should close this issue. Feel free to reopen it as an "add input sanitation" enhancement request if that makes sense.
We definitely should do the input check (with an optional check
parameter to turn it off).
We now do this (I think thanks to @thofma ):
julia> finite_field(4,1)
ERROR: Characteristic must be prime
Describe the bug
roots
on a Polynomial over finite field raises an error if the polynomial has a root at 0To Reproduce
The errors look like
Expected behavior
roots(x^2+x)
should returnfq[0,3]
(note,3=-1
for the field in question, but this happens for other fields too)System (please complete the following information):
Additional context
I am trying to play with algebraic tori and Cayley graphs over
PSL_2(F_q)
. I have little understanding of that field of math, so maybe I am doing something wrong. I am following section 5 of "Existence and Explicit Constructions of q + 1 Regular Ramanujan Graphs for Every Prime Power q" by Morgenstern, where I need to enumerate the roots of certain polynomials of Fq. If there is a trivial way to do that with Oscar, do point me to it :D