passagemath-polyhedra 10.6.31rc3__cp314-cp314-musllinux_1_2_aarch64.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.

Potentially problematic release.


This version of passagemath-polyhedra might be problematic. Click here for more details.

Files changed (208) hide show
  1. passagemath_polyhedra-10.6.31rc3.dist-info/METADATA +367 -0
  2. passagemath_polyhedra-10.6.31rc3.dist-info/METADATA.bak +369 -0
  3. passagemath_polyhedra-10.6.31rc3.dist-info/RECORD +208 -0
  4. passagemath_polyhedra-10.6.31rc3.dist-info/WHEEL +5 -0
  5. passagemath_polyhedra-10.6.31rc3.dist-info/top_level.txt +2 -0
  6. passagemath_polyhedra.libs/libgcc_s-2d945d6c.so.1 +0 -0
  7. passagemath_polyhedra.libs/libgmp-28992bcb.so.10.5.0 +0 -0
  8. passagemath_polyhedra.libs/libgomp-1ede7ee7.so.1.0.0 +0 -0
  9. passagemath_polyhedra.libs/libstdc++-85f2cd6d.so.6.0.33 +0 -0
  10. sage/all__sagemath_polyhedra.py +50 -0
  11. sage/game_theory/all.py +8 -0
  12. sage/game_theory/catalog.py +6 -0
  13. sage/game_theory/catalog_normal_form_games.py +923 -0
  14. sage/game_theory/cooperative_game.py +844 -0
  15. sage/game_theory/matching_game.py +1181 -0
  16. sage/game_theory/normal_form_game.py +2697 -0
  17. sage/game_theory/parser.py +275 -0
  18. sage/geometry/all__sagemath_polyhedra.py +22 -0
  19. sage/geometry/cone.py +6940 -0
  20. sage/geometry/cone_catalog.py +847 -0
  21. sage/geometry/cone_critical_angles.py +1027 -0
  22. sage/geometry/convex_set.py +1119 -0
  23. sage/geometry/fan.py +3743 -0
  24. sage/geometry/fan_isomorphism.py +389 -0
  25. sage/geometry/fan_morphism.py +1884 -0
  26. sage/geometry/hasse_diagram.py +202 -0
  27. sage/geometry/hyperplane_arrangement/affine_subspace.py +390 -0
  28. sage/geometry/hyperplane_arrangement/all.py +1 -0
  29. sage/geometry/hyperplane_arrangement/arrangement.py +3895 -0
  30. sage/geometry/hyperplane_arrangement/check_freeness.py +145 -0
  31. sage/geometry/hyperplane_arrangement/hyperplane.py +773 -0
  32. sage/geometry/hyperplane_arrangement/library.py +825 -0
  33. sage/geometry/hyperplane_arrangement/ordered_arrangement.py +642 -0
  34. sage/geometry/hyperplane_arrangement/plot.py +520 -0
  35. sage/geometry/integral_points.py +35 -0
  36. sage/geometry/integral_points_generic_dense.cpython-314-aarch64-linux-musl.so +0 -0
  37. sage/geometry/integral_points_generic_dense.pyx +7 -0
  38. sage/geometry/lattice_polytope.py +5894 -0
  39. sage/geometry/linear_expression.py +773 -0
  40. sage/geometry/newton_polygon.py +767 -0
  41. sage/geometry/point_collection.cpython-314-aarch64-linux-musl.so +0 -0
  42. sage/geometry/point_collection.pyx +1008 -0
  43. sage/geometry/polyhedral_complex.py +2616 -0
  44. sage/geometry/polyhedron/all.py +8 -0
  45. sage/geometry/polyhedron/backend_cdd.py +460 -0
  46. sage/geometry/polyhedron/backend_cdd_rdf.py +231 -0
  47. sage/geometry/polyhedron/backend_field.py +347 -0
  48. sage/geometry/polyhedron/backend_normaliz.py +2503 -0
  49. sage/geometry/polyhedron/backend_number_field.py +168 -0
  50. sage/geometry/polyhedron/backend_polymake.py +765 -0
  51. sage/geometry/polyhedron/backend_ppl.py +582 -0
  52. sage/geometry/polyhedron/base.py +1206 -0
  53. sage/geometry/polyhedron/base0.py +1444 -0
  54. sage/geometry/polyhedron/base1.py +886 -0
  55. sage/geometry/polyhedron/base2.py +812 -0
  56. sage/geometry/polyhedron/base3.py +1845 -0
  57. sage/geometry/polyhedron/base4.py +1262 -0
  58. sage/geometry/polyhedron/base5.py +2700 -0
  59. sage/geometry/polyhedron/base6.py +1741 -0
  60. sage/geometry/polyhedron/base7.py +997 -0
  61. sage/geometry/polyhedron/base_QQ.py +1258 -0
  62. sage/geometry/polyhedron/base_RDF.py +98 -0
  63. sage/geometry/polyhedron/base_ZZ.py +934 -0
  64. sage/geometry/polyhedron/base_mutable.py +215 -0
  65. sage/geometry/polyhedron/base_number_field.py +122 -0
  66. sage/geometry/polyhedron/cdd_file_format.py +155 -0
  67. sage/geometry/polyhedron/combinatorial_polyhedron/all.py +1 -0
  68. sage/geometry/polyhedron/combinatorial_polyhedron/base.cpython-314-aarch64-linux-musl.so +0 -0
  69. sage/geometry/polyhedron/combinatorial_polyhedron/base.pxd +76 -0
  70. sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +3859 -0
  71. sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.cpython-314-aarch64-linux-musl.so +0 -0
  72. sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pxd +39 -0
  73. sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx +1038 -0
  74. sage/geometry/polyhedron/combinatorial_polyhedron/conversions.cpython-314-aarch64-linux-musl.so +0 -0
  75. sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pxd +9 -0
  76. sage/geometry/polyhedron/combinatorial_polyhedron/conversions.pyx +501 -0
  77. sage/geometry/polyhedron/combinatorial_polyhedron/face_data_structure.pxd +207 -0
  78. sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.cpython-314-aarch64-linux-musl.so +0 -0
  79. sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pxd +102 -0
  80. sage/geometry/polyhedron/combinatorial_polyhedron/face_iterator.pyx +2274 -0
  81. sage/geometry/polyhedron/combinatorial_polyhedron/face_list_data_structure.cpython-314-aarch64-linux-musl.so +0 -0
  82. sage/geometry/polyhedron/combinatorial_polyhedron/face_list_data_structure.pxd +370 -0
  83. sage/geometry/polyhedron/combinatorial_polyhedron/face_list_data_structure.pyx +84 -0
  84. sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.cpython-314-aarch64-linux-musl.so +0 -0
  85. sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pxd +31 -0
  86. sage/geometry/polyhedron/combinatorial_polyhedron/list_of_faces.pyx +587 -0
  87. sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.cpython-314-aarch64-linux-musl.so +0 -0
  88. sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pxd +52 -0
  89. sage/geometry/polyhedron/combinatorial_polyhedron/polyhedron_face_lattice.pyx +560 -0
  90. sage/geometry/polyhedron/constructor.py +773 -0
  91. sage/geometry/polyhedron/double_description.py +753 -0
  92. sage/geometry/polyhedron/double_description_inhomogeneous.py +564 -0
  93. sage/geometry/polyhedron/face.py +1060 -0
  94. sage/geometry/polyhedron/generating_function.py +1810 -0
  95. sage/geometry/polyhedron/lattice_euclidean_group_element.py +178 -0
  96. sage/geometry/polyhedron/library.py +3502 -0
  97. sage/geometry/polyhedron/misc.py +121 -0
  98. sage/geometry/polyhedron/modules/all.py +1 -0
  99. sage/geometry/polyhedron/modules/formal_polyhedra_module.py +155 -0
  100. sage/geometry/polyhedron/palp_database.py +447 -0
  101. sage/geometry/polyhedron/parent.py +1279 -0
  102. sage/geometry/polyhedron/plot.py +1986 -0
  103. sage/geometry/polyhedron/ppl_lattice_polygon.py +556 -0
  104. sage/geometry/polyhedron/ppl_lattice_polytope.py +1257 -0
  105. sage/geometry/polyhedron/representation.py +1723 -0
  106. sage/geometry/pseudolines.py +515 -0
  107. sage/geometry/relative_interior.py +445 -0
  108. sage/geometry/toric_plotter.py +1103 -0
  109. sage/geometry/triangulation/all.py +2 -0
  110. sage/geometry/triangulation/base.cpython-314-aarch64-linux-musl.so +0 -0
  111. sage/geometry/triangulation/base.pyx +963 -0
  112. sage/geometry/triangulation/data.h +147 -0
  113. sage/geometry/triangulation/data.pxd +4 -0
  114. sage/geometry/triangulation/element.py +914 -0
  115. sage/geometry/triangulation/functions.h +10 -0
  116. sage/geometry/triangulation/functions.pxd +4 -0
  117. sage/geometry/triangulation/point_configuration.py +2256 -0
  118. sage/geometry/triangulation/triangulations.h +49 -0
  119. sage/geometry/triangulation/triangulations.pxd +7 -0
  120. sage/geometry/voronoi_diagram.py +319 -0
  121. sage/interfaces/all__sagemath_polyhedra.py +1 -0
  122. sage/interfaces/polymake.py +2028 -0
  123. sage/numerical/all.py +13 -0
  124. sage/numerical/all__sagemath_polyhedra.py +11 -0
  125. sage/numerical/backends/all.py +1 -0
  126. sage/numerical/backends/all__sagemath_polyhedra.py +1 -0
  127. sage/numerical/backends/cvxopt_backend.cpython-314-aarch64-linux-musl.so +0 -0
  128. sage/numerical/backends/cvxopt_backend.pyx +1006 -0
  129. sage/numerical/backends/cvxopt_backend_test.py +19 -0
  130. sage/numerical/backends/cvxopt_sdp_backend.cpython-314-aarch64-linux-musl.so +0 -0
  131. sage/numerical/backends/cvxopt_sdp_backend.pyx +382 -0
  132. sage/numerical/backends/cvxpy_backend.cpython-314-aarch64-linux-musl.so +0 -0
  133. sage/numerical/backends/cvxpy_backend.pxd +41 -0
  134. sage/numerical/backends/cvxpy_backend.pyx +934 -0
  135. sage/numerical/backends/cvxpy_backend_test.py +13 -0
  136. sage/numerical/backends/generic_backend_test.py +24 -0
  137. sage/numerical/backends/interactivelp_backend.cpython-314-aarch64-linux-musl.so +0 -0
  138. sage/numerical/backends/interactivelp_backend.pxd +36 -0
  139. sage/numerical/backends/interactivelp_backend.pyx +1231 -0
  140. sage/numerical/backends/interactivelp_backend_test.py +12 -0
  141. sage/numerical/backends/logging_backend.py +391 -0
  142. sage/numerical/backends/matrix_sdp_backend.cpython-314-aarch64-linux-musl.so +0 -0
  143. sage/numerical/backends/matrix_sdp_backend.pxd +15 -0
  144. sage/numerical/backends/matrix_sdp_backend.pyx +478 -0
  145. sage/numerical/backends/ppl_backend.cpython-314-aarch64-linux-musl.so +0 -0
  146. sage/numerical/backends/ppl_backend.pyx +1126 -0
  147. sage/numerical/backends/ppl_backend_test.py +13 -0
  148. sage/numerical/backends/scip_backend.cpython-314-aarch64-linux-musl.so +0 -0
  149. sage/numerical/backends/scip_backend.pxd +22 -0
  150. sage/numerical/backends/scip_backend.pyx +1289 -0
  151. sage/numerical/backends/scip_backend_test.py +13 -0
  152. sage/numerical/interactive_simplex_method.py +5338 -0
  153. sage/numerical/knapsack.py +665 -0
  154. sage/numerical/linear_functions.cpython-314-aarch64-linux-musl.so +0 -0
  155. sage/numerical/linear_functions.pxd +31 -0
  156. sage/numerical/linear_functions.pyx +1648 -0
  157. sage/numerical/linear_tensor.py +470 -0
  158. sage/numerical/linear_tensor_constraints.py +448 -0
  159. sage/numerical/linear_tensor_element.cpython-314-aarch64-linux-musl.so +0 -0
  160. sage/numerical/linear_tensor_element.pxd +6 -0
  161. sage/numerical/linear_tensor_element.pyx +459 -0
  162. sage/numerical/mip.cpython-314-aarch64-linux-musl.so +0 -0
  163. sage/numerical/mip.pxd +40 -0
  164. sage/numerical/mip.pyx +3667 -0
  165. sage/numerical/sdp.cpython-314-aarch64-linux-musl.so +0 -0
  166. sage/numerical/sdp.pxd +39 -0
  167. sage/numerical/sdp.pyx +1433 -0
  168. sage/rings/all__sagemath_polyhedra.py +3 -0
  169. sage/rings/polynomial/all__sagemath_polyhedra.py +10 -0
  170. sage/rings/polynomial/omega.py +982 -0
  171. sage/schemes/all__sagemath_polyhedra.py +2 -0
  172. sage/schemes/toric/all.py +10 -0
  173. sage/schemes/toric/chow_group.py +1248 -0
  174. sage/schemes/toric/divisor.py +2082 -0
  175. sage/schemes/toric/divisor_class.cpython-314-aarch64-linux-musl.so +0 -0
  176. sage/schemes/toric/divisor_class.pyx +322 -0
  177. sage/schemes/toric/fano_variety.py +1606 -0
  178. sage/schemes/toric/homset.py +650 -0
  179. sage/schemes/toric/ideal.py +451 -0
  180. sage/schemes/toric/library.py +1322 -0
  181. sage/schemes/toric/morphism.py +1958 -0
  182. sage/schemes/toric/points.py +1032 -0
  183. sage/schemes/toric/sheaf/all.py +1 -0
  184. sage/schemes/toric/sheaf/constructor.py +302 -0
  185. sage/schemes/toric/sheaf/klyachko.py +921 -0
  186. sage/schemes/toric/toric_subscheme.py +905 -0
  187. sage/schemes/toric/variety.py +3460 -0
  188. sage/schemes/toric/weierstrass.py +1078 -0
  189. sage/schemes/toric/weierstrass_covering.py +457 -0
  190. sage/schemes/toric/weierstrass_higher.py +288 -0
  191. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.info +10 -0
  192. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.v03 +0 -0
  193. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.v04 +0 -0
  194. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.v05 +1 -0
  195. sage_wheels/share/reflexive_polytopes/Full2d/zzdb.v06 +1 -0
  196. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.info +22 -0
  197. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v04 +0 -0
  198. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v05 +0 -0
  199. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v06 +0 -0
  200. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v07 +0 -0
  201. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v08 +0 -0
  202. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v09 +0 -0
  203. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v10 +0 -0
  204. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v11 +1 -0
  205. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v12 +1 -0
  206. sage_wheels/share/reflexive_polytopes/Full3d/zzdb.v13 +1 -0
  207. sage_wheels/share/reflexive_polytopes/reflexive_polytopes_2d +80 -0
  208. sage_wheels/share/reflexive_polytopes/reflexive_polytopes_3d +37977 -0
