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
|
@@ -114,7 +114,7 @@ class AffineNilTemperleyLiebTypeA(CombinatorialFreeModule):
|
|
|
114
114
|
"""
|
|
115
115
|
return self.weyl_group().one()
|
|
116
116
|
|
|
117
|
-
def _repr_(self):
|
|
117
|
+
def _repr_(self) -> str:
|
|
118
118
|
"""
|
|
119
119
|
EXAMPLES::
|
|
120
120
|
|
|
@@ -222,7 +222,7 @@ class AffineNilTemperleyLiebTypeA(CombinatorialFreeModule):
|
|
|
222
222
|
|
|
223
223
|
sage: A = AffineNilTemperleyLiebTypeA(5)
|
|
224
224
|
sage: W = A.weyl_group()
|
|
225
|
-
sage: s=W.simple_reflections()
|
|
225
|
+
sage: s = W.simple_reflections()
|
|
226
226
|
sage: A.has_no_braid_relation(s[2]*s[1]*s[0]*s[4]*s[3],0)
|
|
227
227
|
False
|
|
228
228
|
sage: A.has_no_braid_relation(s[2]*s[1]*s[0]*s[4]*s[3],2)
|
|
@@ -243,7 +243,7 @@ class AffineNilTemperleyLiebTypeA(CombinatorialFreeModule):
|
|
|
243
243
|
return j not in wi.descents()
|
|
244
244
|
return self.has_no_braid_relation(w * s[w.first_descent()], i)
|
|
245
245
|
|
|
246
|
-
def _repr_term(self, t, short_display=True):
|
|
246
|
+
def _repr_term(self, t, short_display=True) -> str:
|
|
247
247
|
"""
|
|
248
248
|
EXAMPLES::
|
|
249
249
|
|
sage/algebras/all.py
CHANGED
sage/algebras/askey_wilson.py
CHANGED
|
@@ -312,7 +312,7 @@ class AskeyWilsonAlgebra(CombinatorialFreeModule):
|
|
|
312
312
|
var_names = ['A', 'B', 'C', '\\alpha', '\\beta', '\\gamma']
|
|
313
313
|
return ''.join(exp(l, e) for l, e in zip(var_names, t))
|
|
314
314
|
|
|
315
|
-
def _repr_(self):
|
|
315
|
+
def _repr_(self) -> str:
|
|
316
316
|
r"""
|
|
317
317
|
Return a string representation of ``self``.
|
|
318
318
|
|
|
@@ -197,7 +197,7 @@ class AssociatedGradedAlgebra(CombinatorialFreeModule):
|
|
|
197
197
|
phi = self.module_morphism(diagonal=lambda x: base_one, codomain=A)
|
|
198
198
|
self._A.register_conversion(phi)
|
|
199
199
|
|
|
200
|
-
def _repr_(self):
|
|
200
|
+
def _repr_(self) -> str:
|
|
201
201
|
"""
|
|
202
202
|
Return a string representation of ``self``.
|
|
203
203
|
|
|
@@ -214,7 +214,7 @@ class AssociatedGradedAlgebra(CombinatorialFreeModule):
|
|
|
214
214
|
return "Graded Algebra of {}".format(self._A)
|
|
215
215
|
return "Graded Module of {}".format(self._A)
|
|
216
216
|
|
|
217
|
-
def _latex_(self):
|
|
217
|
+
def _latex_(self) -> str:
|
|
218
218
|
r"""
|
|
219
219
|
Return a latex representation of ``self``.
|
|
220
220
|
|
sage/algebras/cellular_basis.py
CHANGED
|
@@ -109,10 +109,7 @@ REFERENCES:
|
|
|
109
109
|
# https://www.gnu.org/licenses/
|
|
110
110
|
# ****************************************************************************
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
from typing import Self # type: ignore (Python >= 3.11)
|
|
114
|
-
except ImportError:
|
|
115
|
-
from typing_extensions import Self # type: ignore (Python 3.10)
|
|
112
|
+
from typing import Self
|
|
116
113
|
|
|
117
114
|
from sage.categories.algebras import Algebras
|
|
118
115
|
from sage.combinat.free_module import CombinatorialFreeModule
|
|
@@ -211,7 +208,7 @@ class CellularBasis(CombinatorialFreeModule):
|
|
|
211
208
|
to_cellular.register_as_coercion()
|
|
212
209
|
from_cellular.register_as_coercion()
|
|
213
210
|
|
|
214
|
-
def _repr_(self):
|
|
211
|
+
def _repr_(self) -> str:
|
|
215
212
|
r"""
|
|
216
213
|
String representation of ``self``.
|
|
217
214
|
|
|
@@ -223,7 +220,7 @@ class CellularBasis(CombinatorialFreeModule):
|
|
|
223
220
|
"""
|
|
224
221
|
return "Cellular basis of {}".format(self._algebra)
|
|
225
222
|
|
|
226
|
-
def _latex_term(self, x):
|
|
223
|
+
def _latex_term(self, x) -> str:
|
|
227
224
|
r"""
|
|
228
225
|
Return a latex representation of the term indexed by ``x``.
|
|
229
226
|
|
sage/algebras/cluster_algebra.py
CHANGED
|
@@ -1989,8 +1989,7 @@ class ClusterAlgebra(Parent, UniqueRepresentation):
|
|
|
1989
1989
|
msg += "you can compute it by mutating from the initial seed along the sequence "
|
|
1990
1990
|
msg += str(self._path_dict[g_vector])
|
|
1991
1991
|
raise KeyError(msg)
|
|
1992
|
-
|
|
1993
|
-
raise KeyError("the g-vector %s has not been found yet" % str(g_vector))
|
|
1992
|
+
raise KeyError("the g-vector {} has not been found yet".format(g_vector))
|
|
1994
1993
|
|
|
1995
1994
|
def find_g_vector(self, g_vector, depth=infinity):
|
|
1996
1995
|
r"""
|
|
@@ -2630,7 +2629,7 @@ class ClusterAlgebra(Parent, UniqueRepresentation):
|
|
|
2630
2629
|
g_vector = tuple(g_vector)
|
|
2631
2630
|
F = self.theta_basis_F_polynomial(g_vector).subs(self._yhat)
|
|
2632
2631
|
g_mon = prod(self.ambient().gen(i) ** g_vector[i] for i in range(self.rank()))
|
|
2633
|
-
# we only return the
|
|
2632
|
+
# we only return the monomial g_mon times the evaluated F-polynomial because this is how
|
|
2634
2633
|
# theta basis elements behave.
|
|
2635
2634
|
return self.retract(g_mon * F)
|
|
2636
2635
|
|
sage/algebras/down_up_algebra.py
CHANGED
|
@@ -216,7 +216,7 @@ class DownUpAlgebra(CombinatorialFreeModule):
|
|
|
216
216
|
CombinatorialFreeModule.__init__(self, base_ring, indices, category=cat, sorting_reverse=True)
|
|
217
217
|
self._assign_names(['d', 'u'])
|
|
218
218
|
|
|
219
|
-
def _repr_(self):
|
|
219
|
+
def _repr_(self) -> str:
|
|
220
220
|
r"""
|
|
221
221
|
Return a string representation of ``self``.
|
|
222
222
|
|
|
@@ -229,7 +229,7 @@ class DownUpAlgebra(CombinatorialFreeModule):
|
|
|
229
229
|
return "Down-Up algebra with parameters ({}, {}, {}) over {}".format(
|
|
230
230
|
self._alpha, self._beta, self._gamma, self.base_ring())
|
|
231
231
|
|
|
232
|
-
def _latex_(self):
|
|
232
|
+
def _latex_(self) -> str:
|
|
233
233
|
r"""
|
|
234
234
|
Return a latex representation of ``self``.
|
|
235
235
|
|
|
@@ -242,7 +242,7 @@ class DownUpAlgebra(CombinatorialFreeModule):
|
|
|
242
242
|
"""
|
|
243
243
|
return "\\mathcal{DU}(%s,%s,%s)" % (self._alpha, self._beta, self._gamma)
|
|
244
244
|
|
|
245
|
-
def _repr_term(self, m):
|
|
245
|
+
def _repr_term(self, m) -> str:
|
|
246
246
|
r"""
|
|
247
247
|
Return a string representation of the basis element indexed by ``m``.
|
|
248
248
|
|
|
@@ -274,7 +274,7 @@ class DownUpAlgebra(CombinatorialFreeModule):
|
|
|
274
274
|
ret += f"{s}^{m[i]}"
|
|
275
275
|
return ret
|
|
276
276
|
|
|
277
|
-
def _latex_term(self, m):
|
|
277
|
+
def _latex_term(self, m) -> str:
|
|
278
278
|
r"""
|
|
279
279
|
Return a latex representation for the basis element indexed by ``m``.
|
|
280
280
|
|
|
@@ -623,7 +623,7 @@ class VermaModule(CombinatorialFreeModule):
|
|
|
623
623
|
CombinatorialFreeModule.__init__(self, R, NonNegativeIntegers(),
|
|
624
624
|
prefix='v', category=cat)
|
|
625
625
|
|
|
626
|
-
def _repr_(self):
|
|
626
|
+
def _repr_(self) -> str:
|
|
627
627
|
r"""
|
|
628
628
|
Return a string representation of ``self``.
|
|
629
629
|
|
|
@@ -635,7 +635,7 @@ class VermaModule(CombinatorialFreeModule):
|
|
|
635
635
|
"""
|
|
636
636
|
return f"Verma module of weight {self._weights[0]} of {self._DU}"
|
|
637
637
|
|
|
638
|
-
def _latex_(self):
|
|
638
|
+
def _latex_(self) -> str:
|
|
639
639
|
r"""
|
|
640
640
|
Return a latex representation of ``self``.
|
|
641
641
|
|
sage/algebras/free_algebra.py
CHANGED
|
@@ -160,7 +160,6 @@ Some tests for the category::
|
|
|
160
160
|
# https://www.gnu.org/licenses/
|
|
161
161
|
# ***************************************************************************
|
|
162
162
|
|
|
163
|
-
|
|
164
163
|
from sage.algebras.free_algebra_element import FreeAlgebraElement
|
|
165
164
|
from sage.categories.algebras_with_basis import AlgebrasWithBasis
|
|
166
165
|
from sage.categories.functor import Functor
|
|
@@ -377,34 +376,6 @@ class FreeAlgebraFactory(UniqueFactory):
|
|
|
377
376
|
FreeAlgebra = FreeAlgebraFactory('FreeAlgebra')
|
|
378
377
|
|
|
379
378
|
|
|
380
|
-
def is_FreeAlgebra(x) -> bool:
|
|
381
|
-
"""
|
|
382
|
-
Return ``True`` if x is a free algebra; otherwise, return ``False``.
|
|
383
|
-
|
|
384
|
-
EXAMPLES::
|
|
385
|
-
|
|
386
|
-
sage: from sage.algebras.free_algebra import is_FreeAlgebra
|
|
387
|
-
sage: is_FreeAlgebra(5)
|
|
388
|
-
doctest:warning...
|
|
389
|
-
DeprecationWarning: the function is_FreeAlgebra is deprecated;
|
|
390
|
-
use 'isinstance(..., (FreeAlgebra_generic, FreeAlgebra_letterplace))' instead
|
|
391
|
-
See https://github.com/sagemath/sage/issues/37896 for details.
|
|
392
|
-
False
|
|
393
|
-
sage: is_FreeAlgebra(ZZ)
|
|
394
|
-
False
|
|
395
|
-
sage: is_FreeAlgebra(FreeAlgebra(ZZ,100,'x'))
|
|
396
|
-
True
|
|
397
|
-
sage: is_FreeAlgebra(FreeAlgebra(ZZ,10,'x',implementation='letterplace')) # needs sage.libs.singular
|
|
398
|
-
True
|
|
399
|
-
sage: is_FreeAlgebra(FreeAlgebra(ZZ,10,'x',implementation='letterplace', # needs sage.libs.singular
|
|
400
|
-
....: degrees=list(range(1,11))))
|
|
401
|
-
True
|
|
402
|
-
"""
|
|
403
|
-
from sage.misc.superseded import deprecation
|
|
404
|
-
deprecation(37896, "the function is_FreeAlgebra is deprecated; use 'isinstance(..., (FreeAlgebra_generic, FreeAlgebra_letterplace))' instead")
|
|
405
|
-
return isinstance(x, (FreeAlgebra_generic, FreeAlgebra_letterplace))
|
|
406
|
-
|
|
407
|
-
|
|
408
379
|
class FreeAlgebra_generic(CombinatorialFreeModule):
|
|
409
380
|
"""
|
|
410
381
|
The free algebra on `n` generators over a base ring.
|
|
@@ -471,7 +442,7 @@ class FreeAlgebra_generic(CombinatorialFreeModule):
|
|
|
471
442
|
"""
|
|
472
443
|
Element = FreeAlgebraElement
|
|
473
444
|
|
|
474
|
-
def __init__(self, R, n, names, degrees=None):
|
|
445
|
+
def __init__(self, R, n, names, degrees=None) -> None:
|
|
475
446
|
"""
|
|
476
447
|
The free algebra on `n` generators over a base ring.
|
|
477
448
|
|
|
@@ -1246,7 +1217,7 @@ class PBWBasisOfFreeAlgebra(CombinatorialFreeModule):
|
|
|
1246
1217
|
category=category)
|
|
1247
1218
|
self._assign_names(alg.variable_names())
|
|
1248
1219
|
|
|
1249
|
-
def _repr_(self):
|
|
1220
|
+
def _repr_(self) -> str:
|
|
1250
1221
|
"""
|
|
1251
1222
|
Return a string representation of ``self``.
|
|
1252
1223
|
|
|
@@ -1257,7 +1228,7 @@ class PBWBasisOfFreeAlgebra(CombinatorialFreeModule):
|
|
|
1257
1228
|
"""
|
|
1258
1229
|
return "The Poincare-Birkhoff-Witt basis of {}".format(self._alg)
|
|
1259
1230
|
|
|
1260
|
-
def _repr_term(self, w):
|
|
1231
|
+
def _repr_term(self, w) -> str:
|
|
1261
1232
|
"""
|
|
1262
1233
|
Return a representation of term indexed by ``w``.
|
|
1263
1234
|
|
|
@@ -19,8 +19,7 @@ TESTS::
|
|
|
19
19
|
sage: (x*y)^3
|
|
20
20
|
x*y*x*y*x*y
|
|
21
21
|
"""
|
|
22
|
-
|
|
23
|
-
#*****************************************************************************
|
|
22
|
+
# ***************************************************************************
|
|
24
23
|
# Copyright (C) 2005 David Kohel <kohel@maths.usyd.edu>
|
|
25
24
|
#
|
|
26
25
|
# Distributed under the terms of the GNU General Public License (GPL)
|
|
@@ -32,8 +31,8 @@ TESTS::
|
|
|
32
31
|
# See the GNU General Public License for more details; the full text
|
|
33
32
|
# is available at:
|
|
34
33
|
#
|
|
35
|
-
#
|
|
36
|
-
|
|
34
|
+
# https://www.gnu.org/licenses/
|
|
35
|
+
# ***************************************************************************
|
|
37
36
|
|
|
38
37
|
from sage.misc.repr import repr_lincomb
|
|
39
38
|
from sage.monoids.free_monoid_element import FreeMonoidElement
|
|
@@ -57,7 +56,7 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
57
56
|
sage: y * x < x * y
|
|
58
57
|
False
|
|
59
58
|
"""
|
|
60
|
-
def __init__(self, A, x):
|
|
59
|
+
def __init__(self, A, x) -> None:
|
|
61
60
|
"""
|
|
62
61
|
Create the element ``x`` of the FreeAlgebra ``A``.
|
|
63
62
|
|
|
@@ -69,7 +68,7 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
69
68
|
"""
|
|
70
69
|
if isinstance(x, FreeAlgebraElement):
|
|
71
70
|
# We should have an input for when we know we don't need to
|
|
72
|
-
#
|
|
71
|
+
# convert the keys/values
|
|
73
72
|
x = x._monomial_coefficients
|
|
74
73
|
R = A.base_ring()
|
|
75
74
|
if isinstance(x, AlgebraElement): # and x.parent() == A.base_ring():
|
|
@@ -83,7 +82,7 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
83
82
|
|
|
84
83
|
IndexedFreeModuleElement.__init__(self, A, x)
|
|
85
84
|
|
|
86
|
-
def _repr_(self):
|
|
85
|
+
def _repr_(self) -> str:
|
|
87
86
|
"""
|
|
88
87
|
Return string representation of ``self``.
|
|
89
88
|
|
|
@@ -105,10 +104,9 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
105
104
|
M = P.monoid()
|
|
106
105
|
from sage.structure.parent_gens import localvars
|
|
107
106
|
with localvars(M, P.variable_names(), normalize=False):
|
|
108
|
-
|
|
109
|
-
return x
|
|
107
|
+
return repr_lincomb(v, strip_one=True)
|
|
110
108
|
|
|
111
|
-
def _latex_(self):
|
|
109
|
+
def _latex_(self) -> str:
|
|
112
110
|
r"""
|
|
113
111
|
Return latex representation of ``self``.
|
|
114
112
|
|
|
@@ -133,7 +131,7 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
133
131
|
7
|
|
134
132
|
sage: (2*x+y).subs({x:1,y:z})
|
|
135
133
|
2 + z
|
|
136
|
-
sage: f=x+3*y+z
|
|
134
|
+
sage: f = x+3*y+z
|
|
137
135
|
sage: f(1,2,1/2)
|
|
138
136
|
15/2
|
|
139
137
|
sage: f(1,2)
|
|
@@ -159,7 +157,8 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
159
157
|
pass
|
|
160
158
|
return None
|
|
161
159
|
|
|
162
|
-
x = [extract_from(kwds,(p.gen(i),p.variable_name(i)))
|
|
160
|
+
x = [extract_from(kwds, (p.gen(i), p.variable_name(i)))
|
|
161
|
+
for i in range(p.ngens())]
|
|
163
162
|
elif isinstance(x[0], tuple):
|
|
164
163
|
x = x[0]
|
|
165
164
|
|
|
@@ -171,9 +170,9 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
171
170
|
result = None
|
|
172
171
|
for m, c in self._monomial_coefficients.items():
|
|
173
172
|
if result is None:
|
|
174
|
-
result = c*m(x)
|
|
173
|
+
result = c * m(x)
|
|
175
174
|
else:
|
|
176
|
-
result += c*m(x)
|
|
175
|
+
result += c * m(x)
|
|
177
176
|
|
|
178
177
|
if result is None:
|
|
179
178
|
return self.parent().zero()
|
|
@@ -181,8 +180,9 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
181
180
|
|
|
182
181
|
def _mul_(self, y):
|
|
183
182
|
"""
|
|
184
|
-
Return the product of ``self`` and ``y
|
|
185
|
-
|
|
183
|
+
Return the product of ``self`` and ``y``.
|
|
184
|
+
|
|
185
|
+
This is another free algebra element with the same parent.
|
|
186
186
|
|
|
187
187
|
EXAMPLES::
|
|
188
188
|
|
|
@@ -194,16 +194,16 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
194
194
|
z_elt = {}
|
|
195
195
|
for mx, cx in self:
|
|
196
196
|
for my, cy in y:
|
|
197
|
-
key = mx*my
|
|
197
|
+
key = mx * my
|
|
198
198
|
if key in z_elt:
|
|
199
|
-
z_elt[key] += cx*cy
|
|
199
|
+
z_elt[key] += cx * cy
|
|
200
200
|
else:
|
|
201
|
-
z_elt[key] = cx*cy
|
|
201
|
+
z_elt[key] = cx * cy
|
|
202
202
|
if not z_elt[key]:
|
|
203
203
|
del z_elt[key]
|
|
204
204
|
return A._from_dict(z_elt)
|
|
205
205
|
|
|
206
|
-
def is_unit(self):
|
|
206
|
+
def is_unit(self) -> bool:
|
|
207
207
|
r"""
|
|
208
208
|
Return ``True`` if ``self`` is invertible.
|
|
209
209
|
|
|
@@ -276,10 +276,6 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
276
276
|
return scalar * Factorization([(self, 1)])
|
|
277
277
|
return super()._acted_upon_(scalar, self_on_left)
|
|
278
278
|
|
|
279
|
-
# For backward compatibility
|
|
280
|
-
# _lmul_ = _acted_upon_
|
|
281
|
-
# _rmul_ = _acted_upon_
|
|
282
|
-
|
|
283
279
|
def _im_gens_(self, codomain, im_gens, base_map):
|
|
284
280
|
"""
|
|
285
281
|
Apply a morphism defined by its values on the generators.
|
|
@@ -306,7 +302,7 @@ class FreeAlgebraElement(IndexedFreeModuleElement, AlgebraElement):
|
|
|
306
302
|
return codomain.sum(base_map(c) * m(*im_gens)
|
|
307
303
|
for m, c in self._monomial_coefficients.items())
|
|
308
304
|
|
|
309
|
-
def variables(self):
|
|
305
|
+
def variables(self) -> list:
|
|
310
306
|
"""
|
|
311
307
|
Return the variables used in ``self``.
|
|
312
308
|
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
Free algebra quotient elements
|
|
5
5
|
|
|
6
6
|
AUTHORS:
|
|
7
|
-
- William Stein (2011-11-19): improved doctest coverage to 100%
|
|
8
|
-
- David Kohel (2005-09): initial version
|
|
9
|
-
"""
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
- William Stein (2011-11-19): improved doctest coverage to 100%
|
|
9
|
+
- David Kohel (2005-09): initial version
|
|
10
|
+
"""
|
|
11
|
+
# ***************************************************************************
|
|
12
12
|
# Copyright (C) 2005 David Kohel <kohel@maths.usyd.edu>
|
|
13
13
|
#
|
|
14
14
|
# Distributed under the terms of the GNU General Public License (GPL)
|
|
@@ -20,9 +20,8 @@ AUTHORS:
|
|
|
20
20
|
# See the GNU General Public License for more details; the full text
|
|
21
21
|
# is available at:
|
|
22
22
|
#
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
# https://www.gnu.org/licenses/
|
|
24
|
+
# ***************************************************************************
|
|
26
25
|
from sage.misc.repr import repr_lincomb
|
|
27
26
|
from sage.structure.element import RingElement, AlgebraElement
|
|
28
27
|
from sage.structure.parent_gens import localvars
|
|
@@ -33,36 +32,8 @@ from sage.monoids.free_monoid_element import FreeMonoidElement
|
|
|
33
32
|
from sage.algebras.free_algebra_element import FreeAlgebraElement
|
|
34
33
|
|
|
35
34
|
|
|
36
|
-
def is_FreeAlgebraQuotientElement(x):
|
|
37
|
-
"""
|
|
38
|
-
EXAMPLES::
|
|
39
|
-
|
|
40
|
-
sage: from sage.algebras.free_algebra_quotient import hamilton_quatalg
|
|
41
|
-
sage: from sage.algebras.free_algebra_quotient_element import is_FreeAlgebraQuotientElement
|
|
42
|
-
sage: H, (i,j,k) = hamilton_quatalg(QQ)
|
|
43
|
-
sage: is_FreeAlgebraQuotientElement(i)
|
|
44
|
-
doctest:warning...
|
|
45
|
-
DeprecationWarning: The function is_FreeAlgebraQuotientElement is deprecated;
|
|
46
|
-
use 'isinstance(..., FreeAlgebraQuotientElement)' instead.
|
|
47
|
-
See https://github.com/sagemath/sage/issues/38184 for details.
|
|
48
|
-
True
|
|
49
|
-
|
|
50
|
-
Of course this is testing the data type::
|
|
51
|
-
|
|
52
|
-
sage: is_FreeAlgebraQuotientElement(1)
|
|
53
|
-
False
|
|
54
|
-
sage: is_FreeAlgebraQuotientElement(H(1))
|
|
55
|
-
True
|
|
56
|
-
"""
|
|
57
|
-
from sage.misc.superseded import deprecation
|
|
58
|
-
deprecation(38184,
|
|
59
|
-
"The function is_FreeAlgebraQuotientElement is deprecated; "
|
|
60
|
-
"use 'isinstance(..., FreeAlgebraQuotientElement)' instead.")
|
|
61
|
-
return isinstance(x, FreeAlgebraQuotientElement)
|
|
62
|
-
|
|
63
|
-
|
|
64
35
|
class FreeAlgebraQuotientElement(AlgebraElement):
|
|
65
|
-
def __init__(self, A, x):
|
|
36
|
+
def __init__(self, A, x) -> None:
|
|
66
37
|
"""
|
|
67
38
|
Create the element x of the FreeAlgebraQuotient A.
|
|
68
39
|
|
|
@@ -130,7 +101,7 @@ class FreeAlgebraQuotientElement(AlgebraElement):
|
|
|
130
101
|
else:
|
|
131
102
|
raise TypeError("argument x (= %s) is of the wrong type" % x)
|
|
132
103
|
|
|
133
|
-
def _repr_(self):
|
|
104
|
+
def _repr_(self) -> str:
|
|
134
105
|
"""
|
|
135
106
|
EXAMPLES::
|
|
136
107
|
|
|
@@ -145,7 +116,7 @@ class FreeAlgebraQuotientElement(AlgebraElement):
|
|
|
145
116
|
mons = Q.monomial_basis()
|
|
146
117
|
return repr_lincomb(zip(mons, cffs), strip_one=True)
|
|
147
118
|
|
|
148
|
-
def _latex_(self):
|
|
119
|
+
def _latex_(self) -> str:
|
|
149
120
|
r"""
|
|
150
121
|
EXAMPLES::
|
|
151
122
|
|
|
@@ -260,7 +260,7 @@ class FreeZinbielAlgebra(CombinatorialFreeModule):
|
|
|
260
260
|
if self._n is not None:
|
|
261
261
|
self._assign_names(names)
|
|
262
262
|
|
|
263
|
-
def _repr_term(self, t):
|
|
263
|
+
def _repr_term(self, t) -> str:
|
|
264
264
|
"""
|
|
265
265
|
Return a string representation of the basis element indexed by ``t``.
|
|
266
266
|
|
|
@@ -272,7 +272,7 @@ class FreeZinbielAlgebra(CombinatorialFreeModule):
|
|
|
272
272
|
"""
|
|
273
273
|
return "{!s}[{!s}]".format(self._print_options['prefix'], repr(t)[6:])
|
|
274
274
|
|
|
275
|
-
def _repr_(self):
|
|
275
|
+
def _repr_(self) -> str:
|
|
276
276
|
"""
|
|
277
277
|
Return a string representation of ``self``.
|
|
278
278
|
|
|
@@ -672,7 +672,8 @@ class ZinbielFunctor(ConstructionFunctor):
|
|
|
672
672
|
Functor.__init__(self, Rings(), Magmas())
|
|
673
673
|
self.vars = variables
|
|
674
674
|
self._side = side
|
|
675
|
-
self._finite_vars =
|
|
675
|
+
self._finite_vars = (isinstance(variables, (list, tuple))
|
|
676
|
+
or variables in Sets().Finite())
|
|
676
677
|
|
|
677
678
|
def _apply_functor(self, R):
|
|
678
679
|
"""
|
sage/algebras/hall_algebra.py
CHANGED
|
@@ -256,7 +256,7 @@ class HallAlgebra(CombinatorialFreeModule):
|
|
|
256
256
|
M.register_as_coercion()
|
|
257
257
|
(~M).register_as_coercion()
|
|
258
258
|
|
|
259
|
-
def _repr_(self):
|
|
259
|
+
def _repr_(self) -> str:
|
|
260
260
|
"""
|
|
261
261
|
Return a string representation of ``self``.
|
|
262
262
|
|
|
@@ -624,7 +624,7 @@ class HallAlgebraMonomials(CombinatorialFreeModule):
|
|
|
624
624
|
H = HallAlgebra(self.base_ring(), self._q)
|
|
625
625
|
return reduce(lambda cur,r: cur * H.monomial(Partition([1]*r)), a, H.one())
|
|
626
626
|
|
|
627
|
-
def _repr_(self):
|
|
627
|
+
def _repr_(self) -> str:
|
|
628
628
|
"""
|
|
629
629
|
Return a string representation of ``self``.
|
|
630
630
|
|
|
@@ -349,7 +349,7 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
|
|
|
349
349
|
T.module_morphism(LT._from_T_basis, codomain=LT).register_as_coercion()
|
|
350
350
|
LT.module_morphism(T._from_LT_basis, codomain=T).register_as_coercion()
|
|
351
351
|
|
|
352
|
-
def _repr_(self):
|
|
352
|
+
def _repr_(self) -> str:
|
|
353
353
|
r"""
|
|
354
354
|
Return a string representation of ``self``.
|
|
355
355
|
|
|
@@ -365,7 +365,7 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
|
|
|
365
365
|
return "Ariki-Koike algebra of rank {} and order {} with q={} and u={} over {}".format(
|
|
366
366
|
self._r, self._n, self._q, self._u, self.base_ring())
|
|
367
367
|
|
|
368
|
-
def _latex_(self):
|
|
368
|
+
def _latex_(self) -> str:
|
|
369
369
|
r"""
|
|
370
370
|
Return a latex representation of ``self``.
|
|
371
371
|
|
|
@@ -469,7 +469,7 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
|
|
|
469
469
|
"""
|
|
470
470
|
return [Realizations(self.base()), self.base()._category]
|
|
471
471
|
|
|
472
|
-
def _repr_(self):
|
|
472
|
+
def _repr_(self) -> str:
|
|
473
473
|
r"""
|
|
474
474
|
Return the representation of ``self``.
|
|
475
475
|
|
|
@@ -488,7 +488,7 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
|
|
|
488
488
|
cases, these are just default implementations that will get
|
|
489
489
|
specialized in a basis.
|
|
490
490
|
"""
|
|
491
|
-
def _repr_(self):
|
|
491
|
+
def _repr_(self) -> str:
|
|
492
492
|
r"""
|
|
493
493
|
Text representation of this basis of Iwahori-Hecke algebra.
|
|
494
494
|
|
|
@@ -633,7 +633,7 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
|
|
|
633
633
|
_Basis.__init__(self, algebra, prefix='LT')
|
|
634
634
|
self._assign_names(self.algebra_generators().keys())
|
|
635
635
|
|
|
636
|
-
def _repr_term(self, m):
|
|
636
|
+
def _repr_term(self, m) -> str:
|
|
637
637
|
r"""
|
|
638
638
|
Return a string representation of the basis element indexed by ``m``.
|
|
639
639
|
|
|
@@ -656,7 +656,7 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
|
|
|
656
656
|
return rhs
|
|
657
657
|
return lhs + '*' + rhs
|
|
658
658
|
|
|
659
|
-
def _latex_term(self, m):
|
|
659
|
+
def _latex_term(self, m) -> str:
|
|
660
660
|
r"""
|
|
661
661
|
Return a latex representation for the basis element indexed by ``m``.
|
|
662
662
|
|
|
@@ -1231,7 +1231,7 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
|
|
|
1231
1231
|
redword.extend(t[1].reduced_word())
|
|
1232
1232
|
return redword
|
|
1233
1233
|
|
|
1234
|
-
def _repr_term(self, t):
|
|
1234
|
+
def _repr_term(self, t) -> str:
|
|
1235
1235
|
r"""
|
|
1236
1236
|
Return a string representation of the basis element indexed by ``m``.
|
|
1237
1237
|
|
|
@@ -1247,7 +1247,7 @@ class ArikiKoikeAlgebra(Parent, UniqueRepresentation):
|
|
|
1247
1247
|
return (self._print_options['prefix']
|
|
1248
1248
|
+ '[%s]' % ','.join('%d' % i for i in redword))
|
|
1249
1249
|
|
|
1250
|
-
def _latex_term(self, t):
|
|
1250
|
+
def _latex_term(self, t) -> str:
|
|
1251
1251
|
r"""
|
|
1252
1252
|
Return a latex representation for the basis element indexed by ``m``.
|
|
1253
1253
|
|
|
@@ -149,7 +149,7 @@ class SpechtModule(CombinatorialFreeModule):
|
|
|
149
149
|
cat = Modules(R).FiniteDimensional().WithBasis()
|
|
150
150
|
CombinatorialFreeModule.__init__(self, R, indices, category=cat, prefix='S')
|
|
151
151
|
|
|
152
|
-
def _repr_(self):
|
|
152
|
+
def _repr_(self) -> str:
|
|
153
153
|
r"""
|
|
154
154
|
Return a string representation of ``self``.
|
|
155
155
|
|
|
@@ -163,7 +163,7 @@ class SpechtModule(CombinatorialFreeModule):
|
|
|
163
163
|
"""
|
|
164
164
|
return "Specht module of shape {} for {}".format(self._shape, self._AK)
|
|
165
165
|
|
|
166
|
-
def _latex_(self):
|
|
166
|
+
def _latex_(self) -> str:
|
|
167
167
|
r"""
|
|
168
168
|
Return a latex representation of ``self``.
|
|
169
169
|
|