Changeset 7683:f0960b48c972
- Timestamp:
- 11/20/07 03:12:24 (6 years ago)
- Branch:
- default
- Location:
- sage
- Files:
-
- 1 added
- 3 edited
-
rings/number_field/number_field_element.pyx (modified) (1 diff)
-
schemes/elliptic_curves/ell_generic.py (modified) (2 diffs)
-
schemes/elliptic_curves/ell_rational_field.py (modified) (2 diffs)
-
schemes/elliptic_curves/weierstrass_morphism.py (added)
Legend:
- Unmodified
- Added
- Removed
-
sage/rings/number_field/number_field_element.pyx
r7020 r7683 678 678 else: 679 679 raise ValueError, "%s not a square in %s"%(self, self._parent) 680 681 def nth_root(self, n, all=False): 682 """ 683 Return an nth root of self in the given number field. 684 685 EXAMPLES: 686 sage: K.<a> = NumberField(x^4-7) 687 sage: K(7).nth_root(2) 688 a^2 689 sage: K((a-3)^5).nth_root(5) 690 a - 3 691 692 ALGORITHM: 693 Use Pari to factor $x^n$ - \code{self} in K. 694 """ 695 R = sage.rings.polynomial.polynomial_ring.PolynomialRing(self.number_field(), 't') 696 if not self: 697 return [self] if all else self 698 f = (R.gen(0) << (n-1)) - self 699 roots = f.roots() 700 if all: 701 return [r[0] for r in roots] 702 elif len(roots) > 0: 703 return roots[0][0] 704 else: 705 raise ValueError, "%s not a %s-th root in %s"%(self, n, self._parent) 706 680 707 681 708 cdef void _reduce_c_(self): -
sage/schemes/elliptic_curves/ell_generic.py
r7681 r7683 56 56 import constructor 57 57 import formal_group 58 import weierstrass_morphism 58 59 59 60 factor = arith.factor … … 1282 1283 1283 1284 division_polynomial = torsion_polynomial 1284 1285 1286 def isomporphism_to(self, other): 1287 """ 1288 Given another weierstrass model \code{other} of self, return a morphism 1289 from self to \code{other}. 1290 1291 If the curves in question are not isomorphic, raise a ValueError 1292 1293 EXAMPLES: 1294 sage: E = EllipticCurve('37a') 1295 sage: F = E.weierstrass_model() 1296 sage: w = E.isomporphism_to(F); w 1297 Generic morphism: 1298 From: Abelian group of points on Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field 1299 To: Abelian group of points on Elliptic Curve defined by y^2 = x^3 - x + 1/4 over Rational Field 1300 sage: P = E(0,-1,1) 1301 sage: w(P) 1302 (0 : -1/2 : 1) 1303 sage: w(5*P) 1304 (1/4 : 1/8 : 1) 1305 sage: 5*w(P) 1306 (1/4 : 1/8 : 1) 1307 sage: 120*w(P) == w(120*P) 1308 True 1309 1310 We can also handle injections to different base rings: 1311 sage: K.<a> = NumberField(x^3-7) 1312 sage: E.isomporphism_to(E.change_ring(K)) 1313 Generic morphism: 1314 From: Abelian group of points on Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field 1315 To: Abelian group of points on Elliptic Curve defined by y^2 + y = x^3 + (-1)*x over Number Field in a with defining polynomial x^3 - 7 1316 """ 1317 return weierstrass_morphism.WeierstrassIsomorphism(self, other) 1318 1319 def is_isomorphic(self, other): 1320 """ 1321 Returns whether or not self is isomorphic to other, i.e. they define the same curve over 1322 the same basering. 1323 1324 EXAMPLES: 1325 sage: E = EllipticCurve('389a') 1326 sage: F = E.change_weierstrass_model([2,3,4,5]); F 1327 Elliptic Curve defined by y^2 - 8*x*y + 22*y = x^3 - 21*x^2 + 59*x over Rational Field 1328 sage: E.is_isomorphic(F) 1329 True 1330 sage: E.is_isomorphic(F.change_ring(CC)) 1331 False 1332 """ 1333 if not is_EllipticCurve(other): 1334 return False 1335 elif self.base_ring() != other.base_ring(): 1336 return False 1337 else: 1338 try: 1339 phi = self.isomporphism_to(other) 1340 return True 1341 except ValueError: 1342 return False 1343 1344 def change_weierstrass_model(self, *urst): 1345 """ 1346 Return a new Weierstrass model of self under the transformation (on points) 1347 $$ (x,y) \mapsto (x',y') = (u^2*x+r , u^3*y + s*u^2*x' + t) $$ 1348 """ 1349 if isinstance(urst[0], (tuple, list)): 1350 urst = urst[0] 1351 u, r, s, t = urst 1352 a1, a2, a3, a4, a6 = self.ainvs() 1353 b1 = a1*u - 2*s 1354 b3 = a3*u**3 - a1*r*u - 2*t + 2*r*s 1355 b2 = a2*u**2 + a1*s*u - s**2 - 3*r 1356 b4 = a4*u**4 + a3*s*u**3 - 2*a2*r*u**2 + a1*t*u - 2*a1*r*s*u - 2*s*t + 2*r*s**2 + 3*r**2 1357 b6 = a6*u**6 - a4*r*u**4 + a3*t*u**3 - a3*r*s*u**3 + a2*r**2*u**2 - a1*r*t*u + a1*r**2*s*u - t**2 + 2*r*s*t - r**2*s**2 - r**3 1358 return constructor.EllipticCurve(self.base_ring(), [b1,b2,b3,b4,b6]) 1359 1285 1360 def weierstrass_model(self): 1286 1361 """ -
sage/schemes/elliptic_curves/ell_rational_field.py
r7681 r7683 1409 1409 return True 1410 1410 1411 def is_isomorphic(self, E):1412 if not isinstance(E, EllipticCurve_rational_field):1413 raise TypeError, "E (=%s) must be an elliptic curve over the rational numbers"%E1414 return E.minimal_model() == self.minimal_model()1415 1416 1411 def kodaira_type(self, p): 1417 1412 """ … … 1574 1569 F = self.minimal_model() 1575 1570 return EllipticCurve_number_field.weierstrass_model(F) 1571 1572 def local_integral_model(self,p): 1573 r""" 1574 Return a model of self which is integral at the prime $p$ 1575 1576 EXAMPLES: 1577 sage: E=EllipticCurve([0, 0, 1/216, -7/1296, 1/7776]) 1578 sage: E.local_integral_model(2) 1579 Elliptic Curve defined by y^2 + 1/27*y = x^3 - 7/81*x + 2/243 over Rational Field 1580 sage: E.local_integral_model(3) 1581 Elliptic Curve defined by y^2 + 1/8*y = x^3 - 7/16*x + 3/32 over Rational Field 1582 sage: E.local_integral_model(2).local_integral_model(3) == EllipticCurve('5077a1') 1583 True 1584 """ 1585 ai = self.a_invariants() 1586 e = min([(ai[i].valuation(p)/[1,2,3,4,6][i]) for i in range(5)]).floor() 1587 return constructor.EllipticCurve([ai[i]/p**(e*[1,2,3,4,6][i]) for i in range(5)]) 1588 1589 def global_integral_model(self): 1590 r""" 1591 Return a model of self which is integral at all primes 1592 1593 EXAMPLES: 1594 sage: E=EllipticCurve([0, 0, 1/216, -7/1296, 1/7776]) 1595 sage: E.global_integral_model() == EllipticCurve('5077a1') 1596 True 1597 """ 1598 ai = self.a_invariants() 1599 for a in ai: 1600 if not a.is_integral(): 1601 ### Is there really no prime_factors() function? 1602 pj=[fi[0] for fi in a.denom().factor()] 1603 for p in pj: 1604 e = min([(ai[i].valuation(p)/[1,2,3,4,6][i]) for i in range(5)]).floor() 1605 ai = [ai[i]/p**(e*[1,2,3,4,6][i]) for i in range(5)] 1606 return constructor.EllipticCurve(ai) 1607 1608 integral_model = global_integral_model 1576 1609 1577 1610 def integral_weierstrass_model(self):
Note: See TracChangeset
for help on using the changeset viewer.