@@ -0,0 +1,1248 @@
1
+ # sage_setup: distribution = sagemath-polyhedra
2
+ # sage.doctest: needs palp sage.geometry.polyhedron sage.graphs
3
+ r"""
4
+ The Chow group of a toric variety
5
+
6
+ In general, the Chow group is an algebraic version of a homology
7
+ theory. That is, the objects are formal linear combinations of
8
+ submanifolds modulo relations. In particular, the objects of the Chow
9
+ group are formal linear combinations of algebraic subvarieties and the
10
+ equivalence relation is rational equivalence. There is no relative
11
+ version of the Chow group, so it is not a generalized homology
12
+ theory.
13
+
14
+ The Chow groups of smooth or mildly singular toric varieties are
15
+ almost the same as the homology groups:
16
+
17
+ * For smooth toric varieties, `A_{k}(X) = H_{2k}(X,\ZZ)`. While they
18
+ are the same, using the cohomology ring instead of the Chow group
19
+ will be much faster! The cohomology ring does not try to keep track
20
+ of torsion and uses Groebner bases to encode the cup product.
21
+
22
+ * For simplicial toric varieties, `A_{k}(X)\otimes \QQ =
23
+ H_{2k}(X,\QQ)`.
24
+
25
+ Note that in these cases the odd-dimensional (co)homology groups
26
+ vanish. But for sufficiently singular toric varieties the Chow group
27
+ differs from the homology groups (and the odd-dimensional homology
28
+ groups no longer vanish). For singular varieties the Chow group is
29
+ much easier to compute than the (co)homology groups.
30
+
31
+ The toric Chow group of a toric variety is the Chow group generated by
32
+ the toric subvarieties, that is, closures of orbits under the torus
33
+ action. These are in one-to-one correspondence with the cones of the
34
+ fan and, therefore, the toric Chow group is a quotient of the free
35
+ Abelian group generated by the cones. In particular, the toric Chow
36
+ group has finite rank. One can show [FMSS1995]_ that the toric Chow
37
+ groups equal the "full" Chow group of a toric variety, so there is no
38
+ need to distinguish these in the following.
39
+
40
+ AUTHORS:
41
+
42
+ - Volker Braun (2010-08-09): Initial version
43
+
44
+ REFERENCES:
45
+
46
+ - :wikipedia:`Chow_ring`
47
+
48
+ - [FMSS1995]_
49
+
50
+ - [Ful1993]_, Chapter 5.1, "Chow Groups"
51
+
52
+ EXAMPLES::
53
+
54
+ sage: X = toric_varieties.Cube_deformation(7)
55
+ sage: X.is_smooth()
56
+ False
57
+ sage: X.is_orbifold()
58
+ False
59
+ sage: A = X.Chow_group()
60
+ sage: A.degree()
61
+ (Z, C7, C2 x C2 x Z^5, Z)
62
+ sage: A.degree(2).ngens()
63
+ 7
64
+ sage: a = sum( A.gen(i) * (i+1) for i in range(A.ngens()) ) # an element of A
65
+ sage: a # long time (2s on sage.math, 2011)
66
+ ( 9 | 1 mod 7 | 1 mod 2, 0 mod 2, 4, 5, 6, 7, 8 | 3 )
67
+
68
+ The Chow group elements are printed as ``( a0 | a1 mod 7 | a2 mod 2,
69
+ a3 mod 2, a4, a5, a6, a7, a8 | a9 )``, which denotes the element of
70
+ the Chow group in the same basis as ``A.degree()``. The ``|``
71
+ separates individual degrees, so the example means:
72
+
73
+ * The degree-0 part is `3 \in \ZZ`.
74
+
75
+ * The degree-1 part is `1 \in \ZZ_7`.
76
+
77
+ * The torsion of the degree-2 Chow group is `(0, 1) \in
78
+ \ZZ_2\oplus\ZZ_2`.
79
+
80
+ * The free part of the degree-2 Chow group is `(4, 5, 6, 7, 8) \in
81
+ \ZZ^5`.
82
+
83
+ * The degree-3 part is `9 \in \ZZ`.
84
+
85
+ Note that the generators ``A.gens()`` are not sorted in any way. In
86
+ fact, they may be of mixed degree. Use ``A.gens(degree=d)`` to obtain
87
+ the generators in a fixed degree ``d``. See
88
+ :meth:`ChowGroup_class.gens` for more details.
89
+
90
+ Cones of toric varieties can determine their own Chow cycle::
91
+
92
+ sage: A = X.Chow_group(); A
93
+ Chow group of 3-d toric variety covered by 6 affine patches
94
+ sage: cone = X.fan(dim=2)[3]; cone
95
+ 2-d cone of Rational polyhedral fan in 3-d lattice N
96
+ sage: A_cone = A(cone); A_cone
97
+ ( 0 | 6 mod 7 | 0 mod 2, 0 mod 2, 0, 0, 0, 0, 0 | 0 )
98
+ sage: A_cone.degree()
99
+ 1
100
+ sage: 2 * A_cone
101
+ ( 0 | 5 mod 7 | 0 mod 2, 0 mod 2, 0, 0, 0, 0, 0 | 0 )
102
+ sage: A_cone + A.gen(0)
103
+ ( 0 | 6 mod 7 | 1 mod 2, 0 mod 2, 0, 0, 0, 0, 0 | 0 )
104
+
105
+ Chow cycles can be of mixed degrees::
106
+
107
+ sage: mixed = sum(A.gens()); mixed
108
+ ( 1 | 4 mod 7 | 1 mod 2, 1 mod 2, 1, 1, 1, 1, 1 | 1 )
109
+ sage: mixed.project_to_degree(1)
110
+ ( 0 | 4 mod 7 | 0 mod 2, 0 mod 2, 0, 0, 0, 0, 0 | 0 )
111
+ sage: sum( mixed.project_to_degree(i) for i in range(X.dimension()+1) ) == mixed
112
+ True
113
+ """
114
+ # ****************************************************************************
115
+ # Copyright (C) 2010 Volker Braun <vbraun.name@gmail.com>
116
+ #
117
+ # Distributed under the terms of the GNU General Public License (GPL)
118
+ #
119
+ # https://www.gnu.org/licenses/
120
+ # ****************************************************************************
121
+ from __future__ import annotations
122
+
123
+ from sage.misc.cachefunc import cached_method
124
+ from sage.misc.flatten import flatten
125
+ from sage.misc.fast_methods import WithEqualityById
126
+ from sage.modules.fg_pid.fgp_module import FGP_Module_class
127
+ from sage.modules.fg_pid.fgp_element import FGP_Element
128
+ from sage.modules.free_module import FreeModule
129
+ from sage.structure.sage_object import SageObject
130
+ from sage.structure.factory import UniqueFactory
131
+ from sage.rings.integer_ring import ZZ
132
+ from sage.rings.rational_field import QQ
133
+ from sage.rings.infinity import Infinity
134
+
135
+ import sage.geometry.abc
136
+ from sage.schemes.toric.variety import ToricVariety_field
137
+ from sage.schemes.toric.divisor import ToricDivisor_generic
138
+
139
+
140
+ class ChowCycle(FGP_Element):
141
+ """
142
+ The elements of the Chow group.
143
+
144
+ .. WARNING::
145
+
146
+ Do not construct :class:`ChowCycle` objects manually. Instead,
147
+ use the parent :class:`ChowGroup<ChowGroup_class>` to obtain
148
+ generators or Chow cycles corresponding to cones of the fan.
149
+
150
+ EXAMPLES::
151
+
152
+ sage: P2 = toric_varieties.P2()
153
+ sage: A = P2.Chow_group()
154
+ sage: A.gens()
155
+ (( 0 | 0 | 1 ), ( 0 | 1 | 0 ), ( 1 | 0 | 0 ))
156
+ sage: cone = P2.fan(1)[0]
157
+ sage: A(cone)
158
+ ( 0 | 1 | 0 )
159
+ sage: A( Cone([(1,0)]) )
160
+ ( 0 | 1 | 0 )
161
+ """
162
+ def __init__(self, parent, v, check=True):
163
+ r"""
164
+ Construct a :class:`ChowCycle`.
165
+
166
+ INPUT:
167
+
168
+ - ``parent`` -- a :class:`ChowGroup_class`
169
+
170
+ - ``v`` -- a vector in the covering module, that is, with one
171
+ entry for each cone of the toric variety
172
+
173
+ - ``check`` -- boolean (default: ``True``); verify that ``v``
174
+ is in the covering module. Set to ``False`` if you want to
175
+ initialize from a coordinate vector.
176
+
177
+ TESTS::
178
+
179
+ sage: P2 = toric_varieties.P2()
180
+ sage: A = P2.Chow_group()
181
+ sage: from sage.schemes.toric.chow_group import ChowCycle
182
+ sage: ChowCycle(A, (0,1,2,3,11,12,13), check=False)
183
+ ( 36 | 6 | 0 )
184
+ """
185
+ FGP_Element.__init__(self, parent, v, check)
186
+
187
+ def _repr_(self) -> str:
188
+ r"""
189
+ Return a string representation of the Chow cycle.
190
+
191
+ OUTPUT: see the module-level documentation for details
192
+
193
+ EXAMPLES::
194
+
195
+ sage: P2 = toric_varieties.P2()
196
+ sage: A = P2.Chow_group()
197
+ sage: A.degree()
198
+ (Z, Z, Z)
199
+ sage: A.an_element()._repr_()
200
+ '( 0 | 0 | 1 )'
201
+
202
+ A more complicated example with torsion::
203
+
204
+ sage: X = toric_varieties.Cube_nonpolyhedral()
205
+ sage: A = X.Chow_group()
206
+ sage: A.degree()
207
+ (Z, 0, C2 x Z^5, Z)
208
+ sage: sum( A.gen(i) * (i+1) for i in range(A.ngens()) )
209
+ ( 8 || 1 mod 2, 3, 4, 5, 6, 7 | 2 )
210
+ """
211
+ A = self.parent()
212
+ s = '('
213
+ for degree in range(A.scheme().dimension() + 1):
214
+ if degree:
215
+ s += '|'
216
+ generators = A.gens(degree=degree)
217
+ coefficients = A.coordinate_vector(self, degree=degree)
218
+ if generators:
219
+ s += ' '
220
+ for i, gen in enumerate(generators):
221
+ if i > 0:
222
+ s += ', '
223
+ s += str(coefficients[i])
224
+ if gen.order() != Infinity:
225
+ s += ' mod ' + str(gen.order())
226
+ if generators:
227
+ s += ' '
228
+ s += ')'
229
+ return s
230
+
231
+ @cached_method
232
+ def degree(self) -> int:
233
+ r"""
234
+ Return the degree of the Chow cycle.
235
+
236
+ OUTPUT:
237
+
238
+ Integer. The complex dimension of the subvariety representing
239
+ the Chow cycle.
240
+
241
+ This raises a :exc:`ValueError` if the Chow cycle is a
242
+ sum of mixed degree cycles.
243
+
244
+ EXAMPLES::
245
+
246
+ sage: P2 = toric_varieties.P2()
247
+ sage: A = P2.Chow_group()
248
+ sage: [ a.degree() for a in A.gens() ]
249
+ [2, 1, 0]
250
+ """
251
+ ambient_dim = self.parent()._variety.dimension()
252
+ cone_dim = None
253
+ for i, cone in enumerate(self.parent()._cones):
254
+ if self.lift()[i] != 0:
255
+ if cone_dim not in [None, cone.dim()]:
256
+ raise ValueError('Chow cycle is not of definite degree')
257
+ cone_dim = cone.dim()
258
+ return ambient_dim - cone_dim
259
+
260
+ def project_to_degree(self, degree):
261
+ r"""
262
+ Project a (mixed-degree) Chow cycle to the given ``degree``.
263
+
264
+ INPUT:
265
+
266
+ - ``degree`` -- integer; the degree to project to
267
+
268
+ OUTPUT:
269
+
270
+ The projection of the Chow class to the given degree as a new
271
+ :class:`ChowCycle` of the same Chow group.
272
+
273
+ EXAMPLES::
274
+
275
+ sage: A = toric_varieties.P2().Chow_group()
276
+ sage: cycle = 10*A.gen(0) + 11*A.gen(1) + 12*A.gen(2); cycle
277
+ ( 12 | 11 | 10 )
278
+ sage: cycle.project_to_degree(2)
279
+ ( 0 | 0 | 10 )
280
+ """
281
+ ambient_dim = self.parent()._variety.dimension()
282
+ v = list(self.lift())
283
+ for i in range(len(v)):
284
+ cone = self.parent()._cones[i]
285
+ if cone.dim() != ambient_dim - degree:
286
+ v[i] = 0
287
+ v = self.parent().cover()(v)
288
+ P = self.parent()
289
+ return P.element_class(P, v, check=False)
290
+
291
+ def count_points(self):
292
+ r"""
293
+ Return the number of points in the Chow cycle.
294
+
295
+ OUTPUT:
296
+
297
+ An element of ``self.base_ring()``, which is usually
298
+ `\ZZ`. The number of points in the Chow cycle.
299
+
300
+ EXAMPLES::
301
+
302
+ sage: P2 = toric_varieties.P2()
303
+ sage: A = P2.Chow_group()
304
+ sage: a = 5*A.gen(2) + 7*A.gen(1); a
305
+ ( 5 | 7 | 0 )
306
+ sage: a.count_points()
307
+ 5
308
+
309
+ In the case of a smooth complete toric variety, the Chow
310
+ (homology) groups are Poincaré dual to the integral cohomology
311
+ groups. Here is such a smooth example::
312
+
313
+ sage: D = P2.divisor(1)
314
+ sage: a = D.Chow_cycle()
315
+ sage: aD = a.intersection_with_divisor(D)
316
+ sage: aD.count_points()
317
+ 1
318
+ sage: P2.integrate(aD.cohomology_class()) # needs sage.libs.singular
319
+ 1
320
+
321
+ For toric varieties with at most orbifold singularities, the
322
+ isomorphism only holds over `\QQ`. But the normalization of
323
+ the integral is still chosen such that the intersection
324
+ numbers (which are potentially rational) computed both ways
325
+ agree::
326
+
327
+ sage: P1xP1_Z2 = toric_varieties.P1xP1_Z2()
328
+ sage: Dt = P1xP1_Z2.divisor(1); Dt
329
+ V(t)
330
+ sage: Dy = P1xP1_Z2.divisor(3); Dy
331
+ V(y)
332
+ sage: Dt.Chow_cycle(QQ).intersection_with_divisor(Dy).count_points()
333
+ 1/2
334
+ sage: P1xP1_Z2.integrate(Dt.cohomology_class() * Dy.cohomology_class()) # needs sage.libs.singular
335
+ 1/2
336
+ """
337
+ return sum(self.project_to_degree(0).lift())
338
+
339
+ def intersection_with_divisor(self, divisor):
340
+ """
341
+ Intersect the Chow cycle with ``divisor``.
342
+
343
+ See Chapter 5.1 of [Ful1993]_ for a description of the toric algorithm.
344
+
345
+ INPUT:
346
+
347
+ - ``divisor`` -- a :class:`ToricDivisor
348
+ <sage.schemes.toric.divisor.ToricDivisor_generic>`
349
+ that can be moved away from the Chow cycle. For example, any
350
+ Cartier divisor. See also :meth:`ToricDivisor.move_away_from
351
+ <sage.schemes.toric.divisor.ToricDivisor_generic.move_away_from>`.
352
+
353
+ OUTPUT:
354
+
355
+ A new :class:`ChowCycle`. If the divisor is not Cartier then
356
+ this method potentially raises a :exc:`ValueError`, indicating
357
+ that the divisor cannot be made transversal to the Chow cycle.
358
+
359
+ EXAMPLES::
360
+
361
+ sage: dP6 = toric_varieties.dP6()
362
+ sage: cone = dP6.fan().cone_containing(2); cone
363
+ 1-d cone of Rational polyhedral fan in 2-d lattice N
364
+ sage: D = dP6.divisor(cone); D
365
+ V(y)
366
+ sage: A = dP6.Chow_group()
367
+ sage: A(cone)
368
+ ( 0 | 0, 0, 1, 0 | 0 )
369
+ sage: intersection = A(cone).intersection_with_divisor(D); intersection
370
+ ( -1 | 0, 0, 0, 0 | 0 )
371
+ sage: intersection.count_points()
372
+ -1
373
+
374
+ You can do the same computation over the rational Chow group
375
+ since there is no torsion in this case::
376
+
377
+ sage: A_QQ = dP6.Chow_group(base_ring=QQ)
378
+ sage: A_QQ(cone)
379
+ ( 0 | 0, 0, 0, 1 | 0 )
380
+ sage: intersection_QQ = A_QQ(cone).intersection_with_divisor(D); intersection
381
+ ( -1 | 0, 0, 0, 0 | 0 )
382
+ sage: intersection_QQ.count_points()
383
+ -1
384
+ sage: type(intersection_QQ.count_points())
385
+ <... 'sage.rings.rational.Rational'>
386
+ sage: type(intersection.count_points())
387
+ <... 'sage.rings.integer.Integer'>
388
+
389
+ TESTS:
390
+
391
+ The relations are the Chow cycles rationally equivalent to the
392
+ zero cycle. Their intersection with any divisor must be the zero cycle::
393
+
394
+ sage: [ r.intersection_with_divisor(D) for r in dP6.Chow_group().relation_gens() ]
395
+ [( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 ),
396
+ ( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 ),
397
+ ( 0 | 0, 0, 0, 0 | 0 ), ( 0 | 0, 0, 0, 0 | 0 ),
398
+ ( 0 | 0, 0, 0, 0 | 0 )]
399
+ sage: [ r.intersection_with_divisor(D).lift() for r in dP6.Chow_group().relation_gens() ]
400
+ [(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
401
+ (0, 0, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0, 0),
402
+ (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
403
+ (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
404
+ (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
405
+ (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
406
+ (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)]
407
+ """
408
+ assert isinstance(divisor, ToricDivisor_generic), f'{divisor} is not a toric divisor'
409
+
410
+ A = self.parent() # the Chow group
411
+ X = A._variety # the toric variety
412
+ intersection = A(0)
413
+ coefficients = self.lift()
414
+
415
+ for sigma_idx, sigma in enumerate(A._cones):
416
+ if sigma.dim() == X.dimension():
417
+ # full-dimensional cone = degree-0 Chow cycle
418
+ continue
419
+ coefficient = coefficients[sigma_idx]
420
+ if coefficient == 0:
421
+ continue
422
+ D = divisor.move_away_from(sigma)
423
+ for gamma in sigma.facet_of():
424
+ # note: the relative quotients are of dimension one
425
+ n = gamma.relative_quotient(sigma).gen(0).lift()
426
+ perp = sigma.relative_orthogonal_quotient(gamma).gen(0).lift()
427
+ I_gamma = set(gamma.ambient_ray_indices()) - set(sigma.ambient_ray_indices())
428
+ i = I_gamma.pop() # index of a ray in gamma but not sigma
429
+ v_i = X.fan().ray(i)
430
+ a_i = D.coefficient(i)
431
+ s_i = (v_i * perp) / (n * perp)
432
+ b_gamma = a_i / s_i
433
+ intersection += self.base_ring()(coefficient * b_gamma) * A(gamma)
434
+ return intersection
435
+
436
+ def cohomology_class(self):
437
+ r"""
438
+ Return the (Poincaré-dual) cohomology class.
439
+
440
+ Consider a simplicial cone of the fan, that is, a
441
+ `d`-dimensional cone spanned by `d` rays. Take the product of
442
+ the corresponding `d` homogeneous coordinates. This monomial
443
+ represents a cohomology classes of the toric variety `X`, see
444
+ :meth:`~sage.schemes.toric.variety.ToricVariety_field.cohomology_ring`.
445
+ Its cohomological degree is `2d`, which is the same degree as
446
+ the Poincaré-dual of the (real) `\dim(X)-2d`-dimensional torus
447
+ orbit associated to the simplicial cone. By linearity, we can
448
+ associate a cohomology class to each Chow cycle of a
449
+ simplicial toric variety.
450
+
451
+ If the toric variety is compact and smooth, the associated
452
+ cohomology class actually is the Poincaré dual (over the
453
+ integers) of the Chow cycle. In particular, integrals of dual
454
+ cohomology classes perform intersection computations.
455
+
456
+ If the toric variety is compact and has at most orbifold
457
+ singularities, the torsion parts in cohomology and the Chow
458
+ group can differ. But they are still isomorphic as rings over
459
+ the rationals. Moreover, the normalization of integration
460
+ (:meth:`volume_class
461
+ <sage.schemes.toric.variety.ToricVariety_field.volume_class>`)
462
+ and :meth:`count_points` are chosen to agree.
463
+
464
+ OUTPUT:
465
+
466
+ The
467
+ :class:`~sage.schemes.toric.variety.CohomologyClass`
468
+ which is associated to the Chow cycle.
469
+
470
+ If the toric variety is not simplicial, that is, has worse
471
+ than orbifold singularities, there is no way to associate a
472
+ cohomology class of the correct degree. In this case,
473
+ :meth:`cohomology_class` raises a :exc:`ValueError`.
474
+
475
+ EXAMPLES::
476
+
477
+ sage: # needs sage.libs.singular
478
+ sage: dP6 = toric_varieties.dP6()
479
+ sage: cone = dP6.fan().cone_containing(2,3)
480
+ sage: HH = dP6.cohomology_ring()
481
+ sage: A = dP6.Chow_group()
482
+ sage: HH(cone)
483
+ [-w^2]
484
+ sage: A(cone)
485
+ ( 1 | 0, 0, 0, 0 | 0 )
486
+ sage: A(cone).cohomology_class()
487
+ [-w^2]
488
+
489
+ Here is an example of a toric variety with orbifold
490
+ singularities, where we can also use the isomorphism with the
491
+ rational cohomology ring::
492
+
493
+ sage: # needs sage.libs.singular
494
+ sage: WP4 = toric_varieties.P4_11169()
495
+ sage: A = WP4.Chow_group()
496
+ sage: HH = WP4.cohomology_ring()
497
+ sage: cone3d = Cone([(0,0,1,0), (0,0,0,1), (-9,-6,-1,-1)])
498
+ sage: A(cone3d)
499
+ ( 0 | -1 | 0 | 0 | 0 )
500
+ sage: HH(cone3d)
501
+ [3*z4^3]
502
+ sage: D = -WP4.K() # the anticanonical divisor
503
+ sage: A(D)
504
+ ( 0 | 0 | 0 | -18 | 0 )
505
+ sage: HH(D)
506
+ [18*z4]
507
+ sage: WP4.integrate( A(cone3d).cohomology_class() * D.cohomology_class() )
508
+ 1
509
+ sage: WP4.integrate( HH(cone3d) * D.cohomology_class() )
510
+ 1
511
+ sage: A(cone3d).intersection_with_divisor(D).count_points()
512
+ 1
513
+ """
514
+ toric_variety = self.parent().scheme()
515
+ if not toric_variety.is_orbifold():
516
+ raise ValueError('not an orbifold')
517
+ HH = toric_variety.cohomology_ring()
518
+ coeff = self.lift()
519
+ return sum([HH(cone) * coeff[i]
520
+ for i, cone in enumerate(self.parent()._cones)])
521
+
522
+
523
+ class ChowGroupFactory(UniqueFactory):
524
+ """
525
+ Factory for :class:`ChowGroup_class`.
526
+ """
527
+
528
+ def create_key_and_extra_args(self, toric_variety, base_ring=ZZ, check=True):
529
+ r"""
530
+ Create a key that uniquely determines the :class:`ChowGroup_class`.
531
+
532
+ INPUT:
533
+
534
+ - ``toric_variety`` -- a toric variety
535
+
536
+ - ``base_ring`` -- either `\ZZ` (default) or `\QQ`; the
537
+ coefficient ring of the Chow group
538
+
539
+ - ``check`` -- boolean (default: ``True``)
540
+
541
+ EXAMPLES::
542
+
543
+ sage: from sage.schemes.toric.chow_group import *
544
+ sage: P2 = toric_varieties.P2()
545
+ sage: ChowGroup(P2, ZZ, check=True) == ChowGroup(P2, ZZ, check=False) # indirect doctest
546
+ True
547
+ """
548
+ if not isinstance(toric_variety, ToricVariety_field):
549
+ raise ValueError('first argument must be a toric variety')
550
+
551
+ if base_ring not in [ZZ, QQ]:
552
+ raise ValueError('base ring must be either ZZ or QQ')
553
+
554
+ key = (toric_variety, base_ring)
555
+ extra = {'check': check}
556
+ return key, extra
557
+
558
+ def create_object(self, version, key, **extra_args):
559
+ """
560
+ Create a :class:`ChowGroup_class`.
561
+
562
+ INPUT:
563
+
564
+ - ``version`` -- object version; currently not used
565
+
566
+ - ``key`` -- a key created by :meth:`create_key_and_extra_args`
567
+
568
+ - ``**extra_args`` -- currently not used
569
+
570
+ EXAMPLES::
571
+
572
+ sage: from sage.schemes.toric.chow_group import *
573
+ sage: P2 = toric_varieties.P2()
574
+ sage: ChowGroup(P2) # indirect doctest
575
+ Chow group of 2-d CPR-Fano toric variety covered by 3 affine patches
576
+ """
577
+ toric_variety, base_ring = key
578
+ check = extra_args['check']
579
+ return ChowGroup_class(toric_variety, base_ring, check)
580
+
581
+
582
+ ChowGroup = ChowGroupFactory('ChowGroup')
583
+
584
+
585
+ class ChowGroup_class(FGP_Module_class, WithEqualityById):
586
+ r"""
587
+ The Chow group of a toric variety.
588
+
589
+ EXAMPLES::
590
+
591
+ sage: P2 = toric_varieties.P2()
592
+ sage: from sage.schemes.toric.chow_group import ChowGroup_class
593
+ sage: A = ChowGroup_class(P2,ZZ,True); A
594
+ Chow group of 2-d CPR-Fano toric variety covered by 3 affine patches
595
+ sage: A.an_element()
596
+ ( 0 | 0 | 1 )
597
+ """
598
+ Element = ChowCycle
599
+
600
+ def __init__(self, toric_variety, base_ring, check):
601
+ r"""
602
+ EXAMPLES::
603
+
604
+ sage: from sage.schemes.toric.chow_group import *
605
+ sage: P2 = toric_varieties.P2()
606
+ sage: A = ChowGroup_class(P2,ZZ,True); A
607
+ Chow group of 2-d CPR-Fano toric variety covered by 3 affine patches
608
+ sage: isinstance(A, ChowGroup_class)
609
+ True
610
+ sage: isinstance(A.an_element(), ChowCycle)
611
+ True
612
+
613
+ TESTS::
614
+
615
+ sage: A_ZZ = P2.Chow_group()
616
+ sage: 2 * A_ZZ.an_element() * 3
617
+ ( 0 | 0 | 6 )
618
+ sage: 1/2 * A_ZZ.an_element() * 1/3
619
+ Traceback (most recent call last):
620
+ ...
621
+ TypeError: unsupported operand parent(s) for *: 'Rational Field'
622
+ and 'Chow group of 2-d CPR-Fano toric variety covered by 3 affine patches'
623
+ sage: coercion_model.get_action(A_ZZ, ZZ)
624
+ Right scalar multiplication by Integer Ring on Chow group of 2-d
625
+ CPR-Fano toric variety covered by 3 affine patches
626
+ sage: print(coercion_model.get_action(A_ZZ, QQ))
627
+ None
628
+
629
+ You cannot multiply integer classes with fractional
630
+ numbers. For that you need to go to the rational Chow group::
631
+
632
+ sage: A_QQ = P2.Chow_group(QQ)
633
+ sage: 2 * A_QQ.an_element() * 3
634
+ ( 0 | 0 | 6 )
635
+ sage: 1/2 * A_QQ.an_element() * 1/3
636
+ ( 0 | 0 | 1/6 )
637
+ sage: coercion_model.get_action(A_QQ, ZZ)
638
+ Right scalar multiplication by Integer Ring on QQ-Chow group of 2-d
639
+ CPR-Fano toric variety covered by 3 affine patches
640
+ sage: coercion_model.get_action(A_QQ, QQ)
641
+ Right scalar multiplication by Rational Field on QQ-Chow group of 2-d
642
+ CPR-Fano toric variety covered by 3 affine patches
643
+ """
644
+ self._variety = toric_variety
645
+
646
+ # cones are automatically sorted by dimension
647
+ self._cones = flatten(toric_variety.fan().cones())
648
+
649
+ V = FreeModule(base_ring, len(self._cones))
650
+ W = self._rational_equivalence_relations(V)
651
+
652
+ super().__init__(V, W, check)
653
+
654
+ def scheme(self):
655
+ r"""
656
+ Return the underlying toric variety.
657
+
658
+ OUTPUT: a :class:`ToricVariety
659
+ <sage.schemes.toric.variety.ToricVariety_field>`.
660
+
661
+ EXAMPLES::
662
+
663
+ sage: P2 = toric_varieties.P2()
664
+ sage: A = P2.Chow_group()
665
+ sage: A.scheme()
666
+ 2-d CPR-Fano toric variety covered by 3 affine patches
667
+ sage: A.scheme() is P2
668
+ True
669
+ """
670
+ return self._variety
671
+
672
+ def _element_constructor_(self, x, check=True):
673
+ r"""
674
+ Construct a :class:`ChowCycle`.
675
+
676
+ INPUT:
677
+
678
+ - ``x`` -- a cone of the fan, a toric divisor, or a valid
679
+ input for
680
+ :class:`sage.modules.fg_pid.fgp_module.FGP_Module_class`
681
+
682
+ - ``check`` -- boolean (default: ``True``); see
683
+ :class:`sage.modules.fg_pid.fgp_module.FGP_Module_class`
684
+
685
+ EXAMPLES::
686
+
687
+ sage: dP6 = toric_varieties.dP6()
688
+ sage: A = dP6.Chow_group()
689
+ sage: cone = dP6.fan(dim=1)[4]
690
+ sage: A(cone)
691
+ ( 0 | 1, 1, 0, -1 | 0 )
692
+ sage: A(Cone(cone)) # isomorphic but not identical to a cone of the fan!
693
+ ( 0 | 1, 1, 0, -1 | 0 )
694
+ sage: A( dP6.K() )
695
+ ( 0 | -1, -2, -2, -1 | 0 )
696
+ """
697
+ fan = self._variety.fan()
698
+ if isinstance(x, sage.geometry.abc.ConvexRationalPolyhedralCone):
699
+ cone = fan.embed(x)
700
+ return self.element_class(self, self._cone_to_V(cone), False)
701
+ if isinstance(x, ToricDivisor_generic):
702
+ v = sum(x.coefficient(i) * self._cone_to_V(onecone)
703
+ for i, onecone in enumerate(fan(1)))
704
+ return self.element_class(self, v, False)
705
+ return super()._element_constructor_(x, check)
706
+
707
+ def _coerce_map_from_(self, S):
708
+ """
709
+ Return ``True`` if ``S`` canonically coerces to ``self``.
710
+
711
+ EXAMPLES::
712
+
713
+ sage: A = toric_varieties.P2().Chow_group()
714
+ sage: A._coerce_map_from_(ZZ) # private method
715
+ False
716
+ sage: A.has_coerce_map_from(ZZ) # recommended usage
717
+ False
718
+ """
719
+ # We might want to coerce Cone_of_fans into ChowCycles
720
+ # but cones do not have parents at the moment.
721
+ return super()._coerce_map_from_(S)
722
+
723
+ def _rational_equivalence_relations(self, V):
724
+ r"""
725
+ Return the rational equivalence relations between the cones of the fan.
726
+
727
+ See :meth:`relation_gens` for details.
728
+
729
+ EXAMPLES::
730
+
731
+ sage: points_mod = lambda k: matrix([[ 1, 1, 2*k+1],[ 1,-1, 1],[-1, 1, 1],[-1,-1, 1],[-1,-1,-1],[-1, 1,-1],[ 1,-1,-1],[ 1, 1,-1]])
732
+ sage: points = lambda k: matrix([[1,1,1],[1,-1,1],[-1,1,1]]).solve_left(points_mod(k)).rows()
733
+ sage: cones = [[0,1,2,3],[4,5,6,7],[0,1,7,6],[4,5,3,2],[0,2,5,7],[4,6,1,3]]
734
+ sage: X_Delta = lambda k: ToricVariety( Fan(cones=cones, rays=points(k)) )
735
+ sage: from sage.schemes.toric.chow_group import ChowGroup
736
+ sage: A = ChowGroup( X_Delta(2) )
737
+ sage: rel = A._rational_equivalence_relations(A.cover()).basis()
738
+ sage: matrix(rel).submatrix(col=0, ncols=1).elementary_divisors()
739
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
740
+ sage: matrix(rel).submatrix(col=1, ncols=8).elementary_divisors()
741
+ [1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
742
+ sage: matrix(rel).submatrix(col=9, ncols=12).elementary_divisors()
743
+ [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0]
744
+ sage: matrix(rel).submatrix(col=21, ncols=6).elementary_divisors()
745
+ [1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
746
+ """
747
+ relations = []
748
+ for rho in self._cones:
749
+ for u in rho.orthogonal_sublattice().gens():
750
+ rel = V.zero()
751
+ for sigma in rho.facet_of():
752
+ sigma_idx = self._cones.index(sigma)
753
+ Q = sigma.relative_quotient(rho)
754
+ for n in Q.gens():
755
+ rel += (u * n.lift()) * V.gen(sigma_idx)
756
+ relations.append(rel)
757
+ return V.span(relations)
758
+
759
+ def __truediv__(self, other):
760
+ r"""
761
+ Return the quotient of the Chow group by a subgroup.
762
+
763
+ OUTPUT: currently not implemented
764
+
765
+ EXAMPLES::
766
+
767
+ sage: A = toric_varieties.dP6().Chow_group()
768
+ sage: Asub = A.submodule([ A.gen(0), A.gen(3) ])
769
+ sage: A/Asub
770
+ Traceback (most recent call last):
771
+ ...
772
+ NotImplementedError: quotients of the Chow group are not implemented
773
+ """
774
+ raise NotImplementedError('quotients of the Chow group are not implemented')
775
+
776
+ def _repr_(self) -> str:
777
+ """
778
+ Return a string representation.
779
+
780
+ EXAMPLES::
781
+
782
+ sage: P2 = toric_varieties.P2()
783
+ sage: from sage.schemes.toric.chow_group import ChowGroup
784
+ sage: ChowGroup(P2, ZZ)._repr_()
785
+ 'Chow group of 2-d CPR-Fano toric variety covered by 3 affine patches'
786
+ sage: ChowGroup(P2, QQ)._repr_()
787
+ 'QQ-Chow group of 2-d CPR-Fano toric variety covered by 3 affine patches'
788
+ """
789
+ if self.base_ring() == QQ:
790
+ return "QQ-Chow group of " + str(self._variety)
791
+ elif self.base_ring() == ZZ:
792
+ return "Chow group of " + str(self._variety)
793
+ else:
794
+ raise ValueError
795
+
796
+ def _cone_to_V(self, cone):
797
+ r"""
798
+ Convert a cone into the corresponding vector in ``self._V``.
799
+
800
+ INPUT:
801
+
802
+ - ``cone`` -- a :class:`sage.geometry.cone.ConvexRationalPolyhedralCone`
803
+
804
+ OUTPUT: the corresponding element of ``self.V()``
805
+
806
+ EXAMPLES::
807
+
808
+ sage: P2 = toric_varieties.P2()
809
+ sage: A = P2.Chow_group()
810
+ sage: cone = P2.fan(dim=1)[0]
811
+ sage: A._cone_to_V(cone)
812
+ (0, 1, 0, 0, 0, 0, 0)
813
+ """
814
+ assert cone.ambient() is self._variety.fan()
815
+ x = [0] * len(self._cones)
816
+ x[self._cones.index(cone)] = 1
817
+ return self._V(x)
818
+
819
+ @cached_method
820
+ def degree(self, k=None):
821
+ r"""
822
+ Return the degree-`k` Chow group.
823
+
824
+ INPUT:
825
+
826
+ - ``k`` -- integer or ``None`` (default); the degree of the
827
+ Chow group
828
+
829
+ OUTPUT:
830
+
831
+ - if `k` was specified, the Chow group `A_k` as an Abelian
832
+ group.
833
+
834
+ - if `k` was not specified, a tuple containing the Chow groups
835
+ in all degrees.
836
+
837
+ .. NOTE::
838
+
839
+ * For a smooth toric variety, this is the same as the
840
+ Poincaré-dual cohomology group
841
+ `H^{d-2k}(X,\ZZ)`.
842
+
843
+ * For a simplicial toric variety ("orbifold"),
844
+ `A_k(X)\otimes \QQ = H^{d-2k}(X,\QQ)`.
845
+
846
+ EXAMPLES:
847
+
848
+ Four exercises from page 65 of [Ful1993]_. First, an example
849
+ with `A_1(X)=\ZZ\oplus\ZZ/3\ZZ`::
850
+
851
+ sage: X = ToricVariety(Fan(cones=[[0,1], [1,2], [2,0]],
852
+ ....: rays=[[2,-1], [-1,2], [-1,-1]]))
853
+ sage: A = X.Chow_group()
854
+ sage: A.degree(1)
855
+ C3 x Z
856
+
857
+ Second, an example with `A_2(X)=\ZZ^2`::
858
+
859
+ sage: points = [[1,0,0], [0,1,0], [0,0,1], [1,-1,1], [-1,0,-1]]
860
+ sage: l = LatticePolytope(points)
861
+ sage: l.show3d() # needs sage.plot
862
+ sage: X = ToricVariety(FaceFan(l))
863
+ sage: A = X.Chow_group()
864
+ sage: A.degree(2)
865
+ Z^2
866
+
867
+ Third, an example with `A_2(X)=\ZZ^5`::
868
+
869
+ sage: cube = [[ 1,0,0], [0, 1,0], [0,0, 1], [-1, 1, 1],
870
+ ....: [-1,0,0], [0,-1,0], [0,0,-1], [ 1,-1,-1]]
871
+ sage: lat_cube = LatticePolytope(cube)
872
+ sage: X = ToricVariety(FaceFan((LatticePolytope(lat_cube))))
873
+ sage: X.Chow_group().degree(2)
874
+ Z^5
875
+
876
+ Fourth, a fan that is not the fan over a
877
+ polytope. Combinatorially, the fan is the same in the third
878
+ example, only the coordinates of the first point are
879
+ different. But the resulting fan is not the face fan of a
880
+ cube, so the variety is "more singular". Its Chow group has
881
+ torsion, `A_2(X)=\ZZ^5 \oplus \ZZ/2`::
882
+
883
+ sage: rays = [[ 1, 2, 3], [ 1,-1, 1], [-1, 1, 1], [-1,-1, 1],
884
+ ....: [-1,-1,-1], [-1, 1,-1], [ 1,-1,-1], [ 1, 1,-1]]
885
+ sage: cones = [[0,1,2,3], [4,5,6,7], [0,1,7,6],
886
+ ....: [4,5,3,2], [0,2,5,7], [4,6,1,3]]
887
+ sage: X = ToricVariety(Fan(cones, rays))
888
+ sage: X.Chow_group().degree(2) # long time (2s on sage.math, 2011)
889
+ C2 x Z^5
890
+
891
+ Finally, Example 1.3 of [FS1994]_::
892
+
893
+ sage: def points_mod(k):
894
+ ....: return matrix([[ 1, 1, 2*k+1], [ 1,-1, 1],
895
+ ....: [-1, 1, 1], [-1,-1, 1], [-1,-1,-1],
896
+ ....: [-1, 1,-1], [ 1,-1,-1], [ 1, 1,-1]])
897
+ sage: def rays(k):
898
+ ....: return matrix([[ 1, 1, 1],
899
+ ....: [ 1, -1, 1],
900
+ ....: [-1, 1, 1]]).solve_left(points_mod(k)).rows()
901
+ sage: cones = [[0,1,2,3], [4,5,6,7], [0,1,7,6], [4,5,3,2], [0,2,5,7], [4,6,1,3]]
902
+ sage: X_Delta = lambda k: ToricVariety(Fan(cones=cones, rays=rays(k)))
903
+ sage: X_Delta(0).Chow_group().degree() # long time (3s on sage.math, 2011)
904
+ (Z, Z, Z^5, Z)
905
+ sage: X_Delta(1).Chow_group().degree() # long time (3s on sage.math, 2011)
906
+ (Z, 0, Z^5, Z)
907
+ sage: X_Delta(2).Chow_group().degree() # long time (3s on sage.math, 2011)
908
+ (Z, C2, Z^5, Z)
909
+ sage: X_Delta(2).Chow_group(base_ring=QQ).degree() # long time (4s on sage.math, 2011)
910
+ (Q, 0, Q^5, Q)
911
+ """
912
+ if k is not None:
913
+ return self.degree()[k]
914
+ return tuple(ChowGroup_degree_class(self, d)
915
+ for d in range(self._variety.dimension() + 1))
916
+
917
+ def coordinate_vector(self, chow_cycle, degree=None, reduce=True):
918
+ r"""
919
+ Return the coordinate vector of the ``chow_cycle``.
920
+
921
+ INPUT:
922
+
923
+ - ``chow_cycle`` -- a :class:`ChowCycle`
924
+
925
+ - ``degree`` -- ``None`` (default) or integer
926
+
927
+ - ``reduce`` -- boolean (default: ``True``); whether to reduce
928
+ modulo the invariants
929
+
930
+ OUTPUT:
931
+
932
+ * If ``degree is None`` (default), the coordinate vector
933
+ relative to the basis ``self.gens()`` is returned.
934
+
935
+ * If some integer ``degree=d`` is specified, the chow cycle is
936
+ projected to the given degree and the coordinate vector
937
+ relative to the basis ``self.gens(degree=d)`` is returned.
938
+
939
+ EXAMPLES::
940
+
941
+ sage: A = toric_varieties.P2().Chow_group()
942
+ sage: a = A.gen(0) + 2*A.gen(1) + 3*A.gen(2)
943
+ sage: A.coordinate_vector(a)
944
+ (1, 2, 3)
945
+ sage: A.coordinate_vector(a, degree=1)
946
+ (2)
947
+ """
948
+ if degree is None:
949
+ return super().coordinate_vector(chow_cycle, reduce=reduce)
950
+
951
+ a = chow_cycle.project_to_degree(degree)
952
+ return self.degree(degree).module().coordinate_vector(a, reduce=reduce)
953
+
954
+ def gens(self, degree=None) -> tuple:
955
+ r"""
956
+ Return the generators of the Chow group.
957
+
958
+ INPUT:
959
+
960
+ - ``degree`` -- integer (optional); the degree of the Chow
961
+ group
962
+
963
+ OUTPUT:
964
+
965
+ - if no degree is specified, the generators of the whole Chow
966
+ group. The chosen generators may be of mixed degree.
967
+
968
+ - if ``degree=`` `k` was specified, the generators of the
969
+ degree-`k` part `A_k` of the Chow group.
970
+
971
+ EXAMPLES::
972
+
973
+ sage: A = toric_varieties.P2().Chow_group()
974
+ sage: A.gens()
975
+ (( 0 | 0 | 1 ), ( 0 | 1 | 0 ), ( 1 | 0 | 0 ))
976
+ sage: A.gens(degree=1)
977
+ (( 0 | 1 | 0 ),)
978
+ """
979
+ if degree is None:
980
+ return super().gens()
981
+ return self.degree(degree).gens()
982
+
983
+ def relation_gens(self):
984
+ r"""
985
+ Return the Chow cycles equivalent to zero.
986
+
987
+ For each `d-k-1`-dimensional cone `\rho \in \Sigma^{(d-k-1)}`,
988
+ the relations in `A_k(X)`, that is the cycles equivalent to
989
+ zero, are generated by
990
+
991
+ .. MATH::
992
+
993
+ 0 \stackrel{!}{=}
994
+ \mathop{\mathrm{div}}(u) =
995
+ \sum_{\rho < \sigma \in \Sigma^{(n-p)} }
996
+ \big< u, n_{\rho,\sigma} \big> V(\sigma)
997
+ ,\qquad
998
+ u \in M(\rho)
999
+
1000
+ where `n_{\rho,\sigma}` is a (randomly chosen) lift of the
1001
+ generator of `N_\sigma/N_\rho \simeq \ZZ`. See also Exercise
1002
+ 12.5.7 of [CLS2011]_.
1003
+
1004
+ See also :meth:`relations` to obtain the relations as
1005
+ submodule of the free module generated by the cones. Or use
1006
+ ``self.relations().gens()`` to list the relations in the free
1007
+ module.
1008
+
1009
+ OUTPUT:
1010
+
1011
+ A tuple of Chow cycles, each rationally equivalent to zero,
1012
+ that generates the rational equivalence.
1013
+
1014
+ EXAMPLES::
1015
+
1016
+ sage: P2 = toric_varieties.P2()
1017
+ sage: A = P2.Chow_group()
1018
+ sage: first = A.relation_gens()[0]; first
1019
+ ( 0 | 0 | 0 )
1020
+ sage: first.is_zero()
1021
+ True
1022
+ sage: first.lift()
1023
+ (0, 1, 0, -1, 0, 0, 0)
1024
+ """
1025
+ return tuple(self(gen) for gen in self.W().gens())
1026
+
1027
+
1028
+ class ChowGroup_degree_class(SageObject):
1029
+ r"""
1030
+ A fixed-degree subgroup of the Chow group of a toric variety.
1031
+
1032
+ .. WARNING::
1033
+
1034
+ Use
1035
+ :meth:`~sage.schemes.toric.chow_group.ChowGroup_class.degree`
1036
+ to construct :class:`ChowGroup_degree_class` instances.
1037
+
1038
+ EXAMPLES::
1039
+
1040
+ sage: P2 = toric_varieties.P2()
1041
+ sage: A = P2.Chow_group(); A
1042
+ Chow group of 2-d CPR-Fano toric variety covered by 3 affine patches
1043
+ sage: A.degree()
1044
+ (Z, Z, Z)
1045
+ sage: A.degree(2)
1046
+ Z
1047
+ sage: type(_)
1048
+ <class 'sage.schemes.toric.chow_group.ChowGroup_degree_class'>
1049
+ """
1050
+
1051
+ def __init__(self, A, d):
1052
+ r"""
1053
+ Construct a :class:`ChowGroup_degree_class`.
1054
+
1055
+ INPUT:
1056
+
1057
+ - ``A`` -- a :class:`ChowGroup_class`
1058
+
1059
+ - ``d`` -- integer; the degree of the Chow group
1060
+
1061
+ EXAMPLES::
1062
+
1063
+ sage: P2 = toric_varieties.P2()
1064
+ sage: A = P2.Chow_group()
1065
+ sage: from sage.schemes.toric.chow_group import ChowGroup_degree_class
1066
+ sage: A2 = ChowGroup_degree_class(A,2)
1067
+ sage: A2
1068
+ Z
1069
+ """
1070
+ self._Chow_group = A
1071
+ self._degree = d
1072
+
1073
+ toric_variety = A.scheme()
1074
+ fan = toric_variety.fan()
1075
+
1076
+ # Some generators
1077
+ gens = []
1078
+ for cone in fan(codim=d):
1079
+ gen = A._cone_to_V(cone)
1080
+ gens.append(gen)
1081
+
1082
+ # The minimal set of generators
1083
+ self._module = A.submodule(gens)
1084
+ self._gens = tuple([A.element_class(A, a.lift(), False)
1085
+ for a in self._module.gens()])
1086
+
1087
+ def _repr_(self) -> str:
1088
+ """
1089
+ Return a string representation.
1090
+
1091
+ OUTPUT: string
1092
+
1093
+ EXAMPLES::
1094
+
1095
+ sage: projective_plane = toric_varieties.P2()
1096
+ sage: A2 = projective_plane.Chow_group().degree(2)
1097
+ sage: A2._repr_()
1098
+ 'Z'
1099
+ sage: A2_QQ = projective_plane.Chow_group(base_ring=QQ).degree(2)
1100
+ sage: A2_QQ._repr_()
1101
+ 'Q'
1102
+ """
1103
+ invariants = self._module.invariants()
1104
+ if not invariants:
1105
+ return '0'
1106
+
1107
+ free = [x for x in invariants if x == 0]
1108
+ tors = [x for x in invariants if x > 0]
1109
+
1110
+ if self._Chow_group.base_ring() is ZZ:
1111
+ ring = 'Z'
1112
+ elif self._Chow_group.base_ring() is QQ:
1113
+ ring = 'Q'
1114
+ else:
1115
+ raise NotImplementedError('base ring must be ZZ or QQ')
1116
+
1117
+ s = ['C' + str(x) for x in tors]
1118
+ if len(free) == 1:
1119
+ s.append(ring)
1120
+ elif len(free) > 1:
1121
+ s.append(ring + '^' + str(len(free)))
1122
+ return ' x '.join(s)
1123
+
1124
+ def module(self):
1125
+ """
1126
+ Return the submodule of the toric Chow group generated.
1127
+
1128
+ OUTPUT: a :class:`sage.modules.fg_pid.fgp_module.FGP_Module_class`
1129
+
1130
+ EXAMPLES::
1131
+
1132
+ sage: projective_plane = toric_varieties.P2()
1133
+ sage: A2 = projective_plane.Chow_group().degree(2)
1134
+ sage: A2.module()
1135
+ Finitely generated module V/W over Integer Ring with invariants (0)
1136
+ """
1137
+ return self._module
1138
+
1139
+ def ngens(self) -> int:
1140
+ """
1141
+ Return the number of generators.
1142
+
1143
+ OUTPUT: integer
1144
+
1145
+ EXAMPLES::
1146
+
1147
+ sage: projective_plane = toric_varieties.P2()
1148
+ sage: A2 = projective_plane.Chow_group().degree(2)
1149
+ sage: A2.ngens()
1150
+ 1
1151
+ """
1152
+ return len(self._gens)
1153
+
1154
+ def gen(self, i):
1155
+ """
1156
+ Return the ``i``-th generator of the Chow group of fixed degree.
1157
+
1158
+ INPUT:
1159
+
1160
+ - ``i`` -- integer; the index of the generator to be returned
1161
+
1162
+ OUTPUT: a Chow cycle
1163
+
1164
+ EXAMPLES::
1165
+
1166
+ sage: projective_plane = toric_varieties.P2()
1167
+ sage: A2 = projective_plane.Chow_group().degree(2)
1168
+ sage: A2.gen(0)
1169
+ ( 0 | 0 | 1 )
1170
+ """
1171
+ return self._gens[i]
1172
+
1173
+ def gens(self) -> tuple:
1174
+ """
1175
+ Return the generators of the Chow group of fixed degree.
1176
+
1177
+ OUTPUT: a tuple of Chow cycles of fixed degree generating
1178
+ :meth:`module`.
1179
+
1180
+ EXAMPLES::
1181
+
1182
+ sage: projective_plane = toric_varieties.P2()
1183
+ sage: A2 = projective_plane.Chow_group().degree(2)
1184
+ sage: A2.gens()
1185
+ (( 0 | 0 | 1 ),)
1186
+ """
1187
+ return self._gens
1188
+
1189
+
1190
+ def is_ChowGroup(x) -> bool:
1191
+ r"""
1192
+ Return whether ``x`` is a :class:`ChowGroup_class`.
1193
+
1194
+ INPUT:
1195
+
1196
+ - ``x`` -- anything
1197
+
1198
+ OUTPUT: boolean
1199
+
1200
+ EXAMPLES::
1201
+
1202
+ sage: P2 = toric_varieties.P2()
1203
+ sage: A = P2.Chow_group()
1204
+ sage: from sage.schemes.toric.chow_group import is_ChowGroup
1205
+ sage: is_ChowGroup(A)
1206
+ doctest:warning...
1207
+ DeprecationWarning: The function is_ChowGroup is deprecated; use 'isinstance(..., ChowGroup_class)' instead.
1208
+ See https://github.com/sagemath/sage/issues/38022 for details.
1209
+ True
1210
+ sage: is_ChowGroup('Victoria')
1211
+ False
1212
+ """
1213
+ from sage.misc.superseded import deprecation
1214
+ deprecation(38022, "The function is_ChowGroup is deprecated; use 'isinstance(..., ChowGroup_class)' instead.")
1215
+ return isinstance(x, ChowGroup_class)
1216
+
1217
+
1218
+ def is_ChowCycle(x) -> bool:
1219
+ r"""
1220
+ Return whether ``x`` is a :class:`ChowCycle`.
1221
+
1222
+ INPUT:
1223
+
1224
+ - ``x`` -- anything
1225
+
1226
+ OUTPUT: boolean
1227
+
1228
+ EXAMPLES::
1229
+
1230
+ sage: P2 = toric_varieties.P2()
1231
+ sage: A = P2.Chow_group()
1232
+ sage: from sage.schemes.toric.chow_group import *
1233
+ sage: is_ChowCycle(A)
1234
+ doctest:warning...
1235
+ DeprecationWarning: The function is_ChowCycle is deprecated;
1236
+ use 'isinstance(..., ChowCycle)' instead.
1237
+ See https://github.com/sagemath/sage/issues/38277 for details.
1238
+ False
1239
+ sage: is_ChowCycle(A.an_element())
1240
+ True
1241
+ sage: is_ChowCycle('Victoria')
1242
+ False
1243
+ """
1244
+ from sage.misc.superseded import deprecation
1245
+ deprecation(38277,
1246
+ "The function is_ChowCycle is deprecated; "
1247
+ "use 'isinstance(..., ChowCycle)' instead.")
1248
+ return isinstance(x, ChowCycle)