Compute variety in a finite field despite ideal dimension 1
Hi!
My problem has to do asking Sage affine rational points of a variety on a finite field.
Essentially, I define an ideal of bivariate Fq-polynomials in Sage, and ask Sage for the variety associated to the ideal. I happen to know a list of elements in the variety, but Sage doesn't want to compute them, on the basis that the ideal has dimension 1, even though we're working on a finite field...
What would be the best way to make Sage compute these solutions? In full generality, I'm working with polynomials that are not restricted to two variables, so efficiency is important.
# Define a finite field and a bivariate polynomial ring on this field:
Fq.<z> = GF(2^4)
R.<x, y> = Fq[]
# Define a bunch of bivariate polynomials:
polynomials = [
x^15 + (z^2 + z)*x^12*y + x^9*y^2 + (z^2 + z + 1)*x^3*y^4 + y^5,
x^28*y + x^25*y^2 + x^19*y^4 + (z^2 + z + 1)*x^16*y^5 + x^7*y^8 + (z^2 + z + 1)*x*y^10,
x^48*y^5 + x^36*y^9 + x^33*y^10 + x^12*y^17 + x^9*y^18 + x^3*y^20,
x^64*y^21 + x^16*y^37 + x^4*y^41 + x*y^42
]
# Some known solutions to this system:
known_solutions = [
(0 , 0),
(1 , 1),
(z^2 + z , 1),
(z^2 + z + 1, 1)
]
# Verify that these are indeed solutions:
for (a, b) in known_solutions:
for polynomial in polynomials:
if polynomial(a, b) != 0:
raise ValueError('OP is lying')
# Now, let's try to see what SageMath has to say about solutions:
ideal = Ideal(polynomials)
# bruh
try:
variety = ideal.variety(Fq)
except ValueError:
print('OP is crying')
Best