78
78
# ****************************************************************************
79
79
80
80
from sage .categories .integral_domains import IntegralDomains
81
+ from sage .categories .noetherian_rings import NoetherianRings
81
82
from sage .misc .cachefunc import cached_method
82
83
from sage .structure .parent import Parent
83
84
from sage .structure .sequence import Sequence
@@ -457,6 +458,16 @@ class Order(Parent, sage.rings.abc.Order):
457
458
Traceback (most recent call last):
458
459
...
459
460
ValueError: the rank of the span of gens is wrong
461
+
462
+ Orders are always Noetherian::
463
+
464
+ sage: x = polygen(ZZ, 'x')
465
+ sage: L.<alpha> = NumberField(x**4 - x**2 + 7)
466
+ sage: O = L.maximal_order() ; O.is_noetherian()
467
+ True
468
+ sage: E.<w> = NumberField(x^2 - x + 2)
469
+ sage: OE = E.ring_of_integers(); OE.is_noetherian()
470
+ True
460
471
"""
461
472
462
473
def __init__ (self , K ):
@@ -479,8 +490,9 @@ def __init__(self, K):
479
490
0.0535229072603327 + 1.20934552493846*I
480
491
"""
481
492
self ._K = K
493
+ cat = IntegralDomains () & NoetherianRings ()
482
494
Parent .__init__ (self , base = ZZ , names = K .variable_names (),
483
- normalize = False , category = IntegralDomains () )
495
+ normalize = False , category = cat )
484
496
self ._populate_coercion_lists_ (embedding = self .number_field ())
485
497
if self .absolute_degree () == 2 :
486
498
self .is_maximal () # cache
@@ -615,22 +627,6 @@ def is_field(self, proof=True):
615
627
"""
616
628
return False
617
629
618
- def is_noetherian (self ):
619
- r"""
620
- Return ``True`` (because orders are always Noetherian).
621
-
622
- EXAMPLES::
623
-
624
- sage: x = polygen(ZZ, 'x')
625
- sage: L.<alpha> = NumberField(x**4 - x**2 + 7)
626
- sage: O = L.maximal_order() ; O.is_noetherian()
627
- True
628
- sage: E.<w> = NumberField(x^2 - x + 2)
629
- sage: OE = E.ring_of_integers(); OE.is_noetherian()
630
- True
631
- """
632
- return True
633
-
634
630
def is_integrally_closed (self ) -> bool :
635
631
r"""
636
632
Return whether this ring is integrally closed.
@@ -822,7 +818,7 @@ def coordinates(self, x):
822
818
from sage .matrix .constructor import Matrix
823
819
self .__basis_matrix_inverse = Matrix ([to_V (b ) for b in self .basis ()]).inverse ()
824
820
M = self .__basis_matrix_inverse
825
- return to_V (K (x ))* M
821
+ return to_V (K (x )) * M
826
822
827
823
def free_module (self ):
828
824
r"""
@@ -1375,7 +1371,8 @@ def random_element(self, *args, **kwds):
1375
1371
sage: A.random_element().parent() is A
1376
1372
True
1377
1373
"""
1378
- return sum ([ZZ .random_element (* args , ** kwds )* a for a in self .basis ()])
1374
+ return sum ([ZZ .random_element (* args , ** kwds ) * a
1375
+ for a in self .basis ()])
1379
1376
1380
1377
def absolute_degree (self ):
1381
1378
r"""
@@ -1492,41 +1489,41 @@ def some_elements(self):
1492
1489
elements .append (self (a ))
1493
1490
return elements
1494
1491
1495
- ## def absolute_polynomial(self):
1496
- ## """
1497
- ## Return the absolute polynomial of this order, which is just the absolute polynomial of the number field.
1492
+ # def absolute_polynomial(self):
1493
+ # """
1494
+ # Return the absolute polynomial of this order, which is just the absolute polynomial of the number field.
1498
1495
1499
- ## EXAMPLES::
1496
+ # EXAMPLES::
1500
1497
1501
- ## sage: K.<a, b> = NumberField([x^2 + 1, x^3 + x + 1]); OK = K.maximal_order()
1502
- ## Traceback (most recent call last):
1503
- ## ...
1504
- ## NotImplementedError
1498
+ # sage: K.<a, b> = NumberField([x^2 + 1, x^3 + x + 1]); OK = K.maximal_order()
1499
+ # Traceback (most recent call last):
1500
+ # ...
1501
+ # NotImplementedError
1505
1502
1506
- ## #sage: OK.absolute_polynomial()
1507
- ## #x^6 + 5*x^4 - 2*x^3 + 4*x^2 + 4*x + 1
1508
- ## """
1509
- ## return self.number_field().absolute_polynomial()
1503
+ # #sage: OK.absolute_polynomial()
1504
+ # #x^6 + 5*x^4 - 2*x^3 + 4*x^2 + 4*x + 1
1505
+ # """
1506
+ # return self.number_field().absolute_polynomial()
1510
1507
1511
- ## def polynomial(self):
1512
- ## """
1513
- ## Return the polynomial defining the number field that contains self.
1514
- ## """
1515
- ## return self.number_field().polynomial()
1508
+ # def polynomial(self):
1509
+ # """
1510
+ # Return the polynomial defining the number field that contains self.
1511
+ # """
1512
+ # return self.number_field().polynomial()
1516
1513
1517
- ## def polynomial_ntl(self):
1518
- ## """
1519
- ## Return defining polynomial of the parent number field as a
1520
- ## pair, an ntl polynomial and a denominator.
1514
+ # def polynomial_ntl(self):
1515
+ # """
1516
+ # Return defining polynomial of the parent number field as a
1517
+ # pair, an ntl polynomial and a denominator.
1521
1518
1522
- ## This is used mainly to implement some internal arithmetic.
1519
+ # This is used mainly to implement some internal arithmetic.
1523
1520
1524
- ## EXAMPLES::
1521
+ # EXAMPLES::
1525
1522
1526
- ## sage: NumberField(x^2 + 1,'a').maximal_order().polynomial_ntl()
1527
- ## ([1 0 1], 1)
1528
- ## """
1529
- ## return self.number_field().polynomial_ntl()
1523
+ # sage: NumberField(x^2 + 1,'a').maximal_order().polynomial_ntl()
1524
+ # ([1 0 1], 1)
1525
+ # """
1526
+ # return self.number_field().polynomial_ntl()
1530
1527
1531
1528
1532
1529
class Order_absolute (Order ):
@@ -1603,7 +1600,7 @@ def _element_constructor_(self, x):
1603
1600
3*a^2 + 2*a + 1
1604
1601
"""
1605
1602
if isinstance (x , (tuple , list )):
1606
- x = sum (xi * gi for xi , gi in zip (x , self .gens ()))
1603
+ x = sum (xi * gi for xi , gi in zip (x , self .gens ()))
1607
1604
if not isinstance (x , Element ) or x .parent () is not self ._K :
1608
1605
x = self ._K (x )
1609
1606
V , _ , embedding = self ._K .vector_space ()
0 commit comments