Ticket #12080: trac_12080_manin_constant.patch
File trac_12080_manin_constant.patch, 6.3 KB (added by , 5 years ago) 


sage/schemes/elliptic_curves/ell_rational_field.py
# HG changeset patch # User Chris Wuthrich <christian.wuthrich@gmail.com> # Date 1322505476 0 # Node ID 7fb1c96400c8b006f5a0e8ea17e929c6999a5c21 # Parent 9e29a3d84c48c399daaf3920bcb8b17273a0e876 trac #12080: corrections for the manin constant diff git a/sage/schemes/elliptic_curves/ell_rational_field.py b/sage/schemes/elliptic_curves/ell_rational_field.py
a b 3139 3139 3140 3140 3141 3141 Moreover for all algorithms, computing a certain value of an 3142 `L`function "uses a heuristic method that discerns when3142 `L`function 'uses a heuristic method that discerns when 3143 3143 the realnumber approximation to the modular degree is within 3144 epsilon [=0.01 for algorithm= "sympow"] of the same integer for 33144 epsilon [=0.01 for algorithm='sympow'] of the same integer for 3 3145 3145 consecutive trials (which occur maybe every 25000 coefficients or 3146 3146 so). Probably it could just round at some point. For rigour, you 3147 3147 would need to bound the tail by assuming (essentially) that all the … … 3150 3150 that it doesn't do the sum in 1234 order; it uses 3151 3151 1248361224918 (Euler product style) instead, and so you 3152 3152 have to guess ahead of time at what point to curtail this 3153 expansion. "(Quote from an email of Mark Watkins.)3153 expansion.' (Quote from an email of Mark Watkins.) 3154 3154 3155 3155 .. note:: 3156 3156 … … 4359 4359 4360 4360 def manin_constant(self): 4361 4361 r""" 4362 Return the Manin constant of this elliptic curve. 4362 Return the Manin constant of this elliptic curve. If `\phi: X_0(N) \to E` is the modular 4363 parametrization of minimal degree, then the Manin constant `c` is defined to be the rational 4364 number `c` such that `\phi^*(\omega_E) = c\cdot \omega_f` where `\omega_E` is a Neron differential and `\omega_f = f(q) dq/q` is the differential on `X_0(N)` corresponding to the 4365 newform `f` attached to the isogeny class of `E`. 4366 4367 It is known that the Manin constant is an integer. It is conjectured that in each class there is at least one, more precisely the socalled strong Weil curve or `X_0(N)`optimal curve, that has Manin constant `1`. 4363 4368 4364 4369 OUTPUT: 4365 4370 4366 4371 an integer 4367 4372 4368 4373 This function only works if the curve is in the installed … … 4374 4379 sage: EllipticCurve('11a1').manin_constant() 4375 4380 1 4376 4381 sage: EllipticCurve('11a2').manin_constant() 4377 54382 1 4378 4383 sage: EllipticCurve('11a3').manin_constant() 4379 4384 5 4380 4385 4381 4386 Check that it works even if the curve is nonminimal:: 4382 4387 4383 sage: EllipticCurve('11a1').short_weierstrass_model().manin_constant() 4384 1 4385 4386 An example where the isogeny class is large, so it's not completely 4387 trivial to find the minimal degree of an isogeny to the optimal curve:: 4388 4389 sage: [EllipticCurve('210b%s'%i).manin_constant() for i in [1..8]] 4390 [1, 2, 3, 4, 4, 6, 12, 12] 4391 4392 Make sure the special case 990h is treated correctly, i.e., that 990h3 has 4393 Manin constant 1:: 4394 4395 sage: [EllipticCurve('990h%s'%i).manin_constant() for i in [1..4]] 4396 [3, 6, 1, 2] 4397 4398 This plots helps you see that the above Manin constants are 4399 right. Note that the vertex labels are 0based unlike the 4400 Cremona isogeny labels:: 4401 4402 sage: EllipticCurve('210b1').isogeny_graph().plot(edge_labels=True) 4403 """ 4404 label = self.cremona_label() 4405 optimal = self.optimal_curve() 4406 if optimal == self: 4407 return Integer(1) 4408 L, v = self._shortest_paths() 4409 i = L.index(optimal) 4410 return v[i] 4411 4388 sage: EllipticCurve('11a3').change_weierstrass_model([1/35,0,0,0]).manin_constant() 4389 5 4390 4391 Rather complicated examples (see #12080) :: 4392 4393 sage: [ EllipticCurve('27a%s'%i).manin_constant() for i in [1,2,3,4]] 4394 [1, 1, 3, 3] 4395 sage: [ EllipticCurve('80b%s'%i).manin_constant() for i in [1,2,3,4]] 4396 [1, 2, 1, 2] 4397 4398 """ 4399 from sage.databases.cremona import CremonaDatabase 4400 4401 if self.conductor() > CremonaDatabase().largest_conductor(): 4402 raise NotImplementedError, "The Manin constant can only be evaluated for curves in Cremona's tables. If you have not done so, you may wish to install the optional large database." 4403 4404 E = self.minimal_model() 4405 C = self.optimal_curve() 4406 _, m = C.isogeny_class() 4407 ma = max(max(x) for x in m) 4408 OmC = C.period_lattice().basis() 4409 OmE = E.period_lattice().basis() 4410 q_plus = QQ(gp.bestappr(OmE[0]/OmC[0],ma+1) ) 4411 n_plus = q_plus.numerator() 4412 4413 cinf_E = E.real_components() 4414 cinf_C = C.real_components() 4415 OmC_minus = OmC[1].imag() 4416 if cinf_C == 1: 4417 OmC_minus *= 2 4418 OmE_minus = OmE[1].imag() 4419 if cinf_E == 1: 4420 OmE_minus *= 2 4421 q_minus = QQ(gp.bestappr(OmE_minus/OmC_minus, ma+1)) 4422 n_minus = q_minus.numerator() 4423 n = ZZ(n_minus * n_plus) 4424 4425 if cinf_C == cinf_E: 4426 return n 4427 # otherwise they have different number of connected component and we have to adjust for this 4428 elif cinf_C > cinf_E: 4429 if ZZ(n_plus) % 2 == 0 and ZZ(n_minus) % 2 == 0: 4430 return n // 2 4431 else: 4432 return n 4433 else: #if cinf_C < cinf_E: 4434 if q_plus.denominator() % 2 == 0 and q_minus.denominator() % 2 == 0: 4435 return n 4436 else: 4437 return n*2 4438 4412 4439 def _shortest_paths(self): 4413 4440 r""" 4414 4441 Technical internal function that returns the list of isogenies … … 4424 4451 OUTPUT: 4425 4452 4426 4453 list, dict 4427 4454 4428 4455 EXAMPLES:: 4429 4456 4430 4457 sage: EllipticCurve('11a1')._shortest_paths() … … 4483 4510 # to the optimal curve. 4484 4511 v = [deg for num, deg in v.iteritems() if deg] # get just the degrees 4485 4512 return arith.LCM(v) 4486 4487 4488 4513 4489 4514 ########################################################## 4490 4515 # Galois Representations