passagemath-modules 10.6.31rc3__cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_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.

Potentially problematic release.


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

Files changed (807) hide show
  1. passagemath_modules-10.6.31rc3.dist-info/METADATA +281 -0
  2. passagemath_modules-10.6.31rc3.dist-info/RECORD +807 -0
  3. passagemath_modules-10.6.31rc3.dist-info/WHEEL +6 -0
  4. passagemath_modules-10.6.31rc3.dist-info/top_level.txt +2 -0
  5. passagemath_modules.libs/libgfortran-83c28eba.so.5.0.0 +0 -0
  6. passagemath_modules.libs/libgmp-6e109695.so.10.5.0 +0 -0
  7. passagemath_modules.libs/libgsl-cda90e79.so.28.0.0 +0 -0
  8. passagemath_modules.libs/libmpc-7f678fcf.so.3.3.1 +0 -0
  9. passagemath_modules.libs/libmpfr-82690d50.so.6.2.1 +0 -0
  10. passagemath_modules.libs/libopenblasp-r0-6dcb67f9.3.29.so +0 -0
  11. passagemath_modules.libs/libquadmath-2284e583.so.0.0.0 +0 -0
  12. sage/algebras/all__sagemath_modules.py +20 -0
  13. sage/algebras/catalog.py +148 -0
  14. sage/algebras/clifford_algebra.py +3107 -0
  15. sage/algebras/clifford_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
  16. sage/algebras/clifford_algebra_element.pxd +16 -0
  17. sage/algebras/clifford_algebra_element.pyx +997 -0
  18. sage/algebras/commutative_dga.py +4252 -0
  19. sage/algebras/exterior_algebra_groebner.cpython-314-x86_64-linux-gnu.so +0 -0
  20. sage/algebras/exterior_algebra_groebner.pxd +55 -0
  21. sage/algebras/exterior_algebra_groebner.pyx +727 -0
  22. sage/algebras/finite_dimensional_algebras/all.py +2 -0
  23. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +1029 -0
  24. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
  25. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +12 -0
  26. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +706 -0
  27. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py +196 -0
  28. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_morphism.py +255 -0
  29. sage/algebras/finite_gca.py +528 -0
  30. sage/algebras/group_algebra.py +232 -0
  31. sage/algebras/lie_algebras/abelian.py +197 -0
  32. sage/algebras/lie_algebras/affine_lie_algebra.py +1213 -0
  33. sage/algebras/lie_algebras/all.py +25 -0
  34. sage/algebras/lie_algebras/all__sagemath_modules.py +1 -0
  35. sage/algebras/lie_algebras/bch.py +177 -0
  36. sage/algebras/lie_algebras/bgg_dual_module.py +1184 -0
  37. sage/algebras/lie_algebras/bgg_resolution.py +232 -0
  38. sage/algebras/lie_algebras/center_uea.py +767 -0
  39. sage/algebras/lie_algebras/classical_lie_algebra.py +2516 -0
  40. sage/algebras/lie_algebras/examples.py +683 -0
  41. sage/algebras/lie_algebras/free_lie_algebra.py +973 -0
  42. sage/algebras/lie_algebras/heisenberg.py +820 -0
  43. sage/algebras/lie_algebras/lie_algebra.py +1562 -0
  44. sage/algebras/lie_algebras/lie_algebra_element.cpython-314-x86_64-linux-gnu.so +0 -0
  45. sage/algebras/lie_algebras/lie_algebra_element.pxd +68 -0
  46. sage/algebras/lie_algebras/lie_algebra_element.pyx +2122 -0
  47. sage/algebras/lie_algebras/morphism.py +661 -0
  48. sage/algebras/lie_algebras/nilpotent_lie_algebra.py +457 -0
  49. sage/algebras/lie_algebras/onsager.py +1324 -0
  50. sage/algebras/lie_algebras/poincare_birkhoff_witt.py +816 -0
  51. sage/algebras/lie_algebras/quotient.py +462 -0
  52. sage/algebras/lie_algebras/rank_two_heisenberg_virasoro.py +355 -0
  53. sage/algebras/lie_algebras/representation.py +1040 -0
  54. sage/algebras/lie_algebras/structure_coefficients.py +459 -0
  55. sage/algebras/lie_algebras/subalgebra.py +967 -0
  56. sage/algebras/lie_algebras/symplectic_derivation.py +289 -0
  57. sage/algebras/lie_algebras/verma_module.py +1630 -0
  58. sage/algebras/lie_algebras/virasoro.py +1186 -0
  59. sage/algebras/octonion_algebra.cpython-314-x86_64-linux-gnu.so +0 -0
  60. sage/algebras/octonion_algebra.pxd +20 -0
  61. sage/algebras/octonion_algebra.pyx +987 -0
  62. sage/algebras/orlik_solomon.py +907 -0
  63. sage/algebras/orlik_terao.py +779 -0
  64. sage/algebras/steenrod/all.py +7 -0
  65. sage/algebras/steenrod/steenrod_algebra.py +4258 -0
  66. sage/algebras/steenrod/steenrod_algebra_bases.py +1179 -0
  67. sage/algebras/steenrod/steenrod_algebra_misc.py +1167 -0
  68. sage/algebras/steenrod/steenrod_algebra_mult.py +954 -0
  69. sage/algebras/weyl_algebra.py +1126 -0
  70. sage/all__sagemath_modules.py +62 -0
  71. sage/calculus/all__sagemath_modules.py +19 -0
  72. sage/calculus/expr.py +205 -0
  73. sage/calculus/integration.cpython-314-x86_64-linux-gnu.so +0 -0
  74. sage/calculus/integration.pyx +698 -0
  75. sage/calculus/interpolation.cpython-314-x86_64-linux-gnu.so +0 -0
  76. sage/calculus/interpolation.pxd +13 -0
  77. sage/calculus/interpolation.pyx +387 -0
  78. sage/calculus/interpolators.cpython-314-x86_64-linux-gnu.so +0 -0
  79. sage/calculus/interpolators.pyx +326 -0
  80. sage/calculus/ode.cpython-314-x86_64-linux-gnu.so +0 -0
  81. sage/calculus/ode.pxd +5 -0
  82. sage/calculus/ode.pyx +610 -0
  83. sage/calculus/riemann.cpython-314-x86_64-linux-gnu.so +0 -0
  84. sage/calculus/riemann.pyx +1521 -0
  85. sage/calculus/test_sympy.py +201 -0
  86. sage/calculus/transforms/all.py +7 -0
  87. sage/calculus/transforms/dft.py +844 -0
  88. sage/calculus/transforms/dwt.cpython-314-x86_64-linux-gnu.so +0 -0
  89. sage/calculus/transforms/dwt.pxd +7 -0
  90. sage/calculus/transforms/dwt.pyx +160 -0
  91. sage/calculus/transforms/fft.cpython-314-x86_64-linux-gnu.so +0 -0
  92. sage/calculus/transforms/fft.pxd +12 -0
  93. sage/calculus/transforms/fft.pyx +487 -0
  94. sage/calculus/wester.py +662 -0
  95. sage/coding/abstract_code.py +1108 -0
  96. sage/coding/ag_code.py +868 -0
  97. sage/coding/ag_code_decoders.cpython-314-x86_64-linux-gnu.so +0 -0
  98. sage/coding/ag_code_decoders.pyx +2639 -0
  99. sage/coding/all.py +15 -0
  100. sage/coding/bch_code.py +494 -0
  101. sage/coding/binary_code.cpython-314-x86_64-linux-gnu.so +0 -0
  102. sage/coding/binary_code.pxd +124 -0
  103. sage/coding/binary_code.pyx +4139 -0
  104. sage/coding/bounds_catalog.py +43 -0
  105. sage/coding/channel.py +819 -0
  106. sage/coding/channels_catalog.py +29 -0
  107. sage/coding/code_bounds.py +755 -0
  108. sage/coding/code_constructions.py +804 -0
  109. sage/coding/codes_catalog.py +111 -0
  110. sage/coding/cyclic_code.py +1329 -0
  111. sage/coding/databases.py +316 -0
  112. sage/coding/decoder.py +373 -0
  113. sage/coding/decoders_catalog.py +88 -0
  114. sage/coding/delsarte_bounds.py +709 -0
  115. sage/coding/encoder.py +390 -0
  116. sage/coding/encoders_catalog.py +64 -0
  117. sage/coding/extended_code.py +468 -0
  118. sage/coding/gabidulin_code.py +1058 -0
  119. sage/coding/golay_code.py +404 -0
  120. sage/coding/goppa_code.py +441 -0
  121. sage/coding/grs_code.py +2371 -0
  122. sage/coding/guava.py +107 -0
  123. sage/coding/guruswami_sudan/all.py +1 -0
  124. sage/coding/guruswami_sudan/gs_decoder.py +897 -0
  125. sage/coding/guruswami_sudan/interpolation.py +409 -0
  126. sage/coding/guruswami_sudan/utils.py +176 -0
  127. sage/coding/hamming_code.py +176 -0
  128. sage/coding/information_set_decoder.py +1032 -0
  129. sage/coding/kasami_codes.cpython-314-x86_64-linux-gnu.so +0 -0
  130. sage/coding/kasami_codes.pyx +351 -0
  131. sage/coding/linear_code.py +3067 -0
  132. sage/coding/linear_code_no_metric.py +1354 -0
  133. sage/coding/linear_rank_metric.py +961 -0
  134. sage/coding/parity_check_code.py +353 -0
  135. sage/coding/punctured_code.py +719 -0
  136. sage/coding/reed_muller_code.py +999 -0
  137. sage/coding/self_dual_codes.py +942 -0
  138. sage/coding/source_coding/all.py +2 -0
  139. sage/coding/source_coding/huffman.py +553 -0
  140. sage/coding/subfield_subcode.py +423 -0
  141. sage/coding/two_weight_db.py +399 -0
  142. sage/combinat/all__sagemath_modules.py +7 -0
  143. sage/combinat/cartesian_product.py +347 -0
  144. sage/combinat/family.py +11 -0
  145. sage/combinat/free_module.py +1977 -0
  146. sage/combinat/root_system/all.py +147 -0
  147. sage/combinat/root_system/ambient_space.py +527 -0
  148. sage/combinat/root_system/associahedron.py +471 -0
  149. sage/combinat/root_system/braid_move_calculator.py +143 -0
  150. sage/combinat/root_system/braid_orbit.cpython-314-x86_64-linux-gnu.so +0 -0
  151. sage/combinat/root_system/braid_orbit.pyx +144 -0
  152. sage/combinat/root_system/branching_rules.py +2301 -0
  153. sage/combinat/root_system/cartan_matrix.py +1245 -0
  154. sage/combinat/root_system/cartan_type.py +3069 -0
  155. sage/combinat/root_system/coxeter_group.py +162 -0
  156. sage/combinat/root_system/coxeter_matrix.py +1261 -0
  157. sage/combinat/root_system/coxeter_type.py +681 -0
  158. sage/combinat/root_system/dynkin_diagram.py +900 -0
  159. sage/combinat/root_system/extended_affine_weyl_group.py +2993 -0
  160. sage/combinat/root_system/fundamental_group.py +795 -0
  161. sage/combinat/root_system/hecke_algebra_representation.py +1203 -0
  162. sage/combinat/root_system/integrable_representations.py +1227 -0
  163. sage/combinat/root_system/non_symmetric_macdonald_polynomials.py +1965 -0
  164. sage/combinat/root_system/pieri_factors.py +1147 -0
  165. sage/combinat/root_system/plot.py +1615 -0
  166. sage/combinat/root_system/root_lattice_realization_algebras.py +1214 -0
  167. sage/combinat/root_system/root_lattice_realizations.py +4628 -0
  168. sage/combinat/root_system/root_space.py +487 -0
  169. sage/combinat/root_system/root_system.py +882 -0
  170. sage/combinat/root_system/type_A.py +348 -0
  171. sage/combinat/root_system/type_A_affine.py +227 -0
  172. sage/combinat/root_system/type_A_infinity.py +241 -0
  173. sage/combinat/root_system/type_B.py +347 -0
  174. sage/combinat/root_system/type_BC_affine.py +287 -0
  175. sage/combinat/root_system/type_B_affine.py +216 -0
  176. sage/combinat/root_system/type_C.py +317 -0
  177. sage/combinat/root_system/type_C_affine.py +188 -0
  178. sage/combinat/root_system/type_D.py +357 -0
  179. sage/combinat/root_system/type_D_affine.py +208 -0
  180. sage/combinat/root_system/type_E.py +641 -0
  181. sage/combinat/root_system/type_E_affine.py +231 -0
  182. sage/combinat/root_system/type_F.py +387 -0
  183. sage/combinat/root_system/type_F_affine.py +137 -0
  184. sage/combinat/root_system/type_G.py +293 -0
  185. sage/combinat/root_system/type_G_affine.py +132 -0
  186. sage/combinat/root_system/type_H.py +105 -0
  187. sage/combinat/root_system/type_I.py +110 -0
  188. sage/combinat/root_system/type_Q.py +150 -0
  189. sage/combinat/root_system/type_affine.py +509 -0
  190. sage/combinat/root_system/type_dual.py +704 -0
  191. sage/combinat/root_system/type_folded.py +301 -0
  192. sage/combinat/root_system/type_marked.py +748 -0
  193. sage/combinat/root_system/type_reducible.py +601 -0
  194. sage/combinat/root_system/type_relabel.py +730 -0
  195. sage/combinat/root_system/type_super_A.py +837 -0
  196. sage/combinat/root_system/weight_lattice_realizations.py +1188 -0
  197. sage/combinat/root_system/weight_space.py +639 -0
  198. sage/combinat/root_system/weyl_characters.py +2238 -0
  199. sage/crypto/__init__.py +4 -0
  200. sage/crypto/all.py +28 -0
  201. sage/crypto/block_cipher/all.py +7 -0
  202. sage/crypto/block_cipher/des.py +1065 -0
  203. sage/crypto/block_cipher/miniaes.py +2171 -0
  204. sage/crypto/block_cipher/present.py +909 -0
  205. sage/crypto/block_cipher/sdes.py +1527 -0
  206. sage/crypto/boolean_function.cpython-314-x86_64-linux-gnu.so +0 -0
  207. sage/crypto/boolean_function.pxd +10 -0
  208. sage/crypto/boolean_function.pyx +1487 -0
  209. sage/crypto/cipher.py +78 -0
  210. sage/crypto/classical.py +3668 -0
  211. sage/crypto/classical_cipher.py +569 -0
  212. sage/crypto/cryptosystem.py +387 -0
  213. sage/crypto/key_exchange/all.py +7 -0
  214. sage/crypto/key_exchange/catalog.py +24 -0
  215. sage/crypto/key_exchange/diffie_hellman.py +323 -0
  216. sage/crypto/key_exchange/key_exchange_scheme.py +107 -0
  217. sage/crypto/lattice.py +312 -0
  218. sage/crypto/lfsr.py +295 -0
  219. sage/crypto/lwe.py +840 -0
  220. sage/crypto/mq/__init__.py +4 -0
  221. sage/crypto/mq/mpolynomialsystemgenerator.py +204 -0
  222. sage/crypto/mq/rijndael_gf.py +2345 -0
  223. sage/crypto/mq/sbox.py +7 -0
  224. sage/crypto/mq/sr.py +3344 -0
  225. sage/crypto/public_key/all.py +5 -0
  226. sage/crypto/public_key/blum_goldwasser.py +776 -0
  227. sage/crypto/sbox.cpython-314-x86_64-linux-gnu.so +0 -0
  228. sage/crypto/sbox.pyx +2090 -0
  229. sage/crypto/sboxes.py +2090 -0
  230. sage/crypto/stream.py +390 -0
  231. sage/crypto/stream_cipher.py +297 -0
  232. sage/crypto/util.py +519 -0
  233. sage/ext/all__sagemath_modules.py +1 -0
  234. sage/ext/interpreters/__init__.py +1 -0
  235. sage/ext/interpreters/all__sagemath_modules.py +2 -0
  236. sage/ext/interpreters/wrapper_cc.cpython-314-x86_64-linux-gnu.so +0 -0
  237. sage/ext/interpreters/wrapper_cc.pxd +30 -0
  238. sage/ext/interpreters/wrapper_cc.pyx +252 -0
  239. sage/ext/interpreters/wrapper_cdf.cpython-314-x86_64-linux-gnu.so +0 -0
  240. sage/ext/interpreters/wrapper_cdf.pxd +26 -0
  241. sage/ext/interpreters/wrapper_cdf.pyx +245 -0
  242. sage/ext/interpreters/wrapper_rdf.cpython-314-x86_64-linux-gnu.so +0 -0
  243. sage/ext/interpreters/wrapper_rdf.pxd +23 -0
  244. sage/ext/interpreters/wrapper_rdf.pyx +221 -0
  245. sage/ext/interpreters/wrapper_rr.cpython-314-x86_64-linux-gnu.so +0 -0
  246. sage/ext/interpreters/wrapper_rr.pxd +28 -0
  247. sage/ext/interpreters/wrapper_rr.pyx +335 -0
  248. sage/geometry/all__sagemath_modules.py +5 -0
  249. sage/geometry/toric_lattice.py +1745 -0
  250. sage/geometry/toric_lattice_element.cpython-314-x86_64-linux-gnu.so +0 -0
  251. sage/geometry/toric_lattice_element.pyx +432 -0
  252. sage/groups/abelian_gps/abelian_group.py +1925 -0
  253. sage/groups/abelian_gps/abelian_group_element.py +164 -0
  254. sage/groups/abelian_gps/all__sagemath_modules.py +5 -0
  255. sage/groups/abelian_gps/dual_abelian_group.py +421 -0
  256. sage/groups/abelian_gps/dual_abelian_group_element.py +179 -0
  257. sage/groups/abelian_gps/element_base.py +341 -0
  258. sage/groups/abelian_gps/values.py +488 -0
  259. sage/groups/additive_abelian/additive_abelian_group.py +476 -0
  260. sage/groups/additive_abelian/additive_abelian_wrapper.py +857 -0
  261. sage/groups/additive_abelian/all.py +4 -0
  262. sage/groups/additive_abelian/qmodnz.py +231 -0
  263. sage/groups/additive_abelian/qmodnz_element.py +349 -0
  264. sage/groups/affine_gps/affine_group.py +535 -0
  265. sage/groups/affine_gps/all.py +1 -0
  266. sage/groups/affine_gps/catalog.py +17 -0
  267. sage/groups/affine_gps/euclidean_group.py +246 -0
  268. sage/groups/affine_gps/group_element.py +562 -0
  269. sage/groups/all__sagemath_modules.py +12 -0
  270. sage/groups/galois_group.py +479 -0
  271. sage/groups/matrix_gps/all.py +4 -0
  272. sage/groups/matrix_gps/all__sagemath_modules.py +13 -0
  273. sage/groups/matrix_gps/catalog.py +26 -0
  274. sage/groups/matrix_gps/coxeter_group.py +927 -0
  275. sage/groups/matrix_gps/finitely_generated.py +487 -0
  276. sage/groups/matrix_gps/group_element.cpython-314-x86_64-linux-gnu.so +0 -0
  277. sage/groups/matrix_gps/group_element.pxd +11 -0
  278. sage/groups/matrix_gps/group_element.pyx +431 -0
  279. sage/groups/matrix_gps/linear.py +440 -0
  280. sage/groups/matrix_gps/matrix_group.py +617 -0
  281. sage/groups/matrix_gps/named_group.py +296 -0
  282. sage/groups/matrix_gps/orthogonal.py +544 -0
  283. sage/groups/matrix_gps/symplectic.py +251 -0
  284. sage/groups/matrix_gps/unitary.py +436 -0
  285. sage/groups/misc_gps/all__sagemath_modules.py +1 -0
  286. sage/groups/misc_gps/argument_groups.py +1905 -0
  287. sage/groups/misc_gps/imaginary_groups.py +479 -0
  288. sage/groups/perm_gps/all__sagemath_modules.py +1 -0
  289. sage/groups/perm_gps/partn_ref/all__sagemath_modules.py +1 -0
  290. sage/groups/perm_gps/partn_ref/refinement_binary.cpython-314-x86_64-linux-gnu.so +0 -0
  291. sage/groups/perm_gps/partn_ref/refinement_binary.pxd +41 -0
  292. sage/groups/perm_gps/partn_ref/refinement_binary.pyx +1167 -0
  293. sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-314-x86_64-linux-gnu.so +0 -0
  294. sage/groups/perm_gps/partn_ref/refinement_matrices.pxd +31 -0
  295. sage/groups/perm_gps/partn_ref/refinement_matrices.pyx +385 -0
  296. sage/homology/algebraic_topological_model.py +595 -0
  297. sage/homology/all.py +2 -0
  298. sage/homology/all__sagemath_modules.py +8 -0
  299. sage/homology/chain_complex.py +2148 -0
  300. sage/homology/chain_complex_homspace.py +165 -0
  301. sage/homology/chain_complex_morphism.py +629 -0
  302. sage/homology/chain_homotopy.py +604 -0
  303. sage/homology/chains.py +653 -0
  304. sage/homology/free_resolution.py +923 -0
  305. sage/homology/graded_resolution.py +567 -0
  306. sage/homology/hochschild_complex.py +756 -0
  307. sage/homology/homology_group.py +188 -0
  308. sage/homology/homology_morphism.py +422 -0
  309. sage/homology/homology_vector_space_with_basis.py +1454 -0
  310. sage/homology/koszul_complex.py +169 -0
  311. sage/homology/matrix_utils.py +205 -0
  312. sage/libs/all__sagemath_modules.py +1 -0
  313. sage/libs/gsl/__init__.py +1 -0
  314. sage/libs/gsl/airy.pxd +56 -0
  315. sage/libs/gsl/all.pxd +66 -0
  316. sage/libs/gsl/array.cpython-314-x86_64-linux-gnu.so +0 -0
  317. sage/libs/gsl/array.pxd +5 -0
  318. sage/libs/gsl/array.pyx +102 -0
  319. sage/libs/gsl/bessel.pxd +208 -0
  320. sage/libs/gsl/blas.pxd +116 -0
  321. sage/libs/gsl/blas_types.pxd +34 -0
  322. sage/libs/gsl/block.pxd +52 -0
  323. sage/libs/gsl/chebyshev.pxd +37 -0
  324. sage/libs/gsl/clausen.pxd +12 -0
  325. sage/libs/gsl/combination.pxd +47 -0
  326. sage/libs/gsl/complex.pxd +151 -0
  327. sage/libs/gsl/coulomb.pxd +30 -0
  328. sage/libs/gsl/coupling.pxd +21 -0
  329. sage/libs/gsl/dawson.pxd +12 -0
  330. sage/libs/gsl/debye.pxd +24 -0
  331. sage/libs/gsl/dilog.pxd +14 -0
  332. sage/libs/gsl/eigen.pxd +46 -0
  333. sage/libs/gsl/elementary.pxd +12 -0
  334. sage/libs/gsl/ellint.pxd +48 -0
  335. sage/libs/gsl/elljac.pxd +8 -0
  336. sage/libs/gsl/erf.pxd +32 -0
  337. sage/libs/gsl/errno.pxd +26 -0
  338. sage/libs/gsl/exp.pxd +44 -0
  339. sage/libs/gsl/expint.pxd +44 -0
  340. sage/libs/gsl/fermi_dirac.pxd +44 -0
  341. sage/libs/gsl/fft.pxd +121 -0
  342. sage/libs/gsl/fit.pxd +50 -0
  343. sage/libs/gsl/gamma.pxd +94 -0
  344. sage/libs/gsl/gegenbauer.pxd +26 -0
  345. sage/libs/gsl/histogram.pxd +176 -0
  346. sage/libs/gsl/hyperg.pxd +52 -0
  347. sage/libs/gsl/integration.pxd +69 -0
  348. sage/libs/gsl/interp.pxd +109 -0
  349. sage/libs/gsl/laguerre.pxd +24 -0
  350. sage/libs/gsl/lambert.pxd +16 -0
  351. sage/libs/gsl/legendre.pxd +90 -0
  352. sage/libs/gsl/linalg.pxd +185 -0
  353. sage/libs/gsl/log.pxd +26 -0
  354. sage/libs/gsl/math.pxd +43 -0
  355. sage/libs/gsl/matrix.pxd +143 -0
  356. sage/libs/gsl/matrix_complex.pxd +130 -0
  357. sage/libs/gsl/min.pxd +67 -0
  358. sage/libs/gsl/monte.pxd +56 -0
  359. sage/libs/gsl/ntuple.pxd +32 -0
  360. sage/libs/gsl/odeiv.pxd +70 -0
  361. sage/libs/gsl/permutation.pxd +78 -0
  362. sage/libs/gsl/poly.pxd +40 -0
  363. sage/libs/gsl/pow_int.pxd +12 -0
  364. sage/libs/gsl/psi.pxd +28 -0
  365. sage/libs/gsl/qrng.pxd +29 -0
  366. sage/libs/gsl/random.pxd +257 -0
  367. sage/libs/gsl/rng.pxd +100 -0
  368. sage/libs/gsl/roots.pxd +72 -0
  369. sage/libs/gsl/sort.pxd +36 -0
  370. sage/libs/gsl/statistics.pxd +59 -0
  371. sage/libs/gsl/sum.pxd +55 -0
  372. sage/libs/gsl/synchrotron.pxd +16 -0
  373. sage/libs/gsl/transport.pxd +24 -0
  374. sage/libs/gsl/trig.pxd +58 -0
  375. sage/libs/gsl/types.pxd +137 -0
  376. sage/libs/gsl/vector.pxd +101 -0
  377. sage/libs/gsl/vector_complex.pxd +83 -0
  378. sage/libs/gsl/wavelet.pxd +49 -0
  379. sage/libs/gsl/zeta.pxd +28 -0
  380. sage/libs/mpc/__init__.pxd +114 -0
  381. sage/libs/mpc/types.pxd +28 -0
  382. sage/libs/mpfr/__init__.pxd +299 -0
  383. sage/libs/mpfr/types.pxd +26 -0
  384. sage/libs/mpmath/__init__.py +1 -0
  385. sage/libs/mpmath/all.py +27 -0
  386. sage/libs/mpmath/all__sagemath_modules.py +1 -0
  387. sage/libs/mpmath/utils.cpython-314-x86_64-linux-gnu.so +0 -0
  388. sage/libs/mpmath/utils.pxd +4 -0
  389. sage/libs/mpmath/utils.pyx +319 -0
  390. sage/matrix/action.cpython-314-x86_64-linux-gnu.so +0 -0
  391. sage/matrix/action.pxd +26 -0
  392. sage/matrix/action.pyx +596 -0
  393. sage/matrix/all.py +9 -0
  394. sage/matrix/args.cpython-314-x86_64-linux-gnu.so +0 -0
  395. sage/matrix/args.pxd +144 -0
  396. sage/matrix/args.pyx +1668 -0
  397. sage/matrix/benchmark.py +1258 -0
  398. sage/matrix/berlekamp_massey.py +95 -0
  399. sage/matrix/compute_J_ideal.py +926 -0
  400. sage/matrix/constructor.cpython-314-x86_64-linux-gnu.so +0 -0
  401. sage/matrix/constructor.pyx +750 -0
  402. sage/matrix/docs.py +430 -0
  403. sage/matrix/echelon_matrix.cpython-314-x86_64-linux-gnu.so +0 -0
  404. sage/matrix/echelon_matrix.pyx +155 -0
  405. sage/matrix/matrix.pxd +2 -0
  406. sage/matrix/matrix0.cpython-314-x86_64-linux-gnu.so +0 -0
  407. sage/matrix/matrix0.pxd +68 -0
  408. sage/matrix/matrix0.pyx +6324 -0
  409. sage/matrix/matrix1.cpython-314-x86_64-linux-gnu.so +0 -0
  410. sage/matrix/matrix1.pxd +8 -0
  411. sage/matrix/matrix1.pyx +2851 -0
  412. sage/matrix/matrix2.cpython-314-x86_64-linux-gnu.so +0 -0
  413. sage/matrix/matrix2.pxd +25 -0
  414. sage/matrix/matrix2.pyx +20181 -0
  415. sage/matrix/matrix_cdv.cpython-314-x86_64-linux-gnu.so +0 -0
  416. sage/matrix/matrix_cdv.pxd +4 -0
  417. sage/matrix/matrix_cdv.pyx +93 -0
  418. sage/matrix/matrix_complex_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  419. sage/matrix/matrix_complex_double_dense.pxd +5 -0
  420. sage/matrix/matrix_complex_double_dense.pyx +98 -0
  421. sage/matrix/matrix_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  422. sage/matrix/matrix_dense.pxd +5 -0
  423. sage/matrix/matrix_dense.pyx +343 -0
  424. sage/matrix/matrix_domain_dense.pxd +5 -0
  425. sage/matrix/matrix_domain_sparse.pxd +5 -0
  426. sage/matrix/matrix_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  427. sage/matrix/matrix_double_dense.pxd +7 -0
  428. sage/matrix/matrix_double_dense.pyx +3906 -0
  429. sage/matrix/matrix_double_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
  430. sage/matrix/matrix_double_sparse.pxd +6 -0
  431. sage/matrix/matrix_double_sparse.pyx +248 -0
  432. sage/matrix/matrix_generic_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  433. sage/matrix/matrix_generic_dense.pxd +7 -0
  434. sage/matrix/matrix_generic_dense.pyx +354 -0
  435. sage/matrix/matrix_generic_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
  436. sage/matrix/matrix_generic_sparse.pxd +7 -0
  437. sage/matrix/matrix_generic_sparse.pyx +461 -0
  438. sage/matrix/matrix_laurent_mpolynomial_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  439. sage/matrix/matrix_laurent_mpolynomial_dense.pxd +5 -0
  440. sage/matrix/matrix_laurent_mpolynomial_dense.pyx +115 -0
  441. sage/matrix/matrix_misc.py +313 -0
  442. sage/matrix/matrix_numpy_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  443. sage/matrix/matrix_numpy_dense.pxd +14 -0
  444. sage/matrix/matrix_numpy_dense.pyx +450 -0
  445. sage/matrix/matrix_numpy_integer_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  446. sage/matrix/matrix_numpy_integer_dense.pxd +7 -0
  447. sage/matrix/matrix_numpy_integer_dense.pyx +59 -0
  448. sage/matrix/matrix_polynomial_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  449. sage/matrix/matrix_polynomial_dense.pxd +5 -0
  450. sage/matrix/matrix_polynomial_dense.pyx +5341 -0
  451. sage/matrix/matrix_real_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  452. sage/matrix/matrix_real_double_dense.pxd +7 -0
  453. sage/matrix/matrix_real_double_dense.pyx +122 -0
  454. sage/matrix/matrix_space.py +2848 -0
  455. sage/matrix/matrix_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
  456. sage/matrix/matrix_sparse.pxd +5 -0
  457. sage/matrix/matrix_sparse.pyx +1222 -0
  458. sage/matrix/matrix_window.cpython-314-x86_64-linux-gnu.so +0 -0
  459. sage/matrix/matrix_window.pxd +37 -0
  460. sage/matrix/matrix_window.pyx +242 -0
  461. sage/matrix/misc_mpfr.cpython-314-x86_64-linux-gnu.so +0 -0
  462. sage/matrix/misc_mpfr.pyx +80 -0
  463. sage/matrix/operation_table.py +1182 -0
  464. sage/matrix/special.py +3666 -0
  465. sage/matrix/strassen.cpython-314-x86_64-linux-gnu.so +0 -0
  466. sage/matrix/strassen.pyx +851 -0
  467. sage/matrix/symplectic_basis.py +541 -0
  468. sage/matrix/template.pxd +6 -0
  469. sage/matrix/tests.py +71 -0
  470. sage/matroids/advanced.py +77 -0
  471. sage/matroids/all.py +13 -0
  472. sage/matroids/basis_exchange_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  473. sage/matroids/basis_exchange_matroid.pxd +96 -0
  474. sage/matroids/basis_exchange_matroid.pyx +2344 -0
  475. sage/matroids/basis_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  476. sage/matroids/basis_matroid.pxd +45 -0
  477. sage/matroids/basis_matroid.pyx +1217 -0
  478. sage/matroids/catalog.py +44 -0
  479. sage/matroids/chow_ring.py +473 -0
  480. sage/matroids/chow_ring_ideal.py +849 -0
  481. sage/matroids/circuit_closures_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  482. sage/matroids/circuit_closures_matroid.pxd +16 -0
  483. sage/matroids/circuit_closures_matroid.pyx +559 -0
  484. sage/matroids/circuits_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  485. sage/matroids/circuits_matroid.pxd +38 -0
  486. sage/matroids/circuits_matroid.pyx +947 -0
  487. sage/matroids/constructor.py +1086 -0
  488. sage/matroids/database_collections.py +365 -0
  489. sage/matroids/database_matroids.py +5338 -0
  490. sage/matroids/dual_matroid.py +583 -0
  491. sage/matroids/extension.cpython-314-x86_64-linux-gnu.so +0 -0
  492. sage/matroids/extension.pxd +34 -0
  493. sage/matroids/extension.pyx +519 -0
  494. sage/matroids/flats_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  495. sage/matroids/flats_matroid.pxd +28 -0
  496. sage/matroids/flats_matroid.pyx +715 -0
  497. sage/matroids/gammoid.py +600 -0
  498. sage/matroids/graphic_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  499. sage/matroids/graphic_matroid.pxd +39 -0
  500. sage/matroids/graphic_matroid.pyx +2024 -0
  501. sage/matroids/lean_matrix.cpython-314-x86_64-linux-gnu.so +0 -0
  502. sage/matroids/lean_matrix.pxd +126 -0
  503. sage/matroids/lean_matrix.pyx +3667 -0
  504. sage/matroids/linear_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  505. sage/matroids/linear_matroid.pxd +180 -0
  506. sage/matroids/linear_matroid.pyx +6649 -0
  507. sage/matroids/matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  508. sage/matroids/matroid.pxd +243 -0
  509. sage/matroids/matroid.pyx +8759 -0
  510. sage/matroids/matroids_catalog.py +190 -0
  511. sage/matroids/matroids_plot_helpers.py +890 -0
  512. sage/matroids/minor_matroid.py +480 -0
  513. sage/matroids/minorfix.h +9 -0
  514. sage/matroids/named_matroids.py +5 -0
  515. sage/matroids/rank_matroid.py +268 -0
  516. sage/matroids/set_system.cpython-314-x86_64-linux-gnu.so +0 -0
  517. sage/matroids/set_system.pxd +38 -0
  518. sage/matroids/set_system.pyx +800 -0
  519. sage/matroids/transversal_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  520. sage/matroids/transversal_matroid.pxd +14 -0
  521. sage/matroids/transversal_matroid.pyx +893 -0
  522. sage/matroids/union_matroid.cpython-314-x86_64-linux-gnu.so +0 -0
  523. sage/matroids/union_matroid.pxd +20 -0
  524. sage/matroids/union_matroid.pyx +331 -0
  525. sage/matroids/unpickling.cpython-314-x86_64-linux-gnu.so +0 -0
  526. sage/matroids/unpickling.pyx +843 -0
  527. sage/matroids/utilities.py +809 -0
  528. sage/misc/all__sagemath_modules.py +20 -0
  529. sage/misc/c3.cpython-314-x86_64-linux-gnu.so +0 -0
  530. sage/misc/c3.pyx +238 -0
  531. sage/misc/compat.py +87 -0
  532. sage/misc/element_with_label.py +173 -0
  533. sage/misc/func_persist.py +79 -0
  534. sage/misc/pickle_old.cpython-314-x86_64-linux-gnu.so +0 -0
  535. sage/misc/pickle_old.pyx +19 -0
  536. sage/misc/proof.py +7 -0
  537. sage/misc/replace_dot_all.py +472 -0
  538. sage/misc/sagedoc_conf.py +168 -0
  539. sage/misc/sphinxify.py +167 -0
  540. sage/misc/test_class_pickling.py +85 -0
  541. sage/modules/all.py +42 -0
  542. sage/modules/complex_double_vector.py +25 -0
  543. sage/modules/diamond_cutting.py +380 -0
  544. sage/modules/fg_pid/all.py +1 -0
  545. sage/modules/fg_pid/fgp_element.py +456 -0
  546. sage/modules/fg_pid/fgp_module.py +2091 -0
  547. sage/modules/fg_pid/fgp_morphism.py +550 -0
  548. sage/modules/filtered_vector_space.py +1271 -0
  549. sage/modules/finite_submodule_iter.cpython-314-x86_64-linux-gnu.so +0 -0
  550. sage/modules/finite_submodule_iter.pxd +27 -0
  551. sage/modules/finite_submodule_iter.pyx +452 -0
  552. sage/modules/fp_graded/all.py +1 -0
  553. sage/modules/fp_graded/element.py +346 -0
  554. sage/modules/fp_graded/free_element.py +298 -0
  555. sage/modules/fp_graded/free_homspace.py +53 -0
  556. sage/modules/fp_graded/free_module.py +1060 -0
  557. sage/modules/fp_graded/free_morphism.py +217 -0
  558. sage/modules/fp_graded/homspace.py +563 -0
  559. sage/modules/fp_graded/module.py +1340 -0
  560. sage/modules/fp_graded/morphism.py +1990 -0
  561. sage/modules/fp_graded/steenrod/all.py +1 -0
  562. sage/modules/fp_graded/steenrod/homspace.py +65 -0
  563. sage/modules/fp_graded/steenrod/module.py +477 -0
  564. sage/modules/fp_graded/steenrod/morphism.py +404 -0
  565. sage/modules/fp_graded/steenrod/profile.py +241 -0
  566. sage/modules/free_module.py +8447 -0
  567. sage/modules/free_module_element.cpython-314-x86_64-linux-gnu.so +0 -0
  568. sage/modules/free_module_element.pxd +22 -0
  569. sage/modules/free_module_element.pyx +5445 -0
  570. sage/modules/free_module_homspace.py +369 -0
  571. sage/modules/free_module_integer.py +896 -0
  572. sage/modules/free_module_morphism.py +823 -0
  573. sage/modules/free_module_pseudohomspace.py +352 -0
  574. sage/modules/free_module_pseudomorphism.py +578 -0
  575. sage/modules/free_quadratic_module.py +1706 -0
  576. sage/modules/free_quadratic_module_integer_symmetric.py +1790 -0
  577. sage/modules/matrix_morphism.py +1745 -0
  578. sage/modules/misc.py +103 -0
  579. sage/modules/module_functors.py +192 -0
  580. sage/modules/multi_filtered_vector_space.py +719 -0
  581. sage/modules/ore_module.py +2208 -0
  582. sage/modules/ore_module_element.py +178 -0
  583. sage/modules/ore_module_homspace.py +147 -0
  584. sage/modules/ore_module_morphism.py +968 -0
  585. sage/modules/quotient_module.py +699 -0
  586. sage/modules/real_double_vector.py +22 -0
  587. sage/modules/submodule.py +255 -0
  588. sage/modules/tensor_operations.py +567 -0
  589. sage/modules/torsion_quadratic_module.py +1352 -0
  590. sage/modules/tutorial_free_modules.py +248 -0
  591. sage/modules/vector_complex_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  592. sage/modules/vector_complex_double_dense.pxd +6 -0
  593. sage/modules/vector_complex_double_dense.pyx +117 -0
  594. sage/modules/vector_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  595. sage/modules/vector_double_dense.pxd +6 -0
  596. sage/modules/vector_double_dense.pyx +604 -0
  597. sage/modules/vector_integer_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  598. sage/modules/vector_integer_dense.pxd +15 -0
  599. sage/modules/vector_integer_dense.pyx +361 -0
  600. sage/modules/vector_integer_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
  601. sage/modules/vector_integer_sparse.pxd +29 -0
  602. sage/modules/vector_integer_sparse.pyx +406 -0
  603. sage/modules/vector_modn_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  604. sage/modules/vector_modn_dense.pxd +12 -0
  605. sage/modules/vector_modn_dense.pyx +394 -0
  606. sage/modules/vector_modn_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
  607. sage/modules/vector_modn_sparse.pxd +21 -0
  608. sage/modules/vector_modn_sparse.pyx +298 -0
  609. sage/modules/vector_numpy_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  610. sage/modules/vector_numpy_dense.pxd +15 -0
  611. sage/modules/vector_numpy_dense.pyx +304 -0
  612. sage/modules/vector_numpy_integer_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  613. sage/modules/vector_numpy_integer_dense.pxd +7 -0
  614. sage/modules/vector_numpy_integer_dense.pyx +54 -0
  615. sage/modules/vector_rational_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  616. sage/modules/vector_rational_dense.pxd +15 -0
  617. sage/modules/vector_rational_dense.pyx +387 -0
  618. sage/modules/vector_rational_sparse.cpython-314-x86_64-linux-gnu.so +0 -0
  619. sage/modules/vector_rational_sparse.pxd +30 -0
  620. sage/modules/vector_rational_sparse.pyx +413 -0
  621. sage/modules/vector_real_double_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  622. sage/modules/vector_real_double_dense.pxd +6 -0
  623. sage/modules/vector_real_double_dense.pyx +126 -0
  624. sage/modules/vector_space_homspace.py +430 -0
  625. sage/modules/vector_space_morphism.py +989 -0
  626. sage/modules/with_basis/all.py +15 -0
  627. sage/modules/with_basis/cell_module.py +494 -0
  628. sage/modules/with_basis/indexed_element.cpython-314-x86_64-linux-gnu.so +0 -0
  629. sage/modules/with_basis/indexed_element.pxd +13 -0
  630. sage/modules/with_basis/indexed_element.pyx +1058 -0
  631. sage/modules/with_basis/invariant.py +1075 -0
  632. sage/modules/with_basis/morphism.py +1636 -0
  633. sage/modules/with_basis/representation.py +2939 -0
  634. sage/modules/with_basis/subquotient.py +685 -0
  635. sage/numerical/all__sagemath_modules.py +6 -0
  636. sage/numerical/gauss_legendre.cpython-314-x86_64-linux-gnu.so +0 -0
  637. sage/numerical/gauss_legendre.pyx +381 -0
  638. sage/numerical/optimize.py +910 -0
  639. sage/probability/all.py +10 -0
  640. sage/probability/probability_distribution.cpython-314-x86_64-linux-gnu.so +0 -0
  641. sage/probability/probability_distribution.pyx +1242 -0
  642. sage/probability/random_variable.py +411 -0
  643. sage/quadratic_forms/all.py +4 -0
  644. sage/quadratic_forms/all__sagemath_modules.py +15 -0
  645. sage/quadratic_forms/binary_qf.py +2042 -0
  646. sage/quadratic_forms/bqf_class_group.py +748 -0
  647. sage/quadratic_forms/constructions.py +93 -0
  648. sage/quadratic_forms/count_local_2.cpython-314-x86_64-linux-gnu.so +0 -0
  649. sage/quadratic_forms/count_local_2.pyx +365 -0
  650. sage/quadratic_forms/extras.py +195 -0
  651. sage/quadratic_forms/quadratic_form.py +1753 -0
  652. sage/quadratic_forms/quadratic_form__count_local_2.py +221 -0
  653. sage/quadratic_forms/quadratic_form__equivalence_testing.py +708 -0
  654. sage/quadratic_forms/quadratic_form__evaluate.cpython-314-x86_64-linux-gnu.so +0 -0
  655. sage/quadratic_forms/quadratic_form__evaluate.pyx +139 -0
  656. sage/quadratic_forms/quadratic_form__local_density_congruence.py +977 -0
  657. sage/quadratic_forms/quadratic_form__local_field_invariants.py +1072 -0
  658. sage/quadratic_forms/quadratic_form__neighbors.py +424 -0
  659. sage/quadratic_forms/quadratic_form__reduction_theory.py +488 -0
  660. sage/quadratic_forms/quadratic_form__split_local_covering.py +416 -0
  661. sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +657 -0
  662. sage/quadratic_forms/quadratic_form__theta.py +352 -0
  663. sage/quadratic_forms/quadratic_form__variable_substitutions.py +370 -0
  664. sage/quadratic_forms/random_quadraticform.py +209 -0
  665. sage/quadratic_forms/ternary.cpython-314-x86_64-linux-gnu.so +0 -0
  666. sage/quadratic_forms/ternary.pyx +1154 -0
  667. sage/quadratic_forms/ternary_qf.py +2027 -0
  668. sage/rings/all__sagemath_modules.py +28 -0
  669. sage/rings/asymptotic/all__sagemath_modules.py +1 -0
  670. sage/rings/asymptotic/misc.py +1252 -0
  671. sage/rings/cc.py +4 -0
  672. sage/rings/cfinite_sequence.py +1306 -0
  673. sage/rings/complex_conversion.cpython-314-x86_64-linux-gnu.so +0 -0
  674. sage/rings/complex_conversion.pxd +8 -0
  675. sage/rings/complex_conversion.pyx +23 -0
  676. sage/rings/complex_double.cpython-314-x86_64-linux-gnu.so +0 -0
  677. sage/rings/complex_double.pxd +21 -0
  678. sage/rings/complex_double.pyx +2654 -0
  679. sage/rings/complex_mpc.cpython-314-x86_64-linux-gnu.so +0 -0
  680. sage/rings/complex_mpc.pxd +21 -0
  681. sage/rings/complex_mpc.pyx +2576 -0
  682. sage/rings/complex_mpfr.cpython-314-x86_64-linux-gnu.so +0 -0
  683. sage/rings/complex_mpfr.pxd +18 -0
  684. sage/rings/complex_mpfr.pyx +3602 -0
  685. sage/rings/derivation.py +2334 -0
  686. sage/rings/finite_rings/all__sagemath_modules.py +1 -0
  687. sage/rings/finite_rings/maps_finite_field.py +191 -0
  688. sage/rings/function_field/all__sagemath_modules.py +8 -0
  689. sage/rings/function_field/derivations.py +102 -0
  690. sage/rings/function_field/derivations_rational.py +132 -0
  691. sage/rings/function_field/differential.py +853 -0
  692. sage/rings/function_field/divisor.py +1107 -0
  693. sage/rings/function_field/drinfeld_modules/action.py +199 -0
  694. sage/rings/function_field/drinfeld_modules/all.py +1 -0
  695. sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +673 -0
  696. sage/rings/function_field/drinfeld_modules/drinfeld_module.py +2087 -0
  697. sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1131 -0
  698. sage/rings/function_field/drinfeld_modules/homset.py +420 -0
  699. sage/rings/function_field/drinfeld_modules/morphism.py +820 -0
  700. sage/rings/function_field/hermite_form_polynomial.cpython-314-x86_64-linux-gnu.so +0 -0
  701. sage/rings/function_field/hermite_form_polynomial.pyx +188 -0
  702. sage/rings/function_field/khuri_makdisi.cpython-314-x86_64-linux-gnu.so +0 -0
  703. sage/rings/function_field/khuri_makdisi.pyx +935 -0
  704. sage/rings/invariants/all.py +4 -0
  705. sage/rings/invariants/invariant_theory.py +4597 -0
  706. sage/rings/invariants/reconstruction.py +395 -0
  707. sage/rings/polynomial/all__sagemath_modules.py +17 -0
  708. sage/rings/polynomial/integer_valued_polynomials.py +1230 -0
  709. sage/rings/polynomial/laurent_polynomial_mpair.cpython-314-x86_64-linux-gnu.so +0 -0
  710. sage/rings/polynomial/laurent_polynomial_mpair.pxd +15 -0
  711. sage/rings/polynomial/laurent_polynomial_mpair.pyx +2023 -0
  712. sage/rings/polynomial/ore_function_element.py +952 -0
  713. sage/rings/polynomial/ore_function_field.py +1028 -0
  714. sage/rings/polynomial/ore_polynomial_element.cpython-314-x86_64-linux-gnu.so +0 -0
  715. sage/rings/polynomial/ore_polynomial_element.pxd +48 -0
  716. sage/rings/polynomial/ore_polynomial_element.pyx +3145 -0
  717. sage/rings/polynomial/ore_polynomial_ring.py +1334 -0
  718. sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-314-x86_64-linux-gnu.so +0 -0
  719. sage/rings/polynomial/polynomial_real_mpfr_dense.pyx +788 -0
  720. sage/rings/polynomial/q_integer_valued_polynomials.py +1264 -0
  721. sage/rings/polynomial/skew_polynomial_element.cpython-314-x86_64-linux-gnu.so +0 -0
  722. sage/rings/polynomial/skew_polynomial_element.pxd +9 -0
  723. sage/rings/polynomial/skew_polynomial_element.pyx +684 -0
  724. sage/rings/polynomial/skew_polynomial_finite_field.cpython-314-x86_64-linux-gnu.so +0 -0
  725. sage/rings/polynomial/skew_polynomial_finite_field.pxd +19 -0
  726. sage/rings/polynomial/skew_polynomial_finite_field.pyx +1093 -0
  727. sage/rings/polynomial/skew_polynomial_finite_order.cpython-314-x86_64-linux-gnu.so +0 -0
  728. sage/rings/polynomial/skew_polynomial_finite_order.pxd +10 -0
  729. sage/rings/polynomial/skew_polynomial_finite_order.pyx +567 -0
  730. sage/rings/polynomial/skew_polynomial_ring.py +908 -0
  731. sage/rings/real_double_element_gsl.cpython-314-x86_64-linux-gnu.so +0 -0
  732. sage/rings/real_double_element_gsl.pxd +8 -0
  733. sage/rings/real_double_element_gsl.pyx +794 -0
  734. sage/rings/real_field.py +58 -0
  735. sage/rings/real_mpfr.cpython-314-x86_64-linux-gnu.so +0 -0
  736. sage/rings/real_mpfr.pxd +29 -0
  737. sage/rings/real_mpfr.pyx +6122 -0
  738. sage/rings/ring_extension.cpython-314-x86_64-linux-gnu.so +0 -0
  739. sage/rings/ring_extension.pxd +42 -0
  740. sage/rings/ring_extension.pyx +2779 -0
  741. sage/rings/ring_extension_conversion.cpython-314-x86_64-linux-gnu.so +0 -0
  742. sage/rings/ring_extension_conversion.pxd +16 -0
  743. sage/rings/ring_extension_conversion.pyx +462 -0
  744. sage/rings/ring_extension_element.cpython-314-x86_64-linux-gnu.so +0 -0
  745. sage/rings/ring_extension_element.pxd +21 -0
  746. sage/rings/ring_extension_element.pyx +1635 -0
  747. sage/rings/ring_extension_homset.py +64 -0
  748. sage/rings/ring_extension_morphism.cpython-314-x86_64-linux-gnu.so +0 -0
  749. sage/rings/ring_extension_morphism.pxd +35 -0
  750. sage/rings/ring_extension_morphism.pyx +920 -0
  751. sage/schemes/all__sagemath_modules.py +1 -0
  752. sage/schemes/projective/all__sagemath_modules.py +1 -0
  753. sage/schemes/projective/coherent_sheaf.py +300 -0
  754. sage/schemes/projective/cohomology.py +510 -0
  755. sage/stats/all.py +15 -0
  756. sage/stats/basic_stats.py +489 -0
  757. sage/stats/distributions/all.py +7 -0
  758. sage/stats/distributions/catalog.py +34 -0
  759. sage/stats/distributions/dgs.h +50 -0
  760. sage/stats/distributions/dgs.pxd +111 -0
  761. sage/stats/distributions/dgs_bern.h +400 -0
  762. sage/stats/distributions/dgs_gauss.h +614 -0
  763. sage/stats/distributions/dgs_misc.h +104 -0
  764. sage/stats/distributions/discrete_gaussian_integer.cpython-314-x86_64-linux-gnu.so +0 -0
  765. sage/stats/distributions/discrete_gaussian_integer.pxd +14 -0
  766. sage/stats/distributions/discrete_gaussian_integer.pyx +498 -0
  767. sage/stats/distributions/discrete_gaussian_lattice.py +908 -0
  768. sage/stats/distributions/discrete_gaussian_polynomial.py +141 -0
  769. sage/stats/hmm/all.py +15 -0
  770. sage/stats/hmm/chmm.cpython-314-x86_64-linux-gnu.so +0 -0
  771. sage/stats/hmm/chmm.pyx +1595 -0
  772. sage/stats/hmm/distributions.cpython-314-x86_64-linux-gnu.so +0 -0
  773. sage/stats/hmm/distributions.pxd +29 -0
  774. sage/stats/hmm/distributions.pyx +531 -0
  775. sage/stats/hmm/hmm.cpython-314-x86_64-linux-gnu.so +0 -0
  776. sage/stats/hmm/hmm.pxd +17 -0
  777. sage/stats/hmm/hmm.pyx +1388 -0
  778. sage/stats/hmm/util.cpython-314-x86_64-linux-gnu.so +0 -0
  779. sage/stats/hmm/util.pxd +7 -0
  780. sage/stats/hmm/util.pyx +165 -0
  781. sage/stats/intlist.cpython-314-x86_64-linux-gnu.so +0 -0
  782. sage/stats/intlist.pxd +14 -0
  783. sage/stats/intlist.pyx +588 -0
  784. sage/stats/r.py +49 -0
  785. sage/stats/time_series.cpython-314-x86_64-linux-gnu.so +0 -0
  786. sage/stats/time_series.pxd +6 -0
  787. sage/stats/time_series.pyx +2546 -0
  788. sage/tensor/all.py +2 -0
  789. sage/tensor/modules/all.py +8 -0
  790. sage/tensor/modules/alternating_contr_tensor.py +761 -0
  791. sage/tensor/modules/comp.py +5598 -0
  792. sage/tensor/modules/ext_pow_free_module.py +824 -0
  793. sage/tensor/modules/finite_rank_free_module.py +3589 -0
  794. sage/tensor/modules/format_utilities.py +333 -0
  795. sage/tensor/modules/free_module_alt_form.py +858 -0
  796. sage/tensor/modules/free_module_automorphism.py +1207 -0
  797. sage/tensor/modules/free_module_basis.py +1074 -0
  798. sage/tensor/modules/free_module_element.py +284 -0
  799. sage/tensor/modules/free_module_homset.py +652 -0
  800. sage/tensor/modules/free_module_linear_group.py +564 -0
  801. sage/tensor/modules/free_module_morphism.py +1581 -0
  802. sage/tensor/modules/free_module_tensor.py +3289 -0
  803. sage/tensor/modules/reflexive_module.py +386 -0
  804. sage/tensor/modules/tensor_free_module.py +780 -0
  805. sage/tensor/modules/tensor_free_submodule.py +538 -0
  806. sage/tensor/modules/tensor_free_submodule_basis.py +140 -0
  807. sage/tensor/modules/tensor_with_indices.py +1043 -0
