passagemath-schemes 10.8.1a4__cp314-cp314t-macosx_13_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. passagemath_schemes/.dylibs/libflint.22.0.dylib +0 -0
  2. passagemath_schemes/.dylibs/libgmp.10.dylib +0 -0
  3. passagemath_schemes/.dylibs/libgmpxx.4.dylib +0 -0
  4. passagemath_schemes/.dylibs/libmpfr.6.dylib +0 -0
  5. passagemath_schemes/__init__.py +3 -0
  6. passagemath_schemes-10.8.1a4.dist-info/METADATA +203 -0
  7. passagemath_schemes-10.8.1a4.dist-info/METADATA.bak +204 -0
  8. passagemath_schemes-10.8.1a4.dist-info/RECORD +312 -0
  9. passagemath_schemes-10.8.1a4.dist-info/WHEEL +6 -0
  10. passagemath_schemes-10.8.1a4.dist-info/top_level.txt +3 -0
  11. sage/all__sagemath_schemes.py +23 -0
  12. sage/databases/all__sagemath_schemes.py +7 -0
  13. sage/databases/cremona.py +1723 -0
  14. sage/dynamics/all__sagemath_schemes.py +2 -0
  15. sage/dynamics/arithmetic_dynamics/affine_ds.py +1083 -0
  16. sage/dynamics/arithmetic_dynamics/all.py +14 -0
  17. sage/dynamics/arithmetic_dynamics/berkovich_ds.py +1101 -0
  18. sage/dynamics/arithmetic_dynamics/dynamical_semigroup.py +1543 -0
  19. sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +2426 -0
  20. sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +1169 -0
  21. sage/dynamics/arithmetic_dynamics/generic_ds.py +663 -0
  22. sage/dynamics/arithmetic_dynamics/product_projective_ds.py +339 -0
  23. sage/dynamics/arithmetic_dynamics/projective_ds.py +9556 -0
  24. sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-314t-darwin.so +0 -0
  25. sage/dynamics/arithmetic_dynamics/projective_ds_helper.pyx +301 -0
  26. sage/dynamics/arithmetic_dynamics/wehlerK3.py +2578 -0
  27. sage/lfunctions/all.py +18 -0
  28. sage/lfunctions/dokchitser.py +727 -0
  29. sage/lfunctions/pari.py +971 -0
  30. sage/lfunctions/zero_sums.cpython-314t-darwin.so +0 -0
  31. sage/lfunctions/zero_sums.pyx +1847 -0
  32. sage/modular/abvar/abvar.py +5132 -0
  33. sage/modular/abvar/abvar_ambient_jacobian.py +414 -0
  34. sage/modular/abvar/abvar_newform.py +246 -0
  35. sage/modular/abvar/all.py +8 -0
  36. sage/modular/abvar/constructor.py +187 -0
  37. sage/modular/abvar/cuspidal_subgroup.py +371 -0
  38. sage/modular/abvar/finite_subgroup.py +896 -0
  39. sage/modular/abvar/homology.py +721 -0
  40. sage/modular/abvar/homspace.py +989 -0
  41. sage/modular/abvar/lseries.py +415 -0
  42. sage/modular/abvar/morphism.py +935 -0
  43. sage/modular/abvar/torsion_point.py +274 -0
  44. sage/modular/abvar/torsion_subgroup.py +741 -0
  45. sage/modular/all.py +43 -0
  46. sage/modular/arithgroup/all.py +20 -0
  47. sage/modular/arithgroup/arithgroup_element.cpython-314t-darwin.so +0 -0
  48. sage/modular/arithgroup/arithgroup_element.pyx +474 -0
  49. sage/modular/arithgroup/arithgroup_generic.py +1406 -0
  50. sage/modular/arithgroup/arithgroup_perm.py +2692 -0
  51. sage/modular/arithgroup/congroup.cpython-314t-darwin.so +0 -0
  52. sage/modular/arithgroup/congroup.pyx +334 -0
  53. sage/modular/arithgroup/congroup_gamma.py +361 -0
  54. sage/modular/arithgroup/congroup_gamma0.py +692 -0
  55. sage/modular/arithgroup/congroup_gamma1.py +659 -0
  56. sage/modular/arithgroup/congroup_gammaH.py +1491 -0
  57. sage/modular/arithgroup/congroup_generic.py +630 -0
  58. sage/modular/arithgroup/congroup_sl2z.py +266 -0
  59. sage/modular/arithgroup/farey_symbol.cpython-314t-darwin.so +0 -0
  60. sage/modular/arithgroup/farey_symbol.pyx +1067 -0
  61. sage/modular/arithgroup/tests.py +425 -0
  62. sage/modular/btquotients/all.py +4 -0
  63. sage/modular/btquotients/btquotient.py +3736 -0
  64. sage/modular/btquotients/pautomorphicform.py +2564 -0
  65. sage/modular/buzzard.py +100 -0
  66. sage/modular/congroup.py +29 -0
  67. sage/modular/congroup_element.py +13 -0
  68. sage/modular/cusps.py +1107 -0
  69. sage/modular/cusps_nf.py +1270 -0
  70. sage/modular/dims.py +571 -0
  71. sage/modular/dirichlet.py +3310 -0
  72. sage/modular/drinfeld_modform/all.py +2 -0
  73. sage/modular/drinfeld_modform/element.py +446 -0
  74. sage/modular/drinfeld_modform/ring.py +773 -0
  75. sage/modular/drinfeld_modform/tutorial.py +236 -0
  76. sage/modular/etaproducts.py +1076 -0
  77. sage/modular/hecke/algebra.py +725 -0
  78. sage/modular/hecke/all.py +19 -0
  79. sage/modular/hecke/ambient_module.py +994 -0
  80. sage/modular/hecke/degenmap.py +119 -0
  81. sage/modular/hecke/element.py +302 -0
  82. sage/modular/hecke/hecke_operator.py +736 -0
  83. sage/modular/hecke/homspace.py +185 -0
  84. sage/modular/hecke/module.py +1744 -0
  85. sage/modular/hecke/morphism.py +139 -0
  86. sage/modular/hecke/submodule.py +970 -0
  87. sage/modular/hypergeometric_misc.cpython-314t-darwin.so +0 -0
  88. sage/modular/hypergeometric_misc.pxd +4 -0
  89. sage/modular/hypergeometric_misc.pyx +166 -0
  90. sage/modular/hypergeometric_motive.py +2020 -0
  91. sage/modular/local_comp/all.py +2 -0
  92. sage/modular/local_comp/liftings.py +292 -0
  93. sage/modular/local_comp/local_comp.py +1070 -0
  94. sage/modular/local_comp/smoothchar.py +1825 -0
  95. sage/modular/local_comp/type_space.py +748 -0
  96. sage/modular/modform/all.py +30 -0
  97. sage/modular/modform/ambient.py +817 -0
  98. sage/modular/modform/ambient_R.py +177 -0
  99. sage/modular/modform/ambient_eps.py +306 -0
  100. sage/modular/modform/ambient_g0.py +120 -0
  101. sage/modular/modform/ambient_g1.py +199 -0
  102. sage/modular/modform/constructor.py +545 -0
  103. sage/modular/modform/cuspidal_submodule.py +708 -0
  104. sage/modular/modform/defaults.py +14 -0
  105. sage/modular/modform/eis_series.py +487 -0
  106. sage/modular/modform/eisenstein_submodule.py +663 -0
  107. sage/modular/modform/element.py +4105 -0
  108. sage/modular/modform/half_integral.py +154 -0
  109. sage/modular/modform/hecke_operator_on_qexp.py +247 -0
  110. sage/modular/modform/j_invariant.py +47 -0
  111. sage/modular/modform/l_series_gross_zagier.py +127 -0
  112. sage/modular/modform/l_series_gross_zagier_coeffs.cpython-314t-darwin.so +0 -0
  113. sage/modular/modform/l_series_gross_zagier_coeffs.pyx +177 -0
  114. sage/modular/modform/notes.py +45 -0
  115. sage/modular/modform/numerical.py +514 -0
  116. sage/modular/modform/periods.py +14 -0
  117. sage/modular/modform/ring.py +1257 -0
  118. sage/modular/modform/space.py +1859 -0
  119. sage/modular/modform/submodule.py +118 -0
  120. sage/modular/modform/tests.py +64 -0
  121. sage/modular/modform/theta.py +110 -0
  122. sage/modular/modform/vm_basis.py +380 -0
  123. sage/modular/modform/weight1.py +221 -0
  124. sage/modular/modform_hecketriangle/abstract_ring.py +1932 -0
  125. sage/modular/modform_hecketriangle/abstract_space.py +2527 -0
  126. sage/modular/modform_hecketriangle/all.py +30 -0
  127. sage/modular/modform_hecketriangle/analytic_type.py +590 -0
  128. sage/modular/modform_hecketriangle/constructor.py +416 -0
  129. sage/modular/modform_hecketriangle/element.py +351 -0
  130. sage/modular/modform_hecketriangle/functors.py +752 -0
  131. sage/modular/modform_hecketriangle/graded_ring.py +541 -0
  132. sage/modular/modform_hecketriangle/graded_ring_element.py +2225 -0
  133. sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +3349 -0
  134. sage/modular/modform_hecketriangle/hecke_triangle_groups.py +1426 -0
  135. sage/modular/modform_hecketriangle/readme.py +1214 -0
  136. sage/modular/modform_hecketriangle/series_constructor.py +580 -0
  137. sage/modular/modform_hecketriangle/space.py +1037 -0
  138. sage/modular/modform_hecketriangle/subspace.py +423 -0
  139. sage/modular/modsym/all.py +17 -0
  140. sage/modular/modsym/ambient.py +3844 -0
  141. sage/modular/modsym/boundary.py +1420 -0
  142. sage/modular/modsym/element.py +336 -0
  143. sage/modular/modsym/g1list.py +178 -0
  144. sage/modular/modsym/ghlist.py +182 -0
  145. sage/modular/modsym/hecke_operator.py +73 -0
  146. sage/modular/modsym/manin_symbol.cpython-314t-darwin.so +0 -0
  147. sage/modular/modsym/manin_symbol.pxd +5 -0
  148. sage/modular/modsym/manin_symbol.pyx +497 -0
  149. sage/modular/modsym/manin_symbol_list.py +1291 -0
  150. sage/modular/modsym/modsym.py +400 -0
  151. sage/modular/modsym/modular_symbols.py +384 -0
  152. sage/modular/modsym/p1list_nf.py +1241 -0
  153. sage/modular/modsym/relation_matrix.py +591 -0
  154. sage/modular/modsym/relation_matrix_pyx.cpython-314t-darwin.so +0 -0
  155. sage/modular/modsym/relation_matrix_pyx.pyx +108 -0
  156. sage/modular/modsym/space.py +2468 -0
  157. sage/modular/modsym/subspace.py +455 -0
  158. sage/modular/modsym/tests.py +376 -0
  159. sage/modular/multiple_zeta.py +2635 -0
  160. sage/modular/multiple_zeta_F_algebra.py +789 -0
  161. sage/modular/overconvergent/all.py +6 -0
  162. sage/modular/overconvergent/genus0.py +1879 -0
  163. sage/modular/overconvergent/hecke_series.py +1187 -0
  164. sage/modular/overconvergent/weightspace.py +776 -0
  165. sage/modular/pollack_stevens/all.py +4 -0
  166. sage/modular/pollack_stevens/distributions.py +874 -0
  167. sage/modular/pollack_stevens/fund_domain.py +1572 -0
  168. sage/modular/pollack_stevens/manin_map.py +856 -0
  169. sage/modular/pollack_stevens/modsym.py +1590 -0
  170. sage/modular/pollack_stevens/padic_lseries.py +417 -0
  171. sage/modular/pollack_stevens/sigma0.py +534 -0
  172. sage/modular/pollack_stevens/space.py +1078 -0
  173. sage/modular/quasimodform/all.py +3 -0
  174. sage/modular/quasimodform/element.py +846 -0
  175. sage/modular/quasimodform/ring.py +826 -0
  176. sage/modular/quatalg/all.py +3 -0
  177. sage/modular/quatalg/brandt.py +1642 -0
  178. sage/modular/ssmod/all.py +8 -0
  179. sage/modular/ssmod/ssmod.py +827 -0
  180. sage/rings/all__sagemath_schemes.py +1 -0
  181. sage/rings/polynomial/all__sagemath_schemes.py +1 -0
  182. sage/rings/polynomial/binary_form_reduce.py +585 -0
  183. sage/schemes/all.py +41 -0
  184. sage/schemes/berkovich/all.py +6 -0
  185. sage/schemes/berkovich/berkovich_cp_element.py +2582 -0
  186. sage/schemes/berkovich/berkovich_space.py +700 -0
  187. sage/schemes/curves/affine_curve.py +2924 -0
  188. sage/schemes/curves/all.py +33 -0
  189. sage/schemes/curves/closed_point.py +434 -0
  190. sage/schemes/curves/constructor.py +397 -0
  191. sage/schemes/curves/curve.py +542 -0
  192. sage/schemes/curves/plane_curve_arrangement.py +1283 -0
  193. sage/schemes/curves/point.py +463 -0
  194. sage/schemes/curves/projective_curve.py +3203 -0
  195. sage/schemes/curves/weighted_projective_curve.py +106 -0
  196. sage/schemes/curves/zariski_vankampen.py +1931 -0
  197. sage/schemes/cyclic_covers/all.py +2 -0
  198. sage/schemes/cyclic_covers/charpoly_frobenius.py +320 -0
  199. sage/schemes/cyclic_covers/constructor.py +137 -0
  200. sage/schemes/cyclic_covers/cycliccover_finite_field.py +1309 -0
  201. sage/schemes/cyclic_covers/cycliccover_generic.py +310 -0
  202. sage/schemes/elliptic_curves/BSD.py +991 -0
  203. sage/schemes/elliptic_curves/Qcurves.py +592 -0
  204. sage/schemes/elliptic_curves/addition_formulas_ring.py +94 -0
  205. sage/schemes/elliptic_curves/all.py +49 -0
  206. sage/schemes/elliptic_curves/cardinality.py +609 -0
  207. sage/schemes/elliptic_curves/cm.py +1103 -0
  208. sage/schemes/elliptic_curves/constructor.py +1530 -0
  209. sage/schemes/elliptic_curves/ec_database.py +175 -0
  210. sage/schemes/elliptic_curves/ell_curve_isogeny.py +3971 -0
  211. sage/schemes/elliptic_curves/ell_egros.py +457 -0
  212. sage/schemes/elliptic_curves/ell_field.py +2837 -0
  213. sage/schemes/elliptic_curves/ell_finite_field.py +3249 -0
  214. sage/schemes/elliptic_curves/ell_generic.py +3760 -0
  215. sage/schemes/elliptic_curves/ell_local_data.py +1207 -0
  216. sage/schemes/elliptic_curves/ell_modular_symbols.py +775 -0
  217. sage/schemes/elliptic_curves/ell_number_field.py +4220 -0
  218. sage/schemes/elliptic_curves/ell_padic_field.py +107 -0
  219. sage/schemes/elliptic_curves/ell_point.py +4944 -0
  220. sage/schemes/elliptic_curves/ell_rational_field.py +7184 -0
  221. sage/schemes/elliptic_curves/ell_tate_curve.py +671 -0
  222. sage/schemes/elliptic_curves/ell_torsion.py +436 -0
  223. sage/schemes/elliptic_curves/ell_wp.py +352 -0
  224. sage/schemes/elliptic_curves/formal_group.py +760 -0
  225. sage/schemes/elliptic_curves/gal_reps.py +1459 -0
  226. sage/schemes/elliptic_curves/gal_reps_number_field.py +1663 -0
  227. sage/schemes/elliptic_curves/gp_simon.py +152 -0
  228. sage/schemes/elliptic_curves/heegner.py +7328 -0
  229. sage/schemes/elliptic_curves/height.py +2108 -0
  230. sage/schemes/elliptic_curves/hom.py +1788 -0
  231. sage/schemes/elliptic_curves/hom_composite.py +1084 -0
  232. sage/schemes/elliptic_curves/hom_fractional.py +544 -0
  233. sage/schemes/elliptic_curves/hom_frobenius.py +522 -0
  234. sage/schemes/elliptic_curves/hom_scalar.py +531 -0
  235. sage/schemes/elliptic_curves/hom_sum.py +681 -0
  236. sage/schemes/elliptic_curves/hom_velusqrt.py +1290 -0
  237. sage/schemes/elliptic_curves/homset.py +271 -0
  238. sage/schemes/elliptic_curves/isogeny_class.py +1523 -0
  239. sage/schemes/elliptic_curves/isogeny_small_degree.py +2797 -0
  240. sage/schemes/elliptic_curves/jacobian.py +247 -0
  241. sage/schemes/elliptic_curves/kodaira_symbol.py +344 -0
  242. sage/schemes/elliptic_curves/kraus.py +1014 -0
  243. sage/schemes/elliptic_curves/lseries_ell.py +915 -0
  244. sage/schemes/elliptic_curves/mod5family.py +105 -0
  245. sage/schemes/elliptic_curves/mod_poly.py +197 -0
  246. sage/schemes/elliptic_curves/mod_sym_num.cpython-314t-darwin.so +0 -0
  247. sage/schemes/elliptic_curves/mod_sym_num.pyx +3796 -0
  248. sage/schemes/elliptic_curves/modular_parametrization.py +305 -0
  249. sage/schemes/elliptic_curves/padic_lseries.py +1793 -0
  250. sage/schemes/elliptic_curves/padics.py +1816 -0
  251. sage/schemes/elliptic_curves/period_lattice.py +2234 -0
  252. sage/schemes/elliptic_curves/period_lattice_region.cpython-314t-darwin.so +0 -0
  253. sage/schemes/elliptic_curves/period_lattice_region.pyx +722 -0
  254. sage/schemes/elliptic_curves/saturation.py +716 -0
  255. sage/schemes/elliptic_curves/sha_tate.py +1158 -0
  256. sage/schemes/elliptic_curves/weierstrass_morphism.py +1117 -0
  257. sage/schemes/elliptic_curves/weierstrass_transform.py +200 -0
  258. sage/schemes/hyperelliptic_curves/all.py +6 -0
  259. sage/schemes/hyperelliptic_curves/constructor.py +369 -0
  260. sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py +1948 -0
  261. sage/schemes/hyperelliptic_curves/hyperelliptic_g2.py +192 -0
  262. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +936 -0
  263. sage/schemes/hyperelliptic_curves/hyperelliptic_padic_field.py +1332 -0
  264. sage/schemes/hyperelliptic_curves/hyperelliptic_rational_field.py +84 -0
  265. sage/schemes/hyperelliptic_curves/invariants.py +410 -0
  266. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +312 -0
  267. sage/schemes/hyperelliptic_curves/jacobian_g2.py +32 -0
  268. sage/schemes/hyperelliptic_curves/jacobian_generic.py +437 -0
  269. sage/schemes/hyperelliptic_curves/jacobian_homset.py +186 -0
  270. sage/schemes/hyperelliptic_curves/jacobian_morphism.py +878 -0
  271. sage/schemes/hyperelliptic_curves/kummer_surface.py +99 -0
  272. sage/schemes/hyperelliptic_curves/mestre.py +302 -0
  273. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +3863 -0
  274. sage/schemes/jacobians/abstract_jacobian.py +277 -0
  275. sage/schemes/jacobians/all.py +2 -0
  276. sage/schemes/overview.py +161 -0
  277. sage/schemes/plane_conics/all.py +22 -0
  278. sage/schemes/plane_conics/con_field.py +1296 -0
  279. sage/schemes/plane_conics/con_finite_field.py +158 -0
  280. sage/schemes/plane_conics/con_number_field.py +456 -0
  281. sage/schemes/plane_conics/con_rational_field.py +406 -0
  282. sage/schemes/plane_conics/con_rational_function_field.py +581 -0
  283. sage/schemes/plane_conics/constructor.py +249 -0
  284. sage/schemes/plane_quartics/all.py +2 -0
  285. sage/schemes/plane_quartics/quartic_constructor.py +71 -0
  286. sage/schemes/plane_quartics/quartic_generic.py +53 -0
  287. sage/schemes/riemann_surfaces/all.py +1 -0
  288. sage/schemes/riemann_surfaces/riemann_surface.py +4177 -0
  289. sage_wheels/share/cremona/cremona_mini.db +0 -0
  290. sage_wheels/share/ellcurves/rank0 +30427 -0
  291. sage_wheels/share/ellcurves/rank1 +31871 -0
  292. sage_wheels/share/ellcurves/rank10 +6 -0
  293. sage_wheels/share/ellcurves/rank11 +6 -0
  294. sage_wheels/share/ellcurves/rank12 +1 -0
  295. sage_wheels/share/ellcurves/rank14 +1 -0
  296. sage_wheels/share/ellcurves/rank15 +1 -0
  297. sage_wheels/share/ellcurves/rank17 +1 -0
  298. sage_wheels/share/ellcurves/rank19 +1 -0
  299. sage_wheels/share/ellcurves/rank2 +2388 -0
  300. sage_wheels/share/ellcurves/rank20 +1 -0
  301. sage_wheels/share/ellcurves/rank21 +1 -0
  302. sage_wheels/share/ellcurves/rank22 +1 -0
  303. sage_wheels/share/ellcurves/rank23 +1 -0
  304. sage_wheels/share/ellcurves/rank24 +1 -0
  305. sage_wheels/share/ellcurves/rank28 +1 -0
  306. sage_wheels/share/ellcurves/rank3 +836 -0
  307. sage_wheels/share/ellcurves/rank4 +10 -0
  308. sage_wheels/share/ellcurves/rank5 +5 -0
  309. sage_wheels/share/ellcurves/rank6 +5 -0
  310. sage_wheels/share/ellcurves/rank7 +5 -0
  311. sage_wheels/share/ellcurves/rank8 +6 -0
  312. sage_wheels/share/ellcurves/rank9 +7 -0
