passagemath-modules 10.5.46__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 (320) hide show
  1. {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/METADATA +49 -44
  2. {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/RECORD +320 -314
  3. passagemath_modules.dylibs/libmpc.3.dylib +0 -0
  4. passagemath_modules.dylibs/libopenblasp-r0.3.29.dylib +0 -0
  5. sage/algebras/clifford_algebra.py +2 -2
  6. sage/algebras/clifford_algebra_element.cpython-310-darwin.so +0 -0
  7. sage/algebras/clifford_algebra_element.pyx +4 -2
  8. sage/algebras/exterior_algebra_groebner.cpython-310-darwin.so +0 -0
  9. sage/algebras/exterior_algebra_groebner.pyx +2 -0
  10. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra.py +83 -5
  11. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.cpython-310-darwin.so +0 -0
  12. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pxd +2 -0
  13. sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_element.pyx +28 -3
  14. sage/algebras/finite_gca.py +1 -1
  15. sage/algebras/lie_algebras/bgg_dual_module.py +18 -11
  16. sage/algebras/lie_algebras/classical_lie_algebra.py +3 -3
  17. sage/algebras/lie_algebras/examples.py +2 -2
  18. sage/algebras/lie_algebras/free_lie_algebra.py +1 -1
  19. sage/algebras/lie_algebras/heisenberg.py +4 -4
  20. sage/algebras/lie_algebras/lie_algebra.py +1 -1
  21. sage/algebras/lie_algebras/lie_algebra_element.cpython-310-darwin.so +0 -0
  22. sage/algebras/lie_algebras/lie_algebra_element.pyx +63 -27
  23. sage/algebras/lie_algebras/quotient.py +40 -29
  24. sage/algebras/lie_algebras/subalgebra.py +76 -53
  25. sage/algebras/lie_algebras/verma_module.py +1 -3
  26. sage/algebras/octonion_algebra.cpython-310-darwin.so +0 -0
  27. sage/algebras/octonion_algebra.pyx +1 -1
  28. sage/algebras/orlik_solomon.py +4 -4
  29. sage/algebras/orlik_terao.py +4 -4
  30. sage/algebras/steenrod/steenrod_algebra.py +37 -30
  31. sage/algebras/steenrod/steenrod_algebra_bases.py +2 -2
  32. sage/algebras/steenrod/steenrod_algebra_misc.py +4 -4
  33. sage/algebras/steenrod/steenrod_algebra_mult.py +2 -2
  34. sage/all__sagemath_modules.py +1 -0
  35. sage/calculus/integration.cpython-310-darwin.so +0 -0
  36. sage/calculus/integration.pyx +6 -5
  37. sage/calculus/interpolation.cpython-310-darwin.so +0 -0
  38. sage/calculus/interpolators.cpython-310-darwin.so +0 -0
  39. sage/calculus/ode.cpython-310-darwin.so +0 -0
  40. sage/calculus/ode.pxd +2 -2
  41. sage/calculus/ode.pyx +6 -4
  42. sage/calculus/riemann.cpython-310-darwin.so +0 -0
  43. sage/calculus/riemann.pyx +68 -48
  44. sage/calculus/transforms/dwt.cpython-310-darwin.so +0 -0
  45. sage/calculus/transforms/fft.cpython-310-darwin.so +0 -0
  46. sage/coding/ag_code_decoders.cpython-310-darwin.so +0 -0
  47. sage/coding/ag_code_decoders.pyx +31 -31
  48. sage/coding/binary_code.cpython-310-darwin.so +0 -0
  49. sage/coding/binary_code.pxd +6 -6
  50. sage/coding/binary_code.pyx +212 -173
  51. sage/coding/guruswami_sudan/utils.py +3 -5
  52. sage/coding/kasami_codes.cpython-310-darwin.so +0 -0
  53. sage/coding/kasami_codes.pyx +20 -24
  54. sage/coding/linear_code.py +2 -2
  55. sage/coding/linear_code_no_metric.py +5 -5
  56. sage/coding/linear_rank_metric.py +81 -19
  57. sage/combinat/free_module.py +22 -2
  58. sage/combinat/root_system/ambient_space.py +1 -1
  59. sage/combinat/root_system/associahedron.py +4 -4
  60. sage/combinat/root_system/braid_move_calculator.py +1 -1
  61. sage/combinat/root_system/braid_orbit.cpython-310-darwin.so +0 -0
  62. sage/combinat/root_system/branching_rules.py +2 -2
  63. sage/combinat/root_system/cartan_type.py +14 -14
  64. sage/combinat/root_system/coxeter_group.py +2 -2
  65. sage/combinat/root_system/coxeter_type.py +11 -0
  66. sage/combinat/root_system/extended_affine_weyl_group.py +8 -8
  67. sage/combinat/root_system/fundamental_group.py +2 -4
  68. sage/combinat/root_system/hecke_algebra_representation.py +1 -1
  69. sage/combinat/root_system/pieri_factors.py +2 -2
  70. sage/combinat/root_system/root_lattice_realization_algebras.py +1 -1
  71. sage/combinat/root_system/root_lattice_realizations.py +1 -1
  72. sage/combinat/root_system/type_folded.py +3 -3
  73. sage/combinat/root_system/type_reducible.py +8 -7
  74. sage/combinat/root_system/type_super_A.py +2 -2
  75. sage/combinat/root_system/weight_lattice_realizations.py +9 -8
  76. sage/combinat/root_system/weyl_characters.py +1 -1
  77. sage/crypto/__init__.py +1 -0
  78. sage/crypto/block_cipher/des.py +1 -1
  79. sage/crypto/block_cipher/miniaes.py +3 -3
  80. sage/crypto/block_cipher/present.py +3 -3
  81. sage/crypto/block_cipher/sdes.py +3 -3
  82. sage/crypto/boolean_function.cpython-310-darwin.so +0 -0
  83. sage/crypto/boolean_function.pyx +22 -23
  84. sage/crypto/key_exchange/diffie_hellman.py +4 -9
  85. sage/crypto/mq/sr.py +1 -1
  86. sage/crypto/public_key/blum_goldwasser.py +3 -3
  87. sage/crypto/sbox.cpython-310-darwin.so +0 -0
  88. sage/crypto/sbox.pyx +1 -1
  89. sage/crypto/sboxes.py +22 -0
  90. sage/crypto/util.py +4 -6
  91. sage/ext/interpreters/__init__.py +1 -1
  92. sage/ext/interpreters/all__sagemath_modules.py +1 -1
  93. sage/ext/interpreters/wrapper_cc.cpython-310-darwin.so +0 -0
  94. sage/ext/interpreters/wrapper_cc.pxd +5 -5
  95. sage/ext/interpreters/wrapper_cc.pyx +1 -1
  96. sage/ext/interpreters/wrapper_cdf.cpython-310-darwin.so +0 -0
  97. sage/ext/interpreters/wrapper_cdf.pxd +5 -7
  98. sage/ext/interpreters/wrapper_cdf.pyx +4 -10
  99. sage/ext/interpreters/wrapper_rdf.cpython-310-darwin.so +0 -0
  100. sage/ext/interpreters/wrapper_rdf.pxd +1 -1
  101. sage/ext/interpreters/wrapper_rdf.pyx +1 -1
  102. sage/ext/interpreters/wrapper_rr.cpython-310-darwin.so +0 -0
  103. sage/ext/interpreters/wrapper_rr.pxd +5 -5
  104. sage/ext/interpreters/wrapper_rr.pyx +1 -2
  105. sage/geometry/toric_lattice.py +3 -3
  106. sage/geometry/toric_lattice_element.cpython-310-darwin.so +0 -0
  107. sage/groups/additive_abelian/additive_abelian_group.py +1 -1
  108. sage/groups/additive_abelian/qmodnz.py +4 -4
  109. sage/groups/matrix_gps/coxeter_group.py +17 -4
  110. sage/groups/matrix_gps/group_element.cpython-310-darwin.so +0 -0
  111. sage/groups/misc_gps/argument_groups.py +2 -2
  112. sage/groups/misc_gps/imaginary_groups.py +4 -4
  113. sage/groups/perm_gps/partn_ref/refinement_binary.cpython-310-darwin.so +0 -0
  114. sage/groups/perm_gps/partn_ref/refinement_matrices.cpython-310-darwin.so +0 -0
  115. sage/homology/chain_complex.py +0 -2
  116. sage/homology/hochschild_complex.py +3 -3
  117. sage/homology/homology_morphism.py +6 -6
  118. sage/homology/homology_vector_space_with_basis.py +1 -1
  119. sage/libs/gsl/array.cpython-310-darwin.so +0 -0
  120. sage/libs/mpmath/utils.cpython-310-darwin.so +0 -0
  121. sage/matrix/action.cpython-310-darwin.so +0 -0
  122. sage/matrix/args.cpython-310-darwin.so +0 -0
  123. sage/matrix/args.pyx +25 -10
  124. sage/matrix/benchmark.py +8 -4
  125. sage/matrix/compute_J_ideal.py +2 -2
  126. sage/matrix/constructor.cpython-310-darwin.so +0 -0
  127. sage/matrix/echelon_matrix.cpython-310-darwin.so +0 -0
  128. sage/matrix/echelon_matrix.pyx +1 -1
  129. sage/matrix/matrix0.cpython-310-darwin.so +0 -0
  130. sage/matrix/matrix0.pxd +3 -3
  131. sage/matrix/matrix0.pyx +7 -5
  132. sage/matrix/matrix1.cpython-310-darwin.so +0 -0
  133. sage/matrix/matrix1.pyx +87 -48
  134. sage/matrix/matrix2.cpython-310-darwin.so +0 -0
  135. sage/matrix/matrix2.pxd +3 -3
  136. sage/matrix/matrix2.pyx +758 -75
  137. sage/matrix/matrix_cdv.cpython-310-darwin.so +0 -0
  138. sage/matrix/matrix_complex_double_dense.cpython-310-darwin.so +0 -0
  139. sage/matrix/matrix_complex_double_dense.pyx +1 -1
  140. sage/matrix/matrix_dense.cpython-310-darwin.so +0 -0
  141. sage/matrix/matrix_dense.pyx +2 -3
  142. sage/matrix/matrix_double_dense.cpython-310-darwin.so +0 -0
  143. sage/matrix/matrix_double_dense.pyx +11 -5
  144. sage/matrix/matrix_double_sparse.cpython-310-darwin.so +0 -0
  145. sage/matrix/matrix_generic_dense.cpython-310-darwin.so +0 -0
  146. sage/matrix/matrix_generic_sparse.cpython-310-darwin.so +0 -0
  147. sage/matrix/matrix_generic_sparse.pyx +1 -1
  148. sage/matrix/matrix_laurent_mpolynomial_dense.cpython-310-darwin.so +0 -0
  149. sage/matrix/matrix_numpy_dense.cpython-310-darwin.so +0 -0
  150. sage/matrix/matrix_numpy_integer_dense.cpython-310-darwin.so +0 -0
  151. sage/matrix/matrix_polynomial_dense.cpython-310-darwin.so +0 -0
  152. sage/matrix/matrix_polynomial_dense.pyx +952 -261
  153. sage/matrix/matrix_real_double_dense.cpython-310-darwin.so +0 -0
  154. sage/matrix/matrix_sparse.cpython-310-darwin.so +0 -0
  155. sage/matrix/matrix_sparse.pyx +2 -3
  156. sage/matrix/matrix_window.cpython-310-darwin.so +0 -0
  157. sage/matrix/matrix_window.pyx +2 -2
  158. sage/matrix/misc_mpfr.cpython-310-darwin.so +0 -0
  159. sage/matrix/operation_table.py +0 -2
  160. sage/matrix/special.py +4 -0
  161. sage/matrix/strassen.cpython-310-darwin.so +0 -0
  162. sage/matrix/strassen.pyx +1 -1
  163. sage/matroids/basis_exchange_matroid.cpython-310-darwin.so +0 -0
  164. sage/matroids/basis_matroid.cpython-310-darwin.so +0 -0
  165. sage/matroids/chow_ring.py +68 -65
  166. sage/matroids/chow_ring_ideal.py +41 -38
  167. sage/matroids/circuit_closures_matroid.cpython-310-darwin.so +0 -0
  168. sage/matroids/circuits_matroid.cpython-310-darwin.so +0 -0
  169. sage/matroids/database_matroids.py +16 -5
  170. sage/matroids/dual_matroid.py +2 -2
  171. sage/matroids/extension.cpython-310-darwin.so +0 -0
  172. sage/matroids/flats_matroid.cpython-310-darwin.so +0 -0
  173. sage/matroids/gammoid.py +1 -1
  174. sage/matroids/graphic_matroid.cpython-310-darwin.so +0 -0
  175. sage/matroids/graphic_matroid.pyx +3 -3
  176. sage/matroids/lean_matrix.cpython-310-darwin.so +0 -0
  177. sage/matroids/lean_matrix.pyx +22 -22
  178. sage/matroids/linear_matroid.cpython-310-darwin.so +0 -0
  179. sage/matroids/linear_matroid.pyx +13 -13
  180. sage/matroids/matroid.cpython-310-darwin.so +0 -0
  181. sage/matroids/matroid.pyx +15 -15
  182. sage/matroids/matroids_plot_helpers.py +48 -46
  183. sage/matroids/minor_matroid.py +2 -2
  184. sage/matroids/set_system.cpython-310-darwin.so +0 -0
  185. sage/matroids/transversal_matroid.cpython-310-darwin.so +0 -0
  186. sage/matroids/transversal_matroid.pyx +3 -3
  187. sage/matroids/union_matroid.cpython-310-darwin.so +0 -0
  188. sage/matroids/union_matroid.pyx +3 -0
  189. sage/matroids/unpickling.cpython-310-darwin.so +0 -0
  190. sage/matroids/utilities.py +2 -2
  191. sage/misc/c3.cpython-310-darwin.so +0 -0
  192. sage/misc/compat.py +1 -2
  193. sage/misc/pickle_old.cpython-310-darwin.so +0 -0
  194. sage/modules/diamond_cutting.py +117 -30
  195. sage/modules/fg_pid/fgp_module.py +3 -3
  196. sage/modules/filtered_vector_space.py +4 -4
  197. sage/modules/finite_submodule_iter.cpython-310-darwin.so +0 -0
  198. sage/modules/fp_graded/free_module.py +2 -2
  199. sage/modules/fp_graded/module.py +2 -2
  200. sage/modules/fp_graded/morphism.py +4 -4
  201. sage/modules/fp_graded/steenrod/morphism.py +1 -1
  202. sage/modules/free_module.py +144 -15
  203. sage/modules/free_module_element.cpython-310-darwin.so +0 -0
  204. sage/modules/free_module_element.pyx +4 -4
  205. sage/modules/free_module_integer.py +2 -2
  206. sage/modules/free_module_morphism.py +3 -3
  207. sage/modules/free_module_pseudohomspace.py +352 -0
  208. sage/modules/free_module_pseudomorphism.py +578 -0
  209. sage/modules/free_quadratic_module_integer_symmetric.py +24 -13
  210. sage/modules/matrix_morphism.py +9 -9
  211. sage/modules/multi_filtered_vector_space.py +4 -4
  212. sage/modules/ore_module.py +2208 -0
  213. sage/modules/ore_module_element.py +178 -0
  214. sage/modules/ore_module_homspace.py +147 -0
  215. sage/modules/ore_module_morphism.py +968 -0
  216. sage/modules/quotient_module.py +11 -1
  217. sage/modules/submodule.py +1 -1
  218. sage/modules/torsion_quadratic_module.py +1 -1
  219. sage/modules/vector_complex_double_dense.cpython-310-darwin.so +0 -0
  220. sage/modules/vector_double_dense.cpython-310-darwin.so +0 -0
  221. sage/modules/vector_integer_dense.cpython-310-darwin.so +0 -0
  222. sage/modules/vector_integer_sparse.cpython-310-darwin.so +0 -0
  223. sage/modules/vector_integer_sparse.pyx +4 -4
  224. sage/modules/vector_modn_dense.cpython-310-darwin.so +0 -0
  225. sage/modules/vector_modn_sparse.cpython-310-darwin.so +0 -0
  226. sage/modules/vector_numpy_dense.cpython-310-darwin.so +0 -0
  227. sage/modules/vector_numpy_integer_dense.cpython-310-darwin.so +0 -0
  228. sage/modules/vector_rational_dense.cpython-310-darwin.so +0 -0
  229. sage/modules/vector_rational_dense.pyx +1 -1
  230. sage/modules/vector_rational_sparse.cpython-310-darwin.so +0 -0
  231. sage/modules/vector_rational_sparse.pyx +5 -5
  232. sage/modules/vector_real_double_dense.cpython-310-darwin.so +0 -0
  233. sage/modules/vector_space_morphism.py +2 -2
  234. sage/modules/with_basis/cell_module.py +17 -0
  235. sage/modules/with_basis/indexed_element.cpython-310-darwin.so +0 -0
  236. sage/modules/with_basis/indexed_element.pyx +1 -1
  237. sage/modules/with_basis/invariant.py +1 -1
  238. sage/modules/with_basis/representation.py +0 -1
  239. sage/modules/with_basis/subquotient.py +2 -2
  240. sage/numerical/gauss_legendre.cpython-310-darwin.so +0 -0
  241. sage/probability/probability_distribution.cpython-310-darwin.so +0 -0
  242. sage/quadratic_forms/binary_qf.py +7 -7
  243. sage/quadratic_forms/bqf_class_group.py +26 -92
  244. sage/quadratic_forms/count_local_2.cpython-310-darwin.so +0 -0
  245. sage/quadratic_forms/extras.py +1 -1
  246. sage/quadratic_forms/quadratic_form.py +5 -4
  247. sage/quadratic_forms/quadratic_form__equivalence_testing.py +7 -4
  248. sage/quadratic_forms/quadratic_form__evaluate.cpython-310-darwin.so +0 -0
  249. sage/quadratic_forms/quadratic_form__local_field_invariants.py +10 -10
  250. sage/quadratic_forms/quadratic_form__ternary_Tornaria.py +2 -2
  251. sage/quadratic_forms/ternary.cpython-310-darwin.so +0 -0
  252. sage/quadratic_forms/ternary_qf.py +50 -83
  253. sage/rings/complex_conversion.cpython-310-darwin.so +0 -0
  254. sage/rings/complex_double.cpython-310-darwin.so +0 -0
  255. sage/rings/complex_double.pxd +1 -0
  256. sage/rings/complex_double.pyx +37 -32
  257. sage/rings/complex_mpc.cpython-310-darwin.so +0 -0
  258. sage/rings/complex_mpc.pyx +27 -23
  259. sage/rings/complex_mpfr.cpython-310-darwin.so +0 -0
  260. sage/rings/complex_mpfr.pyx +11 -9
  261. sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +277 -21
  262. sage/rings/function_field/drinfeld_modules/drinfeld_module.py +10 -1
  263. sage/rings/function_field/drinfeld_modules/finite_drinfeld_module.py +1 -1
  264. sage/rings/function_field/drinfeld_modules/homset.py +1 -2
  265. sage/rings/function_field/drinfeld_modules/morphism.py +2 -2
  266. sage/rings/function_field/hermite_form_polynomial.cpython-310-darwin.so +0 -0
  267. sage/rings/function_field/khuri_makdisi.cpython-310-darwin.so +0 -0
  268. sage/rings/function_field/khuri_makdisi.pyx +27 -25
  269. sage/rings/invariants/invariant_theory.py +61 -60
  270. sage/rings/invariants/reconstruction.py +8 -8
  271. sage/rings/polynomial/laurent_polynomial_mpair.cpython-310-darwin.so +0 -0
  272. sage/rings/polynomial/ore_function_element.py +1 -1
  273. sage/rings/polynomial/ore_polynomial_element.cpython-310-darwin.so +0 -0
  274. sage/rings/polynomial/ore_polynomial_element.pyx +8 -8
  275. sage/rings/polynomial/ore_polynomial_ring.py +134 -17
  276. sage/rings/polynomial/polynomial_real_mpfr_dense.cpython-310-darwin.so +0 -0
  277. sage/rings/polynomial/skew_polynomial_element.cpython-310-darwin.so +0 -0
  278. sage/rings/polynomial/skew_polynomial_finite_field.cpython-310-darwin.so +0 -0
  279. sage/rings/polynomial/skew_polynomial_finite_field.pyx +3 -4
  280. sage/rings/polynomial/skew_polynomial_finite_order.cpython-310-darwin.so +0 -0
  281. sage/rings/polynomial/skew_polynomial_finite_order.pyx +2 -5
  282. sage/rings/real_double_element_gsl.cpython-310-darwin.so +0 -0
  283. sage/rings/real_mpfr.cpython-310-darwin.so +0 -0
  284. sage/rings/real_mpfr.pyx +25 -7
  285. sage/rings/ring_extension.cpython-310-darwin.so +0 -0
  286. sage/rings/ring_extension.pyx +4 -2
  287. sage/rings/ring_extension_conversion.cpython-310-darwin.so +0 -0
  288. sage/rings/ring_extension_element.cpython-310-darwin.so +0 -0
  289. sage/rings/ring_extension_element.pyx +42 -0
  290. sage/rings/ring_extension_morphism.cpython-310-darwin.so +0 -0
  291. sage/schemes/projective/cohomology.py +2 -2
  292. sage/stats/basic_stats.py +9 -6
  293. sage/stats/distributions/dgs_misc.h +11 -4
  294. sage/stats/distributions/discrete_gaussian_integer.cpython-310-darwin.so +0 -0
  295. sage/stats/distributions/discrete_gaussian_integer.pyx +9 -7
  296. sage/stats/hmm/chmm.cpython-310-darwin.so +0 -0
  297. sage/stats/hmm/chmm.pyx +13 -13
  298. sage/stats/hmm/distributions.cpython-310-darwin.so +0 -0
  299. sage/stats/hmm/distributions.pxd +3 -3
  300. sage/stats/hmm/distributions.pyx +3 -3
  301. sage/stats/hmm/hmm.cpython-310-darwin.so +0 -0
  302. sage/stats/hmm/hmm.pxd +3 -3
  303. sage/stats/hmm/hmm.pyx +6 -6
  304. sage/stats/hmm/util.cpython-310-darwin.so +0 -0
  305. sage/stats/hmm/util.pyx +6 -6
  306. sage/stats/intlist.cpython-310-darwin.so +0 -0
  307. sage/stats/intlist.pxd +3 -3
  308. sage/stats/time_series.cpython-310-darwin.so +0 -0
  309. sage/tensor/modules/alternating_contr_tensor.py +3 -3
  310. sage/tensor/modules/comp.py +3 -3
  311. sage/tensor/modules/ext_pow_free_module.py +3 -3
  312. sage/tensor/modules/format_utilities.py +3 -3
  313. sage/tensor/modules/free_module_linear_group.py +3 -3
  314. sage/tensor/modules/free_module_morphism.py +0 -1
  315. sage/tensor/modules/tensor_free_module.py +3 -3
  316. sage/tensor/modules/tensor_free_submodule.py +1 -1
  317. sage/tensor/modules/tensor_free_submodule_basis.py +1 -1
  318. sage/tensor/modules/tensor_with_indices.py +5 -5
  319. {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/WHEEL +0 -0
  320. {passagemath_modules-10.5.46.dist-info → passagemath_modules-10.6.20.dist-info}/top_level.txt +0 -0
sage/matrix/matrix1.pyx CHANGED
@@ -10,15 +10,15 @@ TESTS::
10
10
  sage: TestSuite(A).run()
11
11
  """
12
12
 
13
- #*****************************************************************************
13
+ # ***************************************************************************
14
14
  # Copyright (C) 2005, 2006 William Stein <wstein@gmail.com>
15
15
  #
16
16
  # This program is free software: you can redistribute it and/or modify
17
17
  # it under the terms of the GNU General Public License as published by
18
18
  # the Free Software Foundation, either version 2 of the License, or
19
19
  # (at your option) any later version.
20
- # http://www.gnu.org/licenses/
21
- #*****************************************************************************
20
+ # https://www.gnu.org/licenses/
21
+ # ***************************************************************************
22
22
 
23
23
  from cpython.sequence cimport PySequence_Fast
24
24
 
@@ -56,9 +56,9 @@ cdef class Matrix(Matrix0):
56
56
  for i from 0 <= i < nr:
57
57
  tmp = []
58
58
  for j from 0 <= j < nc:
59
- tmp.append(w[i*nc + j]._pari_init_())
60
- v.append( ','.join(tmp))
61
- return 'Mat([%s])'%(';'.join(v))
59
+ tmp.append(w[i * nc + j]._pari_init_())
60
+ v.append(','.join(tmp))
61
+ return 'Mat([%s])' % (';'.join(v))
62
62
 
63
63
  def __pari__(self):
64
64
  """
@@ -136,11 +136,12 @@ cdef class Matrix(Matrix0):
136
136
  for i from 0 <= i < self._nrows:
137
137
  tmp = []
138
138
  for j from 0 <= j < self._ncols:
139
- tmp.append(self.get_unsafe(i,j)._gap_init_())
140
- v.append( '[%s]'%(','.join(tmp)) )
139
+ tmp.append(self.get_unsafe(i, j)._gap_init_())
140
+ v.append('[%s]' % (','.join(tmp)))
141
141
  # It is needed to multiply with 'One(...)', because
142
142
  # otherwise the result would not be a gap matrix
143
- return '[%s]*One(%s)'%(','.join(v),sage.interfaces.gap.gap(self.base_ring()).name())
143
+ return '[%s]*One(%s)' % (','.join(v),
144
+ sage.interfaces.gap.gap(self.base_ring()).name())
144
145
 
145
146
  def _libgap_(self):
146
147
  """
@@ -262,9 +263,9 @@ cdef class Matrix(Matrix0):
262
263
  for i from 0 <= i < self._nrows:
263
264
  tmp = []
264
265
  for j from 0 <= j < self._ncols:
265
- tmp.append(self.get_unsafe(i,j)._maxima_init_())
266
- v.append( '[%s]'%(','.join(tmp)) )
267
- return 'matrix(%s)'%(','.join(v))
266
+ tmp.append(self.get_unsafe(i, j)._maxima_init_())
267
+ v.append('[%s]' % (','.join(tmp)))
268
+ return 'matrix(%s)' % (','.join(v))
268
269
 
269
270
  def _mathematica_init_(self):
270
271
  """
@@ -421,7 +422,7 @@ cdef class Matrix(Matrix0):
421
422
  0+1r5 3
422
423
  """
423
424
  P = polymake(self.parent())
424
- return polymake.new_object(P, [ list(r) for r in self.rows(copy=False) ])
425
+ return polymake.new_object(P, [list(r) for r in self.rows(copy=False)])
425
426
 
426
427
  def _singular_(self, singular=None):
427
428
  """
@@ -435,7 +436,8 @@ cdef class Matrix(Matrix0):
435
436
  except (NotImplementedError, AttributeError):
436
437
  raise TypeError("Cannot coerce to Singular")
437
438
 
438
- return singular.matrix(self.nrows(),self.ncols(),singular(self.list()))
439
+ return singular.matrix(self.nrows(), self.ncols(),
440
+ singular(self.list()))
439
441
 
440
442
  def _macaulay2_(self, macaulay2=None):
441
443
  """
@@ -505,9 +507,9 @@ cdef class Matrix(Matrix0):
505
507
  for i from 0 <= i < nr:
506
508
  tmp = []
507
509
  for j from 0 <= j < nc:
508
- tmp.append(w[i*nc + j]._pari_init_())
509
- v.append( ','.join(tmp))
510
- return '[%s]'%(';'.join(v))
510
+ tmp.append(w[i * nc + j]._pari_init_())
511
+ v.append(','.join(tmp))
512
+ return '[%s]' % (';'.join(v))
511
513
 
512
514
  def _scilab_(self, scilab=None):
513
515
  """
@@ -658,7 +660,8 @@ cdef class Matrix(Matrix0):
658
660
  entries.sort()
659
661
  # We hand-format the keys to get rid of the space that would
660
662
  # normally follow the comma
661
- entries = [(sib.name('(%d,%d)'%k), sib(v, 2)) for k,v in entries]
663
+ entries = [(sib.name('(%d,%d)' % k), sib(v, 2))
664
+ for k, v in entries]
662
665
  return sib.name('matrix')(self.base_ring(),
663
666
  sib.int(self.nrows()),
664
667
  sib.int(self.ncols()),
@@ -737,12 +740,39 @@ cdef class Matrix(Matrix0):
737
740
  """
738
741
  import numpy
739
742
  A = numpy.matrix(self.list(), dtype=dtype, copy=copy)
740
- return numpy.resize(A,(self.nrows(), self.ncols()))
743
+ return numpy.resize(A, (self.nrows(), self.ncols()))
744
+
745
+ def _mpmath_(self, prec=None, rounding=None):
746
+ """
747
+ Return a ``mpmath`` matrix.
748
+
749
+ INPUT: See :meth:`sage.structure.element.Element._mpmath_`.
750
+
751
+ EXAMPLES::
752
+
753
+ sage: # needs mpmath sage.symbolic
754
+ sage: m = matrix(SR, 2, 2, [1, 2, 3, pi])
755
+ sage: from mpmath import mp
756
+ sage: mp.dps = 30
757
+ sage: mp.matrix(m) # not tested (doesn't work yet)
758
+ sage: m._mpmath_(mp.prec)
759
+ matrix(
760
+ [['1.0', '2.0'],
761
+ ['3.0', '3.14159265358979323846264338328']])
762
+ """
763
+ if prec is None:
764
+ R = self.base_ring()
765
+ try:
766
+ prec = R.precision()
767
+ except AttributeError:
768
+ prec = 53
769
+ from mpmath import mp
770
+ return mp.matrix([[item._mpmath_(prec, rounding) for item in row] for row in self])
741
771
 
742
772
  # Define the magic "__array__" function so that numpy.array(m) can convert
743
773
  # a matrix m to a numpy array.
744
774
  # See http://docs.scipy.org/doc/numpy/user/c-info.how-to-extend.html#converting-an-arbitrary-sequence-object
745
- __array__=numpy
775
+ __array__ = numpy
746
776
 
747
777
  ###################################################
748
778
  # Construction functions
@@ -1020,14 +1050,16 @@ cdef class Matrix(Matrix0):
1020
1050
  raise ValueError(msg.format(copy))
1021
1051
  x = self.fetch('columns')
1022
1052
  if x is not None:
1023
- if copy: return list(x)
1053
+ if copy:
1054
+ return list(x)
1024
1055
  return x
1025
1056
  if self.is_sparse():
1026
1057
  columns = self.sparse_columns(copy=copy)
1027
1058
  else:
1028
1059
  columns = self.dense_columns(copy=copy)
1029
1060
  self.cache('columns', columns)
1030
- if copy: return list(columns)
1061
+ if copy:
1062
+ return list(columns)
1031
1063
  return columns
1032
1064
 
1033
1065
  def rows(self, copy=True):
@@ -1076,14 +1108,16 @@ cdef class Matrix(Matrix0):
1076
1108
  raise ValueError(msg.format(copy))
1077
1109
  x = self.fetch('rows')
1078
1110
  if x is not None:
1079
- if copy: return list(x)
1111
+ if copy:
1112
+ return list(x)
1080
1113
  return x
1081
1114
  if self.is_sparse():
1082
1115
  rows = self.sparse_rows(copy=copy)
1083
1116
  else:
1084
1117
  rows = self.dense_rows(copy=copy)
1085
1118
  self.cache('rows', rows)
1086
- if copy: return list(rows)
1119
+ if copy:
1120
+ return list(rows)
1087
1121
  return rows
1088
1122
 
1089
1123
  def dense_columns(self, copy=True):
@@ -1132,7 +1166,8 @@ cdef class Matrix(Matrix0):
1132
1166
  """
1133
1167
  x = self.fetch('dense_columns')
1134
1168
  if x is not None:
1135
- if copy: return list(x)
1169
+ if copy:
1170
+ return list(x)
1136
1171
  return x
1137
1172
  cdef Py_ssize_t i
1138
1173
  A = self if self.is_dense() else self.dense_matrix()
@@ -1186,7 +1221,8 @@ cdef class Matrix(Matrix0):
1186
1221
  """
1187
1222
  x = self.fetch('dense_rows')
1188
1223
  if x is not None:
1189
- if copy: return list(x)
1224
+ if copy:
1225
+ return list(x)
1190
1226
  return x
1191
1227
 
1192
1228
  cdef Py_ssize_t i
@@ -1242,7 +1278,8 @@ cdef class Matrix(Matrix0):
1242
1278
  """
1243
1279
  x = self.fetch('sparse_columns')
1244
1280
  if x is not None:
1245
- if copy: return list(x)
1281
+ if copy:
1282
+ return list(x)
1246
1283
  return x
1247
1284
 
1248
1285
  cdef Py_ssize_t i, j
@@ -1324,7 +1361,8 @@ cdef class Matrix(Matrix0):
1324
1361
  """
1325
1362
  x = self.fetch('sparse_rows')
1326
1363
  if x is not None:
1327
- if copy: return list(x)
1364
+ if copy:
1365
+ return list(x)
1328
1366
  return x
1329
1367
 
1330
1368
  cdef Py_ssize_t i, j
@@ -1475,7 +1513,7 @@ cdef class Matrix(Matrix0):
1475
1513
  return self.rows(copy=False)[i]
1476
1514
  cdef Py_ssize_t j
1477
1515
  V = self.row_ambient_module()
1478
- tmp = [self.get_unsafe(i,j) for j in range(self._ncols)]
1516
+ tmp = [self.get_unsafe(i, j) for j in range(self._ncols)]
1479
1517
  return V(tmp, coerce=False, copy=False, check=False)
1480
1518
 
1481
1519
  ###########################################################################
@@ -1724,12 +1762,12 @@ cdef class Matrix(Matrix0):
1724
1762
  bottom = bottom.row()
1725
1763
  else:
1726
1764
  raise TypeError('a matrix must be stacked with '
1727
- 'another matrix or a vector')
1765
+ 'another matrix or a vector')
1728
1766
  other = <Matrix?>bottom
1729
1767
 
1730
1768
  if self._ncols != other._ncols:
1731
1769
  raise TypeError("number of columns must be the same, not %s and %s" %
1732
- (self.ncols(), bottom.ncols()) )
1770
+ (self.ncols(), bottom.ncols()))
1733
1771
 
1734
1772
  top_ring = self._base_ring
1735
1773
  bottom_ring = other._base_ring
@@ -1768,10 +1806,10 @@ cdef class Matrix(Matrix0):
1768
1806
  cdef Py_ssize_t nr = self._nrows
1769
1807
  for r in range(self._nrows):
1770
1808
  for c in range(self._ncols):
1771
- Z.set_unsafe(r, c, self.get_unsafe(r,c))
1809
+ Z.set_unsafe(r, c, self.get_unsafe(r, c))
1772
1810
  for r in range(other._nrows):
1773
1811
  for c in range(other._ncols):
1774
- Z.set_unsafe(r+nr, c, other.get_unsafe(r,c))
1812
+ Z.set_unsafe(r + nr, c, other.get_unsafe(r, c))
1775
1813
 
1776
1814
  return Z
1777
1815
 
@@ -1950,29 +1988,29 @@ cdef class Matrix(Matrix0):
1950
1988
  right = right.column()
1951
1989
  else:
1952
1990
  raise TypeError("a matrix must be augmented with another matrix, "
1953
- "or a vector")
1991
+ "or a vector")
1954
1992
 
1955
1993
  cdef Matrix other
1956
1994
  other = right
1957
1995
 
1958
1996
  if self._nrows != other._nrows:
1959
1997
  raise TypeError('number of rows must be the same, '
1960
- '{0} != {1}'.format(self._nrows, other._nrows))
1998
+ '{0} != {1}'.format(self._nrows, other._nrows))
1961
1999
  if not (self._base_ring is other.base_ring()):
1962
2000
  other = other.change_ring(self._base_ring)
1963
2001
 
1964
2002
  cdef Matrix Z
1965
- Z = self.new_matrix(ncols = self._ncols + other._ncols)
2003
+ Z = self.new_matrix(ncols=self._ncols + other._ncols)
1966
2004
 
1967
2005
  cdef Py_ssize_t r, c
1968
2006
  for r from 0 <= r < self._nrows:
1969
2007
  for c from 0 <= c < self._ncols:
1970
- Z.set_unsafe(r,c, self.get_unsafe(r,c))
2008
+ Z.set_unsafe(r, c, self.get_unsafe(r, c))
1971
2009
  nc = self.ncols()
1972
2010
 
1973
2011
  for r from 0 <= r < other._nrows:
1974
2012
  for c from 0 <= c < other._ncols:
1975
- Z.set_unsafe(r, c+nc, other.get_unsafe(r,c))
2013
+ Z.set_unsafe(r, c + nc, other.get_unsafe(r, c))
1976
2014
 
1977
2015
  if subdivide:
1978
2016
  Z._subdivide_on_augment(self, other)
@@ -2235,7 +2273,7 @@ cdef class Matrix(Matrix0):
2235
2273
  return A
2236
2274
 
2237
2275
  def submatrix(self, Py_ssize_t row=0, Py_ssize_t col=0,
2238
- Py_ssize_t nrows=-1, Py_ssize_t ncols=-1):
2276
+ Py_ssize_t nrows=-1, Py_ssize_t ncols=-1):
2239
2277
  """
2240
2278
  Return the matrix constructed from ``self`` using the specified
2241
2279
  range of rows and columns.
@@ -2290,7 +2328,8 @@ cdef class Matrix(Matrix0):
2290
2328
  nrows = self._nrows - row
2291
2329
  if ncols == -1:
2292
2330
  ncols = self._ncols - col
2293
- return self.matrix_from_rows_and_columns(range(row, row+nrows), range(col, col+ncols))
2331
+ return self.matrix_from_rows_and_columns(range(row, row + nrows),
2332
+ range(col, col + ncols))
2294
2333
 
2295
2334
  def set_row(self, row, v):
2296
2335
  r"""
@@ -2356,7 +2395,7 @@ cdef class Matrix(Matrix0):
2356
2395
  raise ValueError(msg.format(self._ncols, len(v)))
2357
2396
  if (row < 0) or (row >= self._nrows):
2358
2397
  msg = "row number must be between 0 and {0} (inclusive), not {1}"
2359
- raise ValueError(msg.format(self._nrows-1, row))
2398
+ raise ValueError(msg.format(self._nrows - 1, row))
2360
2399
 
2361
2400
  try:
2362
2401
  for j in range(self._ncols):
@@ -2430,7 +2469,7 @@ cdef class Matrix(Matrix0):
2430
2469
  raise ValueError(msg.format(self._nrows, len(v)))
2431
2470
  if (col < 0) or (col >= self._ncols):
2432
2471
  msg = "column number must be between 0 and {0} (inclusive), not {1}"
2433
- raise ValueError(msg.format(self._ncols-1, col))
2472
+ raise ValueError(msg.format(self._ncols - 1, col))
2434
2473
 
2435
2474
  try:
2436
2475
  for i in range(self._nrows):
@@ -2614,7 +2653,7 @@ cdef class Matrix(Matrix0):
2614
2653
  return self
2615
2654
  cdef Matrix A
2616
2655
  A = self.new_matrix(self._nrows, self._ncols, self,
2617
- coerce=False, sparse=False)
2656
+ coerce=False, sparse=False)
2618
2657
  if self._subdivisions is not None:
2619
2658
  A.subdivide(self.subdivisions())
2620
2659
  return A
@@ -2658,7 +2697,7 @@ cdef class Matrix(Matrix0):
2658
2697
  if self.is_sparse():
2659
2698
  return self
2660
2699
  A = self.new_matrix(self._nrows, self._ncols, self,
2661
- coerce=False, sparse=True)
2700
+ coerce=False, sparse=True)
2662
2701
  if self._subdivisions is not None:
2663
2702
  A.subdivide(self.subdivisions())
2664
2703
  return A
@@ -2689,10 +2728,10 @@ cdef class Matrix(Matrix0):
2689
2728
 
2690
2729
  sage: M = MatrixSpace(QQ, 3, implementation='generic')
2691
2730
  sage: m = M.an_element()
2692
- sage: m.matrix_space()
2731
+ sage: m.matrix_space() # needs sage.libs.flint
2693
2732
  Full MatrixSpace of 3 by 3 dense matrices over Rational Field
2694
2733
  (using Matrix_generic_dense)
2695
- sage: m.matrix_space(nrows=2, ncols=12)
2734
+ sage: m.matrix_space(nrows=2, ncols=12) # needs sage.libs.flint
2696
2735
  Full MatrixSpace of 2 by 12 dense matrices over Rational Field
2697
2736
  (using Matrix_generic_dense)
2698
2737
  sage: m.matrix_space(nrows=2, sparse=True)
@@ -2773,10 +2812,10 @@ cdef class Matrix(Matrix0):
2773
2812
 
2774
2813
  sage: M = MatrixSpace(ZZ, 2, 3, implementation='generic')
2775
2814
  sage: m = M.an_element()
2776
- sage: m.new_matrix().parent()
2815
+ sage: m.new_matrix().parent() # needs sage.libs.flint
2777
2816
  Full MatrixSpace of 2 by 3 dense matrices over Integer Ring
2778
2817
  (using Matrix_generic_dense)
2779
- sage: m.new_matrix(3,3).parent()
2818
+ sage: m.new_matrix(3,3).parent() # needs sage.libs.flint
2780
2819
  Full MatrixSpace of 3 by 3 dense matrices over Integer Ring
2781
2820
  (using Matrix_generic_dense)
2782
2821
  sage: m.new_matrix(3,3, sparse=True).parent()
Binary file
sage/matrix/matrix2.pxd CHANGED
@@ -3,15 +3,15 @@
3
3
  Generic matrices
4
4
  """
5
5
 
6
- #*****************************************************************************
6
+ # ***************************************************************************
7
7
  # Copyright (C) 2006 William Stein <wstein@gmail.com>
8
8
  #
9
9
  # This program is free software: you can redistribute it and/or modify
10
10
  # it under the terms of the GNU General Public License as published by
11
11
  # the Free Software Foundation, either version 2 of the License, or
12
12
  # (at your option) any later version.
13
- # http://www.gnu.org/licenses/
14
- #*****************************************************************************
13
+ # https://www.gnu.org/licenses/
14
+ # ***************************************************************************
15
15
 
16
16
  from sage.matrix.matrix1 cimport Matrix as Matrix1
17
17