@@ -0,0 +1,1454 @@
1
+ # sage_setup: distribution = sagemath-modules
2
+ # sage.doctest: needs sage.graphs (because all doctests use the catalogs simplicial_complexes, cubical_complexes)
3
+ """
4
+ Homology and cohomology with a basis
5
+
6
+ This module provides homology and cohomology vector spaces suitable
7
+ for computing cup products and cohomology operations.
8
+
9
+ REFERENCES:
10
+
11
+ - [GDR2003]_
12
+ - [GDR1999]_
13
+
14
+ AUTHORS:
15
+
16
+ - John H. Palmieri, Travis Scrimshaw (2015-09)
17
+ """
18
+ ########################################################################
19
+ # Copyright (C) 2015 John H. Palmieri <palmieri@math.washington.edu>
20
+ # Travis Scrimshaw <tscrimsh at umn.edu>
21
+ #
22
+ # Distributed under the terms of the GNU General Public License (GPL)
23
+ # as published by the Free Software Foundation; either version 2 of
24
+ # the License, or (at your option) any later version.
25
+ #
26
+ # https://www.gnu.org/licenses/
27
+ ########################################################################
28
+
29
+ from sage.algebras.steenrod.steenrod_algebra import SteenrodAlgebra
30
+ from sage.misc.cachefunc import cached_method
31
+ from sage.categories.algebras import Algebras
32
+ from sage.categories.category import Category
33
+ from sage.categories.left_modules import LeftModules
34
+ from sage.categories.right_modules import RightModules
35
+ from sage.categories.modules import Modules
36
+ from sage.combinat.free_module import CombinatorialFreeModule
37
+ from sage.matrix.constructor import matrix
38
+ from sage.modules.free_module_element import vector
39
+ from sage.sets.family import Family
40
+
41
+ try:
42
+ from sage.topology.simplicial_complex import SimplicialComplex
43
+ from sage.topology.simplicial_set import SimplicialSet_arbitrary
44
+ from sage.topology.cubical_complex import CubicalComplex
45
+ except ImportError:
46
+ SimplicialComplex = SimplicialSet_arbitrary = CubicalComplex = ()
47
+
48
+
49
+ class HomologyVectorSpaceWithBasis(CombinatorialFreeModule):
50
+ r"""
51
+ Homology (or cohomology) vector space.
52
+
53
+ This provides enough structure to allow the computation of cup
54
+ products and cohomology operations. See the class
55
+ :class:`CohomologyRing` (which derives from this) for examples.
56
+
57
+ It also requires field coefficients (hence the "VectorSpace" in
58
+ the name of the class).
59
+
60
+ .. NOTE::
61
+
62
+ This is not intended to be created directly by the user, but
63
+ instead via the methods
64
+ :meth:`~sage.topology.cell_complex.GenericCellComplex.homology_with_basis` and
65
+ :meth:`~sage.topology.cell_complex.GenericCellComplex.cohomology_ring`
66
+ for the class of :class:`cell
67
+ complexes<sage.topology.cell_complex.GenericCellComplex>`.
68
+
69
+ INPUT:
70
+
71
+ - ``base_ring`` -- must be a field
72
+ - ``cell_complex`` -- the cell complex whose homology we are
73
+ computing
74
+ - ``cohomology`` -- boolean (default: ``False``); if ``True``, return
75
+ the cohomology as a module
76
+ - ``category`` -- (optional) a subcategory of modules with basis
77
+
78
+ EXAMPLES:
79
+
80
+ Homology classes are denoted by ``h_{d,i}`` where ``d`` is the
81
+ degree of the homology class and ``i`` is their index in the list
82
+ of basis elements in that degree. Cohomology classes are denoted
83
+ ``h^{1,0}``::
84
+
85
+ sage: RP2 = cubical_complexes.RealProjectivePlane()
86
+ sage: RP2.homology_with_basis(GF(2))
87
+ Homology module of Cubical complex with 21 vertices and 81 cubes
88
+ over Finite Field of size 2
89
+ sage: RP2.cohomology_ring(GF(2))
90
+ Cohomology ring of Cubical complex with 21 vertices and 81 cubes
91
+ over Finite Field of size 2
92
+ sage: simplicial_complexes.Torus().homology_with_basis(QQ)
93
+ Homology module of Minimal triangulation of the torus
94
+ over Rational Field
95
+
96
+ To access a basis element, use its degree and index (0 or 1 in the 1st
97
+ cohomology group of a torus)::
98
+
99
+ sage: H = simplicial_complexes.Torus().cohomology_ring(QQ)
100
+ sage: H.basis(1)
101
+ Finite family {(1, 0): h^{1,0}, (1, 1): h^{1,1}}
102
+ sage: x = H.basis()[1,0]; x
103
+ h^{1,0}
104
+ sage: y = H.basis()[1,1]; y
105
+ h^{1,1}
106
+ sage: 2*x-3*y
107
+ 2*h^{1,0} - 3*h^{1,1}
108
+
109
+ You can compute cup products of cohomology classes::
110
+
111
+ sage: x.cup_product(y)
112
+ -h^{2,0}
113
+ sage: y.cup_product(x)
114
+ h^{2,0}
115
+ sage: x.cup_product(x)
116
+ 0
117
+
118
+ This works with simplicial, cubical, and `\Delta`-complexes, and
119
+ also simplicial sets::
120
+
121
+ sage: Torus_c = cubical_complexes.Torus()
122
+ sage: H = Torus_c.cohomology_ring(GF(2))
123
+ sage: x,y = H.basis(1)
124
+ sage: x.cup_product(x)
125
+ 0
126
+ sage: x.cup_product(y)
127
+ h^{2,0}
128
+ sage: y.cup_product(y)
129
+ 0
130
+
131
+ sage: Klein_d = delta_complexes.KleinBottle()
132
+ sage: H = Klein_d.cohomology_ring(GF(2))
133
+ sage: u,v = sorted(H.basis(1))
134
+ sage: u.cup_product(u)
135
+ h^{2,0}
136
+ sage: u.cup_product(v)
137
+ 0
138
+ sage: v.cup_product(v)
139
+ h^{2,0}
140
+
141
+ An isomorphism between the rings for the cubical model and the
142
+ `\Delta`-complex model can be obtained by sending `x` to `u+v`,
143
+ `y` to `v`. ::
144
+
145
+ sage: # needs sage.groups
146
+ sage: X = simplicial_sets.RealProjectiveSpace(6)
147
+ sage: H_X = X.cohomology_ring(GF(2))
148
+ sage: a = H_X.basis()[1,0]
149
+ sage: a**6
150
+ h^{6,0}
151
+ sage: a**7
152
+ 0
153
+
154
+ All products of positive-dimensional elements in a suspension
155
+ should be zero::
156
+
157
+ sage: # needs sage.groups
158
+ sage: Y = X.suspension()
159
+ sage: H_Y = Y.cohomology_ring(GF(2))
160
+ sage: b = H_Y.basis()[2,0]
161
+ sage: b**2
162
+ 0
163
+ sage: B = sorted(H_Y.basis())[1:]
164
+ sage: B
165
+ [h^{2,0}, h^{3,0}, h^{4,0}, h^{5,0}, h^{6,0}, h^{7,0}]
166
+ sage: import itertools
167
+ sage: [a*b for (a,b) in itertools.combinations(B, 2)]
168
+ [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
169
+
170
+ The basis elements in the simplicial complex case have been chosen
171
+ differently; apply the change of basis `x \mapsto a + b`, `y \mapsto
172
+ b` to see the same product structure. ::
173
+
174
+ sage: Klein_s = simplicial_complexes.KleinBottle()
175
+ sage: H = Klein_s.cohomology_ring(GF(2))
176
+ sage: a,b = H.basis(1)
177
+ sage: a.cup_product(a)
178
+ 0
179
+ sage: a.cup_product(b)
180
+ h^{2,0}
181
+ sage: (a+b).cup_product(a+b)
182
+ h^{2,0}
183
+ sage: b.cup_product(b)
184
+ h^{2,0}
185
+ """
186
+ def __init__(self, base_ring, cell_complex, cohomology=False, category=None):
187
+ """
188
+ Initialize ``self``.
189
+
190
+ EXAMPLES::
191
+
192
+ sage: RP2 = simplicial_complexes.ProjectivePlane()
193
+ sage: H = RP2.homology_with_basis(QQ)
194
+ sage: TestSuite(H).run()
195
+ sage: H = RP2.homology_with_basis(GF(2))
196
+ sage: TestSuite(H).run()
197
+ sage: H = RP2.cohomology_ring(GF(2))
198
+ sage: TestSuite(H).run()
199
+ sage: H = RP2.cohomology_ring(GF(5))
200
+ sage: TestSuite(H).run()
201
+ sage: H = simplicial_complexes.ComplexProjectivePlane().cohomology_ring()
202
+ sage: TestSuite(H).run()
203
+ """
204
+ # phi is the associated chain contraction.
205
+ # M is the homology chain complex.
206
+ phi, M = cell_complex.algebraic_topological_model(base_ring)
207
+ if cohomology:
208
+ phi = phi.dual()
209
+ # We only need the rank of M in each degree, and since
210
+ # we're working over a field, we don't need to dualize M
211
+ # if working with cohomology.
212
+ category = Modules(base_ring).WithBasis().Graded().FiniteDimensional().or_subcategory(category)
213
+ self._contraction = phi
214
+ self._complex = cell_complex
215
+ self._cohomology = cohomology
216
+ self._graded_indices = {deg: range(M.free_module_rank(deg))
217
+ for deg in range(cell_complex.dimension()+1)}
218
+ indices = [(deg, i) for deg in self._graded_indices
219
+ for i in self._graded_indices[deg]]
220
+ CombinatorialFreeModule.__init__(self, base_ring, indices, category=category)
221
+
222
+ def basis(self, d=None):
223
+ """
224
+ Return (the degree ``d`` homogeneous component of) the basis
225
+ of this graded vector space.
226
+
227
+ INPUT:
228
+
229
+ - ``d`` -- (optional) the degree
230
+
231
+ EXAMPLES::
232
+
233
+ sage: RP2 = simplicial_complexes.ProjectivePlane()
234
+ sage: H = RP2.homology_with_basis(QQ)
235
+ sage: H.basis()
236
+ Finite family {(0, 0): h_{0,0}}
237
+ sage: H.basis(0)
238
+ Finite family {(0, 0): h_{0,0}}
239
+ sage: H.basis(1)
240
+ Finite family {}
241
+ sage: H.basis(2)
242
+ Finite family {}
243
+ """
244
+ if d is None:
245
+ return Family(self._indices, self.monomial)
246
+ else:
247
+ indices = [(d, i) for i in self._graded_indices.get(d, [])]
248
+ return Family(indices, self.monomial)
249
+
250
+ def degree_on_basis(self, i):
251
+ r"""
252
+ Return the degree of the basis element indexed by ``i``.
253
+
254
+ EXAMPLES::
255
+
256
+ sage: H = simplicial_complexes.Torus().homology_with_basis(GF(7))
257
+ sage: H.degree_on_basis((2,0))
258
+ 2
259
+ """
260
+ return i[0]
261
+
262
+ def contraction(self):
263
+ r"""
264
+ The chain contraction associated to this homology computation.
265
+
266
+ That is, to work with chain representatives of homology
267
+ classes, we need the chain complex `C` associated to the cell
268
+ complex, the chain complex `H` of its homology (with trivial
269
+ differential), chain maps `\pi: C \to H` and `\iota: H \to C`,
270
+ and a chain contraction `\phi` giving a chain homotopy between
271
+ `1_C` and `\iota \circ \pi`.
272
+
273
+ OUTPUT: `\phi`
274
+
275
+ See :class:`~sage.homology.chain_homotopy.ChainContraction` for information
276
+ about chain contractions, and see
277
+ :func:`~sage.homology.algebraic_topological_model.algebraic_topological_model`
278
+ for the construction of this particular chain contraction `\phi`.
279
+
280
+ EXAMPLES::
281
+
282
+ sage: H = simplicial_complexes.Simplex(2).homology_with_basis(QQ)
283
+ sage: H.contraction()
284
+ Chain homotopy between:
285
+ Chain complex endomorphism of Chain complex with at most 3 nonzero terms over Rational Field
286
+ and Chain complex endomorphism of Chain complex with at most 3 nonzero terms over Rational Field
287
+
288
+ From the chain contraction, one can also recover the maps `\pi`
289
+ and `\iota`::
290
+
291
+ sage: phi = H.contraction()
292
+ sage: phi.pi()
293
+ Chain complex morphism:
294
+ From: Chain complex with at most 3 nonzero terms over Rational Field
295
+ To: Chain complex with at most 1 nonzero terms over Rational Field
296
+ sage: phi.iota()
297
+ Chain complex morphism:
298
+ From: Chain complex with at most 1 nonzero terms over Rational Field
299
+ To: Chain complex with at most 3 nonzero terms over Rational Field
300
+ """
301
+ return self._contraction
302
+
303
+ def complex(self):
304
+ """
305
+ The cell complex whose homology is being computed.
306
+
307
+ EXAMPLES::
308
+
309
+ sage: H = simplicial_complexes.Simplex(2).homology_with_basis(QQ)
310
+ sage: H.complex()
311
+ The 2-simplex
312
+ """
313
+ return self._complex
314
+
315
+ def _repr_(self):
316
+ """
317
+ EXAMPLES::
318
+
319
+ sage: simplicial_complexes.Torus().homology_with_basis(QQ)
320
+ Homology module of Minimal triangulation of the torus
321
+ over Rational Field
322
+ """
323
+ if self._cohomology:
324
+ base = "Cohomology"
325
+ else:
326
+ base = "Homology"
327
+ return base + " module of {} over {}".format(self._complex, self.base_ring())
328
+
329
+ def _repr_term(self, i):
330
+ """
331
+ Return ``'h_{i[0],i[1]}'`` for homology, ``'h^{i[0],i[1]}'`` for
332
+ cohomology, for the basis element indexed by ``i``.
333
+
334
+ EXAMPLES::
335
+
336
+ sage: H = simplicial_complexes.Torus().homology_with_basis(QQ)
337
+ sage: H.basis()[1,0] # indirect doctest
338
+ h_{1,0}
339
+ sage: latex(H.basis()[1,1]) # indirect doctest
340
+ h_{1,1}
341
+ sage: co = simplicial_complexes.KleinBottle().cohomology_ring(GF(2))
342
+ sage: co.basis()[1,0] # indirect doctest
343
+ h^{1,0}
344
+ """
345
+ sym = '^' if self._cohomology else '_'
346
+ return 'h{}{{{},{}}}'.format(sym, i[0], i[1])
347
+
348
+ _latex_term = _repr_term
349
+
350
+ @cached_method
351
+ def _to_cycle_on_basis(self, i):
352
+ r"""
353
+ Return the (co)cycle representative of the basis element
354
+ indexed by ``i``.
355
+
356
+ .. SEEALSO::
357
+
358
+ :meth:`HomologyVectorSpaceWithBasis.Element.to_cocycle`
359
+
360
+ EXAMPLES::
361
+
362
+ sage: S2 = simplicial_complexes.Sphere(2)
363
+ sage: H = S2.homology_with_basis(QQ)
364
+ sage: H._to_cycle_on_basis((2,0))
365
+ -(0, 1, 2) + (0, 1, 3) - (0, 2, 3) + (1, 2, 3)
366
+
367
+ sage: S2.cohomology_ring(QQ)._to_cycle_on_basis((2,0))
368
+ \chi_(1, 2, 3)
369
+ sage: S2.cohomology_ring(QQ)._to_cycle_on_basis((0,0))
370
+ \chi_(0,) + \chi_(1,) + \chi_(2,) + \chi_(3,)
371
+
372
+ sage: RP3 = simplicial_complexes.RealProjectiveSpace(3)
373
+ sage: H = RP3.cohomology_ring(GF(2))
374
+ sage: H._to_cycle_on_basis((0,0))
375
+ \chi_(1,) + \chi_(2,) + \chi_(3,) + \chi_(4,) + \chi_(5,) + \chi_(6,)
376
+ + \chi_(7,) + \chi_(8,) + \chi_(9,) + \chi_(10,) + \chi_(11,)
377
+ sage: H._to_cycle_on_basis((1,0))
378
+ \chi_(2, 4) + \chi_(2, 5) + \chi_(2, 8) + \chi_(2, 10)
379
+ + \chi_(3, 4) + \chi_(3, 6) + \chi_(3, 8) + \chi_(3, 9)
380
+ + \chi_(4, 5) + \chi_(4, 6) + \chi_(4, 11) + \chi_(5, 7)
381
+ + \chi_(5, 9) + \chi_(6, 7) + \chi_(6, 10) + \chi_(7, 8)
382
+ + \chi_(9, 10)
383
+ sage: H._to_cycle_on_basis((2,0))
384
+ \chi_(3, 5, 9) + \chi_(3, 6, 10) + \chi_(3, 9, 10)
385
+ + \chi_(4, 5, 7) + \chi_(4, 5, 9) + \chi_(4, 6, 7) + \chi_(6, 7, 10)
386
+ sage: H._to_cycle_on_basis((3,0))
387
+ \chi_(5, 6, 7, 8)
388
+ """
389
+ vec = self.contraction().iota().in_degree(i[0]).column(i[1])
390
+ chains = self.complex().n_chains(i[0], self.base_ring(),
391
+ cochains=self._cohomology)
392
+ return chains.from_vector(vec)
393
+
394
+ def dual(self):
395
+ r"""
396
+ Return the dual space.
397
+
398
+ If ``self`` is homology, return the cohomology ring. If
399
+ ``self`` is cohomology, return the homology as a vector space.
400
+
401
+ EXAMPLES::
402
+
403
+ sage: T = simplicial_complexes.Torus()
404
+ sage: hom = T.homology_with_basis(GF(2))
405
+ sage: coh = T.cohomology_ring(GF(2))
406
+ sage: hom.dual() is coh
407
+ True
408
+ sage: coh.dual() is hom
409
+ True
410
+ """
411
+ if is_GF2(self.base_ring()):
412
+ if self._cohomology:
413
+ return HomologyVectorSpaceWithBasis_mod2(self.base_ring(),
414
+ self.complex())
415
+ return CohomologyRing_mod2(self.base_ring(), self.complex())
416
+ if self._cohomology:
417
+ return HomologyVectorSpaceWithBasis(self.base_ring(),
418
+ self.complex(),
419
+ not self._cohomology)
420
+ return CohomologyRing(self.base_ring(), self.complex())
421
+
422
+ def _test_duality(self, **options):
423
+ r"""
424
+ Test if the ordered bases for homology and cohomology are compatible.
425
+ Return nothing if the test succeeds.
426
+
427
+ This checks whether each evaluation map `H^n \otimes H_n \to
428
+ k` is represented by the identity matrix, in terms of the
429
+ chosen bases.
430
+
431
+ TESTS::
432
+
433
+ sage: T = simplicial_complexes.Torus()
434
+ sage: K = T.suspension()
435
+ sage: K.set_immutable()
436
+ sage: H = K.cohomology_ring(QQ)
437
+ sage: H._test_duality()
438
+
439
+ sage: simplicial_complexes.RandomComplex(8, 2, .2).homology_with_basis(GF(2))._test_duality()
440
+ sage: simplicial_complexes.RandomComplex(8, 2, .4).homology_with_basis(GF(2))._test_duality()
441
+ sage: simplicial_complexes.RandomComplex(8, 2, .6).homology_with_basis(GF(2))._test_duality()
442
+
443
+ sage: simplicial_complexes.RandomComplex(12, 3, .5).homology_with_basis(GF(2))._test_duality() # long time
444
+ """
445
+ tester = self._tester(**options)
446
+ dual = self.dual()
447
+ dims = [a[0] for a in self._indices]
448
+ for dim in range(max(*dims, tester._max_runs) + 1):
449
+ n = len(self.basis(dim))
450
+ m = matrix(n, n, [a.eval(b) for a in self.basis(dim) for b in dual.basis(dim)])
451
+ tester.assertEqual(m, 1, f"error in dimension {dim}")
452
+
453
+ class Element(CombinatorialFreeModule.Element):
454
+ def to_cycle(self):
455
+ r"""
456
+ (Co)cycle representative of this homogeneous (co)homology class.
457
+
458
+ EXAMPLES::
459
+
460
+ sage: S2 = simplicial_complexes.Sphere(2)
461
+ sage: H = S2.homology_with_basis(QQ)
462
+ sage: h20 = H.basis()[2,0]; h20
463
+ h_{2,0}
464
+ sage: h20.to_cycle()
465
+ -(0, 1, 2) + (0, 1, 3) - (0, 2, 3) + (1, 2, 3)
466
+
467
+ Chains are written as linear combinations of simplices
468
+ `\sigma`. Cochains are written as linear combinations of
469
+ characteristic functions `\chi_{\sigma}` for those
470
+ simplices::
471
+
472
+ sage: S2.cohomology_ring(QQ).basis()[2,0].to_cycle()
473
+ \chi_(1, 2, 3)
474
+ sage: S2.cohomology_ring(QQ).basis()[0,0].to_cycle()
475
+ \chi_(0,) + \chi_(1,) + \chi_(2,) + \chi_(3,)
476
+ """
477
+ if not self.is_homogeneous():
478
+ raise ValueError("only defined for homogeneous elements")
479
+ return sum(c * self.parent()._to_cycle_on_basis(i) for i, c in self)
480
+
481
+ def eval(self, other):
482
+ r"""
483
+ Evaluate ``self`` at ``other``.
484
+
485
+ INPUT:
486
+
487
+ - ``other`` -- an element of the dual space; if ``self``
488
+ is an element of cohomology in dimension `n`, then
489
+ ``other`` should be an element of homology in dimension
490
+ `n`, and vice versa
491
+
492
+ This just calls the :meth:`~sage.homology.chains.Cochains.Element.eval`
493
+ method on the representing chains and cochains.
494
+
495
+ EXAMPLES::
496
+
497
+ sage: T = simplicial_complexes.Torus()
498
+ sage: homology = T.homology_with_basis(QQ)
499
+ sage: cohomology = T.cohomology_ring(QQ)
500
+ sage: a1, a2 = homology.basis(1)
501
+ sage: alpha1, alpha2 = cohomology.basis(1)
502
+ sage: a1.to_cycle()
503
+ (0, 3) - (0, 6) + (3, 6)
504
+ sage: alpha1.to_cycle()
505
+ -\chi_(1, 3) - \chi_(1, 4) - \chi_(2, 3) - \chi_(2, 4) - \chi_(2, 5) + \chi_(3, 6)
506
+ sage: a1.eval(alpha1)
507
+ 1
508
+ sage: alpha2.to_cycle()
509
+ \chi_(1, 3) + \chi_(1, 4) + \chi_(1, 6) + \chi_(2, 4) - \chi_(4, 5) + \chi_(5, 6)
510
+ sage: alpha2.eval(a1)
511
+ 0
512
+ sage: (2 * alpha2).eval(a1 + a2)
513
+ 2
514
+ """
515
+ if not self or not other:
516
+ return self.base_ring().zero()
517
+ if self.parent()._cohomology:
518
+ return self.to_cycle().eval(other.to_cycle())
519
+ else:
520
+ return other.to_cycle().eval(self.to_cycle())
521
+
522
+
523
+ class HomologyVectorSpaceWithBasis_mod2(HomologyVectorSpaceWithBasis):
524
+ r"""
525
+ Homology vector space mod 2.
526
+
527
+ Based on :class:`HomologyVectorSpaceWithBasis`, with Steenrod
528
+ operations included.
529
+
530
+ .. NOTE::
531
+
532
+ This is not intended to be created directly by the user, but
533
+ instead via the method
534
+ :meth:`~sage.topology.cell_complex.GenericCellComplex.homology_with_basis`
535
+ for the class of :class:`cell
536
+ complexes<sage.topology.cell_complex.GenericCellComplex>`.
537
+
538
+ .. TODO::
539
+
540
+ Implement Steenrod operations on (co)homology at odd primes,
541
+ and thereby implement this class over `\GF{p}` for any `p`.
542
+
543
+ INPUT:
544
+
545
+ - ``base_ring`` -- must be the field ``GF(2)``
546
+ - ``cell_complex`` -- the cell complex whose homology we are
547
+ computing
548
+ - ``category`` -- (optional) a subcategory of modules with basis
549
+
550
+ This does not include the ``cohomology`` argument present for
551
+ :class:`HomologyVectorSpaceWithBasis`: use
552
+ :class:`CohomologyRing_mod2` for cohomology.
553
+
554
+ EXAMPLES:
555
+
556
+ Mod 2 cohomology operations are defined on both the left and the
557
+ right::
558
+
559
+ sage: # needs sage.groups
560
+ sage: RP4 = simplicial_sets.RealProjectiveSpace(5)
561
+ sage: H = RP4.homology_with_basis(GF(2))
562
+ sage: x4 = H.basis()[4,0]
563
+ sage: x4 * Sq(1)
564
+ h_{3,0}
565
+ sage: Sq(1) * x4
566
+ h_{3,0}
567
+ sage: Sq(2) * x4
568
+ h_{2,0}
569
+ sage: Sq(3) * x4
570
+ h_{1,0}
571
+ sage: Sq(0,1) * x4
572
+ h_{1,0}
573
+ sage: x4 * Sq(0,1)
574
+ h_{1,0}
575
+ sage: Sq(3) * x4
576
+ h_{1,0}
577
+ sage: x4 * Sq(3)
578
+ 0
579
+ """
580
+ def __init__(self, base_ring, cell_complex, category=None):
581
+ """
582
+ Initialize ``self``.
583
+
584
+ EXAMPLES::
585
+
586
+ sage: H = simplicial_complexes.Torus().homology_with_basis(GF(2))
587
+ sage: TestSuite(H).run()
588
+ sage: H = simplicial_complexes.Sphere(3).homology_with_basis(GF(2))
589
+ sage: TestSuite(H).run()
590
+ """
591
+ if not is_GF2(base_ring):
592
+ raise ValueError
593
+ category = Modules(base_ring).WithBasis().Graded().FiniteDimensional().or_subcategory(category)
594
+ category = Category.join((category,
595
+ LeftModules(SteenrodAlgebra(2)),
596
+ RightModules(SteenrodAlgebra(2))))
597
+ HomologyVectorSpaceWithBasis.__init__(self, base_ring,
598
+ cell_complex,
599
+ cohomology=False,
600
+ category=category)
601
+
602
+ class Element(HomologyVectorSpaceWithBasis.Element):
603
+
604
+ def _acted_upon_(self, a, self_on_left):
605
+ r"""
606
+ Define multiplication of ``self`` by ``a``, an
607
+ element of the Steenrod algebra.
608
+
609
+ INPUT:
610
+
611
+ - ``a`` -- an element of the mod 2 Steenrod algebra
612
+ - ``self_on_left`` -- ``True`` if we are computing ``self * a``,
613
+ otherwise ``a * self``
614
+
615
+ Algorithm: use the action of the Steenrod algebra `A` on
616
+ cohomology to construct the action on homology. That is,
617
+ given a right action of `A` on `H^*`,
618
+
619
+ .. MATH::
620
+
621
+ \phi_L: H^* \otimes A \to H^*
622
+
623
+ we define (a la Boardman [Boa1982]_, p. 190)
624
+
625
+ .. MATH::
626
+
627
+ S'' \phi_L: A \otimes H_* \to H_*
628
+
629
+ using the formula
630
+
631
+ .. MATH::
632
+
633
+ \langle (S'' \phi) (f \otimes a), x \rangle
634
+ = \langle f, \phi_L (a \otimes x) \rangle,
635
+
636
+ for `f \in H_m`, `a \in A^n`, and `x \in
637
+ H^{m-n}`. Somewhat more succinctly, we define the action `f
638
+ \cdot a` by
639
+
640
+ .. MATH::
641
+
642
+ (f \cdot a) (x) = f (a \cdot x).
643
+
644
+ So given `f` (a.k.a. ``self``) and `a`, we compute `f (a
645
+ \cdot x)` for all basis elements `x` in `H^{m-n}`,
646
+ yielding a vector indexed by those basis elements. Since
647
+ our basis for homology is dual to the basis for
648
+ cohomology, we can then use the homology basis to convert
649
+ the vector to an element of `H_{m-n}`.
650
+
651
+ This gives a right module structure. To get a left module
652
+ structure, use the right module structure after applying
653
+ the antipode to `a`.
654
+
655
+ EXAMPLES::
656
+
657
+ sage: # needs sage.groups
658
+ sage: RP5 = simplicial_sets.RealProjectiveSpace(5)
659
+ sage: H = RP5.homology_with_basis(GF(2))
660
+ sage: x5 = list(H.basis(5))[0]
661
+ sage: Sq(1) * x5
662
+ 0
663
+ sage: Sq(2) * x5
664
+ h_{3,0}
665
+ sage: x5 * Sq(2)
666
+ h_{3,0}
667
+
668
+ TESTS::
669
+
670
+ sage: # needs sage.groups
671
+ sage: RP4 = simplicial_sets.RealProjectiveSpace(5)
672
+ sage: H = RP4.homology_with_basis(GF(2))
673
+ sage: x4 = H.basis()[4,0]
674
+ sage: (Sq(1) * Sq(2)) * x4 != 0
675
+ True
676
+ sage: (Sq(1) * Sq(2)) * x4 == Sq(1) * (Sq(2) * x4)
677
+ True
678
+ sage: x4 * (Sq(2) * Sq(1)) == (x4 * Sq(2)) * Sq(1)
679
+ True
680
+ sage: 1 * x4
681
+ h_{4,0}
682
+ sage: x4 * 0
683
+ 0
684
+ """
685
+ # Handle field elements first.
686
+ ret = CombinatorialFreeModule.Element._acted_upon_(self, a, self_on_left)
687
+ if ret is not None: # did the scalar action
688
+ return ret
689
+ m = self.degree()
690
+ n = a.degree()
691
+ if m <= n:
692
+ return self.parent().zero()
693
+
694
+ if not self_on_left: # i.e., module element on left
695
+ a = a.antipode()
696
+ P = self.parent()
697
+ return P._from_dict({x.support()[0]: self.eval(a * x)
698
+ for x in sorted(self.parent().dual().basis(m-n))})
699
+
700
+
701
+ class CohomologyRing(HomologyVectorSpaceWithBasis):
702
+ """
703
+ The cohomology ring.
704
+
705
+ .. NOTE::
706
+
707
+ This is not intended to be created directly by the user, but
708
+ instead via the
709
+ :meth:`cohomology ring<sage.topology.cell_complex.GenericCellComplex.cohomology_ring>`
710
+ of a :class:`cell
711
+ complex<sage.topology.cell_complex.GenericCellComplex>`.
712
+
713
+ INPUT:
714
+
715
+ - ``base_ring`` -- must be a field
716
+ - ``cell_complex`` -- the cell complex whose homology we are
717
+ computing
718
+ - ``category`` -- (optional) a subcategory of modules with basis
719
+
720
+ EXAMPLES::
721
+
722
+ sage: CP2 = simplicial_complexes.ComplexProjectivePlane()
723
+ sage: H = CP2.cohomology_ring(QQ)
724
+ sage: H.basis(2)
725
+ Finite family {(2, 0): h^{2,0}}
726
+ sage: x = H.basis(2)[2,0]
727
+
728
+ The product structure is the cup product::
729
+
730
+ sage: x.cup_product(x)
731
+ -h^{4,0}
732
+ sage: x * x
733
+ -h^{4,0}
734
+ """
735
+ def __init__(self, base_ring, cell_complex, category=None):
736
+ """
737
+ Initialize ``self``.
738
+
739
+ EXAMPLES::
740
+
741
+ sage: RP2 = simplicial_complexes.ProjectivePlane()
742
+ sage: H = RP2.cohomology_ring(GF(5))
743
+ sage: TestSuite(H).run()
744
+ sage: T = simplicial_complexes.Torus()
745
+ sage: H = T.cohomology_ring(QQ)
746
+ sage: TestSuite(H).run()
747
+ """
748
+ if category is None:
749
+ category = Algebras(base_ring).WithBasis().Graded().FiniteDimensional()
750
+ HomologyVectorSpaceWithBasis.__init__(self, base_ring, cell_complex, True, category)
751
+
752
+ def _repr_(self):
753
+ """
754
+ EXAMPLES::
755
+
756
+ sage: simplicial_complexes.Torus().cohomology_ring(QQ)
757
+ Cohomology ring of Minimal triangulation of the torus
758
+ over Rational Field
759
+ """
760
+ return "Cohomology ring of {} over {}".format(self._complex, self.base_ring())
761
+
762
+ @cached_method
763
+ def one(self):
764
+ """
765
+ The multiplicative identity element.
766
+
767
+ EXAMPLES::
768
+
769
+ sage: H = simplicial_complexes.Torus().cohomology_ring(QQ)
770
+ sage: H.one()
771
+ h^{0,0}
772
+ sage: all(H.one() * x == x == x * H.one() for x in H.basis())
773
+ True
774
+ """
775
+ one = self.base_ring().one()
776
+ d = {(0, i): one for i in self._graded_indices[0]}
777
+ return self._from_dict(d, remove_zeros=False)
778
+
779
+ @cached_method
780
+ def product_on_basis(self, li, ri):
781
+ r"""
782
+ The cup product of the basis elements indexed by ``li`` and ``ri``
783
+ in this cohomology ring.
784
+
785
+ INPUT:
786
+
787
+ - ``li``, ``ri`` -- index of a cohomology class
788
+
789
+ .. SEEALSO::
790
+
791
+ :meth:`CohomologyRing.Element.cup_product` -- the
792
+ documentation for this method describes the algorithm.
793
+
794
+ EXAMPLES::
795
+
796
+ sage: RP3 = simplicial_complexes.RealProjectiveSpace(3)
797
+ sage: H = RP3.cohomology_ring(GF(2))
798
+ sage: c = H.basis()[1,0]
799
+ sage: c.cup_product(c).cup_product(c) # indirect doctest
800
+ h^{3,0}
801
+
802
+ sage: T = simplicial_complexes.Torus()
803
+ sage: x,y = T.cohomology_ring(QQ).basis(1)
804
+ sage: x.cup_product(y)
805
+ -h^{2,0}
806
+ sage: x.cup_product(x)
807
+ 0
808
+
809
+ sage: one = T.cohomology_ring(QQ).basis()[0,0]
810
+ sage: x.cup_product(one)
811
+ h^{1,0}
812
+ sage: one.cup_product(y) == y
813
+ True
814
+ sage: one.cup_product(one)
815
+ h^{0,0}
816
+ sage: x.cup_product(y) + y.cup_product(x)
817
+ 0
818
+
819
+ This also works with cubical complexes::
820
+
821
+ sage: T = cubical_complexes.Torus()
822
+ sage: x,y = T.cohomology_ring(QQ).basis(1)
823
+ sage: x.cup_product(y)
824
+ h^{2,0}
825
+ sage: x.cup_product(x)
826
+ 0
827
+
828
+ `\Delta`-complexes::
829
+
830
+ sage: T_d = delta_complexes.Torus()
831
+ sage: a,b = T_d.cohomology_ring(QQ).basis(1)
832
+ sage: a.cup_product(b)
833
+ h^{2,0}
834
+ sage: b.cup_product(a)
835
+ -h^{2,0}
836
+ sage: RP2 = delta_complexes.RealProjectivePlane()
837
+ sage: w = RP2.cohomology_ring(GF(2)).basis()[1,0]
838
+ sage: w.cup_product(w)
839
+ h^{2,0}
840
+
841
+ and simplicial sets::
842
+
843
+ sage: from sage.topology.simplicial_set_examples import RealProjectiveSpace
844
+ sage: RP5 = RealProjectiveSpace(5) # needs sage.groups
845
+ sage: x = RP5.cohomology_ring(GF(2)).basis()[1,0] # needs sage.groups
846
+ sage: x**4 # needs sage.groups
847
+ h^{4,0}
848
+
849
+ A non-connected example::
850
+
851
+ sage: K = cubical_complexes.Torus().disjoint_union(cubical_complexes.Torus())
852
+ sage: a,b,c,d = K.cohomology_ring(QQ).basis(1)
853
+ sage: x,y = K.cohomology_ring(QQ).basis(0)
854
+ sage: a.cup_product(x) == a
855
+ True
856
+ sage: a.cup_product(y)
857
+ 0
858
+ """
859
+ scomplex = self.complex()
860
+ base_ring = self.base_ring()
861
+ deg_left = li[0]
862
+ deg_right = ri[0]
863
+ deg_tot = deg_left + deg_right
864
+ left_cycle = self._to_cycle_on_basis(li)
865
+ right_cycle = self._to_cycle_on_basis(ri)
866
+ n_chains_left = scomplex.n_chains(deg_left, base_ring)
867
+ n_chains_right = scomplex.n_chains(deg_right, base_ring)
868
+
869
+ result = {}
870
+ H = scomplex.homology_with_basis(base_ring)
871
+ for gamma_index in H._graded_indices.get(deg_tot, []):
872
+ gamma_coeff = base_ring.zero()
873
+ for cell, coeff in H._to_cycle_on_basis((deg_tot, gamma_index)):
874
+ for (c, left_cell, right_cell) in scomplex.alexander_whitney(cell, deg_left):
875
+ if c:
876
+ left = n_chains_left(left_cell)
877
+ right = n_chains_right(right_cell)
878
+ gamma_coeff += c * coeff * left_cycle.eval(left) * right_cycle.eval(right)
879
+ if gamma_coeff != base_ring.zero():
880
+ result[(deg_tot, gamma_index)] = gamma_coeff
881
+ return self._from_dict(result, remove_zeros=False)
882
+
883
+ class Element(HomologyVectorSpaceWithBasis.Element):
884
+ def cup_product(self, other):
885
+ r"""
886
+ Return the cup product of this element and ``other``.
887
+
888
+ Algorithm: see González-Díaz and Réal [GDR2003]_, p. 88.
889
+ Given two cohomology classes, lift them to cocycle
890
+ representatives via the chain contraction for this
891
+ complex, using
892
+ :meth:`~HomologyVectorSpaceWithBasis.Element.to_cycle`. In
893
+ the sum of their dimensions, look at all of the homology
894
+ classes `\gamma`: lift each of those to a cycle
895
+ representative, apply the Alexander-Whitney diagonal map
896
+ to each cell in the cycle, evaluate the two cocycles on
897
+ these factors, and multiply. The result is the value of
898
+ the cup product cocycle on this homology class. After this
899
+ has been done for all homology classes, since homology and
900
+ cohomology are dual, one can tell which cohomology class
901
+ corresponds to the cup product.
902
+
903
+ .. SEEALSO::
904
+
905
+ :meth:`CohomologyRing.product_on_basis`
906
+
907
+ EXAMPLES::
908
+
909
+ sage: RP3 = simplicial_complexes.RealProjectiveSpace(3)
910
+ sage: H = RP3.cohomology_ring(GF(2))
911
+ sage: c = H.basis()[1,0]
912
+ sage: c.cup_product(c)
913
+ h^{2,0}
914
+ sage: c * c * c
915
+ h^{3,0}
916
+
917
+ We can also take powers::
918
+
919
+ sage: RP2 = simplicial_complexes.RealProjectivePlane()
920
+ sage: a = RP2.cohomology_ring(GF(2)).basis()[1,0]
921
+ sage: a**0
922
+ h^{0,0}
923
+ sage: a**1
924
+ h^{1,0}
925
+ sage: a**2
926
+ h^{2,0}
927
+ sage: a**3
928
+ 0
929
+
930
+ A non-connected example::
931
+
932
+ sage: K = cubical_complexes.Torus().disjoint_union(cubical_complexes.Sphere(2))
933
+ sage: a,b = K.cohomology_ring(QQ).basis(2)
934
+ sage: a**0
935
+ h^{0,0} + h^{0,1}
936
+ """
937
+ return self * other
938
+
939
+
940
+ class CohomologyRing_mod2(CohomologyRing):
941
+ r"""
942
+ The mod 2 cohomology ring.
943
+
944
+ Based on :class:`CohomologyRing`, with Steenrod operations included.
945
+
946
+ .. NOTE::
947
+
948
+ This is not intended to be created directly by the user, but
949
+ instead via the
950
+ :meth:`cohomology ring<sage.topology.cell_complex.GenericCellComplex.cohomology_ring>`
951
+ of a :class:`cell
952
+ complex<sage.topology.cell_complex.GenericCellComplex>`.
953
+
954
+ .. TODO::
955
+
956
+ Implement Steenrod operations on (co)homology at odd primes,
957
+ and thereby implement this class over `\GF{p}` for any `p`.
958
+
959
+ INPUT:
960
+
961
+ - ``base_ring`` -- must be the field ``GF(2)``
962
+ - ``cell_complex`` -- the cell complex whose homology we are
963
+ computing
964
+
965
+ EXAMPLES:
966
+
967
+ Mod 2 cohomology operations are defined on both the left and the
968
+ right::
969
+
970
+ sage: CP2 = simplicial_complexes.ComplexProjectivePlane()
971
+ sage: Hmod2 = CP2.cohomology_ring(GF(2))
972
+ sage: y = Hmod2.basis(2)[2,0]
973
+ sage: y.Sq(2)
974
+ h^{4,0}
975
+
976
+ sage: # needs sage.groups
977
+ sage: Y = simplicial_sets.RealProjectiveSpace(6).suspension()
978
+ sage: H_Y = Y.cohomology_ring(GF(2))
979
+ sage: b = H_Y.basis()[2,0]
980
+ sage: b.Sq(1)
981
+ h^{3,0}
982
+ sage: b.Sq(2)
983
+ 0
984
+ sage: c = H_Y.basis()[4,0]
985
+ sage: c.Sq(1)
986
+ h^{5,0}
987
+ sage: c.Sq(2)
988
+ h^{6,0}
989
+ sage: c.Sq(3)
990
+ h^{7,0}
991
+ sage: c.Sq(4)
992
+ 0
993
+
994
+ Cohomology can be viewed as a left module over the Steenrod
995
+ algebra, and also as a right module::
996
+
997
+ sage: # needs sage.groups
998
+ sage: RP4 = simplicial_sets.RealProjectiveSpace(4)
999
+ sage: H = RP4.cohomology_ring(GF(2))
1000
+ sage: x = H.basis()[1,0]
1001
+ sage: Sq(0,1) * x
1002
+ h^{4,0}
1003
+ sage: Sq(3) * x
1004
+ 0
1005
+ sage: x * Sq(3)
1006
+ h^{4,0}
1007
+ """
1008
+ def __init__(self, base_ring, cell_complex):
1009
+ """
1010
+ Initialize ``self``.
1011
+
1012
+ EXAMPLES::
1013
+
1014
+ sage: RP2 = simplicial_complexes.ProjectivePlane()
1015
+ sage: H = RP2.cohomology_ring(GF(2))
1016
+ sage: TestSuite(H).run()
1017
+ """
1018
+ if not is_GF2(base_ring):
1019
+ raise ValueError("the base ring must be GF(2)")
1020
+ category = Algebras(base_ring).WithBasis().Graded().FiniteDimensional()
1021
+ category = Category.join((category,
1022
+ LeftModules(SteenrodAlgebra(2)),
1023
+ RightModules(SteenrodAlgebra(2))))
1024
+ CohomologyRing.__init__(self, base_ring, cell_complex, category=category)
1025
+
1026
+ class Element(CohomologyRing.Element):
1027
+ def Sq(self, i):
1028
+ r"""
1029
+ Return the result of applying `Sq^i` to this element.
1030
+
1031
+ INPUT:
1032
+
1033
+ - ``i`` -- nonnegative integer
1034
+
1035
+ .. WARNING::
1036
+
1037
+ The main implementation is only for simplicial
1038
+ complexes and simplicial sets; cubical complexes are
1039
+ converted to simplicial complexes first. Note that
1040
+ this converted complex may be large and so computations
1041
+ may be slow. There is no implementation for
1042
+ `\Delta`-complexes.
1043
+
1044
+ This cohomology operation is only defined in
1045
+ characteristic 2. Odd primary Steenrod operations are not
1046
+ implemented.
1047
+
1048
+ Algorithm: see González-Díaz and Réal [GDR1999]_,
1049
+ Corollary 3.2.
1050
+
1051
+ EXAMPLES::
1052
+
1053
+ sage: RP2 = simplicial_complexes.RealProjectiveSpace(2)
1054
+ sage: x = RP2.cohomology_ring(GF(2)).basis()[1,0]
1055
+ sage: x.Sq(1)
1056
+ h^{2,0}
1057
+
1058
+ sage: K = RP2.suspension()
1059
+ sage: K.set_immutable()
1060
+ sage: y = K.cohomology_ring(GF(2)).basis()[2,0]
1061
+ sage: y.Sq(1)
1062
+ h^{3,0}
1063
+
1064
+ sage: # long time
1065
+ sage: # needs sage.groups
1066
+ sage: RP4 = simplicial_complexes.RealProjectiveSpace(4)
1067
+ sage: H = RP4.cohomology_ring(GF(2))
1068
+ sage: x = H.basis()[1,0]
1069
+ sage: y = H.basis()[2,0]
1070
+ sage: z = H.basis()[3,0]
1071
+ sage: x.Sq(1) == y
1072
+ True
1073
+ sage: z.Sq(1)
1074
+ h^{4,0}
1075
+
1076
+ This calculation is much faster with simplicial sets (on
1077
+ one machine, 20 seconds with a simplicial complex, 4 ms
1078
+ with a simplicial set). ::
1079
+
1080
+ sage: RP4_ss = simplicial_sets.RealProjectiveSpace(4) # needs sage.groups
1081
+ sage: z_ss = RP4_ss.cohomology_ring(GF(2)).basis()[3,0] # needs sage.groups
1082
+ sage: z_ss.Sq(1) # needs sage.groups
1083
+ h^{4,0}
1084
+
1085
+ TESTS::
1086
+
1087
+ sage: RP_cubical = cubical_complexes.RealProjectivePlane()
1088
+ sage: x = RP_cubical.cohomology_ring(GF(2)).basis()[1,0]
1089
+ sage: x.Sq(1)
1090
+ h^{2,0}
1091
+ sage: T = delta_complexes.Torus()
1092
+ sage: x = T.cohomology_ring(GF(2)).basis()[1,0]
1093
+ sage: x.Sq(1)
1094
+ Traceback (most recent call last):
1095
+ ...
1096
+ NotImplementedError: Steenrod squares are not implemented for this type of cell complex
1097
+ """
1098
+ P = self.parent()
1099
+ scomplex = P.complex()
1100
+ if isinstance(scomplex, CubicalComplex):
1101
+ # Convert cubical complex to simplicial complex, and
1102
+ # convert self to basis element in the new complex's
1103
+ # cohomology ring.
1104
+ scomplex = SimplicialComplex(scomplex, is_mutable=False)
1105
+ P = scomplex.cohomology_ring(self.base_ring())
1106
+ self = P.sum_of_terms(self.monomial_coefficients().items())
1107
+ if not isinstance(scomplex, (SimplicialComplex, SimplicialSet_arbitrary)):
1108
+ print(scomplex, isinstance(scomplex, SimplicialComplex))
1109
+ raise NotImplementedError('Steenrod squares are not implemented for '
1110
+ 'this type of cell complex')
1111
+ scomplex = P.complex()
1112
+ base_ring = P.base_ring()
1113
+ if not is_GF2(base_ring):
1114
+ # This should never happen: the class should only be
1115
+ # instantiated in characteristic 2.
1116
+ raise ValueError('Steenrod squares are only defined in characteristic 2')
1117
+ # We keep the same notation as in [GDR1999].
1118
+ # The trivial cases:
1119
+ if i == 0:
1120
+ # Sq^0 is the identity.
1121
+ return self
1122
+
1123
+ # Construct each graded component of ``self``
1124
+ ret = P.zero()
1125
+ H = scomplex.homology_with_basis(base_ring)
1126
+ deg_comp = {}
1127
+ for index, coeff in self:
1128
+ d = deg_comp.get(index[0], {})
1129
+ d[index] = coeff
1130
+ deg_comp[index[0]] = d
1131
+
1132
+ # Do the square on each graded component of ``self``.
1133
+ for j in deg_comp:
1134
+ # Make it into an actual element
1135
+ m = j + i
1136
+ if not P._graded_indices.get(m, []) or i > j:
1137
+ continue
1138
+ elt = P._from_dict(deg_comp[j], remove_zeros=False)
1139
+ if i == j:
1140
+ ret += elt.cup_product(elt)
1141
+ continue
1142
+
1143
+ n = j - i
1144
+ # Now assemble the indices over which the sums take place.
1145
+ # S(n) is defined to be floor((m+1)/2) + floor(n/2).
1146
+ S_n = (m+1) // 2 + n // 2
1147
+ if n == 0:
1148
+ sums = [[S_n]]
1149
+ else:
1150
+ sums = [[i_n] + l for i_n in range(S_n, m+1)
1151
+ for l in sum_indices(n-1, i_n, S_n)]
1152
+ # At this point, 'sums' is a list of lists of the form
1153
+ # [i_n, i_{n-1}, ..., i_0]. (It is reversed from the
1154
+ # obvious order because this is closer to the order in
1155
+ # which the face maps will be applied.) Now we sum over
1156
+ # these, according to the formula in [GDR1999], Corollary 3.2.
1157
+ result = {}
1158
+ cycle = elt.to_cycle()
1159
+ n_chains = scomplex.n_chains(j, base_ring)
1160
+ for gamma_index in H._graded_indices.get(m, []):
1161
+ gamma_coeff = base_ring.zero()
1162
+ for cell, coeff in H._to_cycle_on_basis((m, gamma_index)):
1163
+ for indices in sums:
1164
+ indices = list(indices)
1165
+ left = cell
1166
+ right = cell
1167
+ # Since we are working with a simplicial complex, 'cell' is a simplex.
1168
+ if not m % 2:
1169
+ left_endpoint = m
1170
+ while indices:
1171
+ right_endpoint = indices[0] - 1
1172
+ for k in range(left_endpoint, indices.pop(0), -1):
1173
+ left = scomplex.face(left, k)
1174
+ try:
1175
+ left_endpoint = indices[0] - 1
1176
+ for k in range(right_endpoint, indices.pop(0), -1):
1177
+ right = scomplex.face(right, k)
1178
+ except IndexError:
1179
+ pass
1180
+ for k in range(right_endpoint, -1, -1):
1181
+ right = scomplex.face(right, k)
1182
+ else:
1183
+ right_endpoint = m
1184
+ while indices:
1185
+ left_endpoint = indices[0] - 1
1186
+ try:
1187
+ for k in range(right_endpoint, indices.pop(0), -1):
1188
+ right = scomplex.face(right, k)
1189
+ right_endpoint = indices[0] - 1
1190
+ except IndexError:
1191
+ pass
1192
+ for k in range(left_endpoint, indices.pop(0), -1):
1193
+ left = scomplex.face(left, k)
1194
+ for k in range(right_endpoint, -1, -1):
1195
+ right = scomplex.face(right, k)
1196
+
1197
+ if ((hasattr(left, 'is_nondegenerate')
1198
+ and left.is_nondegenerate()
1199
+ and right.is_nondegenerate())
1200
+ or not hasattr(left, 'is_nondegenerate')):
1201
+ left = n_chains(left)
1202
+ right = n_chains(right)
1203
+ gamma_coeff += coeff * cycle.eval(left) * cycle.eval(right)
1204
+ if gamma_coeff != base_ring.zero():
1205
+ result[(m, gamma_index)] = gamma_coeff
1206
+ ret += P._from_dict(result, remove_zeros=False)
1207
+ return ret
1208
+
1209
+ def _acted_upon_(self, a, self_on_left):
1210
+ r"""
1211
+ Define multiplication of ``self`` by ``a``, an
1212
+ element of the Steenrod algebra.
1213
+
1214
+ INPUT:
1215
+
1216
+ - ``a`` -- an element of the mod 2 Steenrod algebra
1217
+ - ``self_on_left`` -- ``True`` if we are computing ``self * a``,
1218
+ otherwise ``a * self``
1219
+
1220
+ Algorithm: for left multiplication by ``a``, since we have
1221
+ :meth:`Sq` to compute multiplication by a single generator
1222
+ `Sq^i`, first convert ``a`` to the Serre-Cartan basis ---
1223
+ that is, sums of products of the elements `Sq^i` --- and
1224
+ then apply :meth:`Sq` repeatedly. Right multiplication by
1225
+ ``a`` is the same as left multiplication by the antipode
1226
+ applied to ``a``.
1227
+
1228
+ EXAMPLES::
1229
+
1230
+ sage: # needs sage.groups
1231
+ sage: SRP4 = simplicial_sets.RealProjectiveSpace(4).suspension()
1232
+ sage: H = SRP4.cohomology_ring(GF(2))
1233
+ sage: x = H.basis()[2,0]
1234
+ sage: Sq(0,1) * x
1235
+ h^{5,0}
1236
+ sage: Sq(3) * x
1237
+ 0
1238
+ sage: x * Sq(3)
1239
+ h^{5,0}
1240
+
1241
+ TESTS::
1242
+
1243
+ sage: # needs sage.groups
1244
+ sage: (Sq(2) * Sq(1)) * x == Sq(2) * (Sq(1) * x)
1245
+ True
1246
+ sage: x * (Sq(1) * Sq(2)) == (x * Sq(1)) * Sq(2)
1247
+ True
1248
+ sage: x * 1
1249
+ h^{2,0}
1250
+ sage: 0 * x
1251
+ 0
1252
+ """
1253
+ # Handle field elements first.
1254
+ ret = CombinatorialFreeModule.Element._acted_upon_(self, a, self_on_left)
1255
+ if ret is not None: # did the scalar action
1256
+ return ret
1257
+ if self_on_left: # i.e., module element on left
1258
+ a = a.antipode()
1259
+ b = a.change_basis('adem')
1260
+ ans = self.parent().zero()
1261
+ mono_dict = b.monomial_coefficients()
1262
+ for seq in mono_dict:
1263
+ x = self
1264
+ for i in reversed(seq):
1265
+ x = x.Sq(i)
1266
+ ans += mono_dict[seq] * x
1267
+ return ans
1268
+
1269
+ def steenrod_module_map(self, deg_domain, deg_codomain, side='left'):
1270
+ r"""
1271
+ Return a component of the module structure map `A \otimes
1272
+ H \to H`, where `H` is this cohomology ring and `A` is the
1273
+ Steenrod algebra.
1274
+
1275
+ INPUT:
1276
+
1277
+ - ``deg_domain`` -- the degree of the domain in the cohomology
1278
+ ring
1279
+
1280
+ - ``deg_codomain`` -- the degree of the codomain in the
1281
+ cohomology ring
1282
+
1283
+ - ``side`` -- (default: ``'left'``) whether we are computing
1284
+ the action as a left module action or a right module
1285
+
1286
+ We will write this with respect to the left action;
1287
+ for the right action, just switch all of the tensors.
1288
+ Writing `m` for ``deg_domain`` and `n` for ``deg_codomain``, this
1289
+ returns `A^{n-m} \otimes H^{m} \to H^{n}`, one single
1290
+ component of the map making `H` into an `A`-module.
1291
+
1292
+ .. WARNING::
1293
+
1294
+ This is only implemented in characteristic two. The main
1295
+ implementation is only for simplicial complexes and simplicial
1296
+ sets; cubical complexes are converted to simplicial complexes
1297
+ first. Note that this converted complex may be large and so
1298
+ computations may be slow. There is no implementation for
1299
+ `\Delta`-complexes.
1300
+
1301
+ ALGORITHM:
1302
+
1303
+ Use the Milnor basis for the truncated Steenrod
1304
+ algebra `A`, and for cohomology, use the basis with which it
1305
+ is equipped. For each pair of basis elements `a` and `h`,
1306
+ compute the product `a \otimes h`, and use this to assemble a
1307
+ matrix defining the action map via multiplication on the
1308
+ appropriate side. That is, if ``side`` is ``'left'``, return a
1309
+ matrix suitable for multiplication on the left, etc.
1310
+
1311
+ EXAMPLES::
1312
+
1313
+ sage: # needs sage.groups
1314
+ sage: RP4 = simplicial_sets.RealProjectiveSpace(4)
1315
+ sage: H = RP4.cohomology_ring(GF(2))
1316
+ sage: H.steenrod_module_map(1, 2)
1317
+ [1]
1318
+ sage: H.steenrod_module_map(1, 3)
1319
+ [0]
1320
+ sage: H.steenrod_module_map(1, 4, 'left')
1321
+ [1 0]
1322
+ sage: H.steenrod_module_map(1, 4, 'right')
1323
+ [1]
1324
+ [1]
1325
+
1326
+ Products of projective spaces::
1327
+
1328
+ sage: RP3 = simplicial_sets.RealProjectiveSpace(3)
1329
+ sage: K = RP3.product(RP3)
1330
+ sage: H = K.cohomology_ring(GF(2))
1331
+ sage: H
1332
+ Cohomology ring of RP^3 x RP^3 over Finite Field of size 2
1333
+
1334
+ There is one column for each element `a \otimes b`, where `a`
1335
+ is a basis element for the Steenrod algebra and `b` is a basis
1336
+ element for the cohomology algebra. There is one row for each
1337
+ basis element of the cohomology algebra. Unfortunately, the
1338
+ chosen basis for this truncated polynomial algebra is not the
1339
+ monomial basis::
1340
+
1341
+ sage: x1, x2 = H.basis(1)
1342
+ sage: x1 * x1
1343
+ h^{2,0} + h^{2,1}
1344
+ sage: x2 * x2
1345
+ h^{2,2}
1346
+ sage: x1 * x2
1347
+ h^{2,0}
1348
+
1349
+ sage: # needs sage.combinat
1350
+ sage: H.steenrod_module_map(1, 2)
1351
+ [1 0]
1352
+ [1 0]
1353
+ [0 1]
1354
+ sage: H.steenrod_module_map(1, 3, 'left')
1355
+ [0 0]
1356
+ [0 0]
1357
+ [0 0]
1358
+ [0 0]
1359
+ sage: H.steenrod_module_map(1, 3, 'right')
1360
+ [0 0 0 0]
1361
+ [0 0 0 0]
1362
+ sage: H.steenrod_module_map(2, 3)
1363
+ [0 0 0]
1364
+ [1 1 0]
1365
+ [0 0 0]
1366
+ [0 0 0]
1367
+ """
1368
+ side = side.lower()
1369
+ if side not in ['right', 'left']:
1370
+ raise ValueError('side must be either "left" or "right"')
1371
+ base_ring = self.base_ring()
1372
+ char = base_ring.characteristic()
1373
+ # Use sorted(...) so that there are reproducible orders on the bases.
1374
+ A_basis = sorted(SteenrodAlgebra(char).basis(deg_codomain - deg_domain))
1375
+ H_basis_dom = sorted(self.basis(deg_domain))
1376
+ H_basis_cod = self.basis(deg_codomain).keys()
1377
+ H_basis_cod = {elt: idx for idx, elt in enumerate(sorted(H_basis_cod))}
1378
+ entries = []
1379
+ for a in A_basis:
1380
+ for h in H_basis_dom:
1381
+ vec = vector(base_ring, len(H_basis_cod))
1382
+ if side == 'left':
1383
+ x = a * h
1384
+ else:
1385
+ x = h * a
1386
+ monos = x.monomial_coefficients()
1387
+ for seq in monos:
1388
+ vec[H_basis_cod[seq]] = monos[seq]
1389
+ entries.extend(vec)
1390
+ # We built the matrix column by column, so now we take the
1391
+ # transpose.
1392
+ if side == 'left':
1393
+ return matrix(base_ring, len(A_basis) * len(H_basis_dom),
1394
+ len(H_basis_cod), entries).transpose()
1395
+ return matrix(base_ring, len(A_basis) * len(H_basis_dom),
1396
+ len(H_basis_cod), entries)
1397
+
1398
+
1399
+ def sum_indices(k, i_k_plus_one, S_k_plus_one):
1400
+ r"""
1401
+ This is a recursive function for computing the indices for the
1402
+ nested sums in González-Díaz and Réal [GDR1999]_, Corollary 3.2.
1403
+
1404
+ In the paper, given indices `i_n`, `i_{n-1}`, ..., `i_{k+1}`,
1405
+ given `k`, and given `S(k+1)`, the number `S(k)` is defined to be
1406
+
1407
+ .. MATH::
1408
+
1409
+ S(k) = -S(k+1) + floor(k/2) + floor((k+1)/2) + i_{k+1},
1410
+
1411
+ and `i_k` ranges from `S(k)` to `i_{k+1}-1`. There are two special
1412
+ cases: if `k=0`, then `i_0 = S(0)`. Also, the initial case of
1413
+ `S(k)` is `S(n)`, which is set in the method :meth:`Sq` before
1414
+ calling this function. For this function, given `k`, `i_{k+1}`,
1415
+ and `S(k+1)`, return a list consisting of the allowable possible
1416
+ indices `[i_k, i_{k-1}, ..., i_1, i_0]` given by the above
1417
+ formula.
1418
+
1419
+ INPUT:
1420
+
1421
+ - ``k`` -- nonnegative integer
1422
+ - ``i_k_plus_one`` -- the positive integer `i_{k+1}`
1423
+ - ``S_k_plus_one`` -- the integer `S(k+1)`
1424
+
1425
+ EXAMPLES::
1426
+
1427
+ sage: from sage.homology.homology_vector_space_with_basis import sum_indices
1428
+ sage: sum_indices(1, 3, 3)
1429
+ [[1, 0], [2, 1]]
1430
+ sage: sum_indices(0, 4, 2)
1431
+ [[2]]
1432
+ """
1433
+ S_k = -S_k_plus_one + k//2 + (k+1)//2 + i_k_plus_one
1434
+ if k == 0:
1435
+ return [[S_k]]
1436
+ return [[i_k] + l for i_k in range(S_k, i_k_plus_one)
1437
+ for l in sum_indices(k-1, i_k, S_k)]
1438
+
1439
+
1440
+ def is_GF2(R):
1441
+ r"""
1442
+ Return ``True`` iff ``R`` is isomorphic to the field `\GF{2}`.
1443
+
1444
+ EXAMPLES::
1445
+
1446
+ sage: from sage.homology.homology_vector_space_with_basis import is_GF2
1447
+ sage: is_GF2(GF(2))
1448
+ True
1449
+ sage: is_GF2(GF(2, impl='ntl')) # needs sage.libs.ntl
1450
+ True
1451
+ sage: is_GF2(GF(3))
1452
+ False
1453
+ """
1454
+ return 2 == R.characteristic() == R.cardinality()