@@ -0,0 +1,581 @@
1
+ # sage_setup: distribution = sagemath-schemes
2
+ r"""
3
+ Projective plane conics over a rational function field
4
+
5
+ The class :class:`ProjectiveConic_rational_function_field` represents a
6
+ projective plane conic over a rational function field `F(t)`, where `F`
7
+ is any field. Instances can be created using :func:`Conic`.
8
+
9
+ AUTHORS:
10
+
11
+ - Lennart Ackermans (2016-02-07): initial version
12
+
13
+ EXAMPLES:
14
+
15
+ Create a conic::
16
+
17
+ sage: K = FractionField(PolynomialRing(QQ, 't'))
18
+ sage: P.<X, Y, Z> = K[]
19
+ sage: Conic(X^2 + Y^2 - Z^2)
20
+ Projective Conic Curve over Fraction Field of Univariate
21
+ Polynomial Ring in t over Rational Field defined by
22
+ X^2 + Y^2 - Z^2
23
+
24
+ Points can be found using :meth:`has_rational_point`::
25
+
26
+ sage: K.<t> = FractionField(QQ['t'])
27
+ sage: C = Conic([1, -t, t])
28
+ sage: C.has_rational_point(point=True) # needs sage.libs.singular
29
+ (True, (0 : 1 : 1))
30
+ """
31
+
32
+ # ****************************************************************************
33
+ # Copyright (C) 2016 Lennart Ackermans
34
+ #
35
+ # This program is free software: you can redistribute it and/or modify
36
+ # it under the terms of the GNU General Public License as published by
37
+ # the Free Software Foundation, either version 2 of the License, or
38
+ # (at your option) any later version.
39
+ # https://www.gnu.org/licenses/
40
+ # ****************************************************************************
41
+
42
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
43
+ from sage.matrix.constructor import diagonal_matrix, matrix, block_matrix
44
+ from sage.schemes.plane_conics.con_field import ProjectiveConic_field
45
+ from sage.arith.functions import lcm
46
+ from sage.arith.misc import GCD as gcd
47
+ from sage.modules.free_module_element import vector
48
+ from sage.rings.fraction_field import FractionField_generic
49
+
50
+
51
+ class ProjectiveConic_rational_function_field(ProjectiveConic_field):
52
+ r"""
53
+ Create a projective plane conic curve over a rational function field
54
+ `F(t)`, where `F` is any field.
55
+
56
+ The algorithms used in this class come mostly from [HC2006]_.
57
+
58
+ EXAMPLES::
59
+
60
+ sage: K = FractionField(PolynomialRing(QQ, 't'))
61
+ sage: P.<X, Y, Z> = K[]
62
+ sage: Conic(X^2 + Y^2 - Z^2)
63
+ Projective Conic Curve over Fraction Field of Univariate
64
+ Polynomial Ring in t over Rational Field defined by
65
+ X^2 + Y^2 - Z^2
66
+
67
+ TESTS::
68
+
69
+ sage: K = FractionField(PolynomialRing(QQ, 't'))
70
+ sage: Conic([K(1), 1, -1])._test_pickling()
71
+
72
+ REFERENCES:
73
+
74
+ - [HC2006]_
75
+ - [Ack2016]_
76
+ """
77
+ def __init__(self, A, f):
78
+ r"""
79
+ See ``Conic`` for full documentation.
80
+
81
+ EXAMPLES::
82
+
83
+ sage: c = Conic([1, 1, 1]); c
84
+ Projective Conic Curve over Rational Field defined by
85
+ x^2 + y^2 + z^2
86
+ """
87
+ ProjectiveConic_field.__init__(self, A, f)
88
+
89
+ def has_rational_point(self, point=False, algorithm='default',
90
+ read_cache=True):
91
+ r"""
92
+ Return ``True`` if and only if the conic ``self``
93
+ has a point over its base field `F(t)`, which is a field of rational
94
+ functions.
95
+
96
+ If ``point`` is True, then returns a second output, which is
97
+ a rational point if one exists.
98
+
99
+ Points are cached whenever they are found. Cached information
100
+ is used if and only if ``read_cache`` is True.
101
+
102
+ The default algorithm does not (yet) work for all base fields `F`.
103
+ In particular, sage is required to have:
104
+
105
+ * an algorithm for finding the square root of elements in finite
106
+ extensions of `F`;
107
+
108
+ * a factorization and gcd algorithm for `F[t]`;
109
+
110
+ * an algorithm for solving conics over `F`.
111
+
112
+ ALGORITHM:
113
+
114
+ The parameter ``algorithm`` specifies the algorithm
115
+ to be used:
116
+
117
+ * ``'default'`` -- use a native Sage implementation, based on the
118
+ algorithm Conic in [HC2006]_.
119
+
120
+ * ``'magma'`` (requires Magma to be installed) --
121
+ delegates the task to the Magma computer algebra
122
+ system.
123
+
124
+ EXAMPLES:
125
+
126
+ We can find points for function fields over (extensions of) `\QQ`
127
+ and finite fields::
128
+
129
+ sage: K.<t> = FractionField(PolynomialRing(QQ, 't'))
130
+ sage: C = Conic(K, [t^2 - 2, 2*t^3, -2*t^3 - 13*t^2 - 2*t + 18])
131
+ sage: C.has_rational_point(point=True) # needs sage.libs.singular
132
+ (True, (3 : (t + 1)/t : 1))
133
+
134
+ sage: R.<t> = FiniteField(23)[]
135
+ sage: C = Conic([2, t^2 + 1, t^2 + 5])
136
+ sage: C.has_rational_point() # needs sage.libs.singular
137
+ True
138
+ sage: C.has_rational_point(point=True) # needs sage.libs.singular
139
+ (True, (5*t : 8 : 1))
140
+
141
+ sage: # needs sage.rings.number_field
142
+ sage: F.<i> = QuadraticField(-1)
143
+ sage: R.<t> = F[]
144
+ sage: C = Conic([1, i*t, -t^2 + 4])
145
+ sage: C.has_rational_point(point=True) # needs sage.libs.singular
146
+ (True, (-t - 2*i : -2*i : 1))
147
+
148
+ It works on non-diagonal conics as well::
149
+
150
+ sage: K.<t> = QQ[]
151
+ sage: C = Conic([4, -4, 8, 1, -4, t + 4])
152
+ sage: C.has_rational_point(point=True) # needs sage.libs.singular
153
+ (True, (1/2 : 1 : 0))
154
+
155
+ If no point exists output still depends on the argument ``point``::
156
+
157
+ sage: K.<t> = QQ[]
158
+ sage: C = Conic(K, [t^2, (t-1), -2*(t-1)])
159
+ sage: C.has_rational_point() # needs sage.libs.singular
160
+ False
161
+ sage: C.has_rational_point(point=True) # needs sage.libs.singular
162
+ (False, None)
163
+
164
+ Due to limitations in Sage of algorithms we depend on, it is not
165
+ yet possible to find points on conics over multivariate function fields
166
+ (see the requirements above)::
167
+
168
+ sage: F.<t1> = FractionField(QQ['t1'])
169
+ sage: K.<t2> = FractionField(F['t2'])
170
+ sage: a = K(1)
171
+ sage: b = 2*t2^2 + 2*t1*t2 - t1^2
172
+ sage: c = -3*t2^4 - 4*t1*t2^3 + 8*t1^2*t2^2 + 16*t1^3 - t2 - 48*t1^4
173
+ sage: C = Conic([a,b,c])
174
+ sage: C.has_rational_point() # needs sage.libs.singular
175
+ Traceback (most recent call last):
176
+ ...
177
+ NotImplementedError: is_square() not implemented for elements of
178
+ Univariate Quotient Polynomial Ring in tbar over Fraction Field
179
+ of Univariate Polynomial Ring in t1 over Rational Field with
180
+ modulus tbar^2 + t1*tbar - 1/2*t1^2
181
+
182
+ In some cases, the algorithm requires us to be
183
+ able to solve conics over `F`. In particular, the following does not
184
+ work::
185
+
186
+ sage: P.<u> = QQ[]
187
+ sage: E = P.fraction_field()
188
+ sage: Q.<Y> = E[]
189
+ sage: F.<v> = E.extension(Y^2 - u^3 - 1)
190
+ sage: R.<t> = F[]
191
+ sage: K = R.fraction_field() # needs sage.rings.function_field
192
+ sage: C = Conic(K, [u, v, 1]) # needs sage.rings.function_field
193
+ sage: C.has_rational_point() # needs sage.rings.function_field
194
+ Traceback (most recent call last):
195
+ ...
196
+ NotImplementedError: has_rational_point not implemented for conics
197
+ over base field Univariate Quotient Polynomial Ring in v over
198
+ Fraction Field of Univariate Polynomial Ring in u over Rational
199
+ Field with modulus v^2 - u^3 - 1
200
+
201
+ TESTS::
202
+
203
+ sage: K.<t> = FractionField(PolynomialRing(QQ, 't'))
204
+ sage: a = (2*t^2 - 3/2*t + 1)/(37/3*t^2 + t - 1/4)
205
+ sage: b = (1/2*t^2 + 1/3)/(-73*t^2 - 2*t + 11/4)
206
+ sage: c = (6934/3*t^6 + 8798/3*t^5 - 947/18*t^4 + 3949/9*t^3 + 20983/18*t^2 + 28/3*t - 131/3)/(-2701/3*t^4 - 293/3*t^3 + 301/6*t^2 + 13/4*t - 11/16)
207
+ sage: C = Conic([a,b,c])
208
+ sage: C.has_rational_point(point=True) # needs sage.libs.singular
209
+ (True, (4*t + 4 : 2*t + 2 : 1))
210
+
211
+ A long time test::
212
+
213
+ sage: K.<t> = FractionField(PolynomialRing(QQ, 't'))
214
+ sage: a = (-1/3*t^6 - 14*t^5 - 1/4*t^4 + 7/2*t^2 - 1/2*t - 1)/(24/5*t^6 - t^5 - 1/4*t^4 + t^3 - 3*t^2 + 8/5*t + 5)
215
+ sage: b = (-3*t^3 + 8*t + 1/2)/(-1/3*t^3 + 3/2*t^2 + 1/12*t + 1/2)
216
+ sage: c = (1232009/225*t^25 - 1015925057/8100*t^24 + 1035477411553/1458000*t^23 + 7901338091/30375*t^22 - 1421379260447/729000*t^21 + 266121260843/972000*t^20 + 80808723191/486000*t^19 - 516656082523/972000*t^18 + 21521589529/40500*t^17 + 4654758997/21600*t^16 - 20064038625227/9720000*t^15 - 173054270347/324000*t^14 + 536200870559/540000*t^13 - 12710739349/50625*t^12 - 197968226971/135000*t^11 - 134122025657/810000*t^10 + 22685316301/120000*t^9 - 2230847689/21600*t^8 - 70624099679/270000*t^7 - 4298763061/270000*t^6 - 41239/216000*t^5 - 13523/36000*t^4 + 493/36000*t^3 + 83/2400*t^2 + 1/300*t + 1/200)/(-27378/125*t^17 + 504387/500*t^16 - 97911/2000*t^15 + 1023531/4000*t^14 + 1874841/8000*t^13 + 865381/12000*t^12 + 15287/375*t^11 + 6039821/6000*t^10 + 599437/1500*t^9 + 18659/250*t^8 + 1218059/6000*t^7 + 2025127/3000*t^6 + 1222759/6000*t^5 + 38573/200*t^4 + 8323/125*t^3 + 15453/125*t^2 + 17031/500*t + 441/10)
217
+ sage: C = Conic([a,b,c])
218
+ sage: C.has_rational_point(point=True) # long time (4 seconds) # needs sage.libs.singular
219
+ (True,
220
+ ((-86/9*t^17 + 1907490361/17182854*t^16 - 1363042615/206194248*t^15 - 4383072337/17182854*t^14 + 80370059033/618582744*t^13 + 62186354267/3092913720*t^12 - 1809118729/15861096*t^11 + 1002057383551/6185827440*t^10 - 483841158703/12371654880*t^9 - 627776378677/2061942480*t^8 - 197829033097/6185827440*t^7 + 386127705377/4123884960*t^6 - 5215102697/137462832*t^5 - 35978456911/317221920*t^4 - 1157738773/171828540*t^3 + 27472621/206194248*t^2 + 82006/2863809*t + 2808401/68731416)/(t^13 + 50677847/1272804*t^12 - 3017827697/15273648*t^11 - 144120133/5727618*t^10 - 3819228607/45820944*t^9 + 13738260095/274925664*t^8 - 10164360733/137462832*t^7 - 23583281/3818412*t^6 - 3902993449/137462832*t^5 + 1816361849/137462832*t^4 - 8343925/11455236*t^3 + 7102163/17182854*t^2 - 15173719/11455236*t - 19573057/11455236) : (655/351*t^17 + 4642530179/103097124*t^16 - 149195572469/137462832*t^15 + 1532672896471/412388496*t^14 + 46038188783/137462832*t^13 + 1373933278223/824776992*t^12 - 881883150035/824776992*t^11 + 47830791587/34365708*t^10 + 29359089785/412388496*t^9 + 58511538875/103097124*t^8 - 8651292257/34365708*t^7 + 647251073/51548562*t^6 - 424282657/45820944*t^5 + 212494760/8591427*t^4 + 746976293/22910472*t^3 - 1085/195816*t^2 - 1085/954603*t - 1085/636402)/(t^13 + 50677847/1272804*t^12 - 3017827697/15273648*t^11 - 144120133/5727618*t^10 - 3819228607/45820944*t^9 + 13738260095/274925664*t^8 - 10164360733/137462832*t^7 - 23583281/3818412*t^6 - 3902993449/137462832*t^5 + 1816361849/137462832*t^4 - 8343925/11455236*t^3 + 7102163/17182854*t^2 - 15173719/11455236*t - 19573057/11455236) : 1))
221
+
222
+
223
+ ``has_rational_point`` used to fail for some conics over function fields
224
+ over finite fields, due to :issue:`20003`::
225
+
226
+ sage: K.<t> = PolynomialRing(GF(7))
227
+ sage: C = Conic([5*t^2 + 4, t^2 + 3*t + 3, 6*t^2 + 3*t + 2,
228
+ ....: 5*t^2 + 5, 4*t + 3, 4*t^2 + t + 5])
229
+ sage: C.has_rational_point()
230
+ True
231
+ """
232
+ from .constructor import Conic
233
+
234
+ if read_cache:
235
+ if self._rational_point is not None:
236
+ return (True, self._rational_point) if point else True
237
+
238
+ if algorithm != 'default':
239
+ return ProjectiveConic_field.has_rational_point(self, point,
240
+ algorithm, read_cache)
241
+
242
+ # Default algorithm
243
+ if self.base_ring().characteristic() == 2:
244
+ raise NotImplementedError("has_rational_point not implemented \
245
+ for function field of characteristic 2.")
246
+ new_conic, transformation, inverse = self.diagonalization()
247
+ coeff = new_conic.coefficients()
248
+ if coeff[0] == 0:
249
+ return (True, transformation([1, 0, 0])) if point else True
250
+ elif coeff[3] == 0:
251
+ return (True, transformation([0, 1, 0])) if point else True
252
+ elif coeff[5] == 0:
253
+ return (True, transformation([0, 0, 1])) if point else True
254
+
255
+ # We save the coefficients of the reduced form in coeff
256
+ # A zero of the reduced conic can be multiplied by multipliers
257
+ # to get a zero of the old conic
258
+ (coeff, multipliers) = new_conic._reduce_conic()
259
+ new_conic = Conic(coeff)
260
+ transformation = transformation \
261
+ * new_conic.hom(diagonal_matrix(multipliers))
262
+ if coeff[0].degree() % 2 == coeff[1].degree() % 2 and \
263
+ coeff[1].degree() % 2 == coeff[2].degree() % 2:
264
+ case = 0
265
+ else:
266
+ case = 1
267
+
268
+ t, = self.base_ring().base().gens() # t in F[t]
269
+ supp = []
270
+ roots = [[], [], []]
271
+ remove = None
272
+ # loop through the coefficients and find a root of f_i (as in
273
+ # [HC2006]) modulo each element in the coefficients' support
274
+ for i in (0, 1, 2):
275
+ supp.append(list(coeff[i].factor()))
276
+ for p in supp[i]:
277
+ if p[1] != 1:
278
+ raise ValueError("Expected factor of exponent 1.")
279
+ # Convert to monic factor
280
+ x = p[0] / list(p[0])[-1]
281
+ N = p[0].base_ring().extension(x, 'tbar')
282
+ R = PolynomialRing(N, 'u')
283
+ u, = R.gens()
284
+ # If p[0] has degree 1, sage might forget the "defining
285
+ # polynomial" of N, so we define our own modulo operation
286
+ if p[0].degree() == 1:
287
+ mod = t.parent().hom([-x[0]])
288
+ else:
289
+ mod = N
290
+ if i == 0:
291
+ x = -mod(coeff[2]) / mod(coeff[1])
292
+ elif i == 1:
293
+ x = -mod(coeff[0]) / mod(coeff[2])
294
+ else:
295
+ x = -mod(coeff[1]) / mod(coeff[0])
296
+ if x.is_square():
297
+ root = N(x.sqrt())
298
+ else:
299
+ return (False, None) if point else False
300
+ # if case == 0 and p[0] has degree 1, we switch to case
301
+ # 1 and remove this factor out of the support. In [HC2006]
302
+ # this is done later, in FindPoint.
303
+ if case == 0 and p[0].degree() == 1:
304
+ case = 1
305
+ # remove later so the loop iterator stays in place.
306
+ remove = (i, p)
307
+ else:
308
+ roots[i].append(root)
309
+ if remove:
310
+ supp[remove[0]].remove(remove[1])
311
+ supp = [[p[0] for p in supp[i]] for i in (0, 1, 2)]
312
+
313
+ if case == 0:
314
+ # Find a solution of (5) in [HC2006]
315
+ leading_conic = Conic(self.base_ring().base_ring(),
316
+ [coeff[0].leading_coefficient(),
317
+ coeff[1].leading_coefficient(),
318
+ coeff[2].leading_coefficient()])
319
+ has_point = leading_conic.has_rational_point(True)
320
+ if has_point[0]:
321
+ if point:
322
+ pt = new_conic.find_point(supp, roots, case,
323
+ has_point[1])
324
+ else:
325
+ pt = True
326
+ return (True, transformation(pt)) if point else True
327
+ else:
328
+ return (False, None) if point else False
329
+ # case == 1:
330
+ if point:
331
+ pt = new_conic.find_point(supp, roots, case)
332
+ else:
333
+ pt = True
334
+ return (True, transformation(pt)) if point else True
335
+
336
+ def _reduce_conic(self):
337
+ r"""
338
+ Return the reduced form of the conic, i.e. a conic with base field
339
+ `K=F(t)` and coefficients `a,b,c` such that `a,b,c \in F[t]`,
340
+ `\gcd(a,b)=\gcd(b,c)=\gcd(c,a)=1` and `abc` is square-free.
341
+
342
+ Assumes ``self`` is in diagonal form.
343
+
344
+ OUTPUT:
345
+
346
+ A tuple (coefficients, multipliers), the coefficients of the conic
347
+ in reduced form and multipliers `\lambda, \mu, \nu \in F(t)^*` such
348
+ that `(x,y,z) \in F(t)` is a solution of the reduced conic if and only
349
+ if `(\lambda x, \mu y, \nu z)` is a solution of ``self``.
350
+
351
+ ALGORITHM:
352
+
353
+ The algorithm used is the algorithm ReduceConic in [HC2006]_.
354
+
355
+ EXAMPLES::
356
+
357
+ sage: K.<t> = FractionField(PolynomialRing(QQ, 't'))
358
+ sage: C = Conic(K, [t^2 - 2, 2*t^3, -2*t^3 - 13*t^2 - 2*t + 18])
359
+ sage: C._reduce_conic()
360
+ ([t^2 - 2, 2*t, -2*t^3 - 13*t^2 - 2*t + 18], [t, 1, t])
361
+ """
362
+
363
+ # start with removing fractions
364
+ coeff = [self.coefficients()[0], self.coefficients()[3],
365
+ self.coefficients()[5]]
366
+ coeff = lcm(lcm(coeff[0].denominator(), coeff[1].denominator()),
367
+ coeff[2].denominator()) * vector(coeff)
368
+ # go to base ring of fraction field
369
+ coeff = [self.base().base()(x) for x in coeff]
370
+ coeff = vector(coeff) / gcd(coeff)
371
+ # remove common divisors
372
+ labda = mu = nu = 1
373
+ g1 = g2 = g3 = 0
374
+ ca, cb, cc = coeff
375
+ while g1 != 1 or g2 != 1 or g3 != 1:
376
+ g1 = gcd(ca, cb)
377
+ ca = ca / g1
378
+ cb = cb / g1
379
+ cc = cc * g1
380
+ nu = g1 * nu
381
+ g2 = gcd(ca, cc)
382
+ ca = ca / g2
383
+ cc = cc / g2
384
+ cb = cb * g2
385
+ mu = g2 * mu
386
+ g3 = gcd(cb, cc)
387
+ cb = cb / g3
388
+ cc = cc / g3
389
+ ca = ca * g3
390
+ labda = g3 * labda
391
+ coeff = [ca, cb, cc]
392
+ multipliers = [labda, mu, nu]
393
+
394
+ # remove squares
395
+ for i, x in enumerate(coeff):
396
+ if isinstance(x.parent(), FractionField_generic):
397
+ # go to base ring of fraction field
398
+ x = self.base().base()(x)
399
+
400
+ try:
401
+ decom = x.squarefree_decomposition()
402
+ except (NotImplementedError, AttributeError):
403
+ decom = x.factor()
404
+ x = decom.unit()
405
+ x2 = 1
406
+ for factor in decom:
407
+ if factor[1] > 1:
408
+ if factor[1] % 2 == 0:
409
+ x2 *= factor[0] ** (factor[1] // 2)
410
+ else:
411
+ x *= factor[0]
412
+ x2 *= factor[0] ** ((factor[1] - 1) // 2)
413
+ else:
414
+ x *= factor[0]
415
+ for j, y in enumerate(multipliers):
416
+ if j != i:
417
+ multipliers[j] = y * x2
418
+ coeff[i] = self.base_ring().base().coerce(x)
419
+
420
+ return (coeff, multipliers)
421
+
422
+ def find_point(self, supports, roots, case, solution=0):
423
+ r"""
424
+ Given a solubility certificate like in [HC2006]_, find a point on
425
+ ``self``. Assumes ``self`` is in reduced form (see [HC2006]_ for a
426
+ definition).
427
+
428
+ If you don't have a solubility certificate and just want to find a
429
+ point, use the function :meth:`has_rational_point` instead.
430
+
431
+ INPUT:
432
+
433
+ - ``self`` -- conic in reduced form
434
+ - ``supports`` -- 3-tuple where ``supports[i]`` is a list of all monic
435
+ irreducible `p \in F[t]` that divide the `i`-th of the 3 coefficients
436
+ - ``roots`` -- 3-tuple containing lists of roots of all elements of
437
+ ``supports[i]``, in the same order
438
+ - ``case`` -- 1 or 0, as in [HC2006]_
439
+ - ``solution`` -- (default: 0) a solution of (5) in [HC2006]_, if
440
+ ``case`` = 0, 0 otherwise
441
+
442
+ OUTPUT:
443
+
444
+ A point `(x,y,z) \in F(t)` of ``self``. Output is undefined when the
445
+ input solubility certificate is incorrect.
446
+
447
+ ALGORITHM:
448
+
449
+ The algorithm used is the algorithm FindPoint in [HC2006]_, with
450
+ a simplification from [Ack2016]_.
451
+
452
+ EXAMPLES::
453
+
454
+ sage: K.<t> = FractionField(QQ['t'])
455
+ sage: C = Conic(K, [t^2 - 2, 2*t^3, -2*t^3 - 13*t^2 - 2*t + 18])
456
+ sage: C.has_rational_point(point=True) # indirect test # needs sage.libs.singular
457
+ (True, (3 : (t + 1)/t : 1))
458
+
459
+ Different solubility certificates give different points::
460
+
461
+ sage: # needs sage.rings.number_field
462
+ sage: K.<t> = PolynomialRing(QQ, 't')
463
+ sage: C = Conic(K, [t^2 - 2, 2*t, -2*t^3 - 13*t^2 - 2*t + 18])
464
+ sage: supp = [[t^2 - 2], [t], [t^3 + 13/2*t^2 + t - 9]]
465
+ sage: tbar1 = QQ.extension(supp[0][0], 'tbar').gens()[0]
466
+ sage: tbar2 = QQ.extension(supp[1][0], 'tbar').gens()[0]
467
+ sage: tbar3 = QQ.extension(supp[2][0], 'tbar').gens()[0]
468
+ sage: roots = [[tbar1 + 1], [1/3*tbar2^0], [2/3*tbar3^2 + 11/3*tbar3 - 3]]
469
+ sage: C.find_point(supp, roots, 1)
470
+ (3 : t + 1 : 1)
471
+ sage: roots = [[-tbar1 - 1], [-1/3*tbar2^0], [-2/3*tbar3^2 - 11/3*tbar3 + 3]]
472
+ sage: C.find_point(supp, roots, 1)
473
+ (3 : -t - 1 : 1)
474
+ """
475
+ Ft = self.base().base()
476
+ F = Ft.base()
477
+ t, = Ft.gens()
478
+ coefficients = [Ft(self.coefficients()[0]), Ft(self.coefficients()[3]),
479
+ Ft(self.coefficients()[5])]
480
+ deg = [coefficients[0].degree(), coefficients[1].degree(),
481
+ coefficients[2].degree()]
482
+ # definitions as in [HC2006] and [Ack2016]
483
+ A = ((deg[1] + deg[2]) / 2).ceil() - case
484
+ B = ((deg[2] + deg[0]) / 2).ceil() - case
485
+ C = ((deg[0] + deg[1]) / 2).ceil() - case
486
+
487
+ # For all roots as calculated by has_rational_point(), we create
488
+ # a system of linear equations. As in [Ack2016], we do this
489
+ # by calculating the matrices for all phi_p, with basis consisting
490
+ # of monomials of x, y and z in the space V of potential solutions:
491
+ # t^0, ..., t^A, t^0, ..., t^B and t^0, ..., t^C.
492
+ phi = []
493
+ for (i, p) in enumerate(supports[0]):
494
+ # lift to F[t] and map to R, with R as defined above
495
+ if roots[0][i].parent().is_finite():
496
+ root = roots[0][i].polynomial()
497
+ else:
498
+ root = roots[0][i].lift()
499
+ alpha = root.parent().hom([t])(root)
500
+ d = p.degree()
501
+ # Calculate y - alpha*z mod p for all basis vectors
502
+ phi_p = [[] for i in range(A + B + C + 4)]
503
+ phi_p[0:A + 1] = [vector(F, d)] * (A + 1)
504
+ phi_p[A + 1] = vector(F, d, {0: F(1)})
505
+ lastpoly = F(1)
506
+ for n in range(B):
507
+ lastpoly = (lastpoly * t) % p
508
+ phi_p[A + 2 + n] = vector(F, d, lastpoly.monomial_coefficients())
509
+ lastpoly = -alpha % p
510
+ phi_p[A + B + 2] = vector(F, d, lastpoly.monomial_coefficients())
511
+ for n in range(C):
512
+ lastpoly = (lastpoly * t) % p
513
+ phi_p[A + B + 3 + n] = vector(F, d, lastpoly.monomial_coefficients())
514
+ phi_p[A + B + C + 3] = vector(F, d)
515
+ phi.append(matrix(phi_p).transpose())
516
+ for (i, p) in enumerate(supports[1]):
517
+ if roots[1][i].parent().is_finite():
518
+ root = roots[1][i].polynomial()
519
+ else:
520
+ root = roots[1][i].lift()
521
+ alpha = root.parent().hom([t])(root)
522
+ d = p.degree()
523
+ # Calculate z - alpha*x mod p for all basis vectors
524
+ phi_p = [[] for i in range(A + B + C + 4)]
525
+ phi_p[A + 1:A + B + 2] = [vector(F, d)] * (B + 1)
526
+ phi_p[A + B + 2] = vector(F, d, {0: F(1)})
527
+ lastpoly = F(1)
528
+ for n in range(C):
529
+ lastpoly = (lastpoly * t) % p
530
+ phi_p[A + B + 3 + n] = vector(F, d, lastpoly.monomial_coefficients())
531
+ lastpoly = -alpha % p
532
+ phi_p[0] = vector(F, d, lastpoly.monomial_coefficients())
533
+ for n in range(A):
534
+ lastpoly = (lastpoly * t) % p
535
+ phi_p[1 + n] = vector(F, d, lastpoly.monomial_coefficients())
536
+ phi_p[A + B + C + 3] = vector(F, d)
537
+ phi.append(matrix(phi_p).transpose())
538
+ for (i, p) in enumerate(supports[2]):
539
+ if roots[2][i].parent().is_finite():
540
+ root = roots[2][i].polynomial()
541
+ else:
542
+ root = roots[2][i].lift()
543
+ alpha = root.parent().hom([t])(root)
544
+ d = p.degree()
545
+ # Calculate x - alpha*y mod p for all basis vectors
546
+ phi_p = [[] for i in range(A + B + C + 4)]
547
+ phi_p[A + B + 2:A + B + C + 3] = [vector(F, d)] * (C + 1)
548
+ phi_p[0] = vector(F, d, {0: F(1)})
549
+ lastpoly = F(1)
550
+ for n in range(A):
551
+ lastpoly = (lastpoly * t) % p
552
+ phi_p[1 + n] = vector(F, d, lastpoly.monomial_coefficients())
553
+ lastpoly = -alpha % p
554
+ phi_p[A + 1] = vector(F, d, lastpoly.monomial_coefficients())
555
+ for n in range(B):
556
+ lastpoly = (lastpoly * t) % p
557
+ phi_p[A + 2 + n] = vector(F, d, lastpoly.monomial_coefficients())
558
+ phi_p[A + B + C + 3] = vector(F, d)
559
+ phi.append(matrix(phi_p).transpose())
560
+ if case == 0:
561
+ # We need three more equations
562
+ lx = Ft(solution[0]).leading_coefficient()
563
+ ly = Ft(solution[1]).leading_coefficient()
564
+ lz = Ft(solution[2]).leading_coefficient()
565
+ ABC = A + B + C
566
+ phi.append(matrix([vector(F, ABC + 4, {A: 1, ABC + 3: -lx}),
567
+ vector(F, ABC + 4, {A + B + 1: 1, ABC + 3: -ly}),
568
+ vector(F, ABC + 4, {ABC + 2: 1, ABC + 3: -lz})]))
569
+ # Create the final matrix which we will solve
570
+ M = block_matrix(phi, ncols=1, subdivide=False)
571
+ solution_space = M.right_kernel()
572
+ for v in solution_space.basis():
573
+ if v[:A + B + C + 3] != 0:
574
+ # we do not want to return a trivial solution
575
+ X = Ft(list(v[:A + 1]))
576
+ Y = Ft(list(v[A + 1:A + B + 2]))
577
+ Z = Ft(list(v[A + B + 2:A + B + C + 3]))
578
+ return self.point([X, Y, Z])
579
+
580
+ raise RuntimeError("No solution has been found: possibly incorrect "
581
+ "solubility certificate.")