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,921 @@
1
+ # sage_setup: distribution = sagemath-polyhedra
2
+ # sage.doctest: needs sage.geometry.polyhedron sage.graphs
3
+ """
4
+ Klyachko bundles and sheaves
5
+
6
+ Klyachko bundles are torus-equivariant bundles on toric
7
+ varieties. That is, the action of the maximal torus on the toric
8
+ variety lifts to an action on the bundle. There is an equivalence of
9
+ categories between Klyachko bundles [Kly1990]_ and multiple filtrations (one for
10
+ each ray of the fan) of a vector space. The multi-filtrations are
11
+ implemented in :mod:`sage.modules.multi_filtered_vector_space`.
12
+
13
+ EXAMPLES::
14
+
15
+ sage: X = toric_varieties.dP6xdP6()
16
+ sage: TX = X.sheaves.tangent_bundle()
17
+ sage: Alt2TX = TX.exterior_power(2); Alt2TX
18
+ Rank 6 bundle on 4-d CPR-Fano toric variety covered by 36 affine patches.
19
+
20
+ sage: K = X.sheaves.line_bundle(X.K())
21
+ sage: antiK = X.sheaves.line_bundle(-X.K())
22
+ sage: (Alt2TX * K).cohomology(dim=True, weight=(0,0,0,0)) # long time
23
+ (0, 0, 18, 0, 0)
24
+
25
+ sage: G_sum = TX + X.sheaves.trivial_bundle(2)
26
+ sage: V_sum = G_sum.wedge(2) * K # long time
27
+ sage: V_sum.cohomology(dim=True, weight=(0,0,0,0)) # long time
28
+ (0, 0, 18, 16, 1)
29
+ sage: Gtilde = G_sum.random_deformation()
30
+ sage: V = Gtilde.wedge(2) * K # long time
31
+ sage: V.cohomology(dim=True, weight=(0,0,0,0)) # long time # random failure (see #32773)
32
+ (0, 0, 3, 0, 0)
33
+
34
+ REFERENCES:
35
+
36
+ - [Kly1990]_
37
+
38
+ - [BIP]_
39
+ """
40
+
41
+ # ****************************************************************************
42
+ # Copyright (C) 2013 Volker Braun <vbraun.name@gmail.com>
43
+ #
44
+ # Distributed under the terms of the GNU General Public License (GPL)
45
+ # as published by the Free Software Foundation; either version 2 of
46
+ # the License, or (at your option) any later version.
47
+ # https://www.gnu.org/licenses/
48
+ # ****************************************************************************
49
+
50
+ from sage.structure.all import SageObject
51
+ from sage.structure.richcmp import richcmp_method, richcmp, richcmp_not_equal
52
+ from sage.rings.integer_ring import ZZ
53
+ from sage.misc.cachefunc import cached_method
54
+ from sage.matrix.constructor import vector, block_matrix, zero_matrix
55
+ from sage.modules.multi_filtered_vector_space import MultiFilteredVectorSpace
56
+ import sage.geometry.abc
57
+
58
+
59
+ def is_KlyachkoBundle(X):
60
+ """
61
+ Test whether ``X`` is a Klyachko bundle.
62
+
63
+ INPUT:
64
+
65
+ - ``X`` -- anything
66
+
67
+ OUTPUT: boolean
68
+
69
+ EXAMPLES::
70
+
71
+ sage: from sage.schemes.toric.sheaf.klyachko import is_KlyachkoBundle
72
+ sage: is_KlyachkoBundle('test')
73
+ doctest:warning...
74
+ DeprecationWarning: The function is_KlyachkoBundle is deprecated; use 'isinstance(..., KlyachkoBundle_class)' instead.
75
+ See https://github.com/sagemath/sage/issues/38022 for details.
76
+ False
77
+ """
78
+ from sage.misc.superseded import deprecation
79
+ deprecation(38022, "The function is_KlyachkoBundle is deprecated; use 'isinstance(..., KlyachkoBundle_class)' instead.")
80
+ return isinstance(X, KlyachkoBundle_class)
81
+
82
+
83
+ def Bundle(toric_variety, multi_filtration, check=True):
84
+ r"""
85
+ Construct a Klyacho bundle.
86
+
87
+ INPUT:
88
+
89
+ - ``toric_variety`` -- a toric variety; the base space of the bundle
90
+
91
+ - ``multi_filtration`` -- a multi-filtered vectors space with
92
+ multiple filtrations being indexed by the one-dimensional cones
93
+ of the fan. Either an instance of
94
+ :func:`~sage.modules.multi_filtered_vector_space.MultiFilteredVectorSpace`
95
+ or something (like a dictionary of ordinary filtered vector
96
+ spaces).
97
+
98
+ EXAMPLES::
99
+
100
+ sage: P1 = toric_varieties.P1()
101
+ sage: v1, v2, v3 = [(1,0,0), (0,1,0), (0,0,1)]
102
+ sage: F1 = FilteredVectorSpace({1: [v1, v2, v3], 3: [v1]})
103
+ sage: F2 = FilteredVectorSpace({0: [v1, v2, v3], 2: [v2, v3]})
104
+ sage: P1 = toric_varieties.P1()
105
+ sage: r1, r2 = P1.fan().rays()
106
+ sage: F = MultiFilteredVectorSpace({r1: F1, r2: F2}); F
107
+ Filtrations
108
+ N(-1): QQ^3 >= QQ^2 >= QQ^2 >= 0 >= 0
109
+ N(1): QQ^3 >= QQ^3 >= QQ^1 >= QQ^1 >= 0
110
+
111
+ You should use the
112
+ :meth:`~sage.schemes.toric.sheaf.constructor.SheafLibrary.Klyachko`
113
+ method to construct instances::
114
+
115
+ sage: P1.sheaves.Klyachko(F)
116
+ Rank 3 bundle on 1-d CPR-Fano toric variety covered by 2 affine patches.
117
+
118
+ sage: P1.sheaves.Klyachko({r1: F1, r2: F2}) # alternative
119
+ Rank 3 bundle on 1-d CPR-Fano toric variety covered by 2 affine patches.
120
+
121
+ The above is just a shorthand for::
122
+
123
+ sage: from sage.schemes.toric.sheaf.klyachko import Bundle
124
+ sage: Bundle(P1, F)
125
+ Rank 3 bundle on 1-d CPR-Fano toric variety covered by 2 affine patches.
126
+ """
127
+ base_ring = toric_variety.base_ring()
128
+ if not hasattr(multi_filtration, 'get_filtration'):
129
+ # try to construct a MultiFilteredVectorSpace
130
+ multi_filtration = MultiFilteredVectorSpace(
131
+ multi_filtration, base_ring=base_ring, check=check)
132
+ if multi_filtration.base_ring() != base_ring:
133
+ multi_filtration = multi_filtration.change_ring(base_ring)
134
+ return KlyachkoBundle_class(toric_variety, multi_filtration, check=check)
135
+
136
+
137
+ @richcmp_method
138
+ class KlyachkoBundle_class(SageObject):
139
+
140
+ def __init__(self, toric_variety, multi_filtration, check=True):
141
+ r"""
142
+ A toric bundle using Klyachko's representation.
143
+
144
+ .. warning::
145
+
146
+ You should always use the :func:`Bundle` factory function
147
+ to construct instances.
148
+
149
+ INPUT:
150
+
151
+ - ``toric_variety`` -- a toric variety; the base space of the bundle
152
+
153
+ - ``multi_filtration`` -- a
154
+ :func:`~sage.modules.multi_filtered_vector_space.MultiFilteredVectorSpace`
155
+ with index set the rays of the fan.
156
+
157
+ - ``check`` -- boolean (default: ``True``); whether to perform
158
+ consistency checks
159
+
160
+ EXAMPLES::
161
+
162
+ sage: P1 = toric_varieties.P1()
163
+ sage: r1, r2 = P1.fan().rays()
164
+ sage: F = MultiFilteredVectorSpace({
165
+ ....: r1: FilteredVectorSpace(3,1),
166
+ ....: r2: FilteredVectorSpace(3,0)}); F
167
+ Filtrations
168
+ N(-1): QQ^3 >= 0 >= 0
169
+ N(1): QQ^3 >= QQ^3 >= 0
170
+ sage: from sage.schemes.toric.sheaf.klyachko import Bundle
171
+ sage: Bundle(P1, F)
172
+ Rank 3 bundle on 1-d CPR-Fano toric variety covered by 2 affine patches.
173
+ """
174
+ self._variety = toric_variety
175
+ self._filt = multi_filtration
176
+ if not check:
177
+ return
178
+ from sage.sets.set import Set
179
+ if multi_filtration.index_set() != Set(list(toric_variety.fan().rays())):
180
+ raise ValueError('the index set of the multi-filtration must be'
181
+ ' all rays of the fan.')
182
+ if not multi_filtration.is_exhaustive():
183
+ raise ValueError('multi-filtration must be exhaustive')
184
+ if not multi_filtration.is_separating():
185
+ raise ValueError('multi-filtration must be separating')
186
+
187
+ def variety(self):
188
+ r"""
189
+ Return the base toric variety.
190
+
191
+ OUTPUT: a toric variety
192
+
193
+ EXAMPLES::
194
+
195
+ sage: X = toric_varieties.P2()
196
+ sage: V = X.sheaves.tangent_bundle(); V
197
+ Rank 2 bundle on 2-d CPR-Fano toric variety covered by 3 affine patches.
198
+ sage: V.variety() is X
199
+ True
200
+ """
201
+ return self._variety
202
+
203
+ def base_ring(self):
204
+ r"""
205
+ Return the base field.
206
+
207
+ OUTPUT: a field
208
+
209
+ EXAMPLES::
210
+
211
+ sage: T_P2 = toric_varieties.P2().sheaves.tangent_bundle()
212
+ sage: T_P2.base_ring()
213
+ Rational Field
214
+ """
215
+ return self._filt.base_ring()
216
+
217
+ def fiber(self):
218
+ r"""
219
+ Return the generic fiber of the vector bundle.
220
+
221
+ OUTPUT: a vector space over :meth:`base_ring`
222
+
223
+ EXAMPLES::
224
+
225
+ sage: T_P2 = toric_varieties.P2().sheaves.tangent_bundle()
226
+ sage: T_P2.fiber()
227
+ Vector space of dimension 2 over Rational Field
228
+ """
229
+ from sage.modules.free_module import VectorSpace
230
+ return VectorSpace(self.base_ring(), self.rank())
231
+
232
+ def rank(self):
233
+ r"""
234
+ Return the rank of the vector bundle.
235
+
236
+ OUTPUT: integer
237
+
238
+ EXAMPLES::
239
+
240
+ sage: T_P2 = toric_varieties.P2().sheaves.tangent_bundle()
241
+ sage: T_P2.rank()
242
+ 2
243
+ """
244
+ return self._filt.dimension()
245
+
246
+ def _repr_(self):
247
+ r"""
248
+ Return a string representation.
249
+
250
+ OUTPUT: string
251
+
252
+ EXAMPLES::
253
+
254
+ sage: toric_varieties.P2().sheaves.tangent_bundle()
255
+ Rank 2 bundle on 2-d CPR-Fano toric variety covered by 3 affine patches.
256
+ """
257
+ s = 'Rank '+str(self.rank())+' bundle on '+str(self._variety)+'.'
258
+ return s
259
+
260
+ def get_filtration(self, ray=None):
261
+ r"""
262
+ Return the filtration associated to the ``ray``.
263
+
264
+ INPUT:
265
+
266
+ - ``ray`` -- integer; a `N`-lattice point, a one-dimensional
267
+ cone, or ``None`` (default). Specifies a ray of the fan of
268
+ the toric variety, either via its index or its generator.
269
+
270
+ OUTPUT:
271
+
272
+ The filtered vector space associated to the given ``ray``. If
273
+ no ray is specified, all filtrations are returned.
274
+
275
+ EXAMPLES::
276
+
277
+ sage: TX = toric_varieties.dP6().sheaves.tangent_bundle()
278
+ sage: TX.get_filtration(0)
279
+ QQ^2 >= QQ^1 >= 0
280
+ sage: TX.get_filtration([-1, -1])
281
+ QQ^2 >= QQ^1 >= 0
282
+ sage: TX.get_filtration(TX.variety().fan(1)[0])
283
+ QQ^2 >= QQ^1 >= 0
284
+ sage: TX.get_filtration()
285
+ Filtrations
286
+ N(-1, -1): QQ^2 >= QQ^1 >= 0
287
+ N(-1, 0): QQ^2 >= QQ^1 >= 0
288
+ N(0, -1): QQ^2 >= QQ^1 >= 0
289
+ N(0, 1): QQ^2 >= QQ^1 >= 0
290
+ N(1, 0): QQ^2 >= QQ^1 >= 0
291
+ N(1, 1): QQ^2 >= QQ^1 >= 0
292
+ """
293
+ if ray is None:
294
+ return self._filt
295
+ X = self.variety()
296
+ fan = X.fan()
297
+ if isinstance(ray, sage.geometry.abc.ConvexRationalPolyhedralCone):
298
+ if ray.dim() != 1:
299
+ raise ValueError('not a one-dimensional cone')
300
+ ray = ray.ray(0)
301
+ elif ray in ZZ:
302
+ ray = fan.ray(ray)
303
+ else:
304
+ N = fan.lattice()
305
+ ray = N(ray)
306
+ ray.set_immutable()
307
+ return self._filt.get_filtration(ray)
308
+
309
+ def get_degree(self, ray, i):
310
+ r"""
311
+ Return the vector subspace ``E^\alpha(i)``.
312
+
313
+ - ``ray`` -- integer; a `N`-lattice point, a one-dimensional
314
+ cone, or ``None`` (default). Specifies a ray of the fan of
315
+ the toric variety, either via its index or its generator.
316
+
317
+ - ``i`` -- integer; the filtration degree
318
+
319
+ OUTPUT:
320
+
321
+ A subspace of the :meth:`fiber` vector space. The defining
322
+ data of a Klyachko bundle.
323
+
324
+ EXAMPLES::
325
+
326
+ sage: TX = toric_varieties.dP6().sheaves.tangent_bundle()
327
+ sage: TX.get_degree(0, 1)
328
+ Vector space of degree 2 and dimension 1 over Rational Field
329
+ Basis matrix: [0 1]
330
+ """
331
+ return self.get_filtration(ray).get_degree(i)
332
+
333
+ def filtration_intersection(self, sigma, i):
334
+ r"""
335
+ Return the intersection of the filtered subspaces.
336
+
337
+ INPUT:
338
+
339
+ - ``sigma`` -- a cone of the fan of the base toric variety
340
+
341
+ - ``i`` -- integer; the filtration degree
342
+
343
+ OUTPUT:
344
+
345
+ Let the cone be spanned by the rays `\sigma=\langle r_1,\dots,
346
+ r_k\rangle`. This method returns the intersection
347
+
348
+ .. MATH::
349
+
350
+ \bigcap_{r\in \{r_1,\dots,r_k\}}
351
+ E^{r}(i)
352
+
353
+ EXAMPLES::
354
+
355
+ sage: X = toric_varieties.P2()
356
+ sage: fan = X.fan()
357
+ sage: V = X.sheaves.tangent_bundle()
358
+ sage: V.filtration_intersection(fan(1)[0], 1)
359
+ Vector space of degree 2 and dimension 1 over Rational Field
360
+ Basis matrix: [1 0]
361
+ sage: V.filtration_intersection(fan(2)[0], 1)
362
+ Vector space of degree 2 and dimension 0 over Rational Field
363
+ Basis matrix: []
364
+ """
365
+ sigma = self._variety.fan().embed(sigma)
366
+ V = self.fiber()
367
+ for alpha in sigma.ambient_ray_indices():
368
+ V = V.intersection(self.get_degree(alpha, i))
369
+ return V
370
+
371
+ def E_degree(self, alpha, m):
372
+ r"""
373
+ Return the vector subspace `E^\alpha(m)`.
374
+
375
+ INPUT:
376
+
377
+ - ``alpha`` -- a ray of the fan. Can be specified by its index
378
+ (an integer), a one-dimensional cone, or a `N`-lattice
379
+ point.
380
+
381
+ - ``m`` -- tuple of integers or `M`-lattice point. A point in
382
+ the dual lattice of the fan.
383
+
384
+ OUTPUT:
385
+
386
+ The subspace `E^\alpha(\alpha m)` of the filtration indexed by
387
+ the ray `\alpha` and at the filtration degree `\alpha * m`
388
+
389
+ EXAMPLES::
390
+
391
+ sage: X = toric_varieties.P2()
392
+ sage: M = X.fan().dual_lattice()
393
+ sage: V = X.sheaves.tangent_bundle()
394
+ sage: V.E_degree(X.fan().ray(0), (1,0))
395
+ Vector space of degree 2 and dimension 1 over Rational Field
396
+ Basis matrix: [1 0]
397
+ sage: V.E_degree(X.fan(1)[0], (1,0))
398
+ Vector space of degree 2 and dimension 1 over Rational Field
399
+ Basis matrix: [1 0]
400
+ sage: V.E_degree(0, (1,0))
401
+ Vector space of degree 2 and dimension 1 over Rational Field
402
+ Basis matrix: [1 0]
403
+ """
404
+ fan = self.variety().fan()
405
+ N = fan.lattice()
406
+ M = fan.dual_lattice()
407
+ m = M(m)
408
+ if alpha in ZZ:
409
+ ray = fan.ray(alpha)
410
+ elif alpha in N:
411
+ ray = alpha
412
+ else:
413
+ cone = fan.cone_containing(alpha)
414
+ if cone.dim() != 1:
415
+ raise ValueError('does not determine one-dimensional cone')
416
+ ray = cone.ray(0)
417
+ return self.get_degree(ray, ray*m)
418
+
419
+ @cached_method
420
+ def E_intersection(self, sigma, m):
421
+ r"""
422
+ Return the vector subspace `E^\sigma(m)`.
423
+
424
+ See [Kly1990]_, equation 4.1.
425
+
426
+ INPUT:
427
+
428
+ - ``sigma`` -- a cone of the fan of the base toric variety
429
+
430
+ - ``m`` -- tuple of integers or `M`-lattice point. A point in
431
+ the dual lattice of the fan. Must be immutable.
432
+
433
+ OUTPUT: the subspace `E^\sigma(m)`.
434
+
435
+ EXAMPLES::
436
+
437
+ sage: X = toric_varieties.P2()
438
+ sage: fan = X.fan()
439
+ sage: V = X.sheaves.tangent_bundle()
440
+ sage: V.E_intersection(fan(1)[0], (1,0))
441
+ Vector space of degree 2 and dimension 1 over Rational Field
442
+ Basis matrix: [1 0]
443
+ sage: V.E_intersection(fan(2)[0], (-1,1))
444
+ Vector space of degree 2 and dimension 1 over Rational Field
445
+ Basis matrix: [0 1]
446
+
447
+ For the empty cone, this is always the whole vector space::
448
+
449
+ sage: V.E_intersection(fan(0)[0], (1,0))
450
+ Vector space of dimension 2 over Rational Field
451
+ """
452
+ sigma = self._variety.fan().embed(sigma)
453
+ V = self.fiber()
454
+ for alpha in sigma.rays():
455
+ V = V.intersection(self.E_degree(alpha, m))
456
+ return V
457
+
458
+ @cached_method
459
+ def E_quotient(self, sigma, m):
460
+ r"""
461
+ Return the vector space quotient `E_\sigma(m)`.
462
+
463
+ See [Kly1990]_, equation 4.1.
464
+
465
+ INPUT:
466
+
467
+ - ``sigma`` -- a cone of the fan of the base toric variety
468
+
469
+ - ``m`` -- tuple of integers or `M`-lattice point. A point in
470
+ the dual lattice of the fan. Must be immutable.
471
+
472
+ OUTPUT: the subspace `E_\sigma(m)`.
473
+
474
+ EXAMPLES::
475
+
476
+ sage: X = toric_varieties.P2()
477
+ sage: fan = X.fan()
478
+ sage: M = fan.dual_lattice()
479
+ sage: cone = fan(1)[0]
480
+ sage: V = X.sheaves.tangent_bundle()
481
+ sage: m = M(1, 0)
482
+ sage: m.set_immutable()
483
+ sage: V.E_quotient(cone, m)
484
+ Vector space quotient V/W of dimension 1 over Rational Field where
485
+ V: Vector space of dimension 2 over Rational Field
486
+ W: Vector space of degree 2 and dimension 1 over Rational Field
487
+ Basis matrix: [1 0]
488
+ sage: V.E_quotient(fan(2)[0], (-1,1))
489
+ Vector space quotient V/W of dimension 0 over Rational Field where
490
+ V: Vector space of dimension 2 over Rational Field
491
+ W: Vector space of degree 2 and dimension 2 over Rational Field
492
+ Basis matrix:
493
+ [1 0]
494
+ [0 1]
495
+ """
496
+ sigma = self._variety.fan().embed(sigma)
497
+ V = self.fiber()
498
+ generators = []
499
+ for alpha in sigma.rays():
500
+ generators.extend(self.E_degree(alpha, m).gens())
501
+ return V.quotient(V.span(generators))
502
+
503
+ @cached_method
504
+ def E_quotient_projection(self, sigma, tau, m):
505
+ r"""
506
+ Return the projection map `E_\sigma(m) \to E_\tau(m)` where
507
+ `\sigma` is a face of `\tau`.
508
+
509
+ INPUT:
510
+
511
+ - ``sigma`` -- a cone of the fan of the base toric variety
512
+
513
+ - ``tau`` -- a cone of the fan containing ``sigma``
514
+
515
+ - ``m`` -- tuple of integers or `M`-lattice point. A point in
516
+ the dual lattice of the fan. Must be immutable.
517
+
518
+ OUTPUT: the restriction map
519
+
520
+ .. MATH::
521
+
522
+ E_\sigma(m) \to E_\tau(m)
523
+
524
+ EXAMPLES::
525
+
526
+ sage: P3 = toric_varieties.P(3)
527
+ sage: rays = [(1,0,0), (0,1,0), (0,0,1)]
528
+ sage: F1 = FilteredVectorSpace(rays, {0: [0], 1: [2], 2: [1]})
529
+ sage: F2 = FilteredVectorSpace(3, 0)
530
+ sage: r = P3.fan().rays()
531
+ sage: V = P3.sheaves.Klyachko({r[0]: F1, r[1]: F2, r[2]: F2, r[3]: F2})
532
+ sage: tau = Cone([(1,0,0), (0,1,0)])
533
+ sage: sigma = Cone([(1,0,0)])
534
+ sage: M = P3.fan().dual_lattice()
535
+ sage: m = M(2,1,0)
536
+ sage: m.set_immutable()
537
+ sage: V.E_quotient(sigma, m)
538
+ Vector space quotient V/W of dimension 2 over Rational Field where
539
+ V: Vector space of dimension 3 over Rational Field
540
+ W: Vector space of degree 3 and dimension 1 over Rational Field
541
+ Basis matrix: [0 1 0]
542
+ sage: V.E_quotient(tau, m)
543
+ Vector space quotient V/W of dimension 2 over Rational Field where
544
+ V: Vector space of dimension 3 over Rational Field
545
+ W: Vector space of degree 3 and dimension 1 over Rational Field
546
+ Basis matrix: [0 1 0]
547
+ sage: V.E_quotient_projection(sigma, tau, m)
548
+ Vector space morphism represented by the matrix:
549
+ [1 0]
550
+ [0 1]
551
+ Domain: Vector space quotient V/W of dimension 2 over Rational Field where
552
+ V: Vector space of dimension 3 over Rational Field
553
+ W: Vector space of degree 3 and dimension 1 over Rational Field
554
+ Basis matrix: [0 1 0]
555
+ Codomain: Vector space quotient V/W of dimension 2 over Rational Field where
556
+ V: Vector space of dimension 3 over Rational Field
557
+ W: Vector space of degree 3 and dimension 1 over Rational Field
558
+ Basis matrix: [0 1 0]
559
+ """
560
+ if not sigma.is_face_of(tau):
561
+ raise ValueError('the cone sigma is not a face of the cone tau')
562
+ E_sigma = self.E_quotient(sigma, m)
563
+ E_tau = self.E_quotient(tau, m)
564
+ images = [E_tau(E_sigma.lift(g)) for g in E_sigma.gens()]
565
+ return E_sigma.hom(images, codomain=E_tau)
566
+
567
+ def cohomology_complex(self, m):
568
+ r"""
569
+ Return the "cohomology complex" `C^*(m)`.
570
+
571
+ See [Kly1990]_, equation 4.2.
572
+
573
+ INPUT:
574
+
575
+ - ``m`` -- tuple of integers or `M`-lattice point. A point in
576
+ the dual lattice of the fan. Must be immutable.
577
+
578
+ OUTPUT:
579
+
580
+ The "cohomology complex" as a chain complex over the
581
+ :meth:`base_ring`.
582
+
583
+ EXAMPLES::
584
+
585
+ sage: P3 = toric_varieties.P(3)
586
+ sage: rays = [(1,0,0), (0,1,0), (0,0,1)]
587
+ sage: F1 = FilteredVectorSpace(rays, {0: [0], 1: [2], 2: [1]})
588
+ sage: F2 = FilteredVectorSpace(rays, {0: [1,2], 1: [0]})
589
+ sage: r = P3.fan().rays()
590
+ sage: V = P3.sheaves.Klyachko({r[0]: F1, r[1]: F2, r[2]: F2, r[3]: F2})
591
+ sage: tau = Cone([(1,0,0), (0,1,0)])
592
+ sage: sigma = Cone([(1, 0, 0)])
593
+ sage: M = P3.fan().dual_lattice()
594
+ sage: m = M(1, 1, 0); m.set_immutable()
595
+ sage: V.cohomology_complex(m)
596
+ Chain complex with at most 2 nonzero terms over Rational Field
597
+
598
+ sage: F = CyclotomicField(3)
599
+ sage: P3 = toric_varieties.P(3).change_ring(F)
600
+ sage: V = P3.sheaves.Klyachko({r[0]: F1, r[1]: F2, r[2]: F2, r[3]: F2})
601
+ sage: V.cohomology_complex(m)
602
+ Chain complex with at most 2 nonzero terms over Cyclotomic
603
+ Field of order 3 and degree 2
604
+ """
605
+ fan = self._variety.fan()
606
+ C = fan.complex()
607
+ CV = []
608
+ F = self.base_ring()
609
+ for dim in range(1, fan.dim()+1):
610
+ codim = fan.dim() - dim
611
+ d_C = C.differential(codim)
612
+ d_V = []
613
+ for j in range(d_C.ncols()):
614
+ tau = fan(dim)[j]
615
+ d_V_row = []
616
+ for i in range(d_C.nrows()):
617
+ sigma = fan(dim-1)[i]
618
+ if sigma.is_face_of(tau):
619
+ pr = self.E_quotient_projection(sigma, tau, m)
620
+ d = d_C[i, j] * pr.matrix().transpose()
621
+ else:
622
+ E_sigma = self.E_quotient(sigma, m)
623
+ E_tau = self.E_quotient(tau, m)
624
+ d = zero_matrix(F, E_tau.dimension(), E_sigma.dimension())
625
+ d_V_row.append(d)
626
+ d_V.append(d_V_row)
627
+ d_V = block_matrix(d_V, ring=F)
628
+ CV.append(d_V)
629
+ from sage.homology.chain_complex import ChainComplex
630
+ return ChainComplex(CV, base_ring=self.base_ring())
631
+
632
+ def cohomology(self, degree=None, weight=None, dim=False):
633
+ r"""
634
+ Return the bundle cohomology groups.
635
+
636
+ INPUT:
637
+
638
+ - ``degree`` -- ``None`` (default) or an integer; the degree of
639
+ the cohomology group
640
+
641
+ - ``weight`` -- ``None`` (default) or a tuple of integers or a
642
+ `M`-lattice point. A point in the dual lattice of the fan
643
+ defining a torus character. The weight of the cohomology
644
+ group.
645
+
646
+ - ``dim`` -- boolean (default: ``False``); whether to return
647
+ vector spaces or only their dimension
648
+
649
+ OUTPUT:
650
+
651
+ The cohomology group of given cohomological ``degree`` and
652
+ torus ``weight``.
653
+
654
+ * If no ``weight`` is specified, the unweighted group (sum
655
+ over all weights) is returned.
656
+
657
+ * If no ``degree`` is specified, a dictionary whose keys are
658
+ integers and whose values are the cohomology groups is
659
+ returned. If, in addition, ``dim=True``, then an integral
660
+ vector of the dimensions is returned.
661
+
662
+ EXAMPLES::
663
+
664
+ sage: V = toric_varieties.P2().sheaves.tangent_bundle()
665
+ sage: V.cohomology(degree=0, weight=(0,0))
666
+ Vector space of dimension 2 over Rational Field
667
+ sage: V.cohomology(weight=(0,0), dim=True)
668
+ (2, 0, 0)
669
+ sage: for i,j in cartesian_product((list(range(-2,3)), list(range(-2,3)))):
670
+ ....: HH = V.cohomology(weight=(i,j), dim=True)
671
+ ....: if HH.is_zero(): continue
672
+ ....: print('H^*i(P^2, TP^2)_M({}, {}) = {}'.format(i,j,HH))
673
+ H^*i(P^2, TP^2)_M(-1, 0) = (1, 0, 0)
674
+ H^*i(P^2, TP^2)_M(-1, 1) = (1, 0, 0)
675
+ H^*i(P^2, TP^2)_M(0, -1) = (1, 0, 0)
676
+ H^*i(P^2, TP^2)_M(0, 0) = (2, 0, 0)
677
+ H^*i(P^2, TP^2)_M(0, 1) = (1, 0, 0)
678
+ H^*i(P^2, TP^2)_M(1, -1) = (1, 0, 0)
679
+ H^*i(P^2, TP^2)_M(1, 0) = (1, 0, 0)
680
+ """
681
+ from sage.modules.free_module import FreeModule
682
+ if weight is None:
683
+ raise NotImplementedError('sum over weights is not implemented')
684
+ else:
685
+ weight = self.variety().fan().dual_lattice()(weight)
686
+ weight.set_immutable()
687
+ if degree is not None:
688
+ return self.cohomology(weight=weight, dim=dim)[degree]
689
+ C = self.cohomology_complex(weight)
690
+ space_dim = self._variety.dimension()
691
+ C_homology = C.homology()
692
+ HH = {}
693
+ for d in range(space_dim+1):
694
+ try:
695
+ HH[d] = C_homology[d]
696
+ except KeyError:
697
+ HH[d] = FreeModule(self.base_ring(), 0)
698
+ if dim:
699
+ HH = vector(ZZ, [HH[i].rank() for i in range(space_dim+1)])
700
+ return HH
701
+
702
+ def __richcmp__(self, other, op):
703
+ """
704
+ Compare ``self`` and ``other``.
705
+
706
+ .. warning::
707
+
708
+ This method tests whether the underlying representation is
709
+ the same. Use :meth:`is_isomorphic` to test for
710
+ mathematical equivalence.
711
+
712
+ INPUT:
713
+
714
+ - ``other`` -- anything
715
+
716
+ OUTPUT: boolean
717
+
718
+ EXAMPLES::
719
+
720
+ sage: X = toric_varieties.P2()
721
+ sage: V1 = X.sheaves.trivial_bundle(1)
722
+ sage: V2 = X.sheaves.trivial_bundle(2)
723
+ sage: V2 == V1
724
+ False
725
+ sage: V2 == V1 + V1
726
+ True
727
+
728
+ sage: T_X = X.sheaves.tangent_bundle()
729
+ sage: O_X = X.sheaves.trivial_bundle(1)
730
+ sage: T_X + O_X == O_X + T_X
731
+ False
732
+ """
733
+ if not isinstance(other, KlyachkoBundle_class):
734
+ return NotImplemented
735
+
736
+ lx = self.variety()
737
+ rx = other.variety()
738
+ if lx != rx:
739
+ return richcmp_not_equal(lx, rx, op)
740
+
741
+ return richcmp(self._filt, other._filt, op)
742
+
743
+ def is_isomorphic(self, other):
744
+ """
745
+ Test whether two bundles are isomorphic.
746
+
747
+ INPUT:
748
+
749
+ - ``other`` -- anything
750
+
751
+ OUTPUT: boolean
752
+
753
+ EXAMPLES::
754
+
755
+ sage: X = toric_varieties.P2()
756
+ sage: T_X = X.sheaves.tangent_bundle()
757
+ sage: O_X = X.sheaves.trivial_bundle(1)
758
+ sage: T_X + O_X == O_X + T_X
759
+ False
760
+ sage: (T_X + O_X).is_isomorphic(O_X + T_X)
761
+ Traceback (most recent call last):
762
+ ...
763
+ NotImplementedError
764
+ """
765
+ raise NotImplementedError
766
+
767
+ def direct_sum(self, other):
768
+ """
769
+ Return the sum of two vector bundles.
770
+
771
+ INPUT:
772
+
773
+ - ``other`` -- a Klyachko bundle over the same base
774
+
775
+ OUTPUT: the direct sum as a new Klyachko bundle
776
+
777
+ EXAMPLES::
778
+
779
+ sage: X = toric_varieties.P2()
780
+ sage: V1 = X.sheaves.trivial_bundle(1)
781
+ sage: V2 = X.sheaves.trivial_bundle(2)
782
+ sage: V2.direct_sum(V1)
783
+ Rank 3 bundle on 2-d CPR-Fano toric variety covered by 3 affine patches.
784
+
785
+ sage: V1 = X.sheaves.trivial_bundle(1)
786
+ sage: V2 = X.sheaves.trivial_bundle(2)
787
+ sage: V2 == V1 + V1
788
+ True
789
+ """
790
+ if not self.variety() == other.variety():
791
+ raise ValueError('the bundles must be over the same base toric variety')
792
+ filt = self._filt + other._filt
793
+ return self.__class__(self.variety(), filt, check=True)
794
+
795
+ __add__ = direct_sum
796
+
797
+ def tensor_product(self, other):
798
+ """
799
+ Return the sum of two vector bundles.
800
+
801
+ INPUT:
802
+
803
+ - ``other`` -- a Klyachko bundle over the same base
804
+
805
+ OUTPUT: the tensor product as a new Klyachko bundle
806
+
807
+ EXAMPLES::
808
+
809
+ sage: X = toric_varieties.P2()
810
+ sage: OX = X.sheaves.trivial_bundle(1)
811
+ sage: X.sheaves.tangent_bundle().tensor_product(OX)
812
+ Rank 2 bundle on 2-d CPR-Fano toric variety covered by 3 affine patches.
813
+ sage: OX == OX * OX
814
+ True
815
+ """
816
+ if not self.variety() == other.variety():
817
+ raise ValueError('the bundles must be over the same base toric variety')
818
+ filt = self._filt * other._filt
819
+ return self.__class__(self.variety(), filt, check=True)
820
+
821
+ __mul__ = tensor_product
822
+
823
+ def exterior_power(self, n):
824
+ r"""
825
+ Return the `n`-th exterior power.
826
+
827
+ INPUT:
828
+
829
+ - ``n`` -- integer
830
+
831
+ OUTPUT:
832
+
833
+ The `n`-th exterior power `\wedge_{i=1}^n V` of the bundle `V`
834
+ as a new Klyachko bundle.
835
+
836
+ EXAMPLES::
837
+
838
+ sage: X = toric_varieties.P2_123()
839
+ sage: TX = X.sheaves.tangent_bundle()
840
+ sage: antiK = X.sheaves.line_bundle(-X.K())
841
+ sage: TX.exterior_power(2) == antiK
842
+ True
843
+ sage: TX.wedge(2) == antiK # alias
844
+ True
845
+ """
846
+ filt = self._filt.exterior_power(n)
847
+ return self.__class__(self.variety(), filt, check=True)
848
+
849
+ wedge = exterior_power
850
+
851
+ def symmetric_power(self, n):
852
+ """
853
+ Return the `n`-th symmetric power.
854
+
855
+ INPUT:
856
+
857
+ - ``n`` -- integer
858
+
859
+ OUTPUT: the `n`-th symmetric power as a new Klyachko bundle
860
+
861
+ EXAMPLES::
862
+
863
+ sage: P1 = toric_varieties.P1()
864
+ sage: H = P1.divisor(0)
865
+ sage: L = P1.sheaves.line_bundle(H)
866
+ sage: (L + L).symmetric_power(2)
867
+ Rank 3 bundle on 1-d CPR-Fano toric variety covered by 2 affine patches.
868
+ sage: (L + L).symmetric_power(2) == L*L + L*L + L*L
869
+ True
870
+ """
871
+ filt = self._filt.symmetric_power(n)
872
+ return self.__class__(self.variety(), filt, check=True)
873
+
874
+ def dual(self):
875
+ """
876
+ Return the dual bundle.
877
+
878
+ OUTPUT: the dual bundle as a new Klyachko bundle
879
+
880
+ EXAMPLES::
881
+
882
+ sage: P1 = toric_varieties.P1()
883
+ sage: H = P1.divisor(0)
884
+ sage: L = P1.sheaves.line_bundle(H)
885
+ sage: L.dual()
886
+ Rank 1 bundle on 1-d CPR-Fano toric variety covered by 2 affine patches.
887
+ sage: L.dual() == P1.sheaves.line_bundle(-H)
888
+ True
889
+ """
890
+ filt = self._filt.dual()
891
+ return self.__class__(self.variety(), filt, check=True)
892
+
893
+ def random_deformation(self, epsilon=None):
894
+ """
895
+ Return a generic torus-equivariant deformation of the bundle.
896
+
897
+ INPUT:
898
+
899
+ - ``epsilon`` -- an element of the base ring; scales the
900
+ random deformation
901
+
902
+ OUTPUT:
903
+
904
+ A new Klyachko bundle with randomly perturbed moduli. In
905
+ particular, the same Chern classes.
906
+
907
+ EXAMPLES::
908
+
909
+ sage: P1 = toric_varieties.P1()
910
+ sage: H = P1.divisor(0)
911
+ sage: V = P1.sheaves.line_bundle(H) + P1.sheaves.line_bundle(-H)
912
+ sage: V.cohomology(dim=True, weight=(0,))
913
+ (1, 0)
914
+ sage: Vtilde = V.random_deformation()
915
+ sage: Vtilde.cohomology(dim=True, weight=(0,)) # random failure (see #32773)
916
+ (1, 0)
917
+ """
918
+ filt = self._filt.random_deformation(epsilon)
919
+ while not filt.is_exhaustive():
920
+ filt = self._filt.random_deformation(epsilon)
921
+ return self.__class__(self.variety(), filt, check=True)