Ticket #9409: 9409.sage

File 9409.sage, 1.2 KB (added by John Cremona, 12 years ago)

Test script

Line 
1def test(curve, bound):
2
3    for i in primes(bound):
4
5        print "Checking primes over %s: "%i
6        factors = curve.base_field().ideal(i).factor()
7        for j in range(len(factors)):
8
9            if curve.has_good_reduction(factors[j][0]):
10
11                if factors[j][0].divides(curve.discriminant()):
12
13                    print "Curve has good reduction, but this isn't not a minimal model",
14                    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() )
15
16                else:
17
18                    print "Curve has good reduction and is a minimal model"
19                    print "at %s with %s points in the reduced curve"%(factors[j][0], curve.reduction(factors[j][0]).count_points() )
20
21            else:
22
23                print "Curve has bad reduction over %s"%factors[j][0]
24
25    return
26
27### sample 1
28K.<t> = NumberField(x^2 + 1)
29E = EllipticCurve(K, [0, 1, 0, -2*t - 2, 2*t]); E
30### sample 2
31L.<u> = NumberField(x^2 - 2)
32F = EllipticCurve(L, [0,2,0, 2*u +4, 2*u + 3]); F
33
34def testE(bd=100):
35    test(E, bd)
36
37## the above works fine; the next command will cause the error.
38
39def testF(bd=100):
40    test(F, bd)