passagemath-modules 10.5.32__cp310-cp310-macosx_14_0_arm64.whl → 10.6.20__cp310-cp310-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (334) hide show
  1. {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/METADATA +51 -46
  2. {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/RECORD +333 -323
  3. {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/WHEEL +1 -1
  4. passagemath_modules.dylibs/libgcc_s.1.1.dylib +0 -0
  5. passagemath_modules.dylibs/libgfortran.5.dylib +0 -0
  6. passagemath_modules.dylibs/libgsl.28.dylib +0 -0
  7. passagemath_modules.dylibs/libmpc.3.dylib +0 -0
  8. passagemath_modules.dylibs/libopenblasp-r0.3.29.dylib +0 -0
  9. passagemath_modules.dylibs/libquadmath.0.dylib +0 -0
  10. sage/algebras/clifford_algebra.py +2 -2
  11. sage/algebras/clifford_algebra_element.cpython-310-darwin.so +0 -0
  12. sage/algebras/clifford_algebra_element.pyx +4 -2
  13. sage/algebras/exterior_algebra_groebner.cpython-310-darwin.so +0 -0
  14. sage/algebras/exterior_algebra_groebner.pyx +2 -0
  15. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +83 -5
  16. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-310-darwin.so +0 -0
  17. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +2 -0
  18. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +28 -3
  19. sage/algebras/finite_gca.py +1 -1
  20. sage/algebras/lie_algebras/bgg_dual_module.py +18 -11
  21. sage/algebras/lie_algebras/classical_lie_algebra.py +3 -3
  22. sage/algebras/lie_algebras/examples.py +2 -2
  23. sage/algebras/lie_algebras/free_lie_algebra.py +1 -1
  24. sage/algebras/lie_algebras/heisenberg.py +4 -4
  25. sage/algebras/lie_algebras/lie_algebra.py +1 -1
  26. sage/algebras/lie_algebras/lie_algebra_element.cpython-310-darwin.so +0 -0
  27. sage/algebras/lie_algebras/lie_algebra_element.pyx +65 -28
  28. sage/algebras/lie_algebras/quotient.py +40 -29
  29. sage/algebras/lie_algebras/subalgebra.py +76 -53
  30. sage/algebras/lie_algebras/verma_module.py +1 -3
  31. sage/algebras/octonion_algebra.cpython-310-darwin.so +0 -0
  32. sage/algebras/octonion_algebra.pyx +1 -1
  33. sage/algebras/orlik_solomon.py +4 -4
  34. sage/algebras/orlik_terao.py +4 -4
  35. sage/algebras/steenrod/steenrod_algebra.py +37 -30
  36. sage/algebras/steenrod/steenrod_algebra_bases.py +2 -2
  37. sage/algebras/steenrod/steenrod_algebra_misc.py +4 -4
  38. sage/algebras/steenrod/steenrod_algebra_mult.py +2 -2
  39. sage/all__sagemath_modules.py +1 -0
  40. sage/calculus/integration.cpython-310-darwin.so +0 -0
  41. sage/calculus/integration.pyx +6 -5
  42. sage/calculus/interpolation.cpython-310-darwin.so +0 -0
  43. sage/calculus/interpolators.cpython-310-darwin.so +0 -0
  44. sage/calculus/ode.cpython-310-darwin.so +0 -0
  45. sage/calculus/ode.pxd +2 -2
  46. sage/calculus/ode.pyx +6 -4
  47. sage/calculus/riemann.cpython-310-darwin.so +0 -0
  48. sage/calculus/riemann.pyx +68 -48
  49. sage/calculus/transforms/dwt.cpython-310-darwin.so +0 -0
  50. sage/calculus/transforms/fft.cpython-310-darwin.so +0 -0
  51. sage/coding/ag_code_decoders.cpython-310-darwin.so +0 -0
  52. sage/coding/ag_code_decoders.pyx +31 -31
  53. sage/coding/binary_code.cpython-310-darwin.so +0 -0
  54. sage/coding/binary_code.pxd +6 -6
  55. sage/coding/binary_code.pyx +212 -173
  56. sage/coding/guruswami_sudan/utils.py +3 -5
  57. sage/coding/kasami_codes.cpython-310-darwin.so +0 -0
  58. sage/coding/kasami_codes.pyx +20 -24
  59. sage/coding/linear_code.py +2 -2
  60. sage/coding/linear_code_no_metric.py +5 -5
  61. sage/coding/linear_rank_metric.py +81 -19
  62. sage/combinat/cartesian_product.py +1 -1
  63. sage/combinat/free_module.py +22 -2
  64. sage/combinat/root_system/all.py +1 -1
  65. sage/combinat/root_system/ambient_space.py +1 -1
  66. sage/combinat/root_system/associahedron.py +4 -4
  67. sage/combinat/root_system/braid_move_calculator.py +2 -2
  68. sage/combinat/root_system/braid_orbit.cpython-310-darwin.so +0 -0
  69. sage/combinat/root_system/braid_orbit.pyx +1 -1
  70. sage/combinat/root_system/branching_rules.py +3 -3
  71. sage/combinat/root_system/cartan_type.py +14 -14
  72. sage/combinat/root_system/coxeter_group.py +3 -3
  73. sage/combinat/root_system/coxeter_matrix.py +1 -1
  74. sage/combinat/root_system/coxeter_type.py +12 -1
  75. sage/combinat/root_system/extended_affine_weyl_group.py +9 -9
  76. sage/combinat/root_system/fundamental_group.py +3 -5
  77. sage/combinat/root_system/hecke_algebra_representation.py +1 -1
  78. sage/combinat/root_system/integrable_representations.py +1 -1
  79. sage/combinat/root_system/pieri_factors.py +3 -3
  80. sage/combinat/root_system/root_lattice_realization_algebras.py +1 -1
  81. sage/combinat/root_system/root_lattice_realizations.py +1 -1
  82. sage/combinat/root_system/type_folded.py +3 -3
  83. sage/combinat/root_system/type_reducible.py +8 -7
  84. sage/combinat/root_system/type_super_A.py +2 -2
  85. sage/combinat/root_system/weight_lattice_realizations.py +9 -8
  86. sage/combinat/root_system/weyl_characters.py +2 -2
  87. sage/crypto/__init__.py +1 -0
  88. sage/crypto/block_cipher/des.py +1 -1
  89. sage/crypto/block_cipher/miniaes.py +3 -3
  90. sage/crypto/block_cipher/present.py +3 -3
  91. sage/crypto/block_cipher/sdes.py +3 -3
  92. sage/crypto/boolean_function.cpython-310-darwin.so +0 -0
  93. sage/crypto/boolean_function.pyx +22 -23
  94. sage/crypto/key_exchange/diffie_hellman.py +4 -9
  95. sage/crypto/mq/sr.py +1 -1
  96. sage/crypto/public_key/blum_goldwasser.py +3 -3
  97. sage/crypto/sbox.cpython-310-darwin.so +0 -0
  98. sage/crypto/sbox.pyx +1 -1
  99. sage/crypto/sboxes.py +22 -0
  100. sage/crypto/util.py +4 -6
  101. sage/ext/interpreters/__init__.py +1 -1
  102. sage/ext/interpreters/all__sagemath_modules.py +1 -1
  103. sage/ext/interpreters/wrapper_cc.cpython-310-darwin.so +0 -0
  104. sage/ext/interpreters/wrapper_cc.pxd +5 -5
  105. sage/ext/interpreters/wrapper_cc.pyx +1 -1
  106. sage/ext/interpreters/wrapper_cdf.cpython-310-darwin.so +0 -0
  107. sage/ext/interpreters/wrapper_cdf.pxd +5 -7
  108. sage/ext/interpreters/wrapper_cdf.pyx +4 -10
  109. sage/ext/interpreters/wrapper_rdf.cpython-310-darwin.so +0 -0
  110. sage/ext/interpreters/wrapper_rdf.pxd +1 -1
  111. sage/ext/interpreters/wrapper_rdf.pyx +1 -1
  112. sage/ext/interpreters/wrapper_rr.cpython-310-darwin.so +0 -0
  113. sage/ext/interpreters/wrapper_rr.pxd +5 -5
  114. sage/ext/interpreters/wrapper_rr.pyx +1 -2
  115. sage/geometry/toric_lattice.py +3 -3
  116. sage/geometry/toric_lattice_element.cpython-310-darwin.so +0 -0
  117. sage/groups/additive_abelian/additive_abelian_group.py +1 -1
  118. sage/groups/additive_abelian/qmodnz.py +4 -4
  119. sage/groups/matrix_gps/coxeter_group.py +17 -4
  120. sage/groups/matrix_gps/group_element.cpython-310-darwin.so +0 -0
  121. sage/groups/misc_gps/argument_groups.py +2 -2
  122. sage/groups/misc_gps/imaginary_groups.py +4 -4
  123. sage/groups/perm_gps/partn_ref/refinement_binary.cpython-310-darwin.so +0 -0
  124. sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-310-darwin.so +0 -0
  125. sage/homology/chain_complex.py +0 -2
  126. sage/homology/hochschild_complex.py +3 -3
  127. sage/homology/homology_morphism.py +6 -6
  128. sage/homology/homology_vector_space_with_basis.py +1 -1
  129. sage/libs/gsl/array.cpython-310-darwin.so +0 -0
  130. sage/libs/mpmath/utils.cpython-310-darwin.so +0 -0
  131. sage/matrix/action.cpython-310-darwin.so +0 -0
  132. sage/matrix/args.cpython-310-darwin.so +0 -0
  133. sage/matrix/args.pyx +25 -10
  134. sage/matrix/benchmark.py +8 -4
  135. sage/matrix/compute_J_ideal.py +2 -2
  136. sage/matrix/constructor.cpython-310-darwin.so +0 -0
  137. sage/matrix/echelon_matrix.cpython-310-darwin.so +0 -0
  138. sage/matrix/echelon_matrix.pyx +1 -1
  139. sage/matrix/matrix0.cpython-310-darwin.so +0 -0
  140. sage/matrix/matrix0.pxd +3 -3
  141. sage/matrix/matrix0.pyx +7 -5
  142. sage/matrix/matrix1.cpython-310-darwin.so +0 -0
  143. sage/matrix/matrix1.pyx +87 -48
  144. sage/matrix/matrix2.cpython-310-darwin.so +0 -0
  145. sage/matrix/matrix2.pxd +3 -3
  146. sage/matrix/matrix2.pyx +1261 -63
  147. sage/matrix/matrix_cdv.cpython-310-darwin.so +0 -0
  148. sage/matrix/matrix_complex_double_dense.cpython-310-darwin.so +0 -0
  149. sage/matrix/matrix_complex_double_dense.pyx +1 -1
  150. sage/matrix/matrix_dense.cpython-310-darwin.so +0 -0
  151. sage/matrix/matrix_dense.pyx +2 -3
  152. sage/matrix/matrix_double_dense.cpython-310-darwin.so +0 -0
  153. sage/matrix/matrix_double_dense.pyx +11 -5
  154. sage/matrix/matrix_double_sparse.cpython-310-darwin.so +0 -0
  155. sage/matrix/matrix_generic_dense.cpython-310-darwin.so +0 -0
  156. sage/matrix/matrix_generic_sparse.cpython-310-darwin.so +0 -0
  157. sage/matrix/matrix_generic_sparse.pyx +1 -1
  158. sage/matrix/matrix_laurent_mpolynomial_dense.cpython-310-darwin.so +0 -0
  159. sage/matrix/matrix_numpy_dense.cpython-310-darwin.so +0 -0
  160. sage/matrix/matrix_numpy_integer_dense.cpython-310-darwin.so +0 -0
  161. sage/matrix/matrix_polynomial_dense.cpython-310-darwin.so +0 -0
  162. sage/matrix/matrix_polynomial_dense.pyx +952 -261
  163. sage/matrix/matrix_real_double_dense.cpython-310-darwin.so +0 -0
  164. sage/matrix/matrix_sparse.cpython-310-darwin.so +0 -0
  165. sage/matrix/matrix_sparse.pyx +6 -7
  166. sage/matrix/matrix_window.cpython-310-darwin.so +0 -0
  167. sage/matrix/matrix_window.pyx +2 -2
  168. sage/matrix/misc_mpfr.cpython-310-darwin.so +0 -0
  169. sage/matrix/operation_table.py +0 -2
  170. sage/matrix/special.py +5 -1
  171. sage/matrix/strassen.cpython-310-darwin.so +0 -0
  172. sage/matrix/strassen.pyx +1 -1
  173. sage/matroids/basis_exchange_matroid.cpython-310-darwin.so +0 -0
  174. sage/matroids/basis_matroid.cpython-310-darwin.so +0 -0
  175. sage/matroids/chow_ring.py +68 -65
  176. sage/matroids/chow_ring_ideal.py +41 -38
  177. sage/matroids/circuit_closures_matroid.cpython-310-darwin.so +0 -0
  178. sage/matroids/circuits_matroid.cpython-310-darwin.so +0 -0
  179. sage/matroids/database_matroids.py +16 -5
  180. sage/matroids/dual_matroid.py +2 -2
  181. sage/matroids/extension.cpython-310-darwin.so +0 -0
  182. sage/matroids/flats_matroid.cpython-310-darwin.so +0 -0
  183. sage/matroids/gammoid.py +1 -1
  184. sage/matroids/graphic_matroid.cpython-310-darwin.so +0 -0
  185. sage/matroids/graphic_matroid.pyx +3 -3
  186. sage/matroids/lean_matrix.cpython-310-darwin.so +0 -0
  187. sage/matroids/lean_matrix.pyx +22 -22
  188. sage/matroids/linear_matroid.cpython-310-darwin.so +0 -0
  189. sage/matroids/linear_matroid.pyx +13 -13
  190. sage/matroids/matroid.cpython-310-darwin.so +0 -0
  191. sage/matroids/matroid.pyx +15 -15
  192. sage/matroids/matroids_plot_helpers.py +48 -46
  193. sage/matroids/minor_matroid.py +2 -2
  194. sage/matroids/set_system.cpython-310-darwin.so +0 -0
  195. sage/matroids/transversal_matroid.cpython-310-darwin.so +0 -0
  196. sage/matroids/transversal_matroid.pyx +3 -3
  197. sage/matroids/union_matroid.cpython-310-darwin.so +0 -0
  198. sage/matroids/union_matroid.pyx +3 -0
  199. sage/matroids/unpickling.cpython-310-darwin.so +0 -0
  200. sage/matroids/utilities.py +2 -2
  201. sage/misc/c3.cpython-310-darwin.so +0 -0
  202. sage/misc/compat.py +1 -2
  203. sage/misc/pickle_old.cpython-310-darwin.so +0 -0
  204. sage/modules/diamond_cutting.py +117 -30
  205. sage/modules/fg_pid/fgp_module.py +3 -3
  206. sage/modules/filtered_vector_space.py +4 -4
  207. sage/modules/finite_submodule_iter.cpython-310-darwin.so +0 -0
  208. sage/modules/fp_graded/free_module.py +2 -2
  209. sage/modules/fp_graded/module.py +2 -2
  210. sage/modules/fp_graded/morphism.py +4 -4
  211. sage/modules/fp_graded/steenrod/morphism.py +1 -1
  212. sage/modules/free_module.py +162 -26
  213. sage/modules/free_module_element.cpython-310-darwin.so +0 -0
  214. sage/modules/free_module_element.pyx +4 -4
  215. sage/modules/free_module_integer.py +2 -2
  216. sage/modules/free_module_morphism.py +3 -3
  217. sage/modules/free_module_pseudohomspace.py +352 -0
  218. sage/modules/free_module_pseudomorphism.py +578 -0
  219. sage/modules/free_quadratic_module_integer_symmetric.py +24 -13
  220. sage/modules/matrix_morphism.py +9 -9
  221. sage/modules/multi_filtered_vector_space.py +4 -4
  222. sage/modules/ore_module.py +2208 -0
  223. sage/modules/ore_module_element.py +178 -0
  224. sage/modules/ore_module_homspace.py +147 -0
  225. sage/modules/ore_module_morphism.py +968 -0
  226. sage/modules/quotient_module.py +11 -1
  227. sage/modules/submodule.py +1 -1
  228. sage/modules/torsion_quadratic_module.py +1 -1
  229. sage/modules/vector_complex_double_dense.cpython-310-darwin.so +0 -0
  230. sage/modules/vector_double_dense.cpython-310-darwin.so +0 -0
  231. sage/modules/vector_integer_dense.cpython-310-darwin.so +0 -0
  232. sage/modules/vector_integer_sparse.cpython-310-darwin.so +0 -0
  233. sage/modules/vector_integer_sparse.pyx +4 -4
  234. sage/modules/vector_modn_dense.cpython-310-darwin.so +0 -0
  235. sage/modules/vector_modn_sparse.cpython-310-darwin.so +0 -0
  236. sage/modules/vector_numpy_dense.cpython-310-darwin.so +0 -0
  237. sage/modules/vector_numpy_integer_dense.cpython-310-darwin.so +0 -0
  238. sage/modules/vector_rational_dense.cpython-310-darwin.so +0 -0
  239. sage/modules/vector_rational_dense.pyx +1 -1
  240. sage/modules/vector_rational_sparse.cpython-310-darwin.so +0 -0
  241. sage/modules/vector_rational_sparse.pyx +5 -5
  242. sage/modules/vector_real_double_dense.cpython-310-darwin.so +0 -0
  243. sage/modules/vector_space_morphism.py +2 -2
  244. sage/modules/with_basis/cell_module.py +17 -0
  245. sage/modules/with_basis/indexed_element.cpython-310-darwin.so +0 -0
  246. sage/modules/with_basis/indexed_element.pyx +1 -1
  247. sage/modules/with_basis/invariant.py +1 -1
  248. sage/modules/with_basis/representation.py +0 -1
  249. sage/modules/with_basis/subquotient.py +2 -2
  250. sage/numerical/gauss_legendre.cpython-310-darwin.so +0 -0
  251. sage/probability/probability_distribution.cpython-310-darwin.so +0 -0
  252. sage/quadratic_forms/binary_qf.py +11 -11
  253. sage/quadratic_forms/bqf_class_group.py +26 -92
  254. sage/quadratic_forms/count_local_2.cpython-310-darwin.so +0 -0
  255. sage/quadratic_forms/extras.py +1 -1
  256. sage/quadratic_forms/quadratic_form.py +5 -4
  257. sage/quadratic_forms/quadratic_form__equivalence_testing.py +7 -4
  258. sage/quadratic_forms/quadratic_form__evaluate.cpython-310-darwin.so +0 -0
  259. sage/quadratic_forms/quadratic_form__local_field_invariants.py +10 -10
  260. sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +2 -2
  261. sage/quadratic_forms/ternary.cpython-310-darwin.so +0 -0
  262. sage/quadratic_forms/ternary_qf.py +50 -83
  263. sage/rings/cfinite_sequence.py +16 -17
  264. sage/rings/complex_conversion.cpython-310-darwin.so +0 -0
  265. sage/rings/complex_double.cpython-310-darwin.so +0 -0
  266. sage/rings/complex_double.pxd +1 -0
  267. sage/rings/complex_double.pyx +37 -32
  268. sage/rings/complex_mpc.cpython-310-darwin.so +0 -0
  269. sage/rings/complex_mpc.pyx +27 -23
  270. sage/rings/complex_mpfr.cpython-310-darwin.so +0 -0
  271. sage/rings/complex_mpfr.pyx +11 -11
  272. sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +277 -21
  273. sage/rings/function_field/drinfeld_modules/drinfeld_module.py +10 -1
  274. sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1 -1
  275. sage/rings/function_field/drinfeld_modules/homset.py +1 -2
  276. sage/rings/function_field/drinfeld_modules/morphism.py +2 -2
  277. sage/rings/function_field/hermite_form_polynomial.cpython-310-darwin.so +0 -0
  278. sage/rings/function_field/khuri_makdisi.cpython-310-darwin.so +0 -0
  279. sage/rings/function_field/khuri_makdisi.pyx +27 -25
  280. sage/rings/invariants/invariant_theory.py +61 -60
  281. sage/rings/invariants/reconstruction.py +8 -8
  282. sage/rings/polynomial/laurent_polynomial_mpair.cpython-310-darwin.so +0 -0
  283. sage/rings/polynomial/ore_function_element.py +1 -1
  284. sage/rings/polynomial/ore_polynomial_element.cpython-310-darwin.so +0 -0
  285. sage/rings/polynomial/ore_polynomial_element.pyx +8 -8
  286. sage/rings/polynomial/ore_polynomial_ring.py +134 -17
  287. sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-310-darwin.so +0 -0
  288. sage/rings/polynomial/skew_polynomial_element.cpython-310-darwin.so +0 -0
  289. sage/rings/polynomial/skew_polynomial_finite_field.cpython-310-darwin.so +0 -0
  290. sage/rings/polynomial/skew_polynomial_finite_field.pyx +3 -4
  291. sage/rings/polynomial/skew_polynomial_finite_order.cpython-310-darwin.so +0 -0
  292. sage/rings/polynomial/skew_polynomial_finite_order.pyx +2 -5
  293. sage/rings/real_double_element_gsl.cpython-310-darwin.so +0 -0
  294. sage/rings/real_mpfr.cpython-310-darwin.so +0 -0
  295. sage/rings/real_mpfr.pyx +25 -7
  296. sage/rings/ring_extension.cpython-310-darwin.so +0 -0
  297. sage/rings/ring_extension.pyx +4 -2
  298. sage/rings/ring_extension_conversion.cpython-310-darwin.so +0 -0
  299. sage/rings/ring_extension_element.cpython-310-darwin.so +0 -0
  300. sage/rings/ring_extension_element.pyx +42 -0
  301. sage/rings/ring_extension_morphism.cpython-310-darwin.so +0 -0
  302. sage/schemes/all__sagemath_modules.py +1 -0
  303. sage/schemes/projective/all__sagemath_modules.py +1 -0
  304. sage/schemes/projective/coherent_sheaf.py +300 -0
  305. sage/schemes/projective/cohomology.py +510 -0
  306. sage/stats/basic_stats.py +17 -15
  307. sage/stats/distributions/dgs_misc.h +11 -4
  308. sage/stats/distributions/discrete_gaussian_integer.cpython-310-darwin.so +0 -0
  309. sage/stats/distributions/discrete_gaussian_integer.pyx +9 -7
  310. sage/stats/hmm/chmm.cpython-310-darwin.so +0 -0
  311. sage/stats/hmm/chmm.pyx +13 -13
  312. sage/stats/hmm/distributions.cpython-310-darwin.so +0 -0
  313. sage/stats/hmm/distributions.pxd +3 -3
  314. sage/stats/hmm/distributions.pyx +3 -3
  315. sage/stats/hmm/hmm.cpython-310-darwin.so +0 -0
  316. sage/stats/hmm/hmm.pxd +3 -3
  317. sage/stats/hmm/hmm.pyx +6 -6
  318. sage/stats/hmm/util.cpython-310-darwin.so +0 -0
  319. sage/stats/hmm/util.pyx +6 -6
  320. sage/stats/intlist.cpython-310-darwin.so +0 -0
  321. sage/stats/intlist.pxd +3 -3
  322. sage/stats/time_series.cpython-310-darwin.so +0 -0
  323. sage/tensor/modules/alternating_contr_tensor.py +3 -3
  324. sage/tensor/modules/comp.py +3 -3
  325. sage/tensor/modules/ext_pow_free_module.py +3 -3
  326. sage/tensor/modules/format_utilities.py +3 -3
  327. sage/tensor/modules/free_module_linear_group.py +3 -3
  328. sage/tensor/modules/free_module_morphism.py +0 -1
  329. sage/tensor/modules/tensor_free_module.py +3 -3
  330. sage/tensor/modules/tensor_free_submodule.py +1 -1
  331. sage/tensor/modules/tensor_free_submodule_basis.py +1 -1
  332. sage/tensor/modules/tensor_with_indices.py +5 -5
  333. passagemath_modules.dylibs/libopenblas_armv8p-r0.3.28.dylib +0 -0
  334. {passagemath_modules-10.5.32.dist-info → passagemath_modules-10.6.20.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,510 @@
1
+ # sage_setup: distribution = sagemath-modules
2
+ # sage.doctest: needs sage.libs.singular
3
+ r"""
4
+ Cohomology of coherent sheaves
5
+
6
+ This module implements Maruyama's method for computing the cohomology of
7
+ coherent sheaves on projective schemes. This module is internal, and is not
8
+ intended for direct use. Use :meth:`cohomology` method of coherent sheaves on
9
+ projective schemes.
10
+
11
+ Maruyama's method is explained and proved in detail in [Kudo2017]_. Here we
12
+ summary the main results necessary to understand the implementation.
13
+
14
+ Let `M` be a graded module finitely generated over the homogeneous coordinate
15
+ ring `S` of the projective `r`-space over a field `k`. We aim for computing the
16
+ cohomology groups `H^q(\tilde M)` for the coherent sheaf `\tilde M`.
17
+
18
+ Let `S=k[x_0,x_2,\dots,x_r]`. Then `M` is a quotient of the free module
19
+ `\bigoplus_{i=1}^{t}S` by a submodule. Let
20
+
21
+ .. MATH::
22
+
23
+ 0\to\bigoplus_{j=1}^{t_{r+1}}S(-m^{(r+1)}_j)\overset{f_{r+1}}{\longrightarrow}\dots
24
+ \overset{f_1}{\longrightarrow}\bigoplus_{j=1}^{t_0}S(-m^{(0)}_j)\overset{f_0}{\longrightarrow}M\to 0
25
+
26
+ be a minimal free resolution of `M`. Then it induces a complex of (top) cohomology groups
27
+
28
+ .. MATH::
29
+
30
+ \bigoplus_{j=1}^{t_{i+1}}H^r(\OO_{\PP^r}(-m^{(i+1)}_j))\overset{H^r(f_{i+1})}{\longrightarrow}
31
+ \bigoplus_{j=1}^{t_i}H^r(\OO_{\PP^r}(-m^{(i)}_j))\overset{H^r(f_{i})}{\longrightarrow}
32
+ \bigoplus_{j=1}^{t_{i-1}}H^r(\OO_{\PP^r}(-m^{(i-1)}_j)),
33
+
34
+ where `i` runs from `1` to `r`. Now it holds that
35
+
36
+ .. MATH::
37
+
38
+ H^q(\tilde M)\cong \ker H^r(f_{r-q})/\im H^r(f_{r-q+1})
39
+
40
+ for `1\le q\le r - 1` and
41
+
42
+ .. MATH::
43
+
44
+ H^r(\tilde M)\cong \bigoplus_{j=1}^{t_0}H^r(\OO_{\PP^r}(-m^{(0)}_j))/\im H^r(f_1)
45
+
46
+ and `\dim H^0(\tilde M)` can be computed by the formula
47
+
48
+ .. MATH::
49
+
50
+ \begin{split}
51
+ &\dim \bigoplus_{j=1}^{t_{0}}H^0(\OO_{\PP^r}(-m^{(0)}_j))
52
+ -\dim \bigoplus_{j=1}^{t_{r+1}}H^r(\OO_{\PP^r}(-m^{(r+1)}_j))
53
+ +\dim \bigoplus_{j=1}^{t_{r}}H^r(\OO_{\PP^r}(-m^{(r)}_j)) \\
54
+ &\quad -\rank H^0(f_1)-\rank H^r(f_r)
55
+ \end{split}
56
+
57
+ in which the complex of (bottom) cohomology groups
58
+
59
+ .. MATH::
60
+
61
+ \bigoplus_{j=1}^{t_{i+1}}H^0(\OO_{\PP^r}(-m^{(i+1)}_j))\overset{H^0(f_{i+1})}{\longrightarrow}
62
+ \bigoplus_{j=1}^{t_i}H^0(\OO_{\PP^r}(-m^{(i)}_j))\overset{H^0(f_{i})}{\longrightarrow}
63
+ \bigoplus_{j=1}^{t_{i-1}}H^0(\OO_{\PP^r}(-m^{(i-1)}_j)),
64
+
65
+ where `i` runs from `1` to `r` is used.
66
+
67
+ The implemented algorithm works more generally for twisted coherent sheaves and
68
+ accepts as input shifted graded module `M(-n)` with shift `n`.
69
+
70
+ EXAMPLES:
71
+
72
+ We define the Fermat cubic surface (a curve in `\PP^2`) and compute its cohomology groups::
73
+
74
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
75
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
76
+ sage: sh = X.structure_sheaf()
77
+ sage: sh.cohomology(1)
78
+ 3
79
+
80
+ Internally the cohomology is computed by Maruyama's method::
81
+
82
+ sage: sh._cohomology
83
+ Maruyama Method using S(0) <-- S(-4) <-- 0
84
+ sage: sh._cohomology.H(1)
85
+ Vector space quotient V/W of dimension 3 over Rational Field where
86
+ V: Vector space of degree 3 and dimension 3 over Rational Field
87
+ Basis matrix:
88
+ [1 0 0]
89
+ [0 1 0]
90
+ [0 0 1]
91
+ W: Vector space of degree 3 and dimension 0 over Rational Field
92
+ Basis matrix:
93
+ []
94
+ sage: sh._cohomology.H(1).dimension() == sh.cohomology(1)
95
+ True
96
+ sage: sh.cohomology(2)
97
+ 0
98
+ sage: sh._cohomology.H(2)
99
+ Vector space quotient V/W of dimension 0 over Rational Field where
100
+ V: Vector space of dimension 0 over Rational Field
101
+ W: Vector space of degree 0 and dimension 0 over Rational Field
102
+ Basis matrix:
103
+ []
104
+ sage: sh._cohomology.H(2).dimension() == sh.cohomology(2)
105
+ True
106
+
107
+ The rather complicated form (as a quotient of vector spaces) of the `r`-th
108
+ cohomology group ``H(r)`` reflects the internal representation of the
109
+ cohomology group in terms of the cohomology groups of twisted structure sheaves
110
+ of a projective space.
111
+
112
+ On the other hand, it is not clear how to represent `H^0(\tilde M)` in terms of
113
+ twisted structure sheaves of a projective space. Hence it is merely created
114
+ as a vector space over `k` with the correct dimension::
115
+
116
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
117
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
118
+ sage: sh = X.structure_sheaf()
119
+ sage: sh.cohomology(0)
120
+ 1
121
+ sage: sh._cohomology.H(0)
122
+ Vector space of dimension 1 over Rational Field
123
+ """
124
+
125
+ from sage.structure.sage_object import SageObject
126
+ from sage.misc.flatten import flatten
127
+ from sage.combinat.integer_lists.invlex import IntegerListsLex
128
+ from sage.modules.free_module import VectorSpace
129
+ from sage.modules.free_module_element import vector
130
+ from sage.rings.integer import Integer
131
+
132
+
133
+ class CohomologyGroupBottom(SageObject):
134
+ r"""
135
+ Bottom cohomology group of the twisted structure sheaf of a projective space.
136
+
137
+ INPUT:
138
+
139
+ - ``S`` -- a direct sum of copies of the coordinate ring of a projective space
140
+
141
+ - ``shifts`` -- shifts of the component rings of ``S``
142
+
143
+ This represents `\bigoplus_{j=1}^{t_i}H^0(\OO_{\PP^r}(-m^{(i)}_j))` for shifts `m^{(i)}_j`.
144
+
145
+ EXAMPLES::
146
+
147
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
148
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
149
+ sage: c = X.structure_sheaf()._cohomology
150
+ sage: c.cohomology_group_bottom(0)
151
+ Bottom Cohomology Group of dimension 1
152
+ """
153
+ def __init__(self, S, shifts):
154
+ """
155
+ Initialize.
156
+
157
+ TESTS::
158
+
159
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
160
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
161
+ sage: c = X.structure_sheaf(twist=1)._cohomology
162
+ sage: c.cohomology_group_bottom(0)
163
+ Bottom Cohomology Group of dimension 3
164
+ """
165
+ self.graded_ring = S
166
+ self.shifts = shifts
167
+
168
+ n = S.ngens()
169
+
170
+ basis = []
171
+ summands_basis = []
172
+ summands_index = []
173
+ rank = 0
174
+ for m in self.shifts:
175
+ # list of integer vectors whose entries are all non-negative integers and sum to -m
176
+ l = [vector(e) for e in IntegerListsLex(length=n, min_sum=-m, max_sum=-m)]
177
+ basis += l
178
+ summands_basis.append(l)
179
+ summands_index.append(rank)
180
+ rank += len(l)
181
+
182
+ self.summands_basis = summands_basis
183
+ self.summands_index = summands_index
184
+ self.basis = basis
185
+ self.vector_space = VectorSpace(S.base_ring(), rank)
186
+ self.rank = rank
187
+
188
+ def __repr__(self):
189
+ r"""
190
+ Return the string representation of ``self``.
191
+
192
+ EXAMPLES::
193
+
194
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
195
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
196
+ sage: c = X.structure_sheaf()._cohomology
197
+ sage: c.cohomology_group_bottom(0)
198
+ Bottom Cohomology Group of dimension 1
199
+ """
200
+ return f'Bottom Cohomology Group of dimension {self.rank}'
201
+
202
+
203
+ class CohomologyGroupTop(SageObject):
204
+ r"""
205
+ Top cohomology group of the twisted structure sheaf of a projective space.
206
+
207
+ INPUT:
208
+
209
+ - ``S`` -- a direct sum of copies of the coordinate ring of a projective space
210
+
211
+ - ``shifts`` -- shifts of the component rings of ``S``
212
+
213
+ This represents `\bigoplus_{j=1}^{t_i}H^r(\OO_{\PP^r}(-m^{(i)}_j))` for shifts `m^{(i)}_j`.
214
+
215
+ EXAMPLES::
216
+
217
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
218
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
219
+ sage: c = X.structure_sheaf()._cohomology
220
+ sage: c.cohomology_group_top(0)
221
+ Top Cohomology Group of dimension 0
222
+ """
223
+ def __init__(self, S, shifts):
224
+ """
225
+ Initialize.
226
+
227
+ TESTS::
228
+
229
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
230
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
231
+ sage: c = X.structure_sheaf(twist=1)._cohomology
232
+ sage: c.cohomology_group_top(1)
233
+ Top Cohomology Group of dimension 1
234
+ """
235
+ self.graded_ring = S
236
+ self.shifts = shifts
237
+
238
+ n = S.ngens()
239
+
240
+ basis = []
241
+ summands_basis = []
242
+ summands_index = []
243
+ rank = 0
244
+ for m in self.shifts:
245
+ # list of integer vectors whose entries are all negative integers and sum to -m
246
+ l = [-vector(e) for e in IntegerListsLex(length=n, min_sum=m, max_sum=m, min_part=1)]
247
+ basis += l
248
+ summands_basis.append(l)
249
+ summands_index.append(rank)
250
+ rank += len(l)
251
+
252
+ self.summands_basis = summands_basis
253
+ self.summands_index = summands_index
254
+ self.basis = basis
255
+ self.vector_space = VectorSpace(S.base_ring(), rank)
256
+ self.rank = rank
257
+
258
+ def __repr__(self):
259
+ r"""
260
+ Return the string representation.
261
+
262
+ EXAMPLES::
263
+
264
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
265
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
266
+ sage: c = X.structure_sheaf()._cohomology
267
+ sage: c.cohomology_group_top(1)
268
+ Top Cohomology Group of dimension 3
269
+ """
270
+ return f'Top Cohomology Group of dimension {self.rank}'
271
+
272
+
273
+ class MaruyamaMethod(SageObject):
274
+ r"""
275
+ This class implements Maruyama's method to compute the cohomology group
276
+ `H^q(\tilde M(n))` as a vector space over the base field `k` and
277
+ `h^q(\tilde M(n))=\dim_kH^q(\tilde M(n))` where `n` denotes the twist.
278
+
279
+ INPUT:
280
+
281
+ - ``M`` -- a quotient of a free module over `S` by a submodule, where `S`
282
+ is a multi-variate polynomial ring
283
+
284
+ - ``twist`` -- (default: 0) an integer
285
+
286
+ This class provides :meth:`H` and :meth:`h` as public interface, and all
287
+ other methods are internal.
288
+
289
+ EXAMPLES::
290
+
291
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
292
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
293
+ sage: sh = X.structure_sheaf(1) # twisted sheaf
294
+ sage: sh._cohomology
295
+ Maruyama Method using S(1) <-- S(-3) <-- 0
296
+ """
297
+ def __init__(self, M, twist=0):
298
+ """
299
+ Initialize.
300
+
301
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
302
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
303
+ sage: sh = X.structure_sheaf(1) # twisted sheaf
304
+ sage: c = sh._cohomology
305
+ sage: TestSuite(c).run(skip=['_test_pickling'])
306
+ """
307
+ shifts = [-twist for i in range(M.cover().degree())]
308
+ self.resolution = M.relations().graded_free_resolution(shifts=shifts)
309
+ self.base_ring = self.resolution.target().base_ring()
310
+ self.coefficient_field = self.base_ring.base_ring()
311
+ self.projective_space_dimension = self.base_ring.ngens() - 1
312
+
313
+ def __repr__(self):
314
+ """
315
+ Return the string representation.
316
+
317
+ EXAMPLES::
318
+
319
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
320
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
321
+ sage: X.structure_sheaf()._cohomology
322
+ Maruyama Method using S(0) <-- S(-4) <-- 0
323
+ """
324
+ return f'Maruyama Method using {self.resolution}'
325
+
326
+ def cohomology_group_bottom(self, i):
327
+ r"""
328
+ Return `i`-th bottom cohomology group `\bigoplus_{j=1}^{t_i}H^0(\OO_{\PP^r}(-m^{(i)}_j))`
329
+
330
+ EXAMPLES::
331
+
332
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
333
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
334
+ sage: c = X.structure_sheaf()._cohomology
335
+ sage: c.cohomology_group_bottom(1)
336
+ Bottom Cohomology Group of dimension 0
337
+ """
338
+ S = self.base_ring
339
+ shifts = self.resolution.shifts(i)
340
+ return CohomologyGroupBottom(S, shifts)
341
+
342
+ def cohomology_group_top(self, i):
343
+ r"""
344
+ Return `i`-th top cohomology group `\bigoplus_{j=1}^{t_i}H^r(\OO_{\PP^r}(-m^{(i)}_j))`
345
+
346
+ EXAMPLES::
347
+
348
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
349
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
350
+ sage: c = X.structure_sheaf()._cohomology
351
+ sage: c.cohomology_group_top(1)
352
+ Top Cohomology Group of dimension 3
353
+ """
354
+ S = self.base_ring
355
+ shifts = self.resolution.shifts(i)
356
+ return CohomologyGroupTop(S, shifts)
357
+
358
+ def differential_bottom(self, i):
359
+ r"""
360
+ Return the `i`-th bottom differential map `H^0(f_i)`.
361
+
362
+ EXAMPLES::
363
+
364
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
365
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
366
+ sage: c = X.structure_sheaf()._cohomology
367
+ sage: c.differential_bottom(1)
368
+ Vector space morphism represented as left-multiplication by the matrix:
369
+ []
370
+ Domain: Vector space of dimension 0 over Rational Field
371
+ Codomain: Vector space of dimension 1 over Rational Field
372
+ """
373
+ H1 = self.cohomology_group_bottom(i)
374
+ H0 = self.cohomology_group_bottom(i - 1)
375
+ M = self.resolution.differential(i).matrix()
376
+ K = self.coefficient_field
377
+ zero = K.zero()
378
+
379
+ assert M.ncols() == len(H1.summands_basis)
380
+ assert M.nrows() == len(H0.summands_basis)
381
+
382
+ A = []
383
+ for i in range(M.ncols()):
384
+ basis = H1.summands_basis[i]
385
+ for v in basis:
386
+ image = [zero for e in range(H0.rank)]
387
+ for j in range(M.nrows()):
388
+ f = M[j,i]
389
+ basis = H0.summands_basis[j]
390
+ for c, m in zip(f.coefficients(), f.exponents()):
391
+ u = v + vector(m)
392
+ assert (sum(u) == -H0.shifts[j])
393
+ if any(e < 0 for e in u):
394
+ continue
395
+ k = H0.summands_index[j] + basis.index(u)
396
+ image[k] += c
397
+ A.append(vector(K, image))
398
+
399
+ return H1.vector_space.hom(A, codomain=H0.vector_space, side='right')
400
+
401
+ def differential_top(self, i):
402
+ r"""
403
+ Return the `i`-th top differential map `H^r(f_i)`.
404
+
405
+ EXAMPLES::
406
+
407
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
408
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
409
+ sage: c = X.structure_sheaf()._cohomology
410
+ sage: c.differential_top(1)
411
+ Vector space morphism represented as left-multiplication by the matrix:
412
+ []
413
+ Domain: Vector space of dimension 3 over Rational Field
414
+ Codomain: Vector space of dimension 0 over Rational Field
415
+ """
416
+ H1 = self.cohomology_group_top(i)
417
+ H0 = self.cohomology_group_top(i - 1)
418
+ M = self.resolution.differential(i).matrix()
419
+ K = self.coefficient_field
420
+ zero = K.zero()
421
+
422
+ assert M.ncols() == len(H1.summands_basis)
423
+ assert M.nrows() == len(H0.summands_basis)
424
+
425
+ A = []
426
+ for i in range(M.ncols()):
427
+ basis = H1.summands_basis[i]
428
+ for v in basis:
429
+ image = [zero for e in range(H0.rank)]
430
+ for j in range(M.nrows()):
431
+ f = M[j,i]
432
+ basis = H0.summands_basis[j]
433
+ for c, m in zip(f.coefficients(), f.exponents()):
434
+ u = v + vector(m)
435
+ assert (sum(u) == -H0.shifts[j])
436
+ if any(e >= 0 for e in u):
437
+ continue
438
+ k = H0.summands_index[j] + basis.index(u)
439
+ image[k] += c
440
+ A.append(vector(K, image))
441
+
442
+ return H1.vector_space.hom(A, codomain=H0.vector_space, side='right')
443
+
444
+ def H(self, q):
445
+ r"""
446
+ Return the `q`-th cohomology group `H^q(\tilde M)`.
447
+
448
+ INPUT:
449
+
450
+ - ``q`` -- non-negative integer
451
+
452
+ EXAMPLES::
453
+
454
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
455
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
456
+ sage: c = X.structure_sheaf()._cohomology
457
+ sage: c.H(1)
458
+ Vector space quotient V/W of dimension 3 over Rational Field where
459
+ V: Vector space of degree 3 and dimension 3 over Rational Field
460
+ Basis matrix:
461
+ [1 0 0]
462
+ [0 1 0]
463
+ [0 0 1]
464
+ W: Vector space of degree 3 and dimension 0 over Rational Field
465
+ Basis matrix:
466
+ []
467
+ """
468
+ r = self.projective_space_dimension
469
+ if q == r:
470
+ return self.cohomology_group_top(0).vector_space.quotient(self.differential_top(1).image())
471
+ elif 1 <= q and q < r:
472
+ return self.differential_top(r - q).kernel().quotient(self.differential_top(r - q + 1).image())
473
+ elif q == 0:
474
+ # 0th cohomology group of (global sections) is not realized in
475
+ # terms of cohomology groups and differential maps of twisted
476
+ # structure sheaves of the projective space.
477
+ return VectorSpace(self.coefficient_field, self.h(0))
478
+ elif q > r:
479
+ return VectorSpace(self.coefficient_field, 0)
480
+ raise IndexError('index must be non-negative')
481
+
482
+ def h(self, q):
483
+ r"""
484
+ Return the dimension `h^q(\tilde M)` of the `q`-th cohomology group `H^q(\tilde M)`.
485
+
486
+ INPUT:
487
+
488
+ - ``q`` -- non-negative integer
489
+
490
+ EXAMPLES::
491
+
492
+ sage: P2.<x,y,z> = ProjectiveSpace(QQ, 2)
493
+ sage: X = P2.subscheme([x^4 + y^4 + z^4])
494
+ sage: c = X.structure_sheaf()._cohomology
495
+ sage: c.h(1)
496
+ 3
497
+ """
498
+ r = self.projective_space_dimension
499
+ if q == r:
500
+ return self.cohomology_group_top(0).rank - self.differential_top(1).rank()
501
+ elif 1 <= q and q < r:
502
+ return self.differential_top(r - q).kernel().dimension() - self.differential_top(r - q + 1).rank()
503
+ elif q == 0:
504
+ a = (self.cohomology_group_bottom(0).rank - self.cohomology_group_top(r + 1).rank
505
+ + self.cohomology_group_top(r).rank)
506
+ b = self.differential_bottom(1).rank() + self.differential_top(r).rank()
507
+ return a - b
508
+ elif q > r:
509
+ return Integer(0)
510
+ raise IndexError('index must be non-negative')
sage/stats/basic_stats.py CHANGED
@@ -193,8 +193,8 @@ def std(v, bias=False):
193
193
 
194
194
  EXAMPLES::
195
195
 
196
- sage: # needs sage.symbolic
197
- sage: std([1..6], bias=True)
196
+ sage: data = [random() for i in [1 .. 20]]
197
+ sage: s = std(data)
198
198
  doctest:warning...
199
199
  DeprecationWarning: sage.stats.basic_stats.std is deprecated;
200
200
  use numpy.std or numpy.nanstd instead
@@ -207,6 +207,11 @@ def std(v, bias=False):
207
207
  DeprecationWarning: sage.stats.basic_stats.mean is deprecated;
208
208
  use numpy.mean or numpy.nanmean instead
209
209
  See https://github.com/sagemath/sage/issues/29662 for details.
210
+ sage: s # random
211
+ 0.29487771726609185
212
+
213
+ sage: # needs sage.symbolic
214
+ sage: std([1..6], bias=True)
210
215
  1/2*sqrt(35/3)
211
216
  sage: std([1..6], bias=False)
212
217
  sqrt(7/2)
@@ -230,12 +235,6 @@ def std(v, bias=False):
230
235
  sage: x = stats.TimeSeries([1..100])
231
236
  sage: std(x)
232
237
  29.011491975882016
233
-
234
- TESTS::
235
-
236
- sage: data = [random() for i in [1 .. 20]]
237
- sage: std(data) # random
238
- 0.29487771726609185
239
238
  """
240
239
  deprecation(29662, 'sage.stats.basic_stats.std is deprecated; use numpy.std or numpy.nanstd instead')
241
240
 
@@ -291,24 +290,27 @@ def variance(v, bias=False):
291
290
  35/12
292
291
  sage: variance([e, pi]) # needs sage.symbolic
293
292
  1/2*(pi - e)^2
294
- sage: variance([])
293
+ sage: variance([]) # needs sage.symbolic
295
294
  NaN
296
295
  sage: variance([I, sqrt(2), 3/5]) # needs sage.symbolic
297
296
  1/450*(10*sqrt(2) - 5*I - 3)^2 + 1/450*(5*sqrt(2) - 10*I + 3)^2
298
297
  + 1/450*(5*sqrt(2) + 5*I - 6)^2
299
- sage: variance([RIF(1.0103, 1.0103), RIF(2)])
298
+ sage: variance([RIF(1.0103, 1.0103), RIF(2)]) # needs sage.rings.real_interval_field
300
299
  0.4897530450000000?
301
- sage: import numpy # needs numpy
302
- sage: if int(numpy.version.short_version[0]) > 1: # needs numpy
303
- ....: _ = numpy.set_printoptions(legacy="1.25") # needs numpy
304
- sage: x = numpy.array([1,2,3,4,5]) # needs numpy
305
- sage: variance(x, bias=False) # needs numpy
300
+
301
+ sage: # needs numpy
302
+ sage: import numpy
303
+ sage: if int(numpy.version.short_version[0]) > 1:
304
+ ....: _ = numpy.set_printoptions(legacy="1.25")
305
+ sage: x = numpy.array([1,2,3,4,5])
306
+ sage: variance(x, bias=False)
306
307
  2.5
307
308
  sage: x = stats.TimeSeries([1..100])
308
309
  sage: variance(x)
309
310
  841.6666666666666
310
311
  sage: variance(x, bias=True)
311
312
  833.25
313
+
312
314
  sage: class MyClass:
313
315
  ....: def variance(self, bias=False):
314
316
  ....: return 1
@@ -50,14 +50,21 @@
50
50
  * \brief Macro to help with branch prediction.
51
51
  */
52
52
 
53
+ #ifdef __GNUC__
53
54
  #define __DGS_LIKELY(cond) __builtin_expect ((cond) != 0, 1)
55
+ #else
56
+ #define __DGS_LIKELY(cond) (cond)
57
+ #endif
54
58
 
55
59
  /**
56
60
  * \brief Macro to help with branch prediction.
57
61
  */
58
62
 
63
+ #ifdef __GNUC__
59
64
  #define __DGS_UNLIKELY(cond) __builtin_expect ((cond) != 0, 0)
60
-
65
+ #else
66
+ #define __DGS_UNLIKELY(cond) (cond)
67
+ #endif
61
68
 
62
69
  static int const dgs_radix = sizeof(unsigned long)<<3;
63
70
  static unsigned long const dgs_ffff = -1;
@@ -69,9 +76,9 @@ static inline unsigned long _dgs_randomb_libc(size_t nbits) {
69
76
  size_t n = __DGS_LSB_BITMASK(nbits);
70
77
  assert(((RAND_MAX | (RAND_MAX >> 1)) == RAND_MAX));
71
78
  if (__DGS_LIKELY(n <= RAND_MAX))
72
- return random() & n;
79
+ return rand() & n;
73
80
  assert(RAND_MAX >= __DGS_LSB_BITMASK(22));
74
- unsigned long pool = (((unsigned long)random()) << 0) ^ (((unsigned long)random()) << 22) ^ (((unsigned long)random()) << 44);
81
+ unsigned long pool = (((unsigned long)rand()) << 0) ^ (((unsigned long)rand()) << 22) ^ (((unsigned long)rand()) << 44);
75
82
  return pool & n;
76
83
  }
77
84
 
@@ -80,7 +87,7 @@ static inline unsigned long _dgs_randomm_libc(unsigned long n) {
80
87
  long r;
81
88
  unsigned long k = RAND_MAX/n;
82
89
  do {
83
- r = random();
90
+ r = rand();
84
91
  } while (r >= k*n);
85
92
  return r%n;
86
93
  }
@@ -1,6 +1,8 @@
1
1
  # sage_setup: distribution = sagemath-modules
2
2
  # sage.doctest: needs sage.symbolic
3
- #
3
+ # distutils: libraries = GSL_LIBRARIES
4
+ # distutils: library_dirs = GSL_LIBDIR
5
+ # distutils: include_dirs = GSL_INCDIR
4
6
  # distutils: sources = sage/stats/distributions/dgs_gauss_mp.c sage/stats/distributions/dgs_gauss_dp.c sage/stats/distributions/dgs_bern.c
5
7
  # distutils: depends = sage/stats/distributions/dgs_gauss.h sage/stats/distributions/dgs_bern.h sage/stats/distributions/dgs_misc.h
6
8
  # distutils: extra_compile_args = -D_XOPEN_SOURCE=600
@@ -345,10 +347,10 @@ cdef class DiscreteGaussianDistributionIntegerSampler(SageObject):
345
347
  -3
346
348
  """
347
349
  if sigma <= 0.0:
348
- raise ValueError("sigma must be > 0.0 but got %f"%sigma)
350
+ raise ValueError("sigma must be > 0.0 but got %f" % sigma)
349
351
 
350
352
  if tau < 1:
351
- raise ValueError("tau must be >= 1 but got %d"%tau)
353
+ raise ValueError("tau must be >= 1 but got %d" % tau)
352
354
 
353
355
  if algorithm is None:
354
356
  if sigma*tau <= DiscreteGaussianDistributionIntegerSampler.table_cutoff:
@@ -363,15 +365,15 @@ cdef class DiscreteGaussianDistributionIntegerSampler(SageObject):
363
365
  elif algorithm == "uniform+online":
364
366
  algorithm = DGS_DISC_GAUSS_UNIFORM_ONLINE
365
367
  elif algorithm == "uniform+logtable":
366
- if (c%1):
368
+ if (c % 1):
367
369
  raise ValueError("algorithm 'uniform+logtable' requires c%1 == 0")
368
370
  algorithm = DGS_DISC_GAUSS_UNIFORM_LOGTABLE
369
371
  elif algorithm == "sigma2+logtable":
370
- if (c%1):
372
+ if (c % 1):
371
373
  raise ValueError("algorithm 'uniform+logtable' requires c%1 == 0")
372
374
  algorithm = DGS_DISC_GAUSS_SIGMA2_LOGTABLE
373
375
  else:
374
- raise ValueError("Algorithm '%s' not supported by class 'DiscreteGaussianDistributionIntegerSampler'"%(algorithm))
376
+ raise ValueError("Algorithm '%s' not supported by class 'DiscreteGaussianDistributionIntegerSampler'" % (algorithm))
375
377
 
376
378
  if precision == "mp":
377
379
  if not isinstance(sigma, RealNumber):
@@ -398,7 +400,7 @@ cdef class DiscreteGaussianDistributionIntegerSampler(SageObject):
398
400
  self.sigma = RR(sigma)
399
401
  self.c = RR(c)
400
402
  else:
401
- raise ValueError("Parameter precision '%s' not supported."%precision)
403
+ raise ValueError(f"Parameter precision '{precision}' not supported")
402
404
 
403
405
  self.tau = Integer(tau)
404
406
  self.algorithm = algorithm_str
Binary file