passagemath-combinat 10.6.1__cp312-cp312-musllinux_1_2_aarch64.whl → 10.8.1a1__cp312-cp312-musllinux_1_2_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. passagemath_combinat/__init__.py +3 -0
  2. {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/METADATA +17 -20
  3. {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/RECORD +220 -218
  4. {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/WHEEL +1 -1
  5. passagemath_combinat-10.8.1a1.dist-info/top_level.txt +3 -0
  6. sage/algebras/affine_nil_temperley_lieb.py +3 -3
  7. sage/algebras/all.py +0 -1
  8. sage/algebras/askey_wilson.py +1 -1
  9. sage/algebras/associated_graded.py +2 -2
  10. sage/algebras/cellular_basis.py +3 -6
  11. sage/algebras/cluster_algebra.py +2 -3
  12. sage/algebras/down_up_algebra.py +6 -6
  13. sage/algebras/free_algebra.py +3 -32
  14. sage/algebras/free_algebra_element.py +21 -25
  15. sage/algebras/free_algebra_quotient_element.py +9 -38
  16. sage/algebras/free_zinbiel_algebra.py +4 -3
  17. sage/algebras/hall_algebra.py +2 -2
  18. sage/algebras/hecke_algebras/ariki_koike_algebra.py +8 -8
  19. sage/algebras/hecke_algebras/ariki_koike_specht_modules.py +2 -2
  20. sage/algebras/hecke_algebras/cubic_hecke_algebra.py +11 -14
  21. sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +1 -1
  22. sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +5 -5
  23. sage/algebras/iwahori_hecke_algebra.py +59 -57
  24. sage/algebras/jordan_algebra.py +97 -89
  25. sage/algebras/lie_conformal_algebras/abelian_lie_conformal_algebra.py +6 -6
  26. sage/algebras/lie_conformal_algebras/affine_lie_conformal_algebra.py +14 -12
  27. sage/algebras/lie_conformal_algebras/bosonic_ghosts_lie_conformal_algebra.py +6 -6
  28. sage/algebras/lie_conformal_algebras/fermionic_ghosts_lie_conformal_algebra.py +4 -4
  29. sage/algebras/lie_conformal_algebras/finitely_freely_generated_lca.py +13 -13
  30. sage/algebras/lie_conformal_algebras/free_bosons_lie_conformal_algebra.py +8 -6
  31. sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py +7 -5
  32. sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py +7 -7
  33. sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py +6 -5
  34. sage/algebras/lie_conformal_algebras/lie_conformal_algebra.py +12 -11
  35. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +3 -3
  36. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_basis.py +3 -3
  37. sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +11 -11
  38. sage/algebras/lie_conformal_algebras/n2_lie_conformal_algebra.py +3 -3
  39. sage/algebras/lie_conformal_algebras/neveu_schwarz_lie_conformal_algebra.py +8 -7
  40. sage/algebras/lie_conformal_algebras/virasoro_lie_conformal_algebra.py +9 -8
  41. sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py +6 -5
  42. sage/algebras/nil_coxeter_algebra.py +4 -4
  43. sage/algebras/q_commuting_polynomials.py +6 -6
  44. sage/algebras/q_system.py +3 -3
  45. sage/algebras/quantum_clifford.py +8 -8
  46. sage/algebras/quantum_groups/fock_space.py +48 -8
  47. sage/algebras/quantum_groups/quantum_group_gap.py +5 -7
  48. sage/algebras/quantum_matrix_coordinate_algebra.py +7 -7
  49. sage/algebras/quantum_oscillator.py +3 -3
  50. sage/algebras/quaternion_algebra_element.py +5 -3
  51. sage/algebras/schur_algebra.py +3 -3
  52. sage/algebras/shuffle_algebra.py +5 -8
  53. sage/algebras/splitting_algebra.py +129 -85
  54. sage/algebras/tensor_algebra.py +7 -7
  55. sage/algebras/yangian.py +16 -15
  56. sage/algebras/yokonuma_hecke_algebra.py +13 -11
  57. sage/combinat/all.py +9 -0
  58. sage/combinat/all__sagemath_combinat.py +1 -0
  59. sage/combinat/alternating_sign_matrix.py +36 -29
  60. sage/combinat/baxter_permutations.py +32 -12
  61. sage/combinat/bijectionist.py +13 -17
  62. sage/combinat/chas/fsym.py +6 -6
  63. sage/combinat/chas/wqsym.py +23 -29
  64. sage/combinat/colored_permutations.py +9 -11
  65. sage/combinat/colored_permutations_representations.py +13 -12
  66. sage/combinat/composition_tableau.py +2 -2
  67. sage/combinat/constellation.py +57 -30
  68. sage/combinat/crystals/affine_factorization.py +5 -4
  69. sage/combinat/crystals/alcove_path.py +2 -2
  70. sage/combinat/crystals/fully_commutative_stable_grothendieck.py +3 -2
  71. sage/combinat/crystals/infinity_crystals.py +18 -18
  72. sage/combinat/crystals/kac_modules.py +1 -1
  73. sage/combinat/crystals/kirillov_reshetikhin.py +2 -2
  74. sage/combinat/crystals/letters.cpython-312-aarch64-linux-musl.so +0 -0
  75. sage/combinat/crystals/littelmann_path.py +1 -1
  76. sage/combinat/crystals/pbw_datum.cpython-312-aarch64-linux-musl.so +0 -0
  77. sage/combinat/crystals/pbw_datum.pyx +3 -2
  78. sage/combinat/crystals/spins.cpython-312-aarch64-linux-musl.so +0 -0
  79. sage/combinat/crystals/tensor_product.py +7 -5
  80. sage/combinat/crystals/tensor_product_element.cpython-312-aarch64-linux-musl.so +0 -0
  81. sage/combinat/debruijn_sequence.cpython-312-aarch64-linux-musl.so +0 -0
  82. sage/combinat/debruijn_sequence.pyx +1 -2
  83. sage/combinat/degree_sequences.cpython-312-aarch64-linux-musl.so +0 -0
  84. sage/combinat/degree_sequences.pyx +241 -188
  85. sage/combinat/derangements.py +28 -22
  86. sage/combinat/diagram_algebras.py +12 -14
  87. sage/combinat/dyck_word.py +15 -14
  88. sage/combinat/e_one_star.py +1 -1
  89. sage/combinat/expnums.cpython-312-aarch64-linux-musl.so +0 -0
  90. sage/combinat/fast_vector_partitions.cpython-312-aarch64-linux-musl.so +0 -0
  91. sage/combinat/fqsym.py +13 -19
  92. sage/combinat/free_dendriform_algebra.py +2 -2
  93. sage/combinat/free_prelie_algebra.py +2 -2
  94. sage/combinat/fully_commutative_elements.py +8 -8
  95. sage/combinat/fully_packed_loop.py +9 -9
  96. sage/combinat/gelfand_tsetlin_patterns.py +4 -5
  97. sage/combinat/gray_codes.py +3 -4
  98. sage/combinat/grossman_larson_algebras.py +2 -2
  99. sage/combinat/growth.py +13 -13
  100. sage/combinat/hall_polynomial.py +1 -1
  101. sage/combinat/hillman_grassl.py +1 -1
  102. sage/combinat/integer_matrices.py +5 -7
  103. sage/combinat/k_tableau.py +8 -7
  104. sage/combinat/kazhdan_lusztig.py +3 -3
  105. sage/combinat/key_polynomial.py +845 -298
  106. sage/combinat/knutson_tao_puzzles.py +11 -13
  107. sage/combinat/matrices/hadamard_matrix.py +1 -1
  108. sage/combinat/matrices/latin.py +75 -92
  109. sage/combinat/misc.py +3 -3
  110. sage/combinat/multiset_partition_into_sets_ordered.py +27 -10
  111. sage/combinat/ncsf_qsym/generic_basis_code.py +5 -5
  112. sage/combinat/ncsf_qsym/ncsf.py +6 -5
  113. sage/combinat/ncsf_qsym/qsym.py +9 -17
  114. sage/combinat/ncsym/ncsym.py +8 -12
  115. sage/combinat/nu_dyck_word.py +1 -1
  116. sage/combinat/parallelogram_polyomino.py +3 -5
  117. sage/combinat/parking_functions.py +6 -5
  118. sage/combinat/partition_algebra.py +22 -57
  119. sage/combinat/partition_kleshchev.py +4 -4
  120. sage/combinat/partition_tuple.py +12 -10
  121. sage/combinat/plane_partition.py +10 -13
  122. sage/combinat/positive_integer_semigroup_test.py +17 -0
  123. sage/combinat/q_bernoulli.cpython-312-aarch64-linux-musl.so +0 -0
  124. sage/combinat/quickref.py +2 -2
  125. sage/combinat/recognizable_series.py +2 -2
  126. sage/combinat/regular_sequence.py +7 -7
  127. sage/combinat/regular_sequence_bounded.py +15 -21
  128. sage/combinat/restricted_growth.py +3 -3
  129. sage/combinat/ribbon.py +3 -3
  130. sage/combinat/rigged_configurations/bijection.py +3 -3
  131. sage/combinat/rigged_configurations/rigged_partition.cpython-312-aarch64-linux-musl.so +0 -0
  132. sage/combinat/rsk.py +2 -0
  133. sage/combinat/schubert_polynomial.py +11 -2
  134. sage/combinat/set_partition.py +3 -7
  135. sage/combinat/set_partition_iterator.cpython-312-aarch64-linux-musl.so +0 -0
  136. sage/combinat/set_partition_iterator.pyx +0 -1
  137. sage/combinat/set_partition_ordered.py +2 -2
  138. sage/combinat/sf/classical.py +1 -1
  139. sage/combinat/sf/dual.py +4 -8
  140. sage/combinat/sf/elementary.py +13 -7
  141. sage/combinat/sf/hall_littlewood.py +10 -8
  142. sage/combinat/sf/homogeneous.py +6 -3
  143. sage/combinat/sf/jack.py +11 -9
  144. sage/combinat/sf/llt.py +4 -5
  145. sage/combinat/sf/macdonald.py +10 -11
  146. sage/combinat/sf/monomial.py +6 -0
  147. sage/combinat/sf/ns_macdonald.py +92 -51
  148. sage/combinat/sf/powersum.py +9 -14
  149. sage/combinat/sf/schur.py +6 -0
  150. sage/combinat/sf/sf.py +21 -19
  151. sage/combinat/sf/sfa.py +13 -64
  152. sage/combinat/shifted_primed_tableau.py +5 -7
  153. sage/combinat/shuffle.py +1 -1
  154. sage/combinat/sine_gordon.py +18 -38
  155. sage/combinat/skew_partition.py +9 -12
  156. sage/combinat/skew_tableau.py +2 -7
  157. sage/combinat/sloane_functions.py +1 -1
  158. sage/combinat/species/all.py +67 -2
  159. sage/combinat/species/characteristic_species.py +3 -0
  160. sage/combinat/species/composition_species.py +3 -0
  161. sage/combinat/species/cycle_species.py +4 -0
  162. sage/combinat/species/empty_species.py +3 -0
  163. sage/combinat/species/functorial_composition_species.py +3 -0
  164. sage/combinat/species/generating_series.py +3 -0
  165. sage/combinat/species/library.py +3 -0
  166. sage/combinat/species/linear_order_species.py +3 -0
  167. sage/combinat/species/partition_species.py +3 -0
  168. sage/combinat/species/permutation_species.py +4 -0
  169. sage/combinat/species/product_species.py +3 -0
  170. sage/combinat/species/recursive_species.py +3 -0
  171. sage/combinat/species/set_species.py +3 -0
  172. sage/combinat/species/species.py +13 -7
  173. sage/combinat/species/structure.py +8 -9
  174. sage/combinat/species/subset_species.py +3 -0
  175. sage/combinat/species/sum_species.py +3 -0
  176. sage/combinat/subword.py +4 -1
  177. sage/combinat/subword_complex.py +7 -7
  178. sage/combinat/subword_complex_c.cpython-312-aarch64-linux-musl.so +0 -0
  179. sage/combinat/superpartition.py +1 -1
  180. sage/combinat/symmetric_group_algebra.py +9 -9
  181. sage/combinat/symmetric_group_representations.py +5 -5
  182. sage/combinat/t_sequences.py +4 -4
  183. sage/combinat/tableau.py +3 -4
  184. sage/combinat/tableau_tuple.py +2 -2
  185. sage/combinat/tiling.py +39 -42
  186. sage/combinat/triangles_FHM.py +38 -15
  187. sage/combinat/tutorial.py +2 -2
  188. sage/combinat/vector_partition.py +43 -31
  189. sage/combinat/words/abstract_word.py +4 -4
  190. sage/combinat/words/alphabet.py +12 -12
  191. sage/combinat/words/finite_word.py +25 -229
  192. sage/combinat/words/infinite_word.py +1 -1
  193. sage/combinat/words/morphic.py +13 -13
  194. sage/combinat/words/morphism.py +3 -12
  195. sage/combinat/words/paths.py +16 -17
  196. sage/combinat/words/word.py +60 -35
  197. sage/combinat/words/word_char.cpython-312-aarch64-linux-musl.so +0 -0
  198. sage/combinat/words/word_char.pyx +46 -7
  199. sage/combinat/words/word_datatypes.cpython-312-aarch64-linux-musl.so +0 -0
  200. sage/combinat/words/word_generators.py +39 -38
  201. sage/databases/findstat.py +72 -31
  202. sage/databases/oeis.py +125 -25
  203. sage/databases/sloane.py +14 -8
  204. sage/games/sudoku_backtrack.cpython-312-aarch64-linux-musl.so +0 -0
  205. sage/groups/indexed_free_group.py +3 -4
  206. sage/libs/symmetrica/symmetrica.cpython-312-aarch64-linux-musl.so +0 -0
  207. sage/libs/symmetrica/symmetrica.pxi +1 -0
  208. sage/monoids/automatic_semigroup.py +1 -3
  209. sage/monoids/free_abelian_monoid.py +7 -33
  210. sage/monoids/free_abelian_monoid_element.cpython-312-aarch64-linux-musl.so +0 -0
  211. sage/monoids/free_monoid.py +8 -40
  212. sage/monoids/free_monoid_element.py +1 -9
  213. sage/monoids/string_monoid.py +5 -2
  214. sage/monoids/string_monoid_element.py +12 -66
  215. sage/rings/all__sagemath_combinat.py +7 -0
  216. sage/sat/solvers/__init__.py +3 -4
  217. sage/sat/solvers/cryptominisat.py +2 -3
  218. sage/sat/solvers/picosat.py +2 -3
  219. sage/sat/solvers/sat_lp.py +2 -2
  220. sage/sat/solvers/satsolver.cpython-312-aarch64-linux-musl.so +0 -0
  221. passagemath_combinat-10.6.1.dist-info/top_level.txt +0 -2
@@ -2,6 +2,67 @@
2
2
  r"""
3
3
  Combinatorial species
4
4
 
5
+ A combinatorial species, as introduced by Joyal, is a functor from
6
+ the category of finite sets with bijections to the category of finite
7
+ sets with bijections. Alternatively, we can regard a combinatorial
8
+ species as a formal sum of group actions of the symmetric groups
9
+ `\mathfrak S_n`, for `n\in\NN`. For example, the trivial action of
10
+ `\mathfrak S_n` corresponds to the species `\mathcal E_n` of sets of
11
+ cardinality `n`.
12
+
13
+ More generally, a weighted multisort species in `k` sorts is a
14
+ functor from the category of `k`-tuples of finite sets with
15
+ bijections to the category of weighted finite sets with
16
+ weight-preserving bijections. We may think of the sorts as
17
+ variables, traditionally denoted by `X, Y, Z`.
18
+
19
+ Such a species is equivalent to a formal sum of group actions of
20
+ groups `\mathfrak S_{n_1} \times \cdots \times \mathfrak S_{n_k}` with
21
+ `(n_1,\ldots,n_k)\in\NN^k`, together with a weight on the orbits of
22
+ each group action. Yet more generally, a virtual weighted multisort
23
+ species is a formal difference of weighted multisort species.
24
+
25
+ We regard a combinatorial species as a sequence of group actions of
26
+ the symmetric groups `\mathfrak S_n`, for `n\in\NN`.
27
+
28
+ Coefficients of lazy species are computed on demand. They have
29
+ infinite precision, although equality can only be decided in special
30
+ cases.
31
+
32
+ There are currently two implementations of combinatorial species, one
33
+ of which is deprecated and will be removed once all of the
34
+ functionality has been ported to the new framework.
35
+
36
+ The recommended implementation is :ref:`sage.rings.lazy_species` and
37
+ used as the following examples illustrate.
38
+
39
+ EXAMPLES:
40
+
41
+ We define rooted ordered trees with leaves having weight `q`::
42
+
43
+ sage: R.<q> = QQ[]
44
+ sage: L.<X> = LazyCombinatorialSpecies(R)
45
+ sage: leaf = X
46
+ sage: node = q * X
47
+ sage: linorder = X/(1 - X)
48
+ sage: T = L.undefined(valuation=1)
49
+ sage: T.define(leaf + node * linorder(T))
50
+ sage: T.isotype_generating_series()
51
+ X + q*X^2 + ((q^2+q)*X^3) + ((q^3+3*q^2+q)*X^4) + ((q^4+6*q^3+6*q^2+q)*X^5)
52
+ + ((q^5+10*q^4+20*q^3+10*q^2+q)*X^6) + O(X^7)
53
+
54
+ We define rooted unordered trees with leaves of sort `Y`. The
55
+ standard representation of a species is its molecular decomposition::
56
+
57
+ sage: L = LazyCombinatorialSpecies(R, "X")
58
+ sage: E = L.Sets()
59
+ sage: Ep = E.restrict(1)
60
+ sage: M.<X, Y> = LazyCombinatorialSpecies(R)
61
+ sage: A = M.undefined(valuation=1)
62
+ sage: A.define(Y + X * Ep(A))
63
+ sage: A.truncate(5)
64
+ Y + X*Y + (X^2*Y+X*E_2(Y)) + (X^3*Y+X^2*E_2(Y)+X^2*Y^2+X*E_3(Y))
65
+
5
66
  Introductory material
6
67
  ---------------------
7
68
 
@@ -36,13 +97,17 @@ Miscellaneous
36
97
 
37
98
  - :ref:`sage.combinat.species.structure`
38
99
  - :ref:`sage.combinat.species.misc`
100
+
39
101
  """
40
102
  # install the docstring of this module to the containing package
41
103
  from sage.misc.namespace_package import install_doc
42
104
  install_doc(__package__, __doc__)
43
105
 
44
106
  from sage.misc.lazy_import import lazy_import
45
- lazy_import("sage.combinat.species.recursive_species", "CombinatorialSpecies")
46
- lazy_import("sage.combinat.species", "library", as_='species')
107
+ lazy_import("sage.combinat.species.recursive_species", "CombinatorialSpecies",
108
+ deprecation=(38544, "combinat.species is superseded by LazyCombinatorialSpecies"))
109
+
110
+ lazy_import("sage.combinat.species", "library", as_='species',
111
+ deprecation=(38544, "combinat.species is superseded by LazyCombinatorialSpecies"))
47
112
  del lazy_import
48
113
  del install_doc
@@ -30,6 +30,9 @@ class CharacteristicSpeciesStructure(GenericSpeciesStructure):
30
30
  EXAMPLES::
31
31
 
32
32
  sage: F = species.CharacteristicSpecies(3)
33
+ doctest:warning...
34
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
35
+ See https://github.com/sagemath/sage/issues/38544 for details.
33
36
  sage: a = F.structures([1, 2, 3]).random_element(); a
34
37
  {1, 2, 3}
35
38
  sage: F = species.SingletonSpecies()
@@ -28,6 +28,9 @@ class CompositionSpeciesStructure(GenericSpeciesStructure):
28
28
  TESTS::
29
29
 
30
30
  sage: E = species.SetSpecies(); C = species.CycleSpecies()
31
+ doctest:warning...
32
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
33
+ See https://github.com/sagemath/sage/issues/38544 for details.
31
34
  sage: L = E(C)
32
35
  sage: a = L.structures(['a','b','c']).random_element() # needs sage.libs.flint
33
36
  sage: a == loads(dumps(a)) # needs sage.libs.flint
@@ -26,6 +26,10 @@ class CycleSpeciesStructure(GenericSpeciesStructure):
26
26
  EXAMPLES::
27
27
 
28
28
  sage: S = species.CycleSpecies()
29
+ doctest:warning...
30
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
31
+ See https://github.com/sagemath/sage/issues/38544 for details.
32
+
29
33
  sage: S.structures(["a","b","c"])[0]
30
34
  ('a', 'b', 'c')
31
35
  """
@@ -28,6 +28,9 @@ class EmptySpecies(GenericCombinatorialSpecies, UniqueRepresentation):
28
28
  EXAMPLES::
29
29
 
30
30
  sage: X = species.EmptySpecies(); X
31
+ doctest:warning...
32
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
33
+ See https://github.com/sagemath/sage/issues/38544 for details.
31
34
  Empty species
32
35
  sage: X.structures([]).list()
33
36
  []
@@ -32,6 +32,9 @@ class FunctorialCompositionSpecies(GenericCombinatorialSpecies):
32
32
  EXAMPLES::
33
33
 
34
34
  sage: E = species.SetSpecies()
35
+ doctest:warning...
36
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
37
+ See https://github.com/sagemath/sage/issues/38544 for details.
35
38
  sage: E2 = species.SetSpecies(size=2)
36
39
  sage: WP = species.SubsetSpecies()
37
40
  sage: P2 = E2*E
@@ -217,6 +217,9 @@ class ExponentialGeneratingSeries(LazyPowerSeries):
217
217
  EXAMPLES::
218
218
 
219
219
  sage: G = species.SimpleGraphSpecies()
220
+ doctest:warning...
221
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
222
+ See https://github.com/sagemath/sage/issues/38544 for details.
220
223
  sage: g = G.generating_series()
221
224
  sage: [g.coefficient(i) for i in range(10)]
222
225
  [1, 1, 1, 4/3, 8/3, 128/15, 2048/45, 131072/315, 2097152/315, 536870912/2835]
@@ -42,6 +42,9 @@ def SimpleGraphSpecies():
42
42
  EXAMPLES::
43
43
 
44
44
  sage: S = species.SimpleGraphSpecies()
45
+ doctest:warning...
46
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
47
+ See https://github.com/sagemath/sage/issues/38544 for details.
45
48
  sage: S.generating_series().counts(10)
46
49
  [1, 1, 2, 8, 64, 1024, 32768, 2097152, 268435456, 68719476736]
47
50
  sage: S.cycle_index_series()[:5] # needs sage.libs.pari sage.modules
@@ -28,6 +28,9 @@ class LinearOrderSpeciesStructure(GenericSpeciesStructure):
28
28
  EXAMPLES::
29
29
 
30
30
  sage: P = species.LinearOrderSpecies()
31
+ doctest:warning...
32
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
33
+ See https://github.com/sagemath/sage/issues/38544 for details.
31
34
  sage: s = P.structures(["a", "b", "c"]).random_element()
32
35
  sage: s.canonical_label()
33
36
  ['a', 'b', 'c']
@@ -34,6 +34,9 @@ class PartitionSpeciesStructure(GenericSpeciesStructure):
34
34
 
35
35
  sage: from sage.combinat.species.partition_species import PartitionSpeciesStructure
36
36
  sage: P = species.PartitionSpecies()
37
+ doctest:warning...
38
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
39
+ See https://github.com/sagemath/sage/issues/38544 for details.
37
40
  sage: s = PartitionSpeciesStructure(P, ['a','b','c'], [[1,2],[3]]); s
38
41
  {{'a', 'b'}, {'c'}}
39
42
  sage: s == loads(dumps(s))
@@ -31,6 +31,10 @@ class PermutationSpeciesStructure(GenericSpeciesStructure):
31
31
  EXAMPLES::
32
32
 
33
33
  sage: P = species.PermutationSpecies()
34
+ doctest:warning...
35
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
36
+ See https://github.com/sagemath/sage/issues/38544 for details.
37
+
34
38
  sage: S = P.structures(["a", "b", "c"])
35
39
  sage: [s.canonical_label() for s in S]
36
40
  [['a', 'b', 'c'],
@@ -28,6 +28,9 @@ class ProductSpeciesStructure(GenericSpeciesStructure):
28
28
  TESTS::
29
29
 
30
30
  sage: S = species.SetSpecies()
31
+ doctest:warning...
32
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
33
+ See https://github.com/sagemath/sage/issues/38544 for details.
31
34
  sage: F = S * S
32
35
  sage: a = F.structures(['a','b','c']).random_element()
33
36
  sage: a == loads(dumps(a))
@@ -31,6 +31,9 @@ class CombinatorialSpecies(GenericCombinatorialSpecies):
31
31
  EXAMPLES::
32
32
 
33
33
  sage: F = CombinatorialSpecies()
34
+ doctest:warning...
35
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
36
+ See https://github.com/sagemath/sage/issues/38544 for details.
34
37
  sage: loads(dumps(F))
35
38
  Combinatorial species
36
39
 
@@ -30,6 +30,9 @@ class SetSpeciesStructure(GenericSpeciesStructure):
30
30
  EXAMPLES::
31
31
 
32
32
  sage: S = species.SetSpecies()
33
+ doctest:warning...
34
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
35
+ See https://github.com/sagemath/sage/issues/38544 for details.
33
36
  sage: a = S.structures(["a","b","c"]).random_element(); a
34
37
  {'a', 'b', 'c'}
35
38
  """
@@ -21,6 +21,9 @@ leaves and of `q` to internal nodes::
21
21
 
22
22
  sage: q = QQ['q'].gen()
23
23
  sage: leaf = species.SingletonSpecies()
24
+ doctest:warning...
25
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
26
+ See https://github.com/sagemath/sage/issues/38544 for details.
24
27
  sage: internal_node = species.SingletonSpecies(weight=q)
25
28
  sage: L = species.LinearOrderSpecies(min=1)
26
29
  sage: T = species.CombinatorialSpecies(min=1)
@@ -140,6 +143,9 @@ class GenericCombinatorialSpecies(SageObject):
140
143
  sage: X = species.SingletonSpecies()
141
144
  sage: E = species.EmptySetSpecies()
142
145
  sage: L = CombinatorialSpecies()
146
+ doctest:warning...
147
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
148
+ See https://github.com/sagemath/sage/issues/38544 for details.
143
149
  sage: L.define(E+X*L)
144
150
  sage: K = CombinatorialSpecies()
145
151
  sage: K.define(E+X*L)
@@ -177,7 +183,7 @@ class GenericCombinatorialSpecies(SageObject):
177
183
  """
178
184
  return not (self == other)
179
185
 
180
- def __getstate__(self):
186
+ def _getstate_(self):
181
187
  r"""
182
188
  This is used during the pickling process and returns a dictionary
183
189
  of the data needed to create this object during the unpickling
@@ -189,7 +195,7 @@ class GenericCombinatorialSpecies(SageObject):
189
195
  EXAMPLES::
190
196
 
191
197
  sage: C = species.CharacteristicSpecies(5)
192
- sage: args, kwds = C.__getstate__()
198
+ sage: args, kwds = C._getstate_()
193
199
  sage: args
194
200
  {0: 5}
195
201
  sage: sorted(kwds.items())
@@ -201,10 +207,10 @@ class GenericCombinatorialSpecies(SageObject):
201
207
  except AttributeError:
202
208
  return ({}, kwds)
203
209
 
204
- def __setstate__(self, state):
210
+ def _setstate_(self, state):
205
211
  """
206
212
  This is used during unpickling to recreate this object from the
207
- data provided by the ``__getstate__`` method.
213
+ data provided by the ``_getstate_`` method.
208
214
 
209
215
  TESTS::
210
216
 
@@ -212,7 +218,7 @@ class GenericCombinatorialSpecies(SageObject):
212
218
  sage: C4 = species.CharacteristicSpecies(4)
213
219
  sage: C2
214
220
  Characteristic species of order 2
215
- sage: C2.__setstate__(C4.__getstate__()); C2
221
+ sage: C2._setstate_(C4._getstate_()); C2
216
222
  Characteristic species of order 4
217
223
  """
218
224
  args_dict, kwds = state
@@ -230,7 +236,7 @@ class GenericCombinatorialSpecies(SageObject):
230
236
  sage: C.weighted(t)
231
237
  Cyclic permutation species with weight=t
232
238
  """
233
- args_dict, kwds = self.__getstate__()
239
+ args_dict, kwds = self._getstate_()
234
240
  kwds.update({'weight': weight})
235
241
  return self.__class__(*[args_dict[i] for i in range(len(args_dict))], **kwds)
236
242
 
@@ -796,7 +802,7 @@ class GenericCombinatorialSpecies(SageObject):
796
802
  Qz = QQ['z'].fraction_field()
797
803
 
798
804
  # Generate the variable names and the corresponding polynomial rings
799
- var_names = ["node%s" % i for i in range(d.num_verts())]
805
+ var_names = ["node%s" % i for i in range(d.n_vertices())]
800
806
  R = Qz[", ".join(var_names)]
801
807
  R_gens_dict = R.gens_dict()
802
808
 
@@ -14,6 +14,9 @@ BB = o + o\*BB + o\*|\*BB
14
14
  Here we define this species using the default structures::
15
15
 
16
16
  sage: ball = species.SingletonSpecies()
17
+ doctest:warning...
18
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
19
+ See https://github.com/sagemath/sage/issues/38544 for details.
17
20
  sage: bar = species.EmptySetSpecies()
18
21
  sage: BB = CombinatorialSpecies()
19
22
  sage: BB.define(ball + ball*BB + ball*bar*BB)
@@ -180,11 +183,10 @@ class GenericSpeciesStructure(CombinatorialObject):
180
183
  [1, 2, 3]
181
184
  """
182
185
  if isinstance(i, (int, Integer)):
183
- return self._labels[i-1]
184
- else:
185
- return i
186
+ return self._labels[i - 1]
187
+ return i
186
188
 
187
- def is_isomorphic(self, x):
189
+ def is_isomorphic(self, x) -> bool:
188
190
  """
189
191
  EXAMPLES::
190
192
 
@@ -201,11 +203,8 @@ class GenericSpeciesStructure(CombinatorialObject):
201
203
  if self.parent() != x.parent():
202
204
  return False
203
205
 
204
- #We don't care about the labels for isomorphism testing
205
- if self.canonical_label()._list == x.canonical_label()._list:
206
- return True
207
- else:
208
- return False
206
+ # We don't care about the labels for isomorphism testing
207
+ return self.canonical_label()._list == x.canonical_label()._list
209
208
 
210
209
 
211
210
  #For backward compatibility. This should be removed in the near
@@ -33,6 +33,9 @@ class SubsetSpeciesStructure(GenericSpeciesStructure):
33
33
 
34
34
  sage: set_random_seed(0)
35
35
  sage: S = species.SubsetSpecies()
36
+ doctest:warning...
37
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
38
+ See https://github.com/sagemath/sage/issues/38544 for details.
36
39
  sage: a = S.structures(["a","b","c"])[0]; a
37
40
  {}
38
41
  """
@@ -33,6 +33,9 @@ class SumSpecies(GenericCombinatorialSpecies, UniqueRepresentation):
33
33
  EXAMPLES::
34
34
 
35
35
  sage: S = species.PermutationSpecies()
36
+ doctest:warning...
37
+ DeprecationWarning: combinat.species is superseded by LazyCombinatorialSpecies
38
+ See https://github.com/sagemath/sage/issues/38544 for details.
36
39
  sage: A = S+S
37
40
  sage: A.generating_series()[:5]
38
41
  [2, 2, 2, 2, 2]
sage/combinat/subword.py CHANGED
@@ -56,7 +56,6 @@ AUTHORS:
56
56
  # https://www.gnu.org/licenses/
57
57
  # ****************************************************************************
58
58
  from __future__ import annotations
59
- from collections.abc import Iterator
60
59
  import itertools
61
60
 
62
61
  from sage.structure.parent import Parent
@@ -66,6 +65,10 @@ from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
66
65
  import sage.misc.prandom as prandom
67
66
  from sage.rings.integer import Integer
68
67
  from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
68
+ from typing import TYPE_CHECKING
69
+
70
+ if TYPE_CHECKING:
71
+ from collections.abc import Iterator
69
72
 
70
73
 
71
74
  def _stringification(data):
@@ -350,7 +350,7 @@ class SubwordComplexFacet(Simplex, Element):
350
350
  Phi = self.parent().group().roots()
351
351
  return [Phi[i] for i in self._root_configuration_indices()]
352
352
 
353
- def kappa_preimage(self):
353
+ def kappa_preimage(self) -> list:
354
354
  r"""
355
355
  Return the fiber of ``self`` under the `\kappa` map.
356
356
 
@@ -404,7 +404,7 @@ class SubwordComplexFacet(Simplex, Element):
404
404
  if all(w.action_on_root_indices(i, side='left') < N
405
405
  for i in root_conf)]
406
406
 
407
- def is_vertex(self):
407
+ def is_vertex(self) -> bool:
408
408
  r"""
409
409
  Return ``True`` if ``self`` is a vertex of the brick polytope
410
410
  of ``self.parent``.
@@ -1446,7 +1446,7 @@ class SubwordComplex(UniqueRepresentation, SimplicialComplex):
1446
1446
 
1447
1447
  # topological properties
1448
1448
 
1449
- def is_sphere(self):
1449
+ def is_sphere(self) -> bool:
1450
1450
  r"""
1451
1451
  Return ``True`` if the subword complex ``self`` is a sphere.
1452
1452
 
@@ -1473,7 +1473,7 @@ class SubwordComplex(UniqueRepresentation, SimplicialComplex):
1473
1473
  w = W.demazure_product(self._Q)
1474
1474
  return w == self._pi
1475
1475
 
1476
- def is_ball(self):
1476
+ def is_ball(self) -> bool:
1477
1477
  r"""
1478
1478
  Return ``True`` if the subword complex ``self`` is a ball.
1479
1479
 
@@ -1500,7 +1500,7 @@ class SubwordComplex(UniqueRepresentation, SimplicialComplex):
1500
1500
  """
1501
1501
  return not self.is_sphere()
1502
1502
 
1503
- def is_pure(self):
1503
+ def is_pure(self) -> bool:
1504
1504
  r"""
1505
1505
  Return ``True`` since all subword complexes are pure.
1506
1506
 
@@ -1542,7 +1542,7 @@ class SubwordComplex(UniqueRepresentation, SimplicialComplex):
1542
1542
  # root and weight
1543
1543
 
1544
1544
  @cached_method
1545
- def is_root_independent(self):
1545
+ def is_root_independent(self) -> bool:
1546
1546
  r"""
1547
1547
  Return ``True`` if ``self`` is root-independent.
1548
1548
 
@@ -1570,7 +1570,7 @@ class SubwordComplex(UniqueRepresentation, SimplicialComplex):
1570
1570
  return M.rank() == max(M.ncols(), M.nrows())
1571
1571
 
1572
1572
  @cached_method
1573
- def is_double_root_free(self):
1573
+ def is_double_root_free(self) -> bool:
1574
1574
  r"""
1575
1575
  Return ``True`` if ``self`` is double-root-free.
1576
1576
 
@@ -558,7 +558,7 @@ class SuperPartition(ClonableArray,
558
558
  """
559
559
  sd = self.to_circled_diagram()
560
560
  return SuperPartition.from_circled_diagram(sd[0].conjugate(),
561
- [(j, i) for (i, j) in sd[1]])
561
+ [(j, i) for i, j in sd[1]])
562
562
 
563
563
  def zee(self) -> Integer:
564
564
  r"""
@@ -120,7 +120,7 @@ def SymmetricGroupAlgebra(R, W, category=None):
120
120
  Weyl Group of type ['A', 3] (as a matrix group acting
121
121
  on the ambient space)
122
122
  sage: SGA.an_element()
123
- s1*s2*s3 + 3*s2*s3*s1*s2 + 2*s3*s1 + 1
123
+ s1*s2*s3 + ... + 1
124
124
 
125
125
  The preferred way to construct the symmetric group algebra is to
126
126
  go through the usual ``algebra`` method::
@@ -1314,6 +1314,7 @@ class SymmetricGroupAlgebra_n(GroupAlgebra_class):
1314
1314
  modules (which are the :meth:`Specht modules <specht_module>`
1315
1315
  and also projective modules)::
1316
1316
 
1317
+ sage: # long time
1317
1318
  sage: SGA = SymmetricGroupAlgebra(QQ, 5)
1318
1319
  sage: for la in Partitions(SGA.n):
1319
1320
  ....: idem = SGA.ladder_idempotent(la)
@@ -2176,7 +2177,6 @@ class SymmetricGroupAlgebra_n(GroupAlgebra_class):
2176
2177
  ...
2177
2178
  NotImplementedError: not implemented when p|n!; dimension of invariant forms may be greater than one
2178
2179
  """
2179
- from sage.matrix.special import diagonal_matrix
2180
2180
  F = self.base_ring()
2181
2181
  G = self.group()
2182
2182
 
@@ -2209,9 +2209,9 @@ class SymmetricGroupAlgebra_n(GroupAlgebra_class):
2209
2209
  return F.zero()
2210
2210
  z = F.multiplicative_generator()
2211
2211
  k = u.log(z)
2212
- if k % (q+1) != 0:
2212
+ if k % (q + 1) != 0:
2213
2213
  raise ValueError(f"unable to factor as {u} is not in base field GF({q})")
2214
- return z ** ((k//(q+1)) % (q-1))
2214
+ return z ** ((k // (q + 1)) % (q - 1))
2215
2215
 
2216
2216
  dft_matrix = self.dft()
2217
2217
  n = dft_matrix.nrows()
@@ -2536,7 +2536,7 @@ class SymmetricGroupAlgebra_n(GroupAlgebra_class):
2536
2536
  T = []
2537
2537
  total = 1 # make it 1-based
2538
2538
  for r in la:
2539
- T.append(list(range(total, total+r)))
2539
+ T.append(list(range(total, total + r)))
2540
2540
  total += r
2541
2541
  T = Tableau(T)
2542
2542
  G = self.group()
@@ -2634,7 +2634,7 @@ class SymmetricGroupAlgebra_n(GroupAlgebra_class):
2634
2634
  self._cellular_KL = KazhdanLusztigPolynomial(self._KLG, q)
2635
2635
  polyfunc = self._cellular_KL.P
2636
2636
  else:
2637
- self._cellular_KL = Coxeter3Group(['A', self.n+1])
2637
+ self._cellular_KL = Coxeter3Group(['A', self.n + 1])
2638
2638
  self._KLG = self._cellular_KL
2639
2639
  polyfunc = self._cellular_KL.kazhdan_lusztig_polynomial
2640
2640
 
@@ -3565,9 +3565,9 @@ class HeckeAlgebraSymmetricGroup_generic(CombinatorialFreeModule):
3565
3565
  if x in Permutations():
3566
3566
  if len(x) < self.n:
3567
3567
  return self.monomial(self._indices(
3568
- list(x) + list(range(len(x) + 1, self.n + 1))
3569
- ))
3570
- if all(x[i] == i+1 for i in range(self.n, len(x))):
3568
+ list(x) + list(range(len(x) + 1, self.n + 1))
3569
+ ))
3570
+ if all(x[i] == i + 1 for i in range(self.n, len(x))):
3571
3571
  return self.monomial(self._indices(x[:self.n]))
3572
3572
 
3573
3573
  return self._indices(x)
@@ -683,10 +683,10 @@ class YoungRepresentation_generic(SymmetricGroupRepresentation_generic_class):
683
683
  digraph = copy(Y._digraph)
684
684
  digraph.delete_edges((u, v) for (u, v, (j, beta)) in digraph.edges(sort=True)
685
685
  if j != i)
686
- M = matrix(self._ring, digraph.num_verts())
686
+ M = matrix(self._ring, digraph.n_vertices())
687
687
  for g in digraph.connected_components_subgraphs():
688
- if g.num_verts() == 1:
689
- [v] = g.vertices(sort=True)
688
+ if g.n_vertices() == 1:
689
+ v, = g.vertices(sort=True)
690
690
  w = self._word_dict[v]
691
691
  trivial = None
692
692
  for j, a in enumerate(w):
@@ -699,7 +699,7 @@ class YoungRepresentation_generic(SymmetricGroupRepresentation_generic_class):
699
699
  j = index_lookup[v]
700
700
  M[j, j] = 1 if trivial is True else -1
701
701
  else:
702
- [(u, v, (j, beta))] = g.edges(sort=True)
702
+ (u, v, (j, beta)), = g.edges(sort=True)
703
703
  iu = index_lookup[u]
704
704
  iv = index_lookup[v]
705
705
  M[iu, iu], M[iu, iv], M[iv, iu], M[iv, iv] = \
@@ -732,7 +732,7 @@ class YoungRepresentation_generic(SymmetricGroupRepresentation_generic_class):
732
732
  [-1/2 3/2]
733
733
  [ 1/2 1/2]
734
734
  """
735
- m = self._yang_baxter_graph._digraph.num_verts()
735
+ m = self._yang_baxter_graph._digraph.n_vertices()
736
736
  M = matrix(self._ring, m, m, 1)
737
737
  for i in Permutation(permutation).reduced_word():
738
738
  M *= self.representation_matrix_for_simple_transposition(i)
@@ -357,15 +357,15 @@ def T_sequences_construction_from_base_sequences(base_sequences, check=True):
357
357
 
358
358
  A, B, C, D = base_sequences
359
359
  n = len(C)
360
- p = len(A)-n
360
+ p = len(A) - n
361
361
 
362
- assert len(A) == len(B) == len(C)+p == len(D)+p
362
+ assert len(A) == len(B) == len(C) + p == len(D) + p
363
363
 
364
364
  def seq_sum(seq1, seq2):
365
- return [(a+b)//2 for (a, b) in zip(seq1, seq2)]
365
+ return [(a + b) // 2 for a, b in zip(seq1, seq2)]
366
366
 
367
367
  def seq_subtract(seq1, seq2):
368
- return [(a-b)//2 for (a, b) in zip(seq1, seq2)]
368
+ return [(a - b) // 2 for a, b in zip(seq1, seq2)]
369
369
 
370
370
  def zero_seq(n):
371
371
  return [0 for _ in range(n)]
sage/combinat/tableau.py CHANGED
@@ -7041,6 +7041,8 @@ class SemistandardTableaux_shape_weight(SemistandardTableaux_shape):
7041
7041
  """
7042
7042
  return symmetrica.kostka_tab(self.shape, self.weight)
7043
7043
 
7044
+ random_element = FiniteEnumeratedSets.ParentMethods._random_element_from_unrank
7045
+
7044
7046
 
7045
7047
  class SemistandardTableaux_size_weight(SemistandardTableaux):
7046
7048
  r"""
@@ -9345,10 +9347,7 @@ class IncreasingTableaux_shape_weight(IncreasingTableaux_shape):
9345
9347
  for i in row:
9346
9348
  content_list[i-1] = 1
9347
9349
 
9348
- if tuple(content_list) != self.weight:
9349
- return False
9350
-
9351
- return True
9350
+ return tuple(content_list) == self.weight
9352
9351
 
9353
9352
  def __iter__(self):
9354
9353
  """
@@ -208,7 +208,7 @@ subsequent papers on the representation theory of these algebras.
208
208
  # it under the terms of the GNU General Public License as published by
209
209
  # the Free Software Foundation, either version 2 of the License, or
210
210
  # (at your option) any later version.
211
- # http://www.gnu.org/licenses/
211
+ # https://www.gnu.org/licenses/
212
212
  # ****************************************************************************
213
213
 
214
214
  from sage.arith.misc import factorial
@@ -5078,7 +5078,7 @@ class StandardTableaux_residue(StandardTableauTuples):
5078
5078
  sage: T = StandardTableauTuple([[[6],[7]],[[1,2,3],[4,5]]]).residue_sequence(2,(0,0)).standard_tableaux()
5079
5079
  sage: TestSuite(T).run()
5080
5080
  """
5081
- super().__init__(residue, category=FiniteEnumeratedSets())
5081
+ super().__init__(category=FiniteEnumeratedSets())
5082
5082
  self._level = residue.level()
5083
5083
  self._multicharge = residue.multicharge()
5084
5084
  self._quantum_characteristic = residue.quantum_characteristic()