def test(curve, bound):
for i in primes(bound):
print "Checking primes over %s: "%i
factors = curve.base_field().ideal(i).factor()
for j in range(len(factors)):
if curve.has_good_reduction(factors[j][0]):
if factors[j][0].divides(curve.discriminant()):
print "Curve has good reduction, but this isn't not a minimal model",
print "at %s with %s points in the reduced curve"%(factors[j][0], curve.local_minimal_model(factors[j][0]).reduction(factors[j][0]).count_points() )
else:
print "Curve has good reduction and is a minimal model"
print "at %s with %s points in the reduced curve"%(factors[j][0], curve.reduction(factors[j][0]).count_points() )
else:
print "Curve has bad reduction over %s"%factors[j][0]
return
### sample 1
K. = NumberField(x^2 + 1)
E = EllipticCurve(K, [0, 1, 0, -2*t - 2, 2*t]); E
### sample 2
L.__ = NumberField(x^2 - 2)
F = EllipticCurve(L, [0,2,0, 2*u +4, 2*u + 3]); F
def testE(bd=100):
test(E, bd)
## the above works fine; the next command will cause the error.
def testF(bd=100):
test(F, bd)
__