passagemath-polyhedra 10.6.37__cp314-cp314-musllinux_1_2_x86_64.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 (209) hide show
  1. passagemath_polyhedra/__init__.py +3 -0
  2. passagemath_polyhedra-10.6.37.dist-info/METADATA +367 -0
  3. passagemath_polyhedra-10.6.37.dist-info/METADATA.bak +369 -0
  4. passagemath_polyhedra-10.6.37.dist-info/RECORD +209 -0
  5. passagemath_polyhedra-10.6.37.dist-info/WHEEL +5 -0
  6. passagemath_polyhedra-10.6.37.dist-info/top_level.txt +3 -0
  7. passagemath_polyhedra.libs/libgcc_s-0cd532bd.so.1 +0 -0
  8. passagemath_polyhedra.libs/libgmp-0e7fc84e.so.10.5.0 +0 -0
  9. passagemath_polyhedra.libs/libgomp-8949ffbe.so.1.0.0 +0 -0
  10. passagemath_polyhedra.libs/libstdc++-5d72f927.so.6.0.33 +0 -0
  11. sage/all__sagemath_polyhedra.py +50 -0
  12. sage/game_theory/all.py +8 -0
  13. sage/game_theory/catalog.py +6 -0
  14. sage/game_theory/catalog_normal_form_games.py +923 -0
  15. sage/game_theory/cooperative_game.py +844 -0
  16. sage/game_theory/matching_game.py +1181 -0
  17. sage/game_theory/normal_form_game.py +2697 -0
  18. sage/game_theory/parser.py +275 -0
  19. sage/geometry/all__sagemath_polyhedra.py +22 -0
  20. sage/geometry/cone.py +6940 -0
  21. sage/geometry/cone_catalog.py +847 -0
  22. sage/geometry/cone_critical_angles.py +1027 -0
  23. sage/geometry/convex_set.py +1119 -0
  24. sage/geometry/fan.py +3743 -0
  25. sage/geometry/fan_isomorphism.py +389 -0
  26. sage/geometry/fan_morphism.py +1884 -0
  27. sage/geometry/hasse_diagram.py +202 -0
  28. sage/geometry/hyperplane_arrangement/affine_subspace.py +390 -0
  29. sage/geometry/hyperplane_arrangement/all.py +1 -0
  30. sage/geometry/hyperplane_arrangement/arrangement.py +3905 -0
  31. sage/geometry/hyperplane_arrangement/check_freeness.py +145 -0
  32. sage/geometry/hyperplane_arrangement/hyperplane.py +773 -0
  33. sage/geometry/hyperplane_arrangement/library.py +825 -0
  34. sage/geometry/hyperplane_arrangement/ordered_arrangement.py +642 -0
  35. sage/geometry/hyperplane_arrangement/plot.py +520 -0
  36. sage/geometry/integral_points.py +35 -0
  37. sage/geometry/integral_points_generic_dense.cpython-314-x86_64-linux-musl.so +0 -0
  38. sage/geometry/integral_points_generic_dense.pyx +7 -0
  39. sage/geometry/lattice_polytope.py +5894 -0
  40. sage/geometry/linear_expression.py +773 -0
  41. sage/geometry/newton_polygon.py +767 -0
  42. sage/geometry/point_collection.cpython-314-x86_64-linux-musl.so +0 -0
  43. sage/geometry/point_collection.pyx +1008 -0
  44. sage/geometry/polyhedral_complex.py +2616 -0
  45. sage/geometry/polyhedron/all.py +8 -0
  46. sage/geometry/polyhedron/backend_cdd.py +460 -0
  47. sage/geometry/polyhedron/backend_cdd_rdf.py +231 -0
  48. sage/geometry/polyhedron/backend_field.py +347 -0
  49. sage/geometry/polyhedron/backend_normaliz.py +2503 -0
  50. sage/geometry/polyhedron/backend_number_field.py +168 -0
  51. sage/geometry/polyhedron/backend_polymake.py +765 -0
  52. sage/geometry/polyhedron/backend_ppl.py +582 -0
  53. sage/geometry/polyhedron/base.py +1206 -0
  54. sage/geometry/polyhedron/base0.py +1444 -0
  55. sage/geometry/polyhedron/base1.py +886 -0
  56. sage/geometry/polyhedron/base2.py +812 -0
  57. sage/geometry/polyhedron/base3.py +1845 -0
  58. sage/geometry/polyhedron/base4.py +1262 -0
  59. sage/geometry/polyhedron/base5.py +2700 -0
  60. sage/geometry/polyhedron/base6.py +1741 -0
  61. sage/geometry/polyhedron/base7.py +997 -0
  62. sage/geometry/polyhedron/base_QQ.py +1258 -0
  63. sage/geometry/polyhedron/base_RDF.py +98 -0
  64. sage/geometry/polyhedron/base_ZZ.py +934 -0
  65. sage/geometry/polyhedron/base_mutable.py +215 -0
  66. sage/geometry/polyhedron/base_number_field.py +122 -0
  67. sage/geometry/polyhedron/cdd_file_format.py +155 -0
  68. sage/geometry/polyhedron/combinatorial_polyhedron/all.py +1 -0
  69. sage/geometry/polyhedron/combinatorial_polyhedron/base.cpython-314-x86_64-linux-musl.so +0 -0
  70. sage/geometry/polyhedron/combinatorial_polyhedron/base.pxd +76 -0
  71. sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +3859 -0
  72. sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.cpython-314-x86_64-linux-musl.so +0 -0
  73. sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pxd +39 -0
  74. sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx +1038 -0
  75. sage/geometry/polyhedron/combinatorial_polyhedron/conversions.cpython-314-x86_64-linux-musl.so +0 -0
  76. sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pxd +9 -0
  77. sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pyx +501 -0
  78. sage/geometry/polyhedron/combinatorial_polyhedron/face_data_structure.pxd +207 -0
  79. sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.cpython-314-x86_64-linux-musl.so +0 -0
  80. sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pxd +102 -0
  81. sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pyx +2274 -0
  82. sage/geometry/polyhedron/combinatorial_polyhedron/face_list_data_structure.cpython-314-x86_64-linux-musl.so +0 -0
  83. sage/geometry/polyhedron/combinatorial_polyhedron/face_list_data_structure.pxd +370 -0
  84. sage/geometry/polyhedron/combinatorial_polyhedron/face_list_data_structure.pyx +84 -0
  85. sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.cpython-314-x86_64-linux-musl.so +0 -0
  86. sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pxd +31 -0
  87. sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx +587 -0
  88. sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.cpython-314-x86_64-linux-musl.so +0 -0
  89. sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pxd +52 -0
  90. sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx +560 -0
  91. sage/geometry/polyhedron/constructor.py +773 -0
  92. sage/geometry/polyhedron/double_description.py +753 -0
  93. sage/geometry/polyhedron/double_description_inhomogeneous.py +564 -0
  94. sage/geometry/polyhedron/face.py +1060 -0
  95. sage/geometry/polyhedron/generating_function.py +1810 -0
  96. sage/geometry/polyhedron/lattice_euclidean_group_element.py +178 -0
  97. sage/geometry/polyhedron/library.py +3502 -0
  98. sage/geometry/polyhedron/misc.py +121 -0
  99. sage/geometry/polyhedron/modules/all.py +1 -0
  100. sage/geometry/polyhedron/modules/formal_polyhedra_module.py +155 -0
  101. sage/geometry/polyhedron/palp_database.py +447 -0
  102. sage/geometry/polyhedron/parent.py +1279 -0
  103. sage/geometry/polyhedron/plot.py +1986 -0
  104. sage/geometry/polyhedron/ppl_lattice_polygon.py +556 -0
  105. sage/geometry/polyhedron/ppl_lattice_polytope.py +1257 -0
  106. sage/geometry/polyhedron/representation.py +1723 -0
  107. sage/geometry/pseudolines.py +515 -0
  108. sage/geometry/relative_interior.py +445 -0
  109. sage/geometry/toric_plotter.py +1103 -0
  110. sage/geometry/triangulation/all.py +2 -0
  111. sage/geometry/triangulation/base.cpython-314-x86_64-linux-musl.so +0 -0
  112. sage/geometry/triangulation/base.pyx +963 -0
  113. sage/geometry/triangulation/data.h +147 -0
  114. sage/geometry/triangulation/data.pxd +4 -0
  115. sage/geometry/triangulation/element.py +914 -0
  116. sage/geometry/triangulation/functions.h +10 -0
  117. sage/geometry/triangulation/functions.pxd +4 -0
  118. sage/geometry/triangulation/point_configuration.py +2256 -0
  119. sage/geometry/triangulation/triangulations.h +49 -0
  120. sage/geometry/triangulation/triangulations.pxd +7 -0
  121. sage/geometry/voronoi_diagram.py +319 -0
  122. sage/interfaces/all__sagemath_polyhedra.py +1 -0
  123. sage/interfaces/polymake.py +2028 -0
  124. sage/numerical/all.py +13 -0
  125. sage/numerical/all__sagemath_polyhedra.py +11 -0
  126. sage/numerical/backends/all.py +1 -0
  127. sage/numerical/backends/all__sagemath_polyhedra.py +1 -0
  128. sage/numerical/backends/cvxopt_backend.cpython-314-x86_64-linux-musl.so +0 -0
  129. sage/numerical/backends/cvxopt_backend.pyx +1006 -0
  130. sage/numerical/backends/cvxopt_backend_test.py +19 -0
  131. sage/numerical/backends/cvxopt_sdp_backend.cpython-314-x86_64-linux-musl.so +0 -0
  132. sage/numerical/backends/cvxopt_sdp_backend.pyx +382 -0
  133. sage/numerical/backends/cvxpy_backend.cpython-314-x86_64-linux-musl.so +0 -0
  134. sage/numerical/backends/cvxpy_backend.pxd +41 -0
  135. sage/numerical/backends/cvxpy_backend.pyx +934 -0
  136. sage/numerical/backends/cvxpy_backend_test.py +13 -0
  137. sage/numerical/backends/generic_backend_test.py +24 -0
  138. sage/numerical/backends/interactivelp_backend.cpython-314-x86_64-linux-musl.so +0 -0
  139. sage/numerical/backends/interactivelp_backend.pxd +36 -0
  140. sage/numerical/backends/interactivelp_backend.pyx +1231 -0
  141. sage/numerical/backends/interactivelp_backend_test.py +12 -0
  142. sage/numerical/backends/logging_backend.py +391 -0
  143. sage/numerical/backends/matrix_sdp_backend.cpython-314-x86_64-linux-musl.so +0 -0
  144. sage/numerical/backends/matrix_sdp_backend.pxd +15 -0
  145. sage/numerical/backends/matrix_sdp_backend.pyx +478 -0
  146. sage/numerical/backends/ppl_backend.cpython-314-x86_64-linux-musl.so +0 -0
  147. sage/numerical/backends/ppl_backend.pyx +1126 -0
  148. sage/numerical/backends/ppl_backend_test.py +13 -0
  149. sage/numerical/backends/scip_backend.cpython-314-x86_64-linux-musl.so +0 -0
  150. sage/numerical/backends/scip_backend.pxd +22 -0
  151. sage/numerical/backends/scip_backend.pyx +1289 -0
  152. sage/numerical/backends/scip_backend_test.py +13 -0
  153. sage/numerical/interactive_simplex_method.py +5338 -0
  154. sage/numerical/knapsack.py +665 -0
  155. sage/numerical/linear_functions.cpython-314-x86_64-linux-musl.so +0 -0
  156. sage/numerical/linear_functions.pxd +31 -0
  157. sage/numerical/linear_functions.pyx +1648 -0
  158. sage/numerical/linear_tensor.py +470 -0
  159. sage/numerical/linear_tensor_constraints.py +448 -0
  160. sage/numerical/linear_tensor_element.cpython-314-x86_64-linux-musl.so +0 -0
  161. sage/numerical/linear_tensor_element.pxd +6 -0
  162. sage/numerical/linear_tensor_element.pyx +459 -0
  163. sage/numerical/mip.cpython-314-x86_64-linux-musl.so +0 -0
  164. sage/numerical/mip.pxd +40 -0
  165. sage/numerical/mip.pyx +3667 -0
  166. sage/numerical/sdp.cpython-314-x86_64-linux-musl.so +0 -0
  167. sage/numerical/sdp.pxd +39 -0
  168. sage/numerical/sdp.pyx +1433 -0
  169. sage/rings/all__sagemath_polyhedra.py +3 -0
  170. sage/rings/polynomial/all__sagemath_polyhedra.py +10 -0
  171. sage/rings/polynomial/omega.py +982 -0
  172. sage/schemes/all__sagemath_polyhedra.py +2 -0
  173. sage/schemes/toric/all.py +10 -0
  174. sage/schemes/toric/chow_group.py +1248 -0
  175. sage/schemes/toric/divisor.py +2082 -0
  176. sage/schemes/toric/divisor_class.cpython-314-x86_64-linux-musl.so +0 -0
  177. sage/schemes/toric/divisor_class.pyx +322 -0
  178. sage/schemes/toric/fano_variety.py +1606 -0
  179. sage/schemes/toric/homset.py +650 -0
  180. sage/schemes/toric/ideal.py +451 -0
  181. sage/schemes/toric/library.py +1322 -0
  182. sage/schemes/toric/morphism.py +1958 -0
  183. sage/schemes/toric/points.py +1032 -0
  184. sage/schemes/toric/sheaf/all.py +1 -0
  185. sage/schemes/toric/sheaf/constructor.py +302 -0
  186. sage/schemes/toric/sheaf/klyachko.py +921 -0
  187. sage/schemes/toric/toric_subscheme.py +905 -0
  188. sage/schemes/toric/variety.py +3460 -0
  189. sage/schemes/toric/weierstrass.py +1078 -0
  190. sage/schemes/toric/weierstrass_covering.py +457 -0
  191. sage/schemes/toric/weierstrass_higher.py +288 -0
  192. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.info +10 -0
  193. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.v03 +0 -0
  194. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.v04 +0 -0
  195. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.v05 +1 -0
  196. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.v06 +1 -0
  197. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.info +22 -0
  198. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v04 +0 -0
  199. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v05 +0 -0
  200. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v06 +0 -0
  201. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v07 +0 -0
  202. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v08 +0 -0
  203. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v09 +0 -0
  204. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v10 +0 -0
  205. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v11 +1 -0
  206. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v12 +1 -0
  207. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v13 +1 -0
  208. sage_wheels/share/reflexive_polytopes/reflexive_polytopes_2d +80 -0
  209. sage_wheels/share/reflexive_polytopes/reflexive_polytopes_3d +37977 -0
@@ -0,0 +1,905 @@
1
+ # sage_setup: distribution = sagemath-polyhedra
2
+ # sage.doctest: needs sage.geometry.polyhedron sage.graphs
3
+ r"""
4
+ Subschemes of toric space
5
+
6
+ AUTHORS:
7
+
8
+ - David Kohel (2005): initial version.
9
+
10
+ - William Stein (2005): initial version.
11
+
12
+ - Andrey Novoseltsev (2010-05-17): subschemes of toric varieties.
13
+ """
14
+
15
+ # ****************************************************************************
16
+ # Copyright (C) 2005 William Stein <wstein@gmail.com>
17
+ #
18
+ # Distributed under the terms of the GNU General Public License (GPL)
19
+ # as published by the Free Software Foundation; either version 2 of
20
+ # the License, or (at your option) any later version.
21
+ # https://www.gnu.org/licenses/
22
+ # ****************************************************************************
23
+
24
+ from sage.misc.lazy_import import lazy_import
25
+ from sage.rings.integer_ring import ZZ
26
+ from sage.schemes.generic.algebraic_scheme import AlgebraicScheme_subscheme
27
+
28
+ lazy_import("sage.calculus.functions", "jacobian")
29
+
30
+
31
+ class AlgebraicScheme_subscheme_toric(AlgebraicScheme_subscheme):
32
+ r"""
33
+ Construct an algebraic subscheme of a toric variety.
34
+
35
+ .. WARNING::
36
+
37
+ You should not create objects of this class directly. The
38
+ preferred method to construct such subschemes is to use
39
+ :meth:`~ToricVariety_field.subscheme` method of :class:`toric
40
+ varieties <sage.schemes.toric.variety.ToricVariety_field>`.
41
+
42
+ INPUT:
43
+
44
+ - ``toric_variety`` -- ambient :class:`toric variety
45
+ <ToricVariety_field>`
46
+
47
+ - ``polynomials`` -- single polynomial, list, or ideal of defining
48
+ polynomials in the coordinate ring of ``toric_variety``
49
+
50
+ OUTPUT: an :class:`algebraic subscheme of a toric variety
51
+ <AlgebraicScheme_subscheme_toric>`.
52
+
53
+ TESTS::
54
+
55
+ sage: P1xP1 = toric_varieties.P1xP1()
56
+ sage: P1xP1.inject_variables()
57
+ Defining s, t, x, y
58
+ sage: import sage.schemes.toric.toric_subscheme as SCM
59
+ sage: X = SCM.AlgebraicScheme_subscheme_toric(
60
+ ....: P1xP1, [x*s + y*t, x^3 + y^3])
61
+ sage: X
62
+ Closed subscheme of 2-d CPR-Fano toric variety
63
+ covered by 4 affine patches defined by:
64
+ s*x + t*y,
65
+ x^3 + y^3
66
+
67
+ A better way to construct the same scheme as above::
68
+
69
+ sage: P1xP1.subscheme([x*s + y*t, x^3 + y^3])
70
+ Closed subscheme of 2-d CPR-Fano toric variety
71
+ covered by 4 affine patches defined by:
72
+ s*x + t*y,
73
+ x^3 + y^3
74
+ """
75
+
76
+ # Implementation note: if the toric variety is affine you should
77
+ # construct instances of the derived class
78
+ # AlgebraicScheme_subscheme_affine_toric instead.
79
+
80
+ def __init__(self, toric_variety, polynomials):
81
+ r"""
82
+ See :class:`AlgebraicScheme_subscheme_toric` for documentation.
83
+
84
+ TESTS::
85
+
86
+ sage: P1xP1 = toric_varieties.P1xP1()
87
+ sage: P1xP1.inject_variables()
88
+ Defining s, t, x, y
89
+ sage: import sage.schemes.toric.toric_subscheme as SCM
90
+ sage: X = SCM.AlgebraicScheme_subscheme_toric(
91
+ ....: P1xP1, [x*s + y*t, x^3 + y^3])
92
+ sage: X
93
+ Closed subscheme of 2-d CPR-Fano toric variety
94
+ covered by 4 affine patches defined by:
95
+ s*x + t*y,
96
+ x^3 + y^3
97
+ """
98
+ # Just to make sure that keyword arguments will be passed correctly
99
+ super().__init__(toric_variety, polynomials)
100
+
101
+ def _morphism(self, *args, **kwds):
102
+ r"""
103
+ Construct a morphism determined by action on points of ``self``.
104
+
105
+ INPUT:
106
+
107
+ - same as for
108
+ :class:`~sage.schemes.toric.morphism.SchemeMorphism_polynomial_toric_variety`.
109
+
110
+ OUTPUT: a :class:`~sage.schemes.toric.morphism.SchemeMorphism_polynomial_toric_variety`
111
+
112
+ TESTS::
113
+
114
+ sage: P1xP1 = toric_varieties.P1xP1()
115
+ sage: P1xP1.inject_variables()
116
+ Defining s, t, x, y
117
+ sage: P1 = P1xP1.subscheme(s - t)
118
+ sage: H = P1.Hom(P1xP1)
119
+ sage: H([s, s, x, y])
120
+ Scheme morphism:
121
+ From: Closed subscheme of 2-d CPR-Fano toric variety
122
+ covered by 4 affine patches defined by:
123
+ s - t
124
+ To: 2-d CPR-Fano toric variety covered by 4 affine patches
125
+ Defn: Defined on coordinates by sending [s : t : x : y] to
126
+ [s : s : x : y]
127
+
128
+ sage: sbar, tbar, xbar, ybar = P1.coordinate_ring().gens() # needs sage.libs.singular
129
+ sage: P1._morphism(H, [sbar, sbar, xbar, ybar]) # needs sage.libs.singular
130
+ Scheme morphism:
131
+ From: Closed subscheme of 2-d CPR-Fano toric variety
132
+ covered by 4 affine patches defined by:
133
+ s - t
134
+ To: 2-d CPR-Fano toric variety covered by 4 affine patches
135
+ Defn: Defined on coordinates by sending [s : t : x : y] to
136
+ [t : t : x : y]
137
+ """
138
+ from sage.schemes.toric.morphism import SchemeMorphism_polynomial_toric_variety
139
+ return SchemeMorphism_polynomial_toric_variety(*args, **kwds)
140
+
141
+ def _point_homset(self, *args, **kwds):
142
+ r"""
143
+ Construct a Hom-set for ``self``.
144
+
145
+ INPUT:
146
+
147
+ - same as for
148
+ :class:`~sage.schemes.toric.homset.SchemeHomset_points_toric_field`.
149
+
150
+ OUTPUT: a :class:`~sage.schemes.toric.homset.SchemeHomset_points_subscheme_toric_field`
151
+
152
+ TESTS::
153
+
154
+ sage: P2.<x,y,z> = toric_varieties.P2()
155
+ sage: quadric = P2.subscheme([x^2 + y^2 + z^2])
156
+ sage: quadric._point_homset(Spec(QQ), quadric)
157
+ Set of rational points of Closed subscheme of 2-d CPR-Fano
158
+ toric variety covered by 3 affine patches defined by:
159
+ x^2 + y^2 + z^2
160
+ sage: type(quadric.point_set())
161
+ <class 'sage.schemes.toric.homset.SchemeHomset_points_subscheme_toric_field_with_category'>
162
+ """
163
+ from sage.schemes.toric.homset import SchemeHomset_points_subscheme_toric_field
164
+ return SchemeHomset_points_subscheme_toric_field(*args, **kwds)
165
+
166
+ def fan(self):
167
+ """
168
+ Return the fan of the ambient space.
169
+
170
+ OUTPUT: a fan
171
+
172
+ EXAMPLES::
173
+
174
+ sage: P2.<x,y,z> = toric_varieties.P(2)
175
+ sage: E = P2.subscheme([x^2 + y^2 + z^2])
176
+ sage: E.fan()
177
+ Rational polyhedral fan in 2-d lattice N
178
+ """
179
+ return self.ambient_space().fan()
180
+
181
+ def affine_patch(self, i):
182
+ r"""
183
+ Return the ``i``-th affine patch of ``self`` as an affine
184
+ toric algebraic scheme.
185
+
186
+ INPUT:
187
+
188
+ - ``i`` -- integer; index of a generating cone of the fan of the
189
+ ambient space of ``self``
190
+
191
+ OUTPUT:
192
+
193
+ - subscheme of an affine :class:`toric variety
194
+ <sage.schemes.toric.variety.ToricVariety_field>`
195
+ corresponding to the pull-back of ``self`` by the embedding
196
+ morphism of the ``i``-th :meth:`affine patch of the ambient
197
+ space
198
+ <sage.schemes.toric.variety.ToricVariety_field.affine_patch>`
199
+ of ``self``.
200
+
201
+ The result is cached, so the ``i``-th patch is always the same object
202
+ in memory.
203
+
204
+ EXAMPLES::
205
+
206
+ sage: P1xP1 = toric_varieties.P1xP1()
207
+ sage: patch1 = P1xP1.affine_patch(1)
208
+ sage: patch1.embedding_morphism()
209
+ Scheme morphism:
210
+ From: 2-d affine toric variety
211
+ To: 2-d CPR-Fano toric variety covered by 4 affine patches
212
+ Defn: Defined on coordinates by sending [t : x] to [1 : t : x : 1]
213
+ sage: P1xP1.inject_variables()
214
+ Defining s, t, x, y
215
+ sage: P1 = P1xP1.subscheme(x - y)
216
+ sage: subpatch = P1.affine_patch(1)
217
+ sage: subpatch
218
+ Closed subscheme of 2-d affine toric variety defined by:
219
+ x - 1
220
+ """
221
+ i = int(i) # implicit type checking
222
+ try:
223
+ return self._affine_patches[i]
224
+ except AttributeError:
225
+ self._affine_patches = {}
226
+ except KeyError:
227
+ pass
228
+ ambient_patch = self.ambient_space().affine_patch(i)
229
+ phi_p = ambient_patch.embedding_morphism().defining_polynomials()
230
+ patch = ambient_patch.subscheme(
231
+ [p(phi_p) for p in self.defining_polynomials()])
232
+ patch._embedding_morphism = patch.hom(phi_p, self, check=False)
233
+ self._affine_patches[i] = patch
234
+ return patch
235
+
236
+ def affine_algebraic_patch(self, cone=None, names=None):
237
+ r"""
238
+ Return the affine patch corresponding to ``cone`` as an affine
239
+ algebraic scheme.
240
+
241
+ INPUT:
242
+
243
+ - ``cone`` -- a :class:`Cone
244
+ <sage.geometry.cone.ConvexRationalPolyhedralCone>` `\sigma`
245
+ of the fan. It can be omitted for an affine toric variety,
246
+ in which case the single generating cone is used.
247
+
248
+ OUTPUT:
249
+
250
+ An :class:`affine algebraic subscheme
251
+ <sage.schemes.affine.affine_subscheme.AlgebraicScheme_subscheme_affine>`
252
+ corresponding to the patch `\mathop{Spec}(\sigma^\vee \cap M)`
253
+ associated to the cone `\sigma`.
254
+
255
+ See also :meth:`affine_patch`, which expresses the patches as
256
+ subvarieties of affine toric varieties instead.
257
+
258
+ REFERENCES:
259
+
260
+ ..
261
+
262
+ David A. Cox, "The Homogeneous Coordinate Ring of a Toric
263
+ Variety", Lemma 2.2.
264
+ :arxiv:`alg-geom/9210008v2`
265
+
266
+ EXAMPLES::
267
+
268
+ sage: P2.<x,y,z> = toric_varieties.P2()
269
+ sage: cone = P2.fan().generating_cone(0)
270
+ sage: V = P2.subscheme(x^3 + y^3 + z^3)
271
+ sage: V.affine_algebraic_patch(cone)
272
+ Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
273
+ z0^3 + z1^3 + 1
274
+
275
+ sage: # needs fpylll sage.libs.singular
276
+ sage: cone = Cone([(0,1), (2,1)])
277
+ sage: A2Z2.<x,y> = AffineToricVariety(cone)
278
+ sage: A2Z2.affine_algebraic_patch()
279
+ Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
280
+ -z0*z1 + z2^2
281
+ sage: V = A2Z2.subscheme(x^2 + y^2 - 1)
282
+ sage: patch = V.affine_algebraic_patch(); patch
283
+ Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
284
+ -z0*z1 + z2^2,
285
+ z0 + z1 - 1
286
+ sage: nbhd_patch = V.neighborhood([1,0]).affine_algebraic_patch(); nbhd_patch
287
+ Closed subscheme of Affine Space of dimension 3 over Rational Field defined by:
288
+ -z0*z1 + z2^2,
289
+ z0 + z1 - 1
290
+ sage: nbhd_patch.embedding_center()
291
+ (0, 1, 0)
292
+
293
+ Here we got two defining equations. The first one describes
294
+ the singularity of the ambient space and the second is the
295
+ pull-back of `x^2+y^2-1` ::
296
+
297
+ sage: lp = LatticePolytope([(1,0,0), (1,1,0), (1,1,1), (1,0,1), (-2,-1,-1)],
298
+ ....: lattice=ToricLattice(3))
299
+ sage: X.<x,y,u,v,t> = CPRFanoToricVariety(Delta_polar=lp)
300
+ sage: Y = X.subscheme(x*v + y*u + t)
301
+ sage: cone = Cone([(1,0,0), (1,1,0), (1,1,1), (1,0,1)])
302
+ sage: Y.affine_algebraic_patch(cone) # needs sage.libs.singular
303
+ Closed subscheme of Affine Space of dimension 4 over Rational Field defined by:
304
+ z0*z2 - z1*z3,
305
+ z1 + z3 + 1
306
+ """
307
+ from sage.modules.free_module_element import vector
308
+ from sage.misc.misc_c import prod
309
+ ambient = self.ambient_space()
310
+ fan = ambient.fan()
311
+ if cone is None:
312
+ assert ambient.is_affine()
313
+ cone = fan.generating_cone(0)
314
+ else:
315
+ cone = fan.embed(cone)
316
+ # R/I = C[sigma^dual cap M]
317
+ R, I, dualcone = ambient._semigroup_ring(cone, names)
318
+
319
+ # inhomogenize the Cox homogeneous polynomial with respect to the given cone
320
+ inhomogenize = {ambient.coordinate_ring().gen(i): 1
321
+ for i in range(fan.nrays())
322
+ if i not in cone.ambient_ray_indices()}
323
+ polynomials = [p.subs(inhomogenize) for p in self.defining_polynomials()]
324
+
325
+ # map the monomial x^{D_m} to m, see reference.
326
+ n_rho_matrix = cone.rays().matrix()
327
+
328
+ def pullback_polynomial(p):
329
+ result = R.zero()
330
+ for coefficient, monomial in p:
331
+ exponent = monomial.exponents()[0]
332
+ exponent = [exponent[i] for i in cone.ambient_ray_indices()]
333
+ exponent = vector(ZZ, exponent)
334
+ m = n_rho_matrix.solve_right(exponent)
335
+ assert all(x in ZZ for x in m), \
336
+ f'The polynomial {p} does not define a ZZ-divisor!'
337
+ m_coeffs = dualcone.Hilbert_coefficients(m)
338
+ result += coefficient * prod(R.gen(i)**m_coeffs[i]
339
+ for i in range(R.ngens()))
340
+ return result
341
+
342
+ # construct the affine algebraic scheme to use as patch
343
+ polynomials = [pullback_polynomial(_) for _ in polynomials]
344
+ from sage.schemes.affine.affine_space import AffineSpace
345
+ patch_cover = AffineSpace(R)
346
+ polynomials = list(I.gens()) + polynomials
347
+ polynomials = [x for x in polynomials if not x.is_zero()]
348
+ patch = patch_cover.subscheme(polynomials)
349
+
350
+ # TODO: If the cone is not smooth, then the coordinate_ring()
351
+ # of the affine toric variety is wrong; it should be the
352
+ # G-invariant part. So we can't construct the embedding
353
+ # morphism in that case.
354
+ if cone.is_smooth():
355
+ x = ambient.coordinate_ring().gens()
356
+ phi = []
357
+ for i in range(fan.nrays()):
358
+ if i in cone.ambient_ray_indices():
359
+ phi.append(pullback_polynomial(x[i]))
360
+ else:
361
+ phi.append(1)
362
+ patch._embedding_morphism = patch.hom(phi, self)
363
+ else:
364
+ patch._embedding_morphism = (NotImplementedError,
365
+ 'I only know how to construct embedding morphisms for smooth patches')
366
+
367
+ try:
368
+ point = self.embedding_center()
369
+ except AttributeError:
370
+ return patch
371
+
372
+ # it remains to find the preimage of point
373
+ # map m to the monomial x^{D_m}, see reference.
374
+ F = ambient.coordinate_ring().fraction_field()
375
+ image = [prod([F.gen(i)**(m * n)
376
+ for i, n in enumerate(fan.rays())])
377
+ for m in dualcone.Hilbert_basis()]
378
+ patch._embedding_center = tuple(f(list(point)) for f in image)
379
+ return patch
380
+
381
+ def _best_affine_patch(self, point):
382
+ r"""
383
+ Return the best affine patch of the ambient toric variety.
384
+
385
+ INPUT:
386
+
387
+ - ``point`` -- a point of the algebraic subscheme
388
+
389
+ OUTPUT: integer. The index of the patch. See :meth:`affine_patch`
390
+
391
+ EXAMPLES::
392
+
393
+ sage: P.<x,y,z> = toric_varieties.P2()
394
+ sage: S = P.subscheme(x + 2*y + 3*z)
395
+ sage: S._best_affine_patch(P.point([2,-3,0]))
396
+ 1
397
+ sage: S._best_affine_patch([2,-3,0])
398
+ 1
399
+ """
400
+ # TODO: this method should pick a "best" patch in the sense
401
+ # that it is numerically stable to dehomogenize, see the
402
+ # corresponding method for projective varieties.
403
+ point = list(point)
404
+ zeros = {i for i, coord in enumerate(point) if coord == 0}
405
+ for cone_idx, cone in enumerate(self.ambient_space().fan().generating_cones()):
406
+ if zeros.issubset(cone.ambient_ray_indices()):
407
+ return cone_idx
408
+ assert False, 'The point must not have been a point of the toric variety.'
409
+
410
+ def neighborhood(self, point):
411
+ r"""
412
+ Return a toric algebraic scheme isomorphic to neighborhood of
413
+ the ``point``.
414
+
415
+ INPUT:
416
+
417
+ - ``point`` -- a point of the toric algebraic scheme
418
+
419
+ OUTPUT:
420
+
421
+ An affine toric algebraic scheme (polynomial equations in an
422
+ affine toric variety) with fixed
423
+ :meth:`~AlgebraicScheme.embedding_morphism` and
424
+ :meth:`~AlgebraicScheme.embedding_center`.
425
+
426
+ EXAMPLES::
427
+
428
+ sage: # needs sage.libs.singular
429
+ sage: P.<x,y,z> = toric_varieties.P2()
430
+ sage: S = P.subscheme(x + 2*y + 3*z)
431
+ sage: s = S.point([0,-3,2]); s
432
+ [0 : -3 : 2]
433
+ sage: patch = S.neighborhood(s); patch
434
+ Closed subscheme of 2-d affine toric variety defined by:
435
+ x + 2*y + 6
436
+ sage: patch.embedding_morphism()
437
+ Scheme morphism:
438
+ From: Closed subscheme of 2-d affine toric variety defined by: x + 2*y + 6
439
+ To: Closed subscheme of 2-d CPR-Fano toric variety
440
+ covered by 3 affine patches defined by: x + 2*y + 3*z
441
+ Defn: Defined on coordinates by sending [x : y] to [-2*y - 6 : y : 2]
442
+ sage: patch.embedding_center()
443
+ [0 : -3]
444
+ sage: patch.embedding_morphism()(patch.embedding_center())
445
+ [0 : -3 : 2]
446
+
447
+ A more complicated example::
448
+
449
+ sage: # needs sage.libs.singular
450
+ sage: dP6.<x0,x1,x2,x3,x4,x5> = toric_varieties.dP6()
451
+ sage: twoP1 = dP6.subscheme(x0*x3)
452
+ sage: patch = twoP1.neighborhood([0,1,2, 3,4,5]); patch
453
+ Closed subscheme of 2-d affine toric variety defined by:
454
+ 3*x0
455
+ sage: patch.embedding_morphism()
456
+ Scheme morphism:
457
+ From: Closed subscheme of 2-d affine toric variety defined by: 3*x0
458
+ To: Closed subscheme of 2-d CPR-Fano toric variety
459
+ covered by 6 affine patches defined by: x0*x3
460
+ Defn: Defined on coordinates by sending [x0 : x1] to [0 : x1 : 2 : 3 : 4 : 5]
461
+ sage: patch.embedding_center()
462
+ [0 : 1]
463
+ sage: patch.embedding_morphism()(patch.embedding_center())
464
+ [0 : 1 : 2 : 3 : 4 : 5]
465
+ """
466
+ point = list(point)
467
+ self._check_satisfies_equations(point)
468
+ PP = self.ambient_space()
469
+ fan = PP.fan()
470
+ cone_idx = self._best_affine_patch(point)
471
+ cone = fan.generating_cone(cone_idx)
472
+
473
+ patch_cover = PP.affine_patch(cone_idx)
474
+ R = patch_cover.coordinate_ring()
475
+ phi = []
476
+ point_preimage = []
477
+ for i in range(fan.nrays()):
478
+ try:
479
+ ray_index = cone.ambient_ray_indices().index(i)
480
+ phi.append(R.gen(ray_index))
481
+ point_preimage.append(point[i])
482
+ except ValueError:
483
+ phi.append(point[i])
484
+ pullback_polys = [f(phi) for f in self.defining_polynomials()]
485
+ patch = patch_cover.subscheme(pullback_polys)
486
+ S = patch.coordinate_ring()
487
+ phi_reduced = [S(t) for t in phi]
488
+
489
+ patch._embedding_center = patch(point_preimage)
490
+ patch._embedding_morphism = patch.hom(phi_reduced, self)
491
+ return patch
492
+
493
+ def dimension(self):
494
+ """
495
+ Return the dimension of ``self``.
496
+
497
+ OUTPUT: integer; if ``self`` is empty, `-1` is returned
498
+
499
+ EXAMPLES::
500
+
501
+ sage: # needs sage.libs.singular
502
+ sage: P1xP1 = toric_varieties.P1xP1()
503
+ sage: P1xP1.inject_variables()
504
+ Defining s, t, x, y
505
+ sage: P1 = P1xP1.subscheme(s - t)
506
+ sage: P1.dimension()
507
+ 1
508
+ sage: P1xP1.subscheme([s - t, (s-t)^2]).dimension()
509
+ 1
510
+ sage: P1xP1.subscheme([s, t]).dimension()
511
+ -1
512
+ """
513
+ if '_dimension' in self.__dict__:
514
+ return self._dimension
515
+ npatches = self.ambient_space().fan().ngenerating_cones()
516
+ dims = [self.affine_patch(i).dimension() for i in range(npatches)]
517
+ self._dimension = max(dims)
518
+ return self._dimension
519
+
520
+ def is_smooth(self, point=None):
521
+ r"""
522
+ Test whether the algebraic subscheme is smooth.
523
+
524
+ INPUT:
525
+
526
+ - ``point`` -- a point or ``None`` (default); the point to
527
+ test smoothness at
528
+
529
+ OUTPUT:
530
+
531
+ boolean; if no point was specified, returns whether the
532
+ algebraic subscheme is smooth everywhere. Otherwise,
533
+ smoothness at the specified point is tested.
534
+
535
+ EXAMPLES::
536
+
537
+ sage: # needs sage.libs.singular
538
+ sage: P2.<x,y,z> = toric_varieties.P2()
539
+ sage: cuspidal_curve = P2.subscheme([y^2*z - x^3])
540
+ sage: cuspidal_curve
541
+ Closed subscheme of 2-d CPR-Fano toric variety covered by 3 affine patches defined by:
542
+ -x^3 + y^2*z
543
+ sage: cuspidal_curve.is_smooth([1,1,1])
544
+ True
545
+ sage: cuspidal_curve.is_smooth([0,0,1])
546
+ False
547
+ sage: cuspidal_curve.is_smooth()
548
+ False
549
+
550
+ Any sufficiently generic cubic hypersurface is smooth::
551
+
552
+ sage: P2.subscheme([y^2*z-x^3+z^3+1/10*x*y*z]).is_smooth() # needs sage.libs.singular
553
+ True
554
+
555
+ A more complicated example::
556
+
557
+ sage: # needs sage.libs.singular
558
+ sage: dP6.<x0,x1,x2,x3,x4,x5> = toric_varieties.dP6()
559
+ sage: disjointP1s = dP6.subscheme(x0*x3)
560
+ sage: disjointP1s.is_smooth()
561
+ True
562
+ sage: intersectingP1s = dP6.subscheme(x0*x1)
563
+ sage: intersectingP1s.is_smooth()
564
+ False
565
+
566
+ A smooth hypersurface in a compact singular toric variety::
567
+
568
+ sage: # needs sage.libs.singular
569
+ sage: lp = LatticePolytope([(1,0,0), (1,1,0), (1,1,1), (1,0,1), (-2,-1,-1)],
570
+ ....: lattice=ToricLattice(3))
571
+ sage: X.<x,y,u,v,t> = CPRFanoToricVariety(Delta_polar=lp)
572
+ sage: Y = X.subscheme(x*v + y*u + t)
573
+ sage: cone = Cone([(1,0,0), (1,1,0), (1,1,1), (1,0,1)])
574
+ sage: Y.is_smooth()
575
+ True
576
+ """
577
+ if point is not None:
578
+ toric_patch = self.neighborhood(point)
579
+ return toric_patch.is_smooth(toric_patch.embedding_center())
580
+
581
+ # testing smoothness everywhere tends to be expensive
582
+ if '_smooth' in self.__dict__:
583
+ return self._smooth
584
+ npatches = self.ambient_space().fan().ngenerating_cones()
585
+ self._smooth = all(self.affine_patch(i).is_smooth()
586
+ for i in range(npatches))
587
+ return self._smooth
588
+
589
+ def is_nondegenerate(self):
590
+ r"""
591
+ Check if ``self`` is nondegenerate.
592
+
593
+ OUTPUT:
594
+
595
+ Whether the variety is nondegenerate, that is, the intersection
596
+ with every open torus orbit is smooth and transversal.
597
+
598
+ EXAMPLES::
599
+
600
+ sage: P2.<x,y,z> = toric_varieties.P2()
601
+ sage: P2.subscheme([x^3 + y^3 + z^3]).is_nondegenerate()
602
+ True
603
+ sage: P2.subscheme([x*y*z]).is_nondegenerate()
604
+ False
605
+ sage: X = P2.subscheme([(x-y)^2*(x+y) + x*y*z + z^3])
606
+ sage: X.is_smooth()
607
+ True
608
+ sage: X.is_nondegenerate()
609
+ False
610
+
611
+ A K3 surface in `\mathbf{P}^1 \times \mathbf{P}^1 \times \mathbf{P}^1`::
612
+
613
+ sage: diamond = lattice_polytope.cross_polytope(3)
614
+ sage: fan = FaceFan(diamond)
615
+ sage: P1xP1xP1 = ToricVariety(fan)
616
+ sage: z0, z1, z2, z3, z4, z5 = P1xP1xP1.gens()
617
+ sage: t = 5
618
+ sage: F = z0^2*z1^2*z2^2 + z1^2*z2^2*z3^2 + z0^2*z2^2*z4^2\
619
+ ....: + z2^2*z3^2*z4^2 + t*z0*z1*z2*z3*z4*z5 + z0^2*z1^2*z5^2\
620
+ ....: + z1^2*z3^2*z5^2 + z0^2*z4^2*z5^2 + z3^2*z4^2*z5^2
621
+ sage: X = P1xP1xP1.subscheme([F])
622
+ sage: X.is_smooth()
623
+ True
624
+ sage: X.is_nondegenerate()
625
+ False
626
+
627
+ Taking a random change of variables breaks the symmetry, but
628
+ makes the surface nondegenerate::
629
+
630
+ sage: F1 = F.subs(z0=1*z0 + 1*z3, z3=1*z0 + 2*z3,
631
+ ....: z1=-2*z1 + -1*z4, z4=1*z1 + 2*z4,
632
+ ....: z2=-3*z2 + -1*z5, z5=-3*z2 + 2*z5)
633
+ sage: Y = P1xP1xP1.subscheme([F1])
634
+ sage: Y.is_smooth()
635
+ True
636
+ sage: Y.is_nondegenerate()
637
+ True
638
+
639
+ This example is from Hamm, :arxiv:`1106.1826v1`. It addresses
640
+ an issue raised at :issue:`15239`::
641
+
642
+ sage: X = toric_varieties.WP([1,4,2,3], names='z0 z1 z2 z3')
643
+ sage: X.inject_variables()
644
+ Defining z0, z1, z2, z3
645
+ sage: g0 = z1^3 + z2^6 + z3^4
646
+ sage: g = g0 - 2*z3^2*z0^6 + z2*z0^10 + z0^12
647
+ sage: Y = X.subscheme([g])
648
+ sage: Y.is_nondegenerate()
649
+ False
650
+
651
+ It handles nonzero characteristic::
652
+
653
+ sage: P2.<x,y,z> = toric_varieties.P2()
654
+ sage: f = x^5 + 2*x*y^4 + y^5 - 2*y^3*z^2 + x*z^4 - 2*z^5
655
+ sage: P2.change_ring(GF(5)).subscheme([f]).is_nondegenerate()
656
+ True
657
+ sage: P2.change_ring(GF(7)).subscheme([f]).is_nondegenerate()
658
+ False
659
+
660
+ TESTS:
661
+
662
+ Some corner cases discussed at :issue:`15239`::
663
+
664
+ sage: P2.<x,y,z> = toric_varieties.P2()
665
+ sage: P2.subscheme([]).is_nondegenerate()
666
+ False
667
+ sage: P2.subscheme([x]).is_nondegenerate()
668
+ False
669
+ """
670
+ X = self.ambient_space()
671
+ fan = X.fan()
672
+ SR = X.Stanley_Reisner_ideal()
673
+ from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
674
+ R = PolynomialRing(X.base_ring(), fan.nrays() + SR.ngens(), 't')
675
+ slack = R.gens()[fan.nrays():]
676
+ SR = SR.change_ring(R)
677
+
678
+ def restrict(cone):
679
+ patch = {}
680
+ divide = {}
681
+ for i in cone.ambient_ray_indices():
682
+ patch[R.gen(i)] = R.zero() # restrict to torus orbit
683
+ # divide out highest power of R.gen(i)
684
+ divide[R.gen(i)] = R.one()
685
+ ideal = self.defining_ideal().change_ring(R)
686
+ ideal = ideal.subs(patch)
687
+ mat = jacobian(ideal.gens(), R.gens()[:fan.nrays()])
688
+ minors = mat.minors(self.codimension())
689
+ minors = tuple([ideal.reduce(m) for m in minors])
690
+ Jac_patch = R.ideal(ideal.gens() + minors)
691
+ SR_patch = R.ideal([monomial * slack[i] - R.one()
692
+ for i, monomial in
693
+ enumerate(SR.subs(divide).gens())])
694
+ return ideal, Jac_patch + SR_patch
695
+
696
+ for dim in range(fan.dim() + 1):
697
+ for cone in fan(dim):
698
+ ideal1, ideal2 = restrict(cone)
699
+ if ideal1.is_zero() or ideal2.dimension() != -1:
700
+ return False
701
+
702
+ return True
703
+
704
+ def is_schon(self):
705
+ r"""
706
+ Check if ``self`` is schon (nondegenerate).
707
+
708
+ See :meth:`is_nondegenerate` for further documentation.
709
+
710
+ EXAMPLES::
711
+
712
+ sage: # needs sage.libs.singular
713
+ sage: P2.<x,y,z> = toric_varieties.P2()
714
+ sage: X = P2.subscheme([(x-y)^2*(x+y) + x*y*z + z^3])
715
+ sage: X.is_smooth()
716
+ True
717
+ sage: X.is_schon()
718
+ False
719
+ """
720
+ return self.is_nondegenerate()
721
+
722
+
723
+ class AlgebraicScheme_subscheme_affine_toric(AlgebraicScheme_subscheme_toric):
724
+ r"""
725
+ Construct an algebraic subscheme of an affine toric variety.
726
+
727
+ .. WARNING::
728
+
729
+ You should not create objects of this class directly. The preferred
730
+ method to construct such subschemes is to use
731
+ :meth:`~ToricVariety_field.subscheme` method of
732
+ :class:`toric varieties <ToricVariety_field>`.
733
+
734
+ INPUT:
735
+
736
+ - ``toric_variety`` -- ambient :class:`affine toric variety
737
+ <ToricVariety_field>`
738
+
739
+ - ``polynomials`` -- single polynomial, list, or ideal of defining
740
+ polynomials in the coordinate ring of ``toric_variety``
741
+
742
+ OUTPUT:
743
+
744
+ A :class:`algebraic subscheme of an affine toric variety
745
+ <AlgebraicScheme_subscheme_affine_toric>`.
746
+
747
+ TESTS::
748
+
749
+ sage: P1xP1 = toric_varieties.P1xP1()
750
+ sage: P1xP1.inject_variables()
751
+ Defining s, t, x, y
752
+ sage: import sage.schemes.toric.toric_subscheme as SCM
753
+ sage: X = SCM.AlgebraicScheme_subscheme_toric(
754
+ ....: P1xP1, [x*s + y*t, x^3 + y^3])
755
+ sage: X
756
+ Closed subscheme of 2-d CPR-Fano toric variety
757
+ covered by 4 affine patches defined by:
758
+ s*x + t*y,
759
+ x^3 + y^3
760
+
761
+ A better way to construct the same scheme as above::
762
+
763
+ sage: P1xP1.subscheme([x*s + y*t, x^3 + y^3])
764
+ Closed subscheme of 2-d CPR-Fano toric variety
765
+ covered by 4 affine patches defined by:
766
+ s*x + t*y,
767
+ x^3 + y^3
768
+ """
769
+
770
+ def __init__(self, toric_variety, polynomials):
771
+ r"""
772
+ See :class:`AlgebraicScheme_subscheme_toric` for documentation.
773
+
774
+ TESTS::
775
+
776
+ sage: P1xP1 = toric_varieties.P1xP1()
777
+ sage: P1xP1.inject_variables()
778
+ Defining s, t, x, y
779
+ sage: import sage.schemes.toric.toric_subscheme as SCM
780
+ sage: X = SCM.AlgebraicScheme_subscheme_toric(
781
+ ....: P1xP1, [x*s + y*t, x^3 + y^3])
782
+ sage: X
783
+ Closed subscheme of 2-d CPR-Fano toric variety
784
+ covered by 4 affine patches defined by:
785
+ s*x + t*y,
786
+ x^3 + y^3
787
+ """
788
+ assert toric_variety.is_affine(), 'The toric variety must be affine!'
789
+ # Just to make sure that keyword arguments will be passed correctly
790
+ super().__init__(toric_variety, polynomials)
791
+
792
+ def dimension(self):
793
+ """
794
+ Return the dimension of ``self``.
795
+
796
+ OUTPUT: integer
797
+
798
+ EXAMPLES::
799
+
800
+ sage: # needs sage.libs.singular
801
+ sage: P1xP1.<s0,s1,t0,t1> = toric_varieties.P1xP1()
802
+ sage: P1 = P1xP1.subscheme(s0 - s1)
803
+ sage: P1.dimension()
804
+ 1
805
+
806
+ A more complicated example where the ambient toric variety is
807
+ not smooth::
808
+
809
+ sage: # needs sage.libs.singular
810
+ sage: X.<x,y> = toric_varieties.A2_Z2()
811
+ sage: X.is_smooth()
812
+ False
813
+ sage: Y = X.subscheme([x*y, x^2]); Y
814
+ Closed subscheme of 2-d affine toric variety defined by:
815
+ x*y,
816
+ x^2
817
+ sage: Y.dimension()
818
+ 1
819
+ """
820
+ if '_dimension' in self.__dict__:
821
+ return self._dimension
822
+
823
+ if self.ambient_space().is_smooth():
824
+ self._dimension = self.defining_ideal().dimension()
825
+ else:
826
+ self._dimension = self.affine_algebraic_patch().dimension()
827
+ return self._dimension
828
+
829
+ def is_smooth(self, point=None):
830
+ r"""
831
+ Test whether the algebraic subscheme is smooth.
832
+
833
+ INPUT:
834
+
835
+ - ``point`` -- a point or ``None`` (default); the point to
836
+ test smoothness at
837
+
838
+ OUTPUT:
839
+
840
+ boolean; if no point was specified, returns whether the
841
+ algebraic subscheme is smooth everywhere. Otherwise,
842
+ smoothness at the specified point is tested.
843
+
844
+ EXAMPLES::
845
+
846
+ sage: # needs sage.libs.singular
847
+ sage: A2.<x,y> = toric_varieties.A2()
848
+ sage: cuspidal_curve = A2.subscheme([y^2 - x^3])
849
+ sage: cuspidal_curve
850
+ Closed subscheme of 2-d affine toric variety defined by:
851
+ -x^3 + y^2
852
+ sage: cuspidal_curve.is_smooth([1,1])
853
+ True
854
+ sage: cuspidal_curve.is_smooth([0,0])
855
+ False
856
+ sage: cuspidal_curve.is_smooth()
857
+ False
858
+ sage: circle = A2.subscheme(x^2 + y^2 - 1)
859
+ sage: circle.is_smooth([1,0])
860
+ True
861
+ sage: circle.is_smooth()
862
+ True
863
+
864
+ A more complicated example where the ambient toric variety is
865
+ not smooth::
866
+
867
+ sage: # needs sage.libs.singular
868
+ sage: X.<x,y> = toric_varieties.A2_Z2() # 2-d affine space mod Z/2
869
+ sage: X.is_smooth()
870
+ False
871
+ sage: Y = X.subscheme([x*y, x^2]) # (twice the x=0 curve) mod Z/2
872
+ sage: Y
873
+ Closed subscheme of 2-d affine toric variety defined by:
874
+ x*y,
875
+ x^2
876
+ sage: Y.dimension() # Y is a Weil divisor but not Cartier
877
+ 1
878
+ sage: Y.is_smooth()
879
+ True
880
+ sage: Y.is_smooth([0,0])
881
+ True
882
+ """
883
+ if point is not None:
884
+ self._check_satisfies_equations(point)
885
+ if self.ambient_space().is_smooth():
886
+ R = self.ambient_space().coordinate_ring()
887
+ point_subs = dict(zip(R.gens(), point))
888
+ Jac = self.Jacobian().subs(point_subs)
889
+ return not Jac.is_zero()
890
+ else:
891
+ self._embedding_center = self.point(point)
892
+ affine = self.affine_algebraic_patch()
893
+ return affine.is_smooth(affine.embedding_center())
894
+
895
+ # testing smoothness everywhere tends to be expensive
896
+ if '_smooth' in self.__dict__:
897
+ return self._smooth
898
+
899
+ if self.ambient_space().is_smooth():
900
+ sing_dim = self.Jacobian().dimension()
901
+ self._smooth = (sing_dim == -1)
902
+ else:
903
+ self._smooth = self.affine_algebraic_patch().is_smooth()
904
+
905
+ return self._smooth