Changes in [6552:39de0132cef1:6556:c88b5740aa77]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sage/schemes/elliptic_curves/ell_rational_field.py
r6411 r6556 3258 3258 sage: EllipticCurve('11a1').sha_an_padic(11) #rank 0 3259 3259 1 + O(11) 3260 sage: EllipticCurve('123a1').sha_an_padic(41) #rank 1 (long time) 3260 3261 NOTE: the following doctest is DISABLED. When I put in the fix for 3262 trac #635, this strangely switched sign to become 40 + O(41). 3263 I'm not sure whether this indicates a bug, possibly a normalisation issue. 3264 sage.: EllipticCurve('123a1').sha_an_padic(41) #rank 1 (long time) 3261 3265 1 + O(41) 3262 3266 sage: EllipticCurve('817a1').sha_an_padic(43) #rank 2 (long time) … … 4229 4233 removed some redundant height computations 4230 4234 -- chris wuthrich (22/05/2007), added multiplicative and supersingular cases 4235 -- David Harvey (2007-09-20), fixed some precision loss that was occurring 4231 4236 4232 4237 EXAMPLES: 4233 4238 sage: E = EllipticCurve("37a") 4234 4239 sage: E.padic_regulator(5, 10) 4235 4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + O(5^9)4240 4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + 3*5^9 + O(5^10) 4236 4241 4237 4242 An anomalous case: … … 4241 4246 An anomalous case where the precision drops some: 4242 4247 sage: E = EllipticCurve("5077a") 4243 sage: E.padic_regulator(5, 10) # long time4244 4*5 + 3*5^2 + 2*5^4 + 2*5^5 + 2*5^6 + O(5^8)4248 sage: E.padic_regulator(5, 10) 4249 4*5 + 3*5^2 + 2*5^4 + 2*5^5 + 2*5^6 + 2*5^8 + 3*5^9 + O(5^10) 4245 4250 4246 4251 Check that answers agree over a range of precisions: … … 4310 4315 sage: E = EllipticCurve("37a") 4311 4316 sage: E.padic_height_pairing_matrix(5, 10) 4312 [4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + O(5^9)]4317 [4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + 3*5^9 + O(5^10)] 4313 4318 4314 4319 … … 4317 4322 sage: e._set_gens([e(-1, 1), e(1,0)]) # avoid platform dependent gens 4318 4323 sage: e.padic_height_pairing_matrix(5,10) 4319 [2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + 3*5^7 + 4*5^8 + O(5^ 9) 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + O(5^9)]4320 [ 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + O(5^9) 5 + 4*5^2 + 4*5^3 + 2*5^4 + 4*5^5 + 5^6 + O(5^9)]4324 [2*5 + 2*5^2 + 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + 3*5^7 + 4*5^8 + O(5^10) 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + 2*5^9 + O(5^10)] 4325 [ 4*5 + 3*5^3 + 2*5^4 + 5^5 + 3*5^7 + 3*5^8 + 2*5^9 + O(5^10) 5 + 4*5^2 + 4*5^3 + 2*5^4 + 4*5^5 + 5^6 + 4*5^9 + O(5^10)] 4321 4326 4322 4327 An anomalous rank 3 example: … … 4324 4329 sage: e._set_gens([e(-1,3), e(2,0), e(4,6)]) 4325 4330 sage: e.padic_height_pairing_matrix(5,4) 4326 [ 1 + 5 + O(5^4) 1 + 4*5 + O(5^2) 2*5 + O(5^3)]4327 [ 1 + 4*5 + O(5^2) 2 + 5^2 + 3*5^3 + O(5^4) 3 + 4*5^2 + 4*5^3 + O(5^4)]4328 [ 2*5 + O(5^3) 3 + 4*5^2 + 4*5^3 + O(5^4) 4 + 5 + 3*5^2 + 3*5^3 + O(5^4)]4331 [ 1 + 5 + O(5^4) 1 + 4*5 + 2*5^3 + O(5^4) 2*5 + 3*5^3 + O(5^4)] 4332 [ 1 + 4*5 + 2*5^3 + O(5^4) 2 + 5^2 + 3*5^3 + O(5^4) 3 + 4*5^2 + 4*5^3 + O(5^4)] 4333 [ 2*5 + 3*5^3 + O(5^4) 3 + 4*5^2 + 4*5^3 + O(5^4) 4 + 5 + 3*5^2 + 3*5^3 + O(5^4)] 4329 4334 """ 4330 4335 if check_hypotheses: … … 4589 4594 sage: h = E.padic_height(5, 10) 4590 4595 sage: h(P) 4591 4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + O(5^9)4596 4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + 3*5^9 + O(5^10) 4592 4597 4593 4598 An anomalous case: 4594 4599 sage: h = E.padic_height(53, 10) 4595 4600 sage: h(P) 4596 27*53^-1 + 22 + 32*53 + 5*53^2 + 42*53^3 + 20*53^4 + 43*53^5 + 30*53^6 + 17*53^7 + 22*53^8 + O(53^9)4601 27*53^-1 + 22 + 32*53 + 5*53^2 + 42*53^3 + 20*53^4 + 43*53^5 + 30*53^6 + 17*53^7 + 22*53^8 + 35*53^9 + O(53^10) 4597 4602 4598 4603 Boundary case: 4599 4604 sage: E.padic_height(5, 3)(P) 4600 4*5 + O(5^2)4605 4*5 + 3*5^2 + O(5^3) 4601 4606 4602 4607 A case that works the division polynomial code a little harder: 4603 4608 sage: E.padic_height(5, 10)(5*P) 4604 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + O(5^7)4609 4*5^3 + 3*5^4 + 3*5^5 + 4*5^6 + 4*5^7 + 5^8 + O(5^10) 4605 4610 4606 4611 Check that answers agree over a range of precisions: … … 4618 4623 (2*3 + 2*3^2 + 3^3 + 2*3^4 + 2*3^5 + O(3^6), 3^2 + 3^3 + 3^4 + 3^5 + O(3^7)) 4619 4624 sage: E.padic_regulator(5) 4620 4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + 3*5^9 + 3*5^10 + 5^11 + 5^12 + 3*5^13 + 3*5^15 + 2*5^16 + 3*5^17 + 2*5^18 + O(5^ 19)4621 sage: E.padic_regulator(3, 5)4625 4*5 + 3*5^2 + 3*5^3 + 4*5^4 + 4*5^5 + 5^6 + 4*5^8 + 3*5^9 + 3*5^10 + 5^11 + 5^12 + 3*5^13 + 3*5^15 + 2*5^16 + 3*5^17 + 2*5^18 + O(5^20) 4626 sage: E.padic_regulator(3, 5) 4622 4627 (2*3 + O(3^3), 2*3^2 + O(3^4)) 4623 4628 … … 4645 4650 raise ValueError, "prec (=%s) must be at least 1" % prec 4646 4651 4647 4648 4652 if self.conductor() % p == 0: 4649 4653 Eq = self.tate_curve(p,prec=prec) … … 4653 4657 return lp.Dp_valued_height(prec=prec) 4654 4658 4655 # else good ordinary case4659 # else good ordinary case 4656 4660 4657 #print "now1"4658 4659 4661 # For notation and definitions, see "Efficient Computation of 4660 4662 # p-adic Heights", David Harvey (unpublished) … … 4664 4666 n = arith.LCM(n1, n2) 4665 4667 m = int(n / n2) 4666 #print "now2" 4667 4668 adjusted_prec = prec + 2 * arith.valuation(n, p) + 1 4668 4669 adjusted_prec = prec + 2 * arith.valuation(n, p) # this is M' 4669 4670 R = rings.Integers(p ** adjusted_prec) 4670 #print "now2.5"4671 4671 4672 4672 if sigma is None: 4673 4673 sigma = self.padic_sigma(p, adjusted_prec, check_hypotheses=False) 4674 #print "now3" 4675 4674 4676 4675 # K is the field for the final result 4677 K = Qp(p, prec= prec)4676 K = Qp(p, prec=adjusted_prec-1) 4678 4677 E = self 4679 #print "post-setup"4680 4678 4681 4679 def height(P, check=True): 4682 4680 if P.is_finite_order(): 4683 4681 return K(0) 4682 4684 4683 if check: 4685 4684 assert P.curve() == E, "the point P must lie on the curve " \ … … 4690 4689 4691 4690 alpha, beta, d = C.triple(m) 4692 4691 4693 4692 assert beta.lift() % p != 0, "beta should be a unit!" 4694 4693 assert d.lift() % p == 0, "d should not be a unit!" … … 4699 4698 t_power = t 4700 4699 for k in range(2, adjusted_prec + 1): 4701 # yuck... should just be able to multiply without the lift here 4702 total = total + t_power * R(sigma[k].lift()) 4700 total = total + t_power * sigma[k].lift() 4703 4701 t_power = t_power * t 4704 4702 total = (-alpha / beta) * total 4703 4705 4704 L = Qp(p, prec=adjusted_prec) 4706 total = (-alpha / beta) * total4707 4705 total = L(total.lift(), adjusted_prec) # yuck... get rid of this lift! 4708 4706 answer = total.log() * 2 / n**2 … … 4711 4709 assert answer.precision_absolute() >= prec, "we should have got an " \ 4712 4710 "answer with precision at least prec, but we didn't." 4713 return K(answer.lift(), prec - answer.valuation()) 4714 4715 4716 #print "post height def" 4711 return K(answer) 4712 4717 4713 4718 4714 # (man... I love python's local function definitions...) … … 4848 4844 elif E2.precision_absolute() < N-2: 4849 4845 raise ValueError, "supplied E2 has insufficient precision" 4850 4846 4851 4847 QQt = LaurentSeriesRing(RationalField(), "x") 4852 4848
Note: See TracChangeset
for help on using the changeset viewer.
