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.
- passagemath_combinat/__init__.py +3 -0
- {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/METADATA +17 -20
- {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/RECORD +220 -218
- {passagemath_combinat-10.6.1.dist-info → passagemath_combinat-10.8.1a1.dist-info}/WHEEL +1 -1
- passagemath_combinat-10.8.1a1.dist-info/top_level.txt +3 -0
- sage/algebras/affine_nil_temperley_lieb.py +3 -3
- sage/algebras/all.py +0 -1
- sage/algebras/askey_wilson.py +1 -1
- sage/algebras/associated_graded.py +2 -2
- sage/algebras/cellular_basis.py +3 -6
- sage/algebras/cluster_algebra.py +2 -3
- sage/algebras/down_up_algebra.py +6 -6
- sage/algebras/free_algebra.py +3 -32
- sage/algebras/free_algebra_element.py +21 -25
- sage/algebras/free_algebra_quotient_element.py +9 -38
- sage/algebras/free_zinbiel_algebra.py +4 -3
- sage/algebras/hall_algebra.py +2 -2
- sage/algebras/hecke_algebras/ariki_koike_algebra.py +8 -8
- sage/algebras/hecke_algebras/ariki_koike_specht_modules.py +2 -2
- sage/algebras/hecke_algebras/cubic_hecke_algebra.py +11 -14
- sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +1 -1
- sage/algebras/hecke_algebras/cubic_hecke_matrix_rep.py +5 -5
- sage/algebras/iwahori_hecke_algebra.py +59 -57
- sage/algebras/jordan_algebra.py +97 -89
- sage/algebras/lie_conformal_algebras/abelian_lie_conformal_algebra.py +6 -6
- sage/algebras/lie_conformal_algebras/affine_lie_conformal_algebra.py +14 -12
- sage/algebras/lie_conformal_algebras/bosonic_ghosts_lie_conformal_algebra.py +6 -6
- sage/algebras/lie_conformal_algebras/fermionic_ghosts_lie_conformal_algebra.py +4 -4
- sage/algebras/lie_conformal_algebras/finitely_freely_generated_lca.py +13 -13
- sage/algebras/lie_conformal_algebras/free_bosons_lie_conformal_algebra.py +8 -6
- sage/algebras/lie_conformal_algebras/free_fermions_lie_conformal_algebra.py +7 -5
- sage/algebras/lie_conformal_algebras/freely_generated_lie_conformal_algebra.py +7 -7
- sage/algebras/lie_conformal_algebras/graded_lie_conformal_algebra.py +6 -5
- sage/algebras/lie_conformal_algebras/lie_conformal_algebra.py +12 -11
- sage/algebras/lie_conformal_algebras/lie_conformal_algebra_element.py +3 -3
- sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_basis.py +3 -3
- sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py +11 -11
- sage/algebras/lie_conformal_algebras/n2_lie_conformal_algebra.py +3 -3
- sage/algebras/lie_conformal_algebras/neveu_schwarz_lie_conformal_algebra.py +8 -7
- sage/algebras/lie_conformal_algebras/virasoro_lie_conformal_algebra.py +9 -8
- sage/algebras/lie_conformal_algebras/weyl_lie_conformal_algebra.py +6 -5
- sage/algebras/nil_coxeter_algebra.py +4 -4
- sage/algebras/q_commuting_polynomials.py +6 -6
- sage/algebras/q_system.py +3 -3
- sage/algebras/quantum_clifford.py +8 -8
- sage/algebras/quantum_groups/fock_space.py +48 -8
- sage/algebras/quantum_groups/quantum_group_gap.py +5 -7
- sage/algebras/quantum_matrix_coordinate_algebra.py +7 -7
- sage/algebras/quantum_oscillator.py +3 -3
- sage/algebras/quaternion_algebra_element.py +5 -3
- sage/algebras/schur_algebra.py +3 -3
- sage/algebras/shuffle_algebra.py +5 -8
- sage/algebras/splitting_algebra.py +129 -85
- sage/algebras/tensor_algebra.py +7 -7
- sage/algebras/yangian.py +16 -15
- sage/algebras/yokonuma_hecke_algebra.py +13 -11
- sage/combinat/all.py +9 -0
- sage/combinat/all__sagemath_combinat.py +1 -0
- sage/combinat/alternating_sign_matrix.py +36 -29
- sage/combinat/baxter_permutations.py +32 -12
- sage/combinat/bijectionist.py +13 -17
- sage/combinat/chas/fsym.py +6 -6
- sage/combinat/chas/wqsym.py +23 -29
- sage/combinat/colored_permutations.py +9 -11
- sage/combinat/colored_permutations_representations.py +13 -12
- sage/combinat/composition_tableau.py +2 -2
- sage/combinat/constellation.py +57 -30
- sage/combinat/crystals/affine_factorization.py +5 -4
- sage/combinat/crystals/alcove_path.py +2 -2
- sage/combinat/crystals/fully_commutative_stable_grothendieck.py +3 -2
- sage/combinat/crystals/infinity_crystals.py +18 -18
- sage/combinat/crystals/kac_modules.py +1 -1
- sage/combinat/crystals/kirillov_reshetikhin.py +2 -2
- sage/combinat/crystals/letters.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/crystals/littelmann_path.py +1 -1
- sage/combinat/crystals/pbw_datum.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/crystals/pbw_datum.pyx +3 -2
- sage/combinat/crystals/spins.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/crystals/tensor_product.py +7 -5
- sage/combinat/crystals/tensor_product_element.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/debruijn_sequence.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/debruijn_sequence.pyx +1 -2
- sage/combinat/degree_sequences.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/degree_sequences.pyx +241 -188
- sage/combinat/derangements.py +28 -22
- sage/combinat/diagram_algebras.py +12 -14
- sage/combinat/dyck_word.py +15 -14
- sage/combinat/e_one_star.py +1 -1
- sage/combinat/expnums.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/fast_vector_partitions.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/fqsym.py +13 -19
- sage/combinat/free_dendriform_algebra.py +2 -2
- sage/combinat/free_prelie_algebra.py +2 -2
- sage/combinat/fully_commutative_elements.py +8 -8
- sage/combinat/fully_packed_loop.py +9 -9
- sage/combinat/gelfand_tsetlin_patterns.py +4 -5
- sage/combinat/gray_codes.py +3 -4
- sage/combinat/grossman_larson_algebras.py +2 -2
- sage/combinat/growth.py +13 -13
- sage/combinat/hall_polynomial.py +1 -1
- sage/combinat/hillman_grassl.py +1 -1
- sage/combinat/integer_matrices.py +5 -7
- sage/combinat/k_tableau.py +8 -7
- sage/combinat/kazhdan_lusztig.py +3 -3
- sage/combinat/key_polynomial.py +845 -298
- sage/combinat/knutson_tao_puzzles.py +11 -13
- sage/combinat/matrices/hadamard_matrix.py +1 -1
- sage/combinat/matrices/latin.py +75 -92
- sage/combinat/misc.py +3 -3
- sage/combinat/multiset_partition_into_sets_ordered.py +27 -10
- sage/combinat/ncsf_qsym/generic_basis_code.py +5 -5
- sage/combinat/ncsf_qsym/ncsf.py +6 -5
- sage/combinat/ncsf_qsym/qsym.py +9 -17
- sage/combinat/ncsym/ncsym.py +8 -12
- sage/combinat/nu_dyck_word.py +1 -1
- sage/combinat/parallelogram_polyomino.py +3 -5
- sage/combinat/parking_functions.py +6 -5
- sage/combinat/partition_algebra.py +22 -57
- sage/combinat/partition_kleshchev.py +4 -4
- sage/combinat/partition_tuple.py +12 -10
- sage/combinat/plane_partition.py +10 -13
- sage/combinat/positive_integer_semigroup_test.py +17 -0
- sage/combinat/q_bernoulli.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/quickref.py +2 -2
- sage/combinat/recognizable_series.py +2 -2
- sage/combinat/regular_sequence.py +7 -7
- sage/combinat/regular_sequence_bounded.py +15 -21
- sage/combinat/restricted_growth.py +3 -3
- sage/combinat/ribbon.py +3 -3
- sage/combinat/rigged_configurations/bijection.py +3 -3
- sage/combinat/rigged_configurations/rigged_partition.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/rsk.py +2 -0
- sage/combinat/schubert_polynomial.py +11 -2
- sage/combinat/set_partition.py +3 -7
- sage/combinat/set_partition_iterator.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/set_partition_iterator.pyx +0 -1
- sage/combinat/set_partition_ordered.py +2 -2
- sage/combinat/sf/classical.py +1 -1
- sage/combinat/sf/dual.py +4 -8
- sage/combinat/sf/elementary.py +13 -7
- sage/combinat/sf/hall_littlewood.py +10 -8
- sage/combinat/sf/homogeneous.py +6 -3
- sage/combinat/sf/jack.py +11 -9
- sage/combinat/sf/llt.py +4 -5
- sage/combinat/sf/macdonald.py +10 -11
- sage/combinat/sf/monomial.py +6 -0
- sage/combinat/sf/ns_macdonald.py +92 -51
- sage/combinat/sf/powersum.py +9 -14
- sage/combinat/sf/schur.py +6 -0
- sage/combinat/sf/sf.py +21 -19
- sage/combinat/sf/sfa.py +13 -64
- sage/combinat/shifted_primed_tableau.py +5 -7
- sage/combinat/shuffle.py +1 -1
- sage/combinat/sine_gordon.py +18 -38
- sage/combinat/skew_partition.py +9 -12
- sage/combinat/skew_tableau.py +2 -7
- sage/combinat/sloane_functions.py +1 -1
- sage/combinat/species/all.py +67 -2
- sage/combinat/species/characteristic_species.py +3 -0
- sage/combinat/species/composition_species.py +3 -0
- sage/combinat/species/cycle_species.py +4 -0
- sage/combinat/species/empty_species.py +3 -0
- sage/combinat/species/functorial_composition_species.py +3 -0
- sage/combinat/species/generating_series.py +3 -0
- sage/combinat/species/library.py +3 -0
- sage/combinat/species/linear_order_species.py +3 -0
- sage/combinat/species/partition_species.py +3 -0
- sage/combinat/species/permutation_species.py +4 -0
- sage/combinat/species/product_species.py +3 -0
- sage/combinat/species/recursive_species.py +3 -0
- sage/combinat/species/set_species.py +3 -0
- sage/combinat/species/species.py +13 -7
- sage/combinat/species/structure.py +8 -9
- sage/combinat/species/subset_species.py +3 -0
- sage/combinat/species/sum_species.py +3 -0
- sage/combinat/subword.py +4 -1
- sage/combinat/subword_complex.py +7 -7
- sage/combinat/subword_complex_c.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/superpartition.py +1 -1
- sage/combinat/symmetric_group_algebra.py +9 -9
- sage/combinat/symmetric_group_representations.py +5 -5
- sage/combinat/t_sequences.py +4 -4
- sage/combinat/tableau.py +3 -4
- sage/combinat/tableau_tuple.py +2 -2
- sage/combinat/tiling.py +39 -42
- sage/combinat/triangles_FHM.py +38 -15
- sage/combinat/tutorial.py +2 -2
- sage/combinat/vector_partition.py +43 -31
- sage/combinat/words/abstract_word.py +4 -4
- sage/combinat/words/alphabet.py +12 -12
- sage/combinat/words/finite_word.py +25 -229
- sage/combinat/words/infinite_word.py +1 -1
- sage/combinat/words/morphic.py +13 -13
- sage/combinat/words/morphism.py +3 -12
- sage/combinat/words/paths.py +16 -17
- sage/combinat/words/word.py +60 -35
- sage/combinat/words/word_char.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/words/word_char.pyx +46 -7
- sage/combinat/words/word_datatypes.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/words/word_generators.py +39 -38
- sage/databases/findstat.py +72 -31
- sage/databases/oeis.py +125 -25
- sage/databases/sloane.py +14 -8
- sage/games/sudoku_backtrack.cpython-312-aarch64-linux-musl.so +0 -0
- sage/groups/indexed_free_group.py +3 -4
- sage/libs/symmetrica/symmetrica.cpython-312-aarch64-linux-musl.so +0 -0
- sage/libs/symmetrica/symmetrica.pxi +1 -0
- sage/monoids/automatic_semigroup.py +1 -3
- sage/monoids/free_abelian_monoid.py +7 -33
- sage/monoids/free_abelian_monoid_element.cpython-312-aarch64-linux-musl.so +0 -0
- sage/monoids/free_monoid.py +8 -40
- sage/monoids/free_monoid_element.py +1 -9
- sage/monoids/string_monoid.py +5 -2
- sage/monoids/string_monoid_element.py +12 -66
- sage/rings/all__sagemath_combinat.py +7 -0
- sage/sat/solvers/__init__.py +3 -4
- sage/sat/solvers/cryptominisat.py +2 -3
- sage/sat/solvers/picosat.py +2 -3
- sage/sat/solvers/sat_lp.py +2 -2
- sage/sat/solvers/satsolver.cpython-312-aarch64-linux-musl.so +0 -0
- passagemath_combinat-10.6.1.dist-info/top_level.txt +0 -2
|
@@ -687,13 +687,11 @@ class AutomaticSemigroup(UniqueRepresentation, Parent):
|
|
|
687
687
|
sage: M._constructed
|
|
688
688
|
True
|
|
689
689
|
"""
|
|
690
|
-
i = 0
|
|
691
690
|
# self._elements is never empty; so we are sure
|
|
692
|
-
for x in self._elements:
|
|
691
|
+
for i, x in enumerate(self._elements, 1):
|
|
693
692
|
yield x
|
|
694
693
|
# some other iterator/ method of the semigroup may have
|
|
695
694
|
# been called before we move on to the next line
|
|
696
|
-
i += 1
|
|
697
695
|
if i == len(self._elements) and not self._constructed:
|
|
698
696
|
try:
|
|
699
697
|
next(self._iter)
|
|
@@ -55,15 +55,14 @@ lists of integer exponents.
|
|
|
55
55
|
# https://www.gnu.org/licenses/
|
|
56
56
|
# ****************************************************************************
|
|
57
57
|
|
|
58
|
-
from sage.misc.cachefunc import cached_method
|
|
59
|
-
from sage.structure.category_object import normalize_names
|
|
60
|
-
from sage.structure.parent import Parent
|
|
61
58
|
from sage.categories.monoids import Monoids
|
|
62
|
-
from .
|
|
59
|
+
from sage.misc.cachefunc import cached_method
|
|
60
|
+
from sage.monoids.free_abelian_monoid_element import FreeAbelianMonoidElement
|
|
63
61
|
from sage.rings.integer import Integer
|
|
64
62
|
from sage.rings.integer_ring import ZZ
|
|
65
|
-
|
|
63
|
+
from sage.structure.category_object import normalize_names
|
|
66
64
|
from sage.structure.factory import UniqueFactory
|
|
65
|
+
from sage.structure.parent import Parent
|
|
67
66
|
|
|
68
67
|
|
|
69
68
|
class FreeAbelianMonoidFactory(UniqueFactory):
|
|
@@ -158,38 +157,13 @@ def FreeAbelianMonoid(index_set=None, names=None, **kwds):
|
|
|
158
157
|
return FreeAbelianMonoid_factory(index_set, names)
|
|
159
158
|
|
|
160
159
|
|
|
161
|
-
def is_FreeAbelianMonoid(x):
|
|
162
|
-
"""
|
|
163
|
-
Return ``True`` if `x` is a free abelian monoid.
|
|
164
|
-
|
|
165
|
-
EXAMPLES::
|
|
166
|
-
|
|
167
|
-
sage: from sage.monoids.free_abelian_monoid import is_FreeAbelianMonoid
|
|
168
|
-
sage: is_FreeAbelianMonoid(5)
|
|
169
|
-
doctest:warning...
|
|
170
|
-
DeprecationWarning: the function is_FreeAbelianMonoid is deprecated;
|
|
171
|
-
use 'isinstance(..., FreeAbelianMonoid_class)' instead
|
|
172
|
-
See https://github.com/sagemath/sage/issues/37897 for details.
|
|
173
|
-
False
|
|
174
|
-
sage: is_FreeAbelianMonoid(FreeAbelianMonoid(7,'a'))
|
|
175
|
-
True
|
|
176
|
-
sage: is_FreeAbelianMonoid(FreeMonoid(7,'a'))
|
|
177
|
-
False
|
|
178
|
-
sage: is_FreeAbelianMonoid(FreeMonoid(0,''))
|
|
179
|
-
False
|
|
180
|
-
"""
|
|
181
|
-
from sage.misc.superseded import deprecation
|
|
182
|
-
deprecation(37897, "the function is_FreeAbelianMonoid is deprecated; use 'isinstance(..., FreeAbelianMonoid_class)' instead")
|
|
183
|
-
return isinstance(x, FreeAbelianMonoid_class)
|
|
184
|
-
|
|
185
|
-
|
|
186
160
|
class FreeAbelianMonoid_class(Parent):
|
|
187
161
|
"""
|
|
188
162
|
Free abelian monoid on `n` generators.
|
|
189
163
|
"""
|
|
190
164
|
Element = FreeAbelianMonoidElement
|
|
191
165
|
|
|
192
|
-
def __init__(self, n, names):
|
|
166
|
+
def __init__(self, n, names) -> None:
|
|
193
167
|
"""
|
|
194
168
|
Initialize ``self``.
|
|
195
169
|
|
|
@@ -206,7 +180,7 @@ class FreeAbelianMonoid_class(Parent):
|
|
|
206
180
|
assert names is not None
|
|
207
181
|
Parent.__init__(self, names=names, category=Monoids().Commutative())
|
|
208
182
|
|
|
209
|
-
def __repr__(self):
|
|
183
|
+
def __repr__(self) -> str:
|
|
210
184
|
n = self.__ngens
|
|
211
185
|
return f"Free abelian monoid on {n} generators {self.gens()}"
|
|
212
186
|
|
|
@@ -226,7 +200,7 @@ class FreeAbelianMonoid_class(Parent):
|
|
|
226
200
|
return x
|
|
227
201
|
return self.element_class(self, x)
|
|
228
202
|
|
|
229
|
-
def __contains__(self, x):
|
|
203
|
+
def __contains__(self, x) -> bool:
|
|
230
204
|
"""
|
|
231
205
|
Return ``True`` if `x` is an element of this abelian monoid.
|
|
232
206
|
|
|
Binary file
|
sage/monoids/free_monoid.py
CHANGED
|
@@ -25,48 +25,15 @@ the optional ``names`` argument to the
|
|
|
25
25
|
# https://www.gnu.org/licenses/
|
|
26
26
|
# ****************************************************************************
|
|
27
27
|
|
|
28
|
-
from sage.rings.integer import Integer
|
|
29
|
-
from sage.structure.category_object import normalize_names
|
|
30
28
|
from .free_monoid_element import FreeMonoidElement
|
|
31
|
-
|
|
32
29
|
from .monoid import Monoid_class
|
|
33
30
|
|
|
31
|
+
from sage.categories.monoids import Monoids
|
|
34
32
|
from sage.combinat.words.finite_word import FiniteWord_class
|
|
35
|
-
|
|
36
|
-
from sage.structure.unique_representation import UniqueRepresentation
|
|
33
|
+
from sage.rings.integer import Integer
|
|
37
34
|
from sage.rings.integer_ring import ZZ
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def is_FreeMonoid(x):
|
|
41
|
-
"""
|
|
42
|
-
Return ``True`` if `x` is a free monoid.
|
|
43
|
-
|
|
44
|
-
EXAMPLES::
|
|
45
|
-
|
|
46
|
-
sage: from sage.monoids.free_monoid import is_FreeMonoid
|
|
47
|
-
sage: is_FreeMonoid(5)
|
|
48
|
-
doctest:warning...
|
|
49
|
-
DeprecationWarning: the function is_FreeMonoid is deprecated;
|
|
50
|
-
use 'isinstance(..., (FreeMonoid, IndexedFreeMonoid))' instead
|
|
51
|
-
See https://github.com/sagemath/sage/issues/37897 for details.
|
|
52
|
-
False
|
|
53
|
-
sage: is_FreeMonoid(FreeMonoid(7,'a'))
|
|
54
|
-
True
|
|
55
|
-
sage: is_FreeMonoid(FreeAbelianMonoid(7,'a'))
|
|
56
|
-
False
|
|
57
|
-
sage: is_FreeMonoid(FreeAbelianMonoid(0,''))
|
|
58
|
-
False
|
|
59
|
-
sage: is_FreeMonoid(FreeMonoid(index_set=ZZ))
|
|
60
|
-
True
|
|
61
|
-
sage: is_FreeMonoid(FreeAbelianMonoid(index_set=ZZ))
|
|
62
|
-
False
|
|
63
|
-
"""
|
|
64
|
-
from sage.misc.superseded import deprecation
|
|
65
|
-
deprecation(37897, "the function is_FreeMonoid is deprecated; use 'isinstance(..., (FreeMonoid, IndexedFreeMonoid))' instead")
|
|
66
|
-
if isinstance(x, FreeMonoid):
|
|
67
|
-
return True
|
|
68
|
-
from sage.monoids.indexed_free_monoid import IndexedFreeMonoid
|
|
69
|
-
return isinstance(x, IndexedFreeMonoid)
|
|
35
|
+
from sage.structure.category_object import normalize_names
|
|
36
|
+
from sage.structure.unique_representation import UniqueRepresentation
|
|
70
37
|
|
|
71
38
|
|
|
72
39
|
class FreeMonoid(Monoid_class, UniqueRepresentation):
|
|
@@ -198,7 +165,8 @@ class FreeMonoid(Monoid_class, UniqueRepresentation):
|
|
|
198
165
|
if n < 0:
|
|
199
166
|
raise ValueError("n (=%s) must be nonnegative" % n)
|
|
200
167
|
self.__ngens = int(n)
|
|
201
|
-
|
|
168
|
+
cat = Monoids().Infinite() if names else None
|
|
169
|
+
Monoid_class.__init__(self, names, category=cat)
|
|
202
170
|
|
|
203
171
|
def _repr_(self):
|
|
204
172
|
return f"Free monoid on {self.__ngens} generators {self.gens()}"
|
|
@@ -272,7 +240,7 @@ class FreeMonoid(Monoid_class, UniqueRepresentation):
|
|
|
272
240
|
|
|
273
241
|
raise TypeError("argument x (= %s) is of the wrong type" % x)
|
|
274
242
|
|
|
275
|
-
def __contains__(self, x):
|
|
243
|
+
def __contains__(self, x) -> bool:
|
|
276
244
|
return isinstance(x, FreeMonoidElement) and x.parent() == self
|
|
277
245
|
|
|
278
246
|
def gen(self, i=0):
|
|
@@ -330,6 +298,6 @@ class FreeMonoid(Monoid_class, UniqueRepresentation):
|
|
|
330
298
|
1
|
|
331
299
|
"""
|
|
332
300
|
if self.__ngens == 0:
|
|
333
|
-
return
|
|
301
|
+
return ZZ.one()
|
|
334
302
|
from sage.rings.infinity import infinity
|
|
335
303
|
return infinity
|
|
@@ -31,14 +31,6 @@ from sage.structure.richcmp import richcmp, richcmp_not_equal
|
|
|
31
31
|
from sage.rings.semirings.non_negative_integer_semiring import NN
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
def is_FreeMonoidElement(x):
|
|
35
|
-
from sage.misc.superseded import deprecation
|
|
36
|
-
deprecation(38184,
|
|
37
|
-
"The function is_FreeMonoidElement is deprecated; "
|
|
38
|
-
"use 'isinstance(..., FreeMonoidElement)' instead.")
|
|
39
|
-
return isinstance(x, FreeMonoidElement)
|
|
40
|
-
|
|
41
|
-
|
|
42
34
|
class FreeMonoidElement(MonoidElement):
|
|
43
35
|
"""
|
|
44
36
|
Element of a free monoid.
|
|
@@ -56,7 +48,7 @@ class FreeMonoidElement(MonoidElement):
|
|
|
56
48
|
...
|
|
57
49
|
NotImplementedError
|
|
58
50
|
"""
|
|
59
|
-
def __init__(self, F, x, check=True):
|
|
51
|
+
def __init__(self, F, x, check=True) -> None:
|
|
60
52
|
"""
|
|
61
53
|
Create the element `x` of the FreeMonoid `F`.
|
|
62
54
|
|
sage/monoids/string_monoid.py
CHANGED
|
@@ -55,10 +55,10 @@ class StringMonoid_class(FreeMonoid):
|
|
|
55
55
|
FreeMonoid.__init__(self, n)
|
|
56
56
|
self._alphabet = alphabet
|
|
57
57
|
|
|
58
|
-
def __contains__(self, x):
|
|
58
|
+
def __contains__(self, x) -> bool:
|
|
59
59
|
return isinstance(x, StringMonoidElement) and x.parent() == self
|
|
60
60
|
|
|
61
|
-
def alphabet(self):
|
|
61
|
+
def alphabet(self) -> tuple:
|
|
62
62
|
return tuple(self._alphabet)
|
|
63
63
|
|
|
64
64
|
def one(self):
|
|
@@ -692,6 +692,7 @@ class AlphabeticStringMonoid(StringMonoid_class):
|
|
|
692
692
|
The characteristic frequency probability distribution table
|
|
693
693
|
of Lewand [Lew2000]_::
|
|
694
694
|
|
|
695
|
+
sage: # needs sage.rings.real_mpfr
|
|
695
696
|
sage: table = A.characteristic_frequency(table_name='lewand')
|
|
696
697
|
sage: sorted(table.items())
|
|
697
698
|
<BLANKLINE>
|
|
@@ -725,6 +726,7 @@ class AlphabeticStringMonoid(StringMonoid_class):
|
|
|
725
726
|
Illustrating the difference between :func:`characteristic_frequency`
|
|
726
727
|
and :func:`frequency_distribution() <sage.monoids.string_monoid_element.StringMonoidElement.frequency_distribution>`::
|
|
727
728
|
|
|
729
|
+
sage: # needs sage.rings.real_mpfr
|
|
728
730
|
sage: A = AlphabeticStrings()
|
|
729
731
|
sage: M = A.encoding("abcd")
|
|
730
732
|
sage: FD = M.frequency_distribution().function()
|
|
@@ -768,6 +770,7 @@ class AlphabeticStringMonoid(StringMonoid_class):
|
|
|
768
770
|
|
|
769
771
|
The table name must be either "beker_piper" or "lewand"::
|
|
770
772
|
|
|
773
|
+
sage: # needs sage.rings.real_mpfr
|
|
771
774
|
sage: table = A.characteristic_frequency(table_name="")
|
|
772
775
|
Traceback (most recent call last):
|
|
773
776
|
...
|
|
@@ -30,70 +30,12 @@ lazy_import('sage.rings.real_mpfr', 'RealField')
|
|
|
30
30
|
from .free_monoid_element import FreeMonoidElement
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
def is_StringMonoidElement(x):
|
|
34
|
-
from sage.misc.superseded import deprecation
|
|
35
|
-
deprecation(38280,
|
|
36
|
-
"The function is_StringMonoidElement is deprecated; "
|
|
37
|
-
"use 'isinstance(..., StringMonoidElement)' instead.")
|
|
38
|
-
return isinstance(x, StringMonoidElement)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def is_AlphabeticStringMonoidElement(x):
|
|
42
|
-
from sage.misc.superseded import deprecation
|
|
43
|
-
deprecation(38280,
|
|
44
|
-
"The function is_AlphabeticStringMonoidElement is deprecated; "
|
|
45
|
-
"use 'isinstance(..., StringMonoidElement) and isinstance(x.parent(), AlphabeticStringMonoid)' instead.")
|
|
46
|
-
from .string_monoid import AlphabeticStringMonoid
|
|
47
|
-
return isinstance(x, StringMonoidElement) and \
|
|
48
|
-
isinstance(x.parent(), AlphabeticStringMonoid)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def is_BinaryStringMonoidElement(x):
|
|
52
|
-
from sage.misc.superseded import deprecation
|
|
53
|
-
deprecation(38280,
|
|
54
|
-
"The function is_BinaryStringMonoidElement is deprecated; "
|
|
55
|
-
"use 'isinstance(..., StringMonoidElement) and isinstance(x.parent(), BinaryStringMonoid)' instead.")
|
|
56
|
-
from .string_monoid import BinaryStringMonoid
|
|
57
|
-
return isinstance(x, StringMonoidElement) and \
|
|
58
|
-
isinstance(x.parent(), BinaryStringMonoid)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def is_OctalStringMonoidElement(x):
|
|
62
|
-
from sage.misc.superseded import deprecation
|
|
63
|
-
deprecation(38280,
|
|
64
|
-
"The function is_OctalStringMonoidElement is deprecated; "
|
|
65
|
-
"use 'isinstance(..., StringMonoidElement) and isinstance(x.parent(), OctalStringMonoid)' instead.")
|
|
66
|
-
from .string_monoid import OctalStringMonoid
|
|
67
|
-
return isinstance(x, StringMonoidElement) and \
|
|
68
|
-
isinstance(x.parent(), OctalStringMonoid)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def is_HexadecimalStringMonoidElement(x):
|
|
72
|
-
from sage.misc.superseded import deprecation
|
|
73
|
-
deprecation(38280,
|
|
74
|
-
"The function is_HexadecimalStringMonoidElement is deprecated; "
|
|
75
|
-
"use 'isinstance(..., StringMonoidElement) and isinstance(x.parent(), HexadecimalStringMonoid)' instead.")
|
|
76
|
-
from .string_monoid import HexadecimalStringMonoid
|
|
77
|
-
return isinstance(x, StringMonoidElement) and \
|
|
78
|
-
isinstance(x.parent(), HexadecimalStringMonoid)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def is_Radix64StringMonoidElement(x):
|
|
82
|
-
from sage.misc.superseded import deprecation
|
|
83
|
-
deprecation(38280,
|
|
84
|
-
"The function is_Radix64StringMonoidElement is deprecated; "
|
|
85
|
-
"use 'isinstance(..., StringMonoidElement) and isinstance(x.parent(), Radix64StringMonoid)' instead.")
|
|
86
|
-
from .string_monoid import Radix64StringMonoid
|
|
87
|
-
return isinstance(x, StringMonoidElement) and \
|
|
88
|
-
isinstance(x.parent(), Radix64StringMonoid)
|
|
89
|
-
|
|
90
|
-
|
|
91
33
|
class StringMonoidElement(FreeMonoidElement):
|
|
92
34
|
"""
|
|
93
35
|
Element of a free string monoid.
|
|
94
36
|
"""
|
|
95
37
|
|
|
96
|
-
def __init__(self, S, x, check=True):
|
|
38
|
+
def __init__(self, S, x, check=True) -> None:
|
|
97
39
|
"""
|
|
98
40
|
Create the element ``x`` of the StringMonoid ``S``.
|
|
99
41
|
|
|
@@ -130,7 +72,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
130
72
|
EXAMPLES::
|
|
131
73
|
|
|
132
74
|
sage: S = BinaryStrings()
|
|
133
|
-
sage:
|
|
75
|
+
sage: x, y = S.gens()
|
|
134
76
|
sage: x * y < y * x
|
|
135
77
|
True
|
|
136
78
|
sage: S("01") < S("10")
|
|
@@ -171,7 +113,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
171
113
|
EXAMPLES::
|
|
172
114
|
|
|
173
115
|
sage: S = BinaryStrings()
|
|
174
|
-
sage:
|
|
116
|
+
sage: x, y = S.gens()
|
|
175
117
|
sage: x*y
|
|
176
118
|
01
|
|
177
119
|
"""
|
|
@@ -190,7 +132,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
190
132
|
|
|
191
133
|
EXAMPLES::
|
|
192
134
|
|
|
193
|
-
sage:
|
|
135
|
+
sage: x, y = BinaryStrings().gens()
|
|
194
136
|
sage: x**3 * y**5 * x**7
|
|
195
137
|
000111110000000
|
|
196
138
|
sage: x**0
|
|
@@ -221,6 +163,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
221
163
|
def __len__(self):
|
|
222
164
|
"""
|
|
223
165
|
Return the number of products that occur in this monoid element.
|
|
166
|
+
|
|
224
167
|
For example, the length of the identity is 0, and the length
|
|
225
168
|
of the monoid `x_0^2x_1` is three.
|
|
226
169
|
|
|
@@ -230,7 +173,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
230
173
|
sage: z = S('')
|
|
231
174
|
sage: len(z)
|
|
232
175
|
0
|
|
233
|
-
sage:
|
|
176
|
+
sage: x, y = S.gens()
|
|
234
177
|
sage: len(x**2 * y**3)
|
|
235
178
|
5
|
|
236
179
|
"""
|
|
@@ -413,8 +356,8 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
413
356
|
|
|
414
357
|
Empty strings return no counts of character frequency::
|
|
415
358
|
|
|
416
|
-
sage: M = AlphabeticStrings().encoding("")
|
|
417
|
-
sage: M.character_count()
|
|
359
|
+
sage: M = AlphabeticStrings().encoding("") # needs sage.rings.real_mpfr
|
|
360
|
+
sage: M.character_count() # needs sage.rings.real_mpfr
|
|
418
361
|
{}
|
|
419
362
|
sage: M = BinaryStrings().encoding("")
|
|
420
363
|
sage: M.character_count()
|
|
@@ -479,7 +422,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
479
422
|
|
|
480
423
|
Capital letters of the English alphabet::
|
|
481
424
|
|
|
482
|
-
sage: # needs sage.rings.real_mpfr
|
|
425
|
+
sage: # needs sage.modules sage.rings.real_mpfr
|
|
483
426
|
sage: M = AlphabeticStrings().encoding("abcd")
|
|
484
427
|
sage: L = M.frequency_distribution().function()
|
|
485
428
|
sage: sorted(L.items())
|
|
@@ -491,6 +434,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
491
434
|
|
|
492
435
|
The binary number system::
|
|
493
436
|
|
|
437
|
+
sage: # needs sage.modules
|
|
494
438
|
sage: M = BinaryStrings().encoding("abcd")
|
|
495
439
|
sage: L = M.frequency_distribution().function()
|
|
496
440
|
sage: sorted(L.items())
|
|
@@ -498,6 +442,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
498
442
|
|
|
499
443
|
The hexadecimal number system::
|
|
500
444
|
|
|
445
|
+
sage: # needs sage.modules
|
|
501
446
|
sage: M = HexadecimalStrings().encoding("abcd")
|
|
502
447
|
sage: L = M.frequency_distribution().function()
|
|
503
448
|
sage: sorted(L.items())
|
|
@@ -513,6 +458,7 @@ class StringMonoidElement(FreeMonoidElement):
|
|
|
513
458
|
"BC", and "CD". Now find out the frequency probability of each of
|
|
514
459
|
these digrams as they occur in the string "ABCD"::
|
|
515
460
|
|
|
461
|
+
sage: # needs sage.modules sage.rings.real_mpfr
|
|
516
462
|
sage: M = AlphabeticStrings().encoding("abcd")
|
|
517
463
|
sage: D = M.frequency_distribution(length=2).function()
|
|
518
464
|
sage: sorted(D.items())
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-combinat
|
|
2
2
|
from sage.rings.all__sagemath_categories import *
|
|
3
|
+
|
|
4
|
+
from sage.misc.lazy_import import lazy_import
|
|
5
|
+
|
|
6
|
+
# Lazy combinatorial species
|
|
7
|
+
lazy_import('sage.rings.lazy_species', 'LazyCombinatorialSpecies')
|
|
8
|
+
|
|
9
|
+
del lazy_import
|
sage/sat/solvers/__init__.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# sage_setup: distribution = sagemath-combinat
|
|
2
|
-
from .
|
|
3
|
-
from .
|
|
4
|
-
|
|
5
|
-
from .dimacs import Glucose, GlucoseSyrup, RSat, Kissat
|
|
2
|
+
from sage.sat.solvers.cryptominisat import CryptoMiniSat
|
|
3
|
+
from sage.sat.solvers.dimacs import Glucose, GlucoseSyrup, Kissat, RSat
|
|
4
|
+
from sage.sat.solvers.satsolver import SatSolver
|
|
@@ -20,10 +20,9 @@ AUTHORS:
|
|
|
20
20
|
# the License, or (at your option) any later version.
|
|
21
21
|
# https://www.gnu.org/licenses/
|
|
22
22
|
# ****************************************************************************
|
|
23
|
-
from .satsolver import SatSolver
|
|
24
|
-
|
|
25
|
-
from sage.misc.lazy_import import lazy_import
|
|
26
23
|
from sage.features.sat import Pycryptosat
|
|
24
|
+
from sage.misc.lazy_import import lazy_import
|
|
25
|
+
from sage.sat.solvers.satsolver import SatSolver
|
|
27
26
|
|
|
28
27
|
lazy_import('pycryptosat', ['Solver'], feature=Pycryptosat())
|
|
29
28
|
|
sage/sat/solvers/picosat.py
CHANGED
|
@@ -19,10 +19,9 @@ AUTHORS:
|
|
|
19
19
|
# the License, or (at your option) any later version.
|
|
20
20
|
# https://www.gnu.org/licenses/
|
|
21
21
|
# ****************************************************************************
|
|
22
|
-
from .satsolver import SatSolver
|
|
23
|
-
|
|
24
|
-
from sage.misc.lazy_import import lazy_import
|
|
25
22
|
from sage.features.sat import Pycosat
|
|
23
|
+
from sage.misc.lazy_import import lazy_import
|
|
24
|
+
from sage.sat.solvers.satsolver import SatSolver
|
|
26
25
|
|
|
27
26
|
lazy_import('pycosat', ['solve'], feature=Pycosat())
|
|
28
27
|
|
sage/sat/solvers/sat_lp.py
CHANGED
|
@@ -8,8 +8,8 @@ solves its instance using :class:`MixedIntegerLinearProgram`. Its performance
|
|
|
8
8
|
can be expected to be slower than when using
|
|
9
9
|
:class:`~sage.sat.solvers.cryptominisat.cryptominisat.CryptoMiniSat`.
|
|
10
10
|
"""
|
|
11
|
-
from .
|
|
12
|
-
from sage.
|
|
11
|
+
from sage.numerical.mip import MIPSolverException, MixedIntegerLinearProgram
|
|
12
|
+
from sage.sat.solvers.satsolver import SatSolver
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class SatLP(SatSolver):
|
|
Binary file
|