Dear all,
As part of this year's GSoC, I am trying to generalize `canonical_height` from `projective_ds.py` to number fields with unique factorization.
As of now, there are 8 test failures in this PR, one of which is the following one
sage: S.<z> = QQ[]
sage: K.<v> = NumberField(z^3-5)
sage: O = K.maximal_order()
sage: P.<x,y> = ProjectiveSpace(K, 1)
sage: f = DynamicalSystem([x^2 + 3*y^2, v*y^2])
sage: f.canonical_height(P(25*11, 5*v))
I have been trying to debug this in the evening, however, I couldn't get very far (in fact this error has bugged me for a few days, even after checking relevant documentations), so I was wondering if you could suggest anything?
Thank you.
sage: R.<x> = QQ[]
....: K.<a> = NumberField(3*x^2 - 1)
....: O = K.maximal_order()
....: P.<x,y>=ProjectiveSpace(K,1)
....: f=DynamicalSystem([x^2,y^2])
....: Q=P(a,2)
....: f.canonical_height(Q)
....:
....:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
File ~/github/sage/src/sage/structure/sequence.py:450, in Sequence_generic.__init__(self, x, universe, check, immutable, cr, cr_str, use_sage_types)
449 try:
--> 450 x[i] = universe(x[i])
451 except TypeError:
File ~/github/sage/src/sage/structure/parent.pyx:901, in sage.structure.parent.Parent.__call__()
900 if no_extra_args:
--> 901 return mor._call_(x)
902 else:
File ~/github/sage/src/sage/structure/coerce_maps.pyx:163, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_()
162 print(type(C._element_constructor), C._element_constructor)
--> 163 raise
164
File ~/github/sage/src/sage/structure/coerce_maps.pyx:158, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_()
157 try:
--> 158 return C._element_constructor(x)
159 except Exception:
File ~/github/sage/src/sage/rings/number_field/order.py:1573, in Order_absolute._element_constructor_(self, x)
1572 if not embedding(x) in self._module_rep:
-> 1573 raise TypeError("Not an element of the order.")
1574 return self._element_type(self, x)
TypeError: Not an element of the order.
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
Cell In [1], line 7
5 f=DynamicalSystem([x**Integer(2),y**Integer(2)])
6 Q=P(a,Integer(2))
----> 7 f.canonical_height(Q)
File ~/github/sage/src/sage/dynamics/arithmetic_dynamics/projective_ds.py:2428, in DynamicalSystem_projective.canonical_height(self, point, **kwds)
2426 max_order_PS = ProjectiveSpace(O, 1)
2427 number_field_pt.clear_denominators()
-> 2428 number_field_pt = max_order_PS(number_field_pt)
2430 x_i = number_field_pt[0]
2431 y_i = number_field_pt[1]
File ~/github/sage/src/sage/schemes/generic/scheme.py:266, in Scheme.__call__(self, *args)
264 return S
265 args = S
--> 266 return self.point(args)
File ~/github/sage/src/sage/schemes/projective/projective_space.py:822, in ProjectiveSpace_ring.point(self, v, check)
819 raise ValueError("%s not well defined in dimension > 1" % v)
820 v = [1, 0]
--> 822 return self.point_homset()(v, check=check)
File ~/github/sage/src/sage/schemes/generic/homset.py:279, in SchemeHomset_generic.__call__(self, *args, **kwds)
266 r"""
267 Make Hom-sets callable.
268
(...)
276 (4, 5)
277 """
278 # Homset (base of HomsetWithBase) overrides __call__ @#$
--> 279 return Set_generic.__call__(self, *args, **kwds)
File ~/github/sage/src/sage/structure/parent.pyx:903, in sage.structure.parent.Parent.__call__()
901 return mor._call_(x)
902 else:
--> 903 return mor._call_with_args(x, args, kwds)
904
905 raise TypeError(_LazyString("No conversion defined from %s to %s", (R, self), {}))
File ~/github/sage/src/sage/structure/coerce_maps.pyx:182, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args()
180 print(type(C), C)
181 print(type(C._element_constructor), C._element_constructor)
--> 182 raise
183
184
File ~/github/sage/src/sage/structure/coerce_maps.pyx:172, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_with_args()
170 return C._element_constructor(x)
171 else:
--> 172 return C._element_constructor(x, **kwds)
173 else:
174 if len(kwds) == 0:
File ~/github/sage/src/sage/schemes/generic/homset.py:656, in SchemeHomset_points._element_constructor_(self, *v, **kwds)
654 if len(v) == 1:
655 v = v[0]
--> 656 return self.codomain()._point(self, v, **kwds)
File ~/github/sage/src/sage/schemes/projective/projective_space.py:837, in ProjectiveSpace_ring._point(self, *args, **kwds)
824 def _point(self, *args, **kwds):
825 """
826 Construct a point.
827
(...)
835 (2 : 1 : 0)
836 """
--> 837 return SchemeMorphism_point_projective_ring(*args, **kwds)
File ~/github/sage/src/sage/schemes/projective/projective_point.py:185, in SchemeMorphism_point_projective_ring.__init__(self, X, v, check)
182 raise TypeError("v (=%s) must have %s components"%(v, d))
184 R = X.value_ring()
--> 185 v = Sequence(v, R)
186 if len(v) == d-1: # very common special case
187 v.append(R(1))
File ~/github/sage/src/sage/structure/sequence.py:266, in Sequence(x, universe, check, immutable, cr, cr_str, use_sage_types)
sage: sage: S.<z> = QQ[]
....: sage: K.<v> = NumberField(z^3-5)
....: sage: O = K.maximal_order()
....: sage: P.<x,y> = ProjectiveSpace(K, 1)
....: sage: f = DynamicalSystem([x^2 + 3*y^2, v*y^2])
....: sage: f.canonical_height(P(25*11, 5*v))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In [2], line 6
4 P = ProjectiveSpace(K, Integer(1), names=('x', 'y',)); (x, y,) = P._first_ngens(2)
5 f = DynamicalSystem([x**Integer(2) + Integer(3)*y**Integer(2), v*y**Integer(2)])
----> 6 f.canonical_height(P(Integer(25)*Integer(11), Integer(5)*v))
File ~/github/sage/src/sage/dynamics/arithmetic_dynamics/projective_ds.py:2433, in DynamicalSystem_projective.canonical_height(self, point, **kwds)
2430 x_i = number_field_pt[0]
2431 y_i = number_field_pt[1]
-> 2433 Res = O(f.resultant().abs())
2435 # Compute the error bound as defined in Algorithm 3.1 of [WELLS]
2436 if Res > 1:
File ~/github/sage/src/sage/structure/parent.pyx:901, in sage.structure.parent.Parent.__call__()
899 if mor is not None:
900 if no_extra_args:
--> 901 return mor._call_(x)
902 else:
903 return mor._call_with_args(x, args, kwds)
File ~/github/sage/src/sage/structure/coerce_maps.pyx:163, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_()
161 print(type(C), C)
162 print(type(C._element_constructor), C._element_constructor)
--> 163 raise
164
165 cpdef Element _call_with_args(self, x, args=(), kwds={}):
File ~/github/sage/src/sage/structure/coerce_maps.pyx:158, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_()
156 cdef Parent C = self._codomain
157 try:
--> 158 return C._element_constructor(x)
159 except Exception:
160 if print_warnings:
File ~/github/sage/src/sage/rings/number_field/order.py:1573, in Order_absolute._element_constructor_(self, x)
1571 V, _, embedding = self._K.vector_space()
1572 if not embedding(x) in self._module_rep:
-> 1573 raise TypeError("Not an element of the order.")
1574 return self._element_type(self, x)
TypeError: Not an element of the order.