@@ -926,7 +926,19 @@ def normalize_coordinates(self, **kwds):
926
926
Dynamical System of Projective Space of dimension 1 over
927
927
Number Field in a with defining polynomial 3*x^2 + 1
928
928
Defn: Defined on coordinates by sending (z : w) to
929
- ((3*a)*z^2 + (3*a)*w^2 : z*w)
929
+ ((-3/2*a + 1/2)*z^2 + (-3/2*a + 1/2)*w^2 : (-3/2*a - 3/2)*z*w)
930
+
931
+ ::
932
+
933
+ sage: R.<a,b> = QQ[]
934
+ sage: P.<x,y,z> = ProjectiveSpace(FractionField(R), 2)
935
+ sage: H = End(P)
936
+ sage: f = H([a/b*(x*z + y^2)*x^2, a*b*(x*z + y^2)*y^2, a*(x*z + y^2)*z^2])
937
+ sage: f.normalize_coordinates(); f
938
+ Scheme endomorphism of Projective Space of dimension 2 over Fraction
939
+ Field of Multivariate Polynomial Ring in a, b over Rational Field
940
+ Defn: Defined on coordinates by sending (x : y : z) to
941
+ (x^2 : (b^2)*y^2 : b*z^2)
930
942
"""
931
943
# If ideal or valuation is specified, we scale according the norm
932
944
# defined by the ideal/valuation
@@ -981,18 +993,22 @@ def normalize_coordinates(self, **kwds):
981
993
self .scale_by (uniformizer ** (- 1 * min_val ))
982
994
return
983
995
996
+ N = self .codomain ().ambient_space ().dimension_relative () + 1
997
+
984
998
R = self .domain ().base_ring ()
985
999
986
- # Only clear denominators from the coefficients in the ring of integers
1000
+ # Clear any denominators from the coefficients
987
1001
if R in NumberFields ():
988
1002
O = R .maximal_order ()
989
1003
990
1004
if O is ZZ :
991
- denom = lcm ([self [i ].denominator () for i in range (len ( list ( self )) )])
1005
+ denom = lcm ([self [i ].denominator () for i in range (N )])
992
1006
else :
993
- denom = R .ideal (list ( self )). absolute_norm ().denominator ()
1007
+ denom = R .ideal ([ c for poly in self for c in poly . coefficients ()]). norm ().denominator ()
994
1008
995
1009
self .scale_by (denom )
1010
+ else :
1011
+ self .scale_by (lcm ([self [i ].denominator () for i in range (N )]))
996
1012
997
1013
# There are cases, such as the example above over GF(7),
998
1014
# where we want to compute GCDs, but NOT in the case
@@ -1007,8 +1023,6 @@ def normalize_coordinates(self, **kwds):
1007
1023
GCD = gcd (self [0 ], self [1 ])
1008
1024
index = 2
1009
1025
1010
- N = self .codomain ().ambient_space ().dimension_relative () + 1
1011
-
1012
1026
while GCD != 1 and index < N :
1013
1027
GCD = gcd (GCD , self [index ])
1014
1028
index += + 1
0 commit comments