89
89
from sage .rings .polynomial .polynomial_ring_constructor import PolynomialRing
90
90
from sage .rings .rational_field import QQ , is_RationalField
91
91
from sage .rings .fraction_field import FractionField
92
+ from sage .rings .number_field .order import Order
92
93
93
94
from sage .categories .fields import Fields
94
95
from sage .categories .rings import Rings
@@ -1112,9 +1113,28 @@ def points_of_bounded_height(self, **kwds):
1112
1113
sage: P.<w,z> = ProjectiveSpace(ZZ, 1)
1113
1114
sage: sorted(list(P.points_of_bounded_height(bound=2)))
1114
1115
[(-2 : -1), (-2 : 1), (-1 : -2), (-1 : -1),
1115
- (-1 : 0), (-1 : 1), (-1 : 2), (0 : -1),
1116
- (0 : 1), (1 : -2), (1 : -1), (1 : 0),
1117
- (1 : 1), (1 : 2), (2 : -1), (2 : 1)]
1116
+ (-1 : 0), (-1 : 1), (-1 : 2), (0 : -1)]
1117
+
1118
+ ::
1119
+
1120
+ sage: R.<x> = QQ[]
1121
+ sage: P.<z,w> = ProjectiveSpace(R, 1)
1122
+ sage: P.points_of_bounded_height(bound=2)
1123
+ Traceback (most recent call last):
1124
+ ...
1125
+ NotImplementedError: self must be a projective space over
1126
+ a number field or a ring of integers
1127
+
1128
+ ::
1129
+
1130
+ sage: K.<i> = NumberField(x^2 + 1)
1131
+ sage: PK.<t> = K[]
1132
+ sage: L.<a> = K.extension(t^4 - i)
1133
+ sage: P.<z,w> = ProjectiveSpace(L, 1)
1134
+ sage: sorted(list(P.points_of_bounded_height(bound=1)))
1135
+ [(0 : 1), (1 : 0), (a : 1), (a^2 : 1), (a^3 : 1), (i : 1),
1136
+ (i*a : 1), (i*a^2 : 1), (i*a^3 : 1), (-1 : 1), (-a : 1), (-a^2 : 1),
1137
+ (-a^3 : 1), (-i : 1), (-i*a : 1), (-i*a^2 : 1), (-i*a^3 : 1), (1 : 1)]
1118
1138
"""
1119
1139
from sage .schemes .projective .proj_bdd_height import (
1120
1140
ZZ_points_of_bounded_height ,
@@ -1134,8 +1154,10 @@ def points_of_bounded_height(self, **kwds):
1134
1154
elif R in NumberFields ():
1135
1155
# True for the rational field as well, so check is_RationalField first
1136
1156
field_type = True
1137
- else :
1157
+ elif ( R is ZZ ) or isinstance ( R , Order ) :
1138
1158
is_ring_of_ints = True
1159
+ else :
1160
+ raise NotImplementedError ("self must be a projective space over a number field or a ring of integers" )
1139
1161
1140
1162
bound = kwds .pop ('bound' )
1141
1163
prec = kwds .pop ('precision' , 53 )
0 commit comments