@@ -2437,21 +2437,21 @@ def automorphisms(self, field=None):
2437
2437
2438
2438
OUTPUT:
2439
2439
2440
- (list) A list of `` WeierstrassIsomorphism` ` objects
2440
+ (list) A list of :class:`~wm. WeierstrassIsomorphism` objects
2441
2441
consisting of all the isomorphisms from the curve ``self`` to
2442
2442
itself defined over ``field``.
2443
2443
2444
2444
EXAMPLES::
2445
2445
2446
- sage: E = EllipticCurve_from_j(QQ(0)) # a curve with j=0 over QQ
2447
- sage: E.automorphisms();
2446
+ sage: E = EllipticCurve_from_j(QQ(0)) # a curve with j=0 over QQ
2447
+ sage: E.automorphisms()
2448
2448
[Elliptic-curve endomorphism of Elliptic Curve defined by y^2 + y = x^3 over Rational Field
2449
2449
Via: (u,r,s,t) = (-1, 0, 0, -1), Elliptic-curve endomorphism of Elliptic Curve defined by y^2 + y = x^3 over Rational Field
2450
2450
Via: (u,r,s,t) = (1, 0, 0, 0)]
2451
2451
2452
2452
We can also find automorphisms defined over extension fields::
2453
2453
2454
- sage: K.<a> = NumberField(x^2+3) # adjoin roots of unity
2454
+ sage: K.<a> = NumberField(x^2+3) # adjoin roots of unity
2455
2455
sage: E.automorphisms(K)
2456
2456
[Elliptic-curve endomorphism of Elliptic Curve defined by y^2 + y = x^3 over Number Field in a with defining polynomial x^2 + 3
2457
2457
Via: (u,r,s,t) = (-1, 0, 0, -1),
@@ -2461,15 +2461,12 @@ def automorphisms(self, field=None):
2461
2461
2462
2462
::
2463
2463
2464
- sage: [ len(EllipticCurve_from_j(GF(q,'a')(0)).automorphisms()) for q in [2,4,3,9,5,25,7,49]]
2464
+ sage: [len(EllipticCurve_from_j(GF(q,'a')(0)).automorphisms()) for q in [2,4,3,9,5,25,7,49]]
2465
2465
[2, 24, 2, 12, 2, 6, 6, 6]
2466
2466
"""
2467
- if field is None :
2468
- return [wm .WeierstrassIsomorphism (self , urst , self )
2469
- for urst in wm .isomorphisms (self , self )]
2470
- E = self .change_ring (field )
2471
- return [wm .WeierstrassIsomorphism (E , urst , E )
2472
- for urst in wm .isomorphisms (E , E )]
2467
+ if field is not None :
2468
+ self = self .change_ring (field )
2469
+ return self .isomorphisms (self )
2473
2470
2474
2471
def isomorphisms (self , other , field = None ):
2475
2472
"""
@@ -2485,15 +2482,15 @@ def isomorphisms(self, other, field=None):
2485
2482
2486
2483
OUTPUT:
2487
2484
2488
- (list) A list of `` WeierstrassIsomorphism` ` objects consisting of all
2485
+ (list) A list of :class:`~wm. WeierstrassIsomorphism` objects consisting of all
2489
2486
the isomorphisms from the curve ``self`` to the curve
2490
2487
``other`` defined over ``field``.
2491
2488
2492
2489
EXAMPLES::
2493
2490
2494
2491
sage: E = EllipticCurve_from_j(QQ(0)) # a curve with j=0 over QQ
2495
2492
sage: F = EllipticCurve('27a3') # should be the same one
2496
- sage: E.isomorphisms(F);
2493
+ sage: E.isomorphisms(F)
2497
2494
[Elliptic-curve endomorphism of Elliptic Curve defined by y^2 + y = x^3 over Rational Field
2498
2495
Via: (u,r,s,t) = (-1, 0, 0, -1),
2499
2496
Elliptic-curve endomorphism of Elliptic Curve defined by y^2 + y = x^3 over Rational Field
@@ -2514,13 +2511,11 @@ def isomorphisms(self, other, field=None):
2514
2511
To: Elliptic Curve defined by y^2 = x^3 + x + 6 over Finite Field in a of size 7^2
2515
2512
Via: (u,r,s,t) = (6*a + 4, 0, 0, 0)]
2516
2513
"""
2517
- if field is None :
2518
- return [wm .WeierstrassIsomorphism (self , urst , other )
2519
- for urst in wm .isomorphisms (self , other )]
2520
- E = self .change_ring (field )
2521
- F = other .change_ring (field )
2522
- return [wm .WeierstrassIsomorphism (E , urst , F )
2523
- for urst in wm .isomorphisms (E , F )]
2514
+ if field is not None :
2515
+ self = self .change_ring (field )
2516
+ other = other .change_ring (field )
2517
+ return sorted (wm .WeierstrassIsomorphism (self , urst , other )
2518
+ for urst in wm ._isomorphisms (self , other ))
2524
2519
2525
2520
def is_isomorphic (self , other , field = None ):
2526
2521
"""
@@ -2554,17 +2549,16 @@ def is_isomorphic(self, other, field=None):
2554
2549
if field is None :
2555
2550
if self .base_ring () != other .base_ring ():
2556
2551
return False
2557
- elif self .j_invariant () != other .j_invariant (): # easy check
2558
- return False
2559
- else :
2560
- return wm .isomorphisms (self , other , True ) is not None
2561
2552
else :
2562
- E = self .base_extend (field )
2563
- F = other .base_extend (field )
2564
- if E .j_invariant () != F .j_invariant (): # easy check
2565
- return False
2566
- else :
2567
- return wm .isomorphisms (E , other , F ) is not None
2553
+ self = self .base_extend (field )
2554
+ other = other .base_extend (field )
2555
+ if self .j_invariant () != other .j_invariant (): # easy check
2556
+ return False
2557
+ try :
2558
+ next (wm ._isomorphisms (self , other ))
2559
+ except StopIteration :
2560
+ return False
2561
+ return True
2568
2562
2569
2563
def change_weierstrass_model (self , * urst ):
2570
2564
r"""
0 commit comments