Skip to content

Commit

Permalink
projective_morphism.py: Add a test to ensure sagemath#35797 fixed: Re…
Browse files Browse the repository at this point in the history
…turn a version of the point with normalized coordinates
  • Loading branch information
guojing0 committed Jun 20, 2023
1 parent b5cf23c commit d863eba
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/sage/schemes/projective/projective_morphism.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,18 @@ def normalize_coordinates(self, **kwds):
3-adic Field with capped relative precision 20
Defn: Defined on coordinates by sending (x : y) to
(x^2 + (2 + O(3^20))*y^2 : (3 + O(3^21))*x*y)
::
sage: R.<x> = QQ[]
sage: K.<a> = NumberField(3*x^2 + 1)
sage: P.<z,w> = ProjectiveSpace(K, 1)
sage: f = DynamicalSystem_projective([a*(z^2 + w^2), 1/3*z*w])
sage: f.normalize_coordinates(); f
Dynamical System of Projective Space of dimension 1 over
Number Field in a with defining polynomial 3*x^2 + 1
Defn: Defined on coordinates by sending (z : w) to
((3*a)*z^2 + (3*a)*w^2 : z*w)
"""
# if ideal or valuation is specified, we scale according the norm defined by the ideal/valuation
ideal = kwds.pop('ideal', None)
Expand Down Expand Up @@ -968,14 +980,12 @@ def normalize_coordinates(self, **kwds):
return

R = self.domain().base_ring()

# clear any denominators from the coefficients
N = self.codomain().ambient_space().dimension_relative() + 1

# Only clear denominators from the coefficients in the ring of integers
if R in NumberFields():
if not all([self[i] in R.maximal_order() for i in range(N)]):
LCM = lcm([self[i].denominator() for i in range(N)])
self.scale_by(LCM)
self.scale_by(lcm([self[i].denominator() for i in range(N)]))

# There are cases, such as the example above over GF(7),
# where we want to compute GCDs, but NOT in the case
Expand Down

0 comments on commit d863eba

Please sign in to comment.