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
|
@@ -358,7 +358,7 @@ class AbstractPartitionDiagram(AbstractSetPartition):
|
|
|
358
358
|
sage: pd2 = da.AbstractPartitionDiagram(pd, [[[1,2],[-1,-2]]]) # indirect doctest
|
|
359
359
|
Traceback (most recent call last):
|
|
360
360
|
...
|
|
361
|
-
TypeError: unhashable type: 'list'
|
|
361
|
+
TypeError: ...unhashable type: 'list'...
|
|
362
362
|
"""
|
|
363
363
|
if self._base_diagram:
|
|
364
364
|
tst = frozenset(e for B in self._base_diagram for e in B)
|
|
@@ -502,7 +502,7 @@ class AbstractPartitionDiagram(AbstractSetPartition):
|
|
|
502
502
|
sage: pd([[1,2],[-1,-2]]).compose(pd([[1,2],[-1,-2]]))
|
|
503
503
|
({{-2, -1}, {1, 2}}, 1)
|
|
504
504
|
"""
|
|
505
|
-
|
|
505
|
+
composite_diagram, loops_removed = set_partition_composition(self._base_diagram, other._base_diagram)
|
|
506
506
|
return (self.__class__(self.parent(), composite_diagram, check=check), loops_removed)
|
|
507
507
|
|
|
508
508
|
def propagating_number(self):
|
|
@@ -566,7 +566,7 @@ class AbstractPartitionDiagram(AbstractSetPartition):
|
|
|
566
566
|
"""
|
|
567
567
|
return self.parent().order
|
|
568
568
|
|
|
569
|
-
def is_planar(self):
|
|
569
|
+
def is_planar(self) -> bool:
|
|
570
570
|
r"""
|
|
571
571
|
Test if the diagram ``self`` is planar.
|
|
572
572
|
|
|
@@ -999,7 +999,7 @@ class BrauerDiagram(AbstractPartitionDiagram):
|
|
|
999
999
|
sage: bd([[1,4],[6,7], [-2,-6],[-5,-7], [2,-4],[3,-1],[5,-3]])._repr_compact()
|
|
1000
1000
|
'[14.67/26.57;312]'
|
|
1001
1001
|
"""
|
|
1002
|
-
|
|
1002
|
+
top, bot, thru = self.involution_permutation_triple()
|
|
1003
1003
|
bot.reverse()
|
|
1004
1004
|
s1 = ".".join("".join(str(b) for b in block) for block in top)
|
|
1005
1005
|
s2 = ".".join("".join(str(abs(k)) for k in sorted(block, reverse=True))
|
|
@@ -1109,7 +1109,7 @@ class BrauerDiagram(AbstractPartitionDiagram):
|
|
|
1109
1109
|
std[short_form.index(i)] = j
|
|
1110
1110
|
return std
|
|
1111
1111
|
|
|
1112
|
-
def is_elementary_symmetric(self):
|
|
1112
|
+
def is_elementary_symmetric(self) -> bool:
|
|
1113
1113
|
r"""
|
|
1114
1114
|
Check if is elementary symmetric.
|
|
1115
1115
|
|
|
@@ -1128,10 +1128,10 @@ class BrauerDiagram(AbstractPartitionDiagram):
|
|
|
1128
1128
|
sage: elm2.is_elementary_symmetric()
|
|
1129
1129
|
False
|
|
1130
1130
|
"""
|
|
1131
|
-
|
|
1131
|
+
D1, D2, pi = self.involution_permutation_triple()
|
|
1132
1132
|
D1 = sorted(sorted(abs(y) for y in x) for x in D1)
|
|
1133
1133
|
D2 = sorted(sorted(abs(y) for y in x) for x in D2)
|
|
1134
|
-
return D1 == D2 and pi == list(range(1,len(pi)+1))
|
|
1134
|
+
return D1 == D2 and pi == list(range(1, len(pi) + 1))
|
|
1135
1135
|
|
|
1136
1136
|
|
|
1137
1137
|
class AbstractPartitionDiagrams(Parent, UniqueRepresentation):
|
|
@@ -1329,9 +1329,8 @@ class AbstractPartitionDiagrams(Parent, UniqueRepresentation):
|
|
|
1329
1329
|
return False
|
|
1330
1330
|
if obj.base_diagram():
|
|
1331
1331
|
tst = sorted(flatten(obj.base_diagram()))
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
return True
|
|
1332
|
+
ell = len(tst)
|
|
1333
|
+
return not ell % 2 and tst == list(range(-ell // 2, 0)) + list(range(1, ell // 2 + 1))
|
|
1335
1334
|
return self.order == 0
|
|
1336
1335
|
|
|
1337
1336
|
def _element_constructor_(self, d):
|
|
@@ -1617,7 +1616,7 @@ class BrauerDiagrams(AbstractPartitionDiagrams):
|
|
|
1617
1616
|
raise NotImplementedError("only implemented for integer order,"
|
|
1618
1617
|
" not for order %s" % (self.order))
|
|
1619
1618
|
try:
|
|
1620
|
-
|
|
1619
|
+
D1, D2, pi = tuple(D1_D2_pi)
|
|
1621
1620
|
except ValueError:
|
|
1622
1621
|
raise ValueError("argument %s not in correct form; must be a tuple (D1, D2, pi)" % D1_D2_pi)
|
|
1623
1622
|
D1 = [[abs(x) for x in b] for b in D1 if len(b) == 2] # not needed if argument correctly passed at outset.
|
|
@@ -2205,7 +2204,7 @@ class DiagramBasis(DiagramAlgebra):
|
|
|
2205
2204
|
d1 = self._indices(d1)
|
|
2206
2205
|
if not self._indices.is_parent_of(d2):
|
|
2207
2206
|
d2 = self._indices(d2)
|
|
2208
|
-
|
|
2207
|
+
composite_diagram, loops_removed = d1.compose(d2, check=False)
|
|
2209
2208
|
return self.term(composite_diagram, self._q**loops_removed)
|
|
2210
2209
|
|
|
2211
2210
|
|
|
@@ -4493,7 +4492,6 @@ class TemperleyLiebAlgebra(SubPartitionAlgebra, UnitDiagramMixin):
|
|
|
4493
4492
|
o o o o o o o o o o o o
|
|
4494
4493
|
"""
|
|
4495
4494
|
M = x.monomial_coefficients(copy=False)
|
|
4496
|
-
I = self._indices
|
|
4497
4495
|
return self._from_dict({d.dual(): c for d, c in M.items()},
|
|
4498
4496
|
remove_zeros=False)
|
|
4499
4497
|
|
|
@@ -5578,7 +5576,7 @@ class PottsRepresentation(CombinatorialFreeModule):
|
|
|
5578
5576
|
#########################################################################
|
|
5579
5577
|
|
|
5580
5578
|
|
|
5581
|
-
def is_planar(sp):
|
|
5579
|
+
def is_planar(sp) -> bool:
|
|
5582
5580
|
r"""
|
|
5583
5581
|
Return ``True`` if the diagram corresponding to the set partition ``sp``
|
|
5584
5582
|
is planar; otherwise, return ``False``.
|
sage/combinat/dyck_word.py
CHANGED
|
@@ -78,7 +78,6 @@ REFERENCES:
|
|
|
78
78
|
# https://www.gnu.org/licenses/
|
|
79
79
|
# ****************************************************************************
|
|
80
80
|
from __future__ import annotations
|
|
81
|
-
from collections.abc import Iterator
|
|
82
81
|
|
|
83
82
|
from .combinat import CombinatorialElement, catalan_number
|
|
84
83
|
from sage.combinat.combinatorial_map import combinatorial_map
|
|
@@ -98,6 +97,10 @@ from sage.combinat.words.word import Word
|
|
|
98
97
|
from sage.combinat.set_partition import SetPartitions
|
|
99
98
|
from sage.misc.latex import latex
|
|
100
99
|
from sage.misc.lazy_import import lazy_import
|
|
100
|
+
from typing import TYPE_CHECKING
|
|
101
|
+
|
|
102
|
+
if TYPE_CHECKING:
|
|
103
|
+
from collections.abc import Iterator
|
|
101
104
|
|
|
102
105
|
lazy_import('sage.combinat.alternating_sign_matrix', 'AlternatingSignMatrices')
|
|
103
106
|
|
|
@@ -927,11 +930,10 @@ class DyckWord(CombinatorialElement):
|
|
|
927
930
|
horizontal = "<line x1=\"{}\" y1=\"{}\" x2=\"{}\" y2=\"{}\"/>"
|
|
928
931
|
hori_lines = []
|
|
929
932
|
path = ['<polyline points=\"0,0']
|
|
930
|
-
|
|
933
|
+
y = 0
|
|
931
934
|
max_y = 0
|
|
932
935
|
last_seen_level = [0]
|
|
933
|
-
for e in self:
|
|
934
|
-
x += 1
|
|
936
|
+
for x, e in enumerate(self, start=1):
|
|
935
937
|
if e == open_symbol:
|
|
936
938
|
y += 1
|
|
937
939
|
last_seen_level.append(x - 1)
|
|
@@ -2060,7 +2062,7 @@ class DyckWord_complete(DyckWord):
|
|
|
2060
2062
|
EXAMPLES::
|
|
2061
2063
|
|
|
2062
2064
|
sage: R = QQ['q','t'].fraction_field()
|
|
2063
|
-
sage:
|
|
2065
|
+
sage: q, t = R.gens()
|
|
2064
2066
|
sage: f = sum(t**D.area() * D.characteristic_symmetric_function() # needs sage.modules
|
|
2065
2067
|
....: for D in DyckWords(3)); f
|
|
2066
2068
|
(q^3+q^2*t+q*t^2+t^3+q*t)*s[1, 1, 1] + (q^2+q*t+t^2+q+t)*s[2, 1] + s[3]
|
|
@@ -2697,7 +2699,7 @@ class DyckWord_complete(DyckWord):
|
|
|
2697
2699
|
bseq[bpeak[-i - 1]] - bseq[bpeak[-i - 1] + 1] + 1)
|
|
2698
2700
|
return out
|
|
2699
2701
|
|
|
2700
|
-
def tunnels(self):
|
|
2702
|
+
def tunnels(self) -> Iterator[tuple[int, int]]:
|
|
2701
2703
|
r"""
|
|
2702
2704
|
Return an iterator of ranges of the matching parentheses in the Dyck
|
|
2703
2705
|
word ``self``.
|
|
@@ -2747,15 +2749,14 @@ class DyckWord_complete(DyckWord):
|
|
|
2747
2749
|
n = len(self)
|
|
2748
2750
|
tunnels = self.tunnels()
|
|
2749
2751
|
if tunnel_type == 'left':
|
|
2750
|
-
return len([1 for
|
|
2751
|
-
|
|
2752
|
-
return len([1 for
|
|
2753
|
-
|
|
2754
|
-
return len([1 for
|
|
2755
|
-
|
|
2752
|
+
return len([1 for i, j in tunnels if i + j < n])
|
|
2753
|
+
if tunnel_type == 'centered':
|
|
2754
|
+
return len([1 for i, j in tunnels if i + j == n])
|
|
2755
|
+
if tunnel_type == 'right':
|
|
2756
|
+
return len([1 for i, j in tunnels if i + j > n])
|
|
2757
|
+
if tunnel_type == 'all':
|
|
2756
2758
|
return len(list(tunnels))
|
|
2757
|
-
|
|
2758
|
-
raise ValueError("the given tunnel_type is not valid")
|
|
2759
|
+
raise ValueError("the given tunnel_type is not valid")
|
|
2759
2760
|
|
|
2760
2761
|
@combinatorial_map(order=2, name="Reverse path")
|
|
2761
2762
|
def reverse(self) -> DyckWord:
|
sage/combinat/e_one_star.py
CHANGED
|
Binary file
|
|
Binary file
|
sage/combinat/fqsym.py
CHANGED
|
@@ -364,8 +364,14 @@ class FreeQuasisymmetricFunctions(UniqueRepresentation, Parent):
|
|
|
364
364
|
|
|
365
365
|
sage: F = algebras.FQSym(QQ)
|
|
366
366
|
sage: TestSuite(F).run() # long time (3s)
|
|
367
|
+
|
|
368
|
+
sage: F = algebras.FQSym(ZZ).F()
|
|
369
|
+
sage: F.is_commutative()
|
|
370
|
+
False
|
|
367
371
|
"""
|
|
368
372
|
category = HopfAlgebras(R).Graded().Connected()
|
|
373
|
+
if R.is_zero():
|
|
374
|
+
category = category.Commutative()
|
|
369
375
|
Parent.__init__(self, base=R, category=category.WithRealizations())
|
|
370
376
|
|
|
371
377
|
# Bases
|
|
@@ -401,7 +407,7 @@ class FreeQuasisymmetricFunctions(UniqueRepresentation, Parent):
|
|
|
401
407
|
"""
|
|
402
408
|
return self.F()
|
|
403
409
|
|
|
404
|
-
_shorthands =
|
|
410
|
+
_shorthands = ('F', 'G', 'M')
|
|
405
411
|
|
|
406
412
|
class F(FQSymBasis_abstract):
|
|
407
413
|
r"""
|
|
@@ -689,7 +695,7 @@ class FreeQuasisymmetricFunctions(UniqueRepresentation, Parent):
|
|
|
689
695
|
raise ValueError("n must be at least the maximal degree")
|
|
690
696
|
|
|
691
697
|
SGA = SymmetricGroupAlgebra(self.base_ring(), n)
|
|
692
|
-
return SGA._from_dict({Permutations(n)(key): c for
|
|
698
|
+
return SGA._from_dict({Permutations(n)(key): c for key, c in self})
|
|
693
699
|
|
|
694
700
|
class G(FQSymBasis_abstract):
|
|
695
701
|
r"""
|
|
@@ -1219,7 +1225,7 @@ class FreeQuasisymmetricFunctions(UniqueRepresentation, Parent):
|
|
|
1219
1225
|
# See the FQSymBases.ElementMethods.star_involution doc
|
|
1220
1226
|
# for the formula we're using here.
|
|
1221
1227
|
M = self.parent()
|
|
1222
|
-
return M._from_dict({w.complement().reverse(): c for
|
|
1228
|
+
return M._from_dict({w.complement().reverse(): c for w, c in self},
|
|
1223
1229
|
remove_zeros=False)
|
|
1224
1230
|
|
|
1225
1231
|
|
|
@@ -1351,18 +1357,6 @@ class FQSymBases(Category_realization_of_parent):
|
|
|
1351
1357
|
"""
|
|
1352
1358
|
return False
|
|
1353
1359
|
|
|
1354
|
-
def is_commutative(self):
|
|
1355
|
-
"""
|
|
1356
|
-
Return whether this `FQSym` is commutative.
|
|
1357
|
-
|
|
1358
|
-
EXAMPLES::
|
|
1359
|
-
|
|
1360
|
-
sage: F = algebras.FQSym(ZZ).F()
|
|
1361
|
-
sage: F.is_commutative()
|
|
1362
|
-
False
|
|
1363
|
-
"""
|
|
1364
|
-
return self.base_ring().is_zero()
|
|
1365
|
-
|
|
1366
1360
|
def some_elements(self):
|
|
1367
1361
|
"""
|
|
1368
1362
|
Return some elements of the free quasi-symmetric functions.
|
|
@@ -1523,7 +1517,7 @@ class FQSymBases(Category_realization_of_parent):
|
|
|
1523
1517
|
sage: A.from_symmetric_group_algebra(SGA4.zero())
|
|
1524
1518
|
0
|
|
1525
1519
|
"""
|
|
1526
|
-
return self._from_dict({Permutation(key): c for
|
|
1520
|
+
return self._from_dict({Permutation(key): c for key, c in x})
|
|
1527
1521
|
|
|
1528
1522
|
class ElementMethods:
|
|
1529
1523
|
def omega_involution(self):
|
|
@@ -1634,7 +1628,7 @@ class FQSymBases(Category_realization_of_parent):
|
|
|
1634
1628
|
# componentwise, then convert back.
|
|
1635
1629
|
parent = self.parent()
|
|
1636
1630
|
F = parent.realization_of().F()
|
|
1637
|
-
dct = {I.reverse(): coeff for
|
|
1631
|
+
dct = {I.reverse(): coeff for I, coeff in F(self)}
|
|
1638
1632
|
return parent(F._from_dict(dct, remove_zeros=False))
|
|
1639
1633
|
|
|
1640
1634
|
def psi_involution(self):
|
|
@@ -1736,7 +1730,7 @@ class FQSymBases(Category_realization_of_parent):
|
|
|
1736
1730
|
# componentwise, then convert back.
|
|
1737
1731
|
parent = self.parent()
|
|
1738
1732
|
F = parent.realization_of().F()
|
|
1739
|
-
dct = {I.complement(): coeff for
|
|
1733
|
+
dct = {I.complement(): coeff for I, coeff in F(self)}
|
|
1740
1734
|
return parent(F._from_dict(dct, remove_zeros=False))
|
|
1741
1735
|
|
|
1742
1736
|
def star_involution(self):
|
|
@@ -1856,7 +1850,7 @@ class FQSymBases(Category_realization_of_parent):
|
|
|
1856
1850
|
# complement componentwise, then convert back.
|
|
1857
1851
|
parent = self.parent()
|
|
1858
1852
|
F = parent.realization_of().F()
|
|
1859
|
-
dct = {I.complement().reverse(): coeff for
|
|
1853
|
+
dct = {I.complement().reverse(): coeff for I, coeff in F(self)}
|
|
1860
1854
|
return parent(F._from_dict(dct, remove_zeros=False))
|
|
1861
1855
|
|
|
1862
1856
|
def to_symmetric_group_algebra(self, n=None):
|
|
@@ -314,7 +314,7 @@ class FreeDendriformAlgebra(CombinatorialFreeModule):
|
|
|
314
314
|
sage: A.degree_on_basis(u.over(u))
|
|
315
315
|
2
|
|
316
316
|
"""
|
|
317
|
-
return t.
|
|
317
|
+
return t.number_of_nodes()
|
|
318
318
|
|
|
319
319
|
def _an_element_(self):
|
|
320
320
|
"""
|
|
@@ -628,7 +628,7 @@ class FreeDendriformAlgebra(CombinatorialFreeModule):
|
|
|
628
628
|
"""
|
|
629
629
|
B = self.basis()
|
|
630
630
|
Trees = B.keys()
|
|
631
|
-
if not x.
|
|
631
|
+
if not x.number_of_nodes():
|
|
632
632
|
return self.one().tensor(self.one())
|
|
633
633
|
L, R = list(x)
|
|
634
634
|
try:
|
|
@@ -374,7 +374,7 @@ class FreePreLieAlgebra(CombinatorialFreeModule):
|
|
|
374
374
|
sage: A.degree_on_basis(RT([RT([])]))
|
|
375
375
|
2
|
|
376
376
|
"""
|
|
377
|
-
return t.
|
|
377
|
+
return t.number_of_nodes()
|
|
378
378
|
|
|
379
379
|
def _an_element_(self):
|
|
380
380
|
"""
|
|
@@ -610,7 +610,7 @@ class FreePreLieAlgebra(CombinatorialFreeModule):
|
|
|
610
610
|
resu = self.zero()
|
|
611
611
|
for k in range(min_deg, N + 1): # total degree of (x ; y, y, y, y)
|
|
612
612
|
for mx, coef_x in xx:
|
|
613
|
-
dx = mx.
|
|
613
|
+
dx = mx.number_of_nodes()
|
|
614
614
|
step = self.zero()
|
|
615
615
|
for pi in IntegerVectors(k - dx, n, min_part=vy, max_part=max_y):
|
|
616
616
|
for ly in product(*[y_homog[part] for part in pi]):
|
|
@@ -29,8 +29,6 @@ Natalie Schoenhals for their contribution to the project and the code.
|
|
|
29
29
|
# (at your option) any later version.
|
|
30
30
|
# https://www.gnu.org/licenses/
|
|
31
31
|
# ****************************************************************************
|
|
32
|
-
from collections import deque
|
|
33
|
-
|
|
34
32
|
from sage.categories.coxeter_groups import CoxeterGroups
|
|
35
33
|
from sage.categories.enumerated_sets import EnumeratedSets
|
|
36
34
|
from sage.misc.lazy_import import lazy_import
|
|
@@ -159,7 +157,9 @@ class FullyCommutativeElement(NormalizedClonableList):
|
|
|
159
157
|
False
|
|
160
158
|
"""
|
|
161
159
|
word = list(self)
|
|
162
|
-
from sage.combinat.root_system.braid_orbit import
|
|
160
|
+
from sage.combinat.root_system.braid_orbit import (
|
|
161
|
+
is_fully_commutative as is_fully_comm,
|
|
162
|
+
)
|
|
163
163
|
|
|
164
164
|
group = self.parent().coxeter_group()
|
|
165
165
|
braid_rels = group.braid_relations()
|
|
@@ -272,7 +272,7 @@ class FullyCommutativeElement(NormalizedClonableList):
|
|
|
272
272
|
levels = h.level_sets()
|
|
273
273
|
letters_at_level = [set(self[i] for i in level) for level in levels]
|
|
274
274
|
|
|
275
|
-
for
|
|
275
|
+
for level_zero_index, members in enumerate(levels):
|
|
276
276
|
level = level_zero_index + 1
|
|
277
277
|
for i in members:
|
|
278
278
|
x = self[i]
|
|
@@ -440,7 +440,7 @@ class FullyCommutativeElement(NormalizedClonableList):
|
|
|
440
440
|
view = list(self) if side == 'left' else self[::-1]
|
|
441
441
|
m = self.parent().coxeter_group().coxeter_matrix()
|
|
442
442
|
out = set()
|
|
443
|
-
for
|
|
443
|
+
for i, t in enumerate(view):
|
|
444
444
|
if not any(m[x, t] > 2 for x in view[:i]):
|
|
445
445
|
out.add(t)
|
|
446
446
|
return out
|
|
@@ -713,9 +713,9 @@ class FullyCommutativeElement(NormalizedClonableList):
|
|
|
713
713
|
|
|
714
714
|
# Perform the coset decomposition on the specified side:
|
|
715
715
|
if side == 'left':
|
|
716
|
-
|
|
716
|
+
string, remaining = self.coset_decomposition(J, side=side)
|
|
717
717
|
elif side == 'right':
|
|
718
|
-
|
|
718
|
+
remaining, string = self.coset_decomposition(J, side=side)
|
|
719
719
|
|
|
720
720
|
cur_string = list(string)
|
|
721
721
|
|
|
@@ -1012,7 +1012,7 @@ class FullyCommutativeElements(UniqueRepresentation, Parent):
|
|
|
1012
1012
|
letters = self.coxeter_group().index_set()
|
|
1013
1013
|
|
|
1014
1014
|
# To make the iterator deterministic, use a dictionary rather than a
|
|
1015
|
-
# set, for the keys are then ordered by default
|
|
1015
|
+
# set, for the keys are then ordered by default:
|
|
1016
1016
|
recent_words = {empty_word: True}
|
|
1017
1017
|
yield empty_word
|
|
1018
1018
|
while recent_words:
|
|
@@ -307,7 +307,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
307
307
|
sage: ASMs = AlternatingSignMatrices(3).list()
|
|
308
308
|
sage: ncp = FullyPackedLoop(ASMs[1]).link_pattern() # fpl's gyration orbit size is 2
|
|
309
309
|
sage: rotated_ncp=[]
|
|
310
|
-
sage: for
|
|
310
|
+
sage: for a, b in ncp:
|
|
311
311
|
....: for i in range(5):
|
|
312
312
|
....: a,b=a%6+1,b%6+1;
|
|
313
313
|
....: rotated_ncp.append((a,b))
|
|
@@ -318,7 +318,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
318
318
|
sage: fpl = FullyPackedLoop(ASMs[0])
|
|
319
319
|
sage: ncp = fpl.link_pattern() # fpl's gyration size is 3
|
|
320
320
|
sage: rotated_ncp=[]
|
|
321
|
-
sage: for
|
|
321
|
+
sage: for a, b in ncp:
|
|
322
322
|
....: for i in range(5):
|
|
323
323
|
....: a,b=a%6+1,b%6+1;
|
|
324
324
|
....: rotated_ncp.append((a,b))
|
|
@@ -331,7 +331,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
331
331
|
sage: fpl = FullyPackedLoop(mat) # n=7
|
|
332
332
|
sage: ncp = fpl.link_pattern()
|
|
333
333
|
sage: rotated_ncp=[]
|
|
334
|
-
sage: for
|
|
334
|
+
sage: for a, b in ncp:
|
|
335
335
|
....: for i in range(13):
|
|
336
336
|
....: a,b=a%14+1,b%14+1;
|
|
337
337
|
....: rotated_ncp.append((a,b))
|
|
@@ -344,7 +344,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
344
344
|
sage: fpl = FullyPackedLoop(mat) # n =6
|
|
345
345
|
sage: ncp = fpl.link_pattern()
|
|
346
346
|
sage: rotated_ncp=[]
|
|
347
|
-
sage: for
|
|
347
|
+
sage: for a, b in ncp:
|
|
348
348
|
....: for i in range(11):
|
|
349
349
|
....: a,b=a%12+1,b%12+1;
|
|
350
350
|
....: rotated_ncp.append((a,b))
|
|
@@ -762,7 +762,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
762
762
|
its order. Setting this option to ``True`` makes it unlikely to
|
|
763
763
|
have two neighboring links with the same color.
|
|
764
764
|
|
|
765
|
-
- ``loop_fill`` --
|
|
765
|
+
- ``loop_fill`` -- boolean (default: ``False``); whether to fill the interior of the loops
|
|
766
766
|
|
|
767
767
|
EXAMPLES:
|
|
768
768
|
|
|
@@ -1082,7 +1082,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
1082
1082
|
sage: ASMs = AlternatingSignMatrices(3).list()
|
|
1083
1083
|
sage: ncp = FullyPackedLoop(ASMs[1]).link_pattern()
|
|
1084
1084
|
sage: rotated_ncp=[]
|
|
1085
|
-
sage: for
|
|
1085
|
+
sage: for a, b in ncp:
|
|
1086
1086
|
....: for i in range(5):
|
|
1087
1087
|
....: a,b=a%6+1,b%6+1;
|
|
1088
1088
|
....: rotated_ncp.append((a,b))
|
|
@@ -1093,7 +1093,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
1093
1093
|
sage: fpl = FullyPackedLoop(ASMs[0])
|
|
1094
1094
|
sage: ncp = fpl.link_pattern()
|
|
1095
1095
|
sage: rotated_ncp=[]
|
|
1096
|
-
sage: for
|
|
1096
|
+
sage: for a, b in ncp:
|
|
1097
1097
|
....: for i in range(5):
|
|
1098
1098
|
....: a,b=a%6+1,b%6+1;
|
|
1099
1099
|
....: rotated_ncp.append((a,b))
|
|
@@ -1106,7 +1106,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
1106
1106
|
sage: fpl = FullyPackedLoop(mat) # n=7
|
|
1107
1107
|
sage: ncp = fpl.link_pattern()
|
|
1108
1108
|
sage: rotated_ncp=[]
|
|
1109
|
-
sage: for
|
|
1109
|
+
sage: for a, b in ncp:
|
|
1110
1110
|
....: for i in range(13):
|
|
1111
1111
|
....: a,b=a%14+1,b%14+1;
|
|
1112
1112
|
....: rotated_ncp.append((a,b))
|
|
@@ -1119,7 +1119,7 @@ class FullyPackedLoop(Element, metaclass=InheritComparisonClasscallMetaclass):
|
|
|
1119
1119
|
sage: fpl = FullyPackedLoop(mat)
|
|
1120
1120
|
sage: ncp = fpl.link_pattern()
|
|
1121
1121
|
sage: rotated_ncp=[]
|
|
1122
|
-
sage: for
|
|
1122
|
+
sage: for a, b in ncp:
|
|
1123
1123
|
....: for i in range(11):
|
|
1124
1124
|
....: a,b=a%12+1,b%12+1;
|
|
1125
1125
|
....: rotated_ncp.append((a,b))
|
|
@@ -705,10 +705,9 @@ class GelfandTsetlinPatterns(UniqueRepresentation, Parent):
|
|
|
705
705
|
for i in range(1, len(gt)) for j in range(len(gt[i]))):
|
|
706
706
|
return False
|
|
707
707
|
# Check if it is strict if applicable
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
return True
|
|
708
|
+
return not (self._strict and any(gt[i][j] == gt[i][j - 1]
|
|
709
|
+
for i in range(len(gt))
|
|
710
|
+
for j in range(1, len(gt[i]))))
|
|
712
711
|
|
|
713
712
|
def _repr_(self):
|
|
714
713
|
"""
|
|
@@ -1182,7 +1181,7 @@ class GelfandTsetlinPatterns(UniqueRepresentation, Parent):
|
|
|
1182
1181
|
elif self._k < 0:
|
|
1183
1182
|
raise ValueError('cannot sample from empty set')
|
|
1184
1183
|
else:
|
|
1185
|
-
return self._cftp(0)
|
|
1184
|
+
return self.element_class(self, self._cftp(0))
|
|
1186
1185
|
else:
|
|
1187
1186
|
raise ValueError('cannot sample from infinite set')
|
|
1188
1187
|
|
sage/combinat/gray_codes.py
CHANGED
|
@@ -70,19 +70,18 @@ def product(m):
|
|
|
70
70
|
....: assert sum(1 for _ in product(t)) == prod(t)-1
|
|
71
71
|
"""
|
|
72
72
|
# n is the length of the element (we ignore sets of size 1)
|
|
73
|
-
n =
|
|
73
|
+
n = 0
|
|
74
74
|
|
|
75
75
|
new_m = [] # will be the set of upper bounds m_i different from 1
|
|
76
76
|
mm = [] # index of each set (we skip sets of cardinality 1)
|
|
77
|
-
for i in m:
|
|
77
|
+
for k, i in enumerate(m):
|
|
78
78
|
i = int(i)
|
|
79
79
|
if i <= 0:
|
|
80
80
|
raise ValueError("accept only positive integers")
|
|
81
81
|
if i > 1:
|
|
82
|
-
new_m.append(i-1)
|
|
82
|
+
new_m.append(i - 1)
|
|
83
83
|
mm.append(k)
|
|
84
84
|
n += 1
|
|
85
|
-
k += 1
|
|
86
85
|
|
|
87
86
|
m = new_m
|
|
88
87
|
f = list(range(n + 1)) # focus pointer
|
|
@@ -360,7 +360,7 @@ class GrossmanLarsonAlgebra(CombinatorialFreeModule):
|
|
|
360
360
|
sage: A.degree_on_basis(RT([RT([])]))
|
|
361
361
|
1
|
|
362
362
|
"""
|
|
363
|
-
return t.
|
|
363
|
+
return t.number_of_nodes() - 1
|
|
364
364
|
|
|
365
365
|
def _an_element_(self):
|
|
366
366
|
"""
|
|
@@ -509,7 +509,7 @@ class GrossmanLarsonAlgebra(CombinatorialFreeModule):
|
|
|
509
509
|
sage: A.counit_on_basis(RT([],'#'))
|
|
510
510
|
1
|
|
511
511
|
"""
|
|
512
|
-
if x.
|
|
512
|
+
if x.number_of_nodes() == 1:
|
|
513
513
|
return self.base_ring().one()
|
|
514
514
|
return self.base_ring().zero()
|
|
515
515
|
|
sage/combinat/growth.py
CHANGED
|
@@ -748,7 +748,7 @@ class GrowthDiagram(SageObject):
|
|
|
748
748
|
sage: G.out_labels() == G.conjugate().out_labels()[::-1]
|
|
749
749
|
True
|
|
750
750
|
"""
|
|
751
|
-
F = {(j,i): v for (i,j),v in self._filling.items()}
|
|
751
|
+
F = {(j, i): v for (i, j), v in self._filling.items()}
|
|
752
752
|
return GrowthDiagram(self.rule,
|
|
753
753
|
filling=F,
|
|
754
754
|
shape=self.shape().conjugate(),
|
|
@@ -803,7 +803,7 @@ class GrowthDiagram(SageObject):
|
|
|
803
803
|
shape_lambda = [l - p for p in self._mu] + [l] * (h - len(self._mu))
|
|
804
804
|
shape_mu = [l - p for p in self._lambda]
|
|
805
805
|
shape = SkewPartition([shape_lambda[::-1], shape_mu[::-1]])
|
|
806
|
-
F = {(l-i-1, h-j-1): v for (i,j),v in self._filling.items()}
|
|
806
|
+
F = {(l-i-1, h-j-1): v for (i, j), v in self._filling.items()}
|
|
807
807
|
return GrowthDiagram(self.rule,
|
|
808
808
|
filling=F,
|
|
809
809
|
shape=shape)
|
|
@@ -996,7 +996,7 @@ class GrowthDiagram(SageObject):
|
|
|
996
996
|
if not self.is_rectangular():
|
|
997
997
|
raise ValueError("can only convert fillings of rectangular shapes to words")
|
|
998
998
|
w = [0] * self._lambda[0]
|
|
999
|
-
for (
|
|
999
|
+
for (i, j), v in self._filling.items():
|
|
1000
1000
|
if v != 0:
|
|
1001
1001
|
if v == 1:
|
|
1002
1002
|
if w[i] == 0:
|
|
@@ -1044,7 +1044,7 @@ class GrowthDiagram(SageObject):
|
|
|
1044
1044
|
raise ValueError("can only convert fillings of rectangular shapes to words")
|
|
1045
1045
|
w1 = []
|
|
1046
1046
|
w2 = []
|
|
1047
|
-
for (
|
|
1047
|
+
for (i, j), v in sorted(self._filling.items()):
|
|
1048
1048
|
if v >= 0:
|
|
1049
1049
|
w1.extend([i+1]*v)
|
|
1050
1050
|
w2.extend([j+1]*v)
|
|
@@ -1410,13 +1410,13 @@ class GrowthDiagram(SageObject):
|
|
|
1410
1410
|
if isinstance(v, dict):
|
|
1411
1411
|
# it is a dict of dicts
|
|
1412
1412
|
F = dict()
|
|
1413
|
-
for
|
|
1414
|
-
for
|
|
1413
|
+
for i, row in filling.items():
|
|
1414
|
+
for j, v in row.items():
|
|
1415
1415
|
if v != 0:
|
|
1416
|
-
F[(i,j)] = int(v)
|
|
1416
|
+
F[(i, j)] = int(v)
|
|
1417
1417
|
else:
|
|
1418
1418
|
# it is dict of coordinates
|
|
1419
|
-
F = {(i,j): v for (
|
|
1419
|
+
F = {(i, j): v for (i, j), v in filling.items()
|
|
1420
1420
|
if v != 0}
|
|
1421
1421
|
except StopIteration:
|
|
1422
1422
|
# it is an empty dict of coordinates
|
|
@@ -3005,7 +3005,7 @@ class RuleSylvester(Rule):
|
|
|
3005
3005
|
sage: Sylvester.rank(Sylvester.vertices(3)[0])
|
|
3006
3006
|
3
|
|
3007
3007
|
"""
|
|
3008
|
-
return v.
|
|
3008
|
+
return v.number_of_nodes()
|
|
3009
3009
|
|
|
3010
3010
|
def is_Q_edge(self, v, w):
|
|
3011
3011
|
r"""
|
|
@@ -3149,7 +3149,7 @@ class RuleSylvester(Rule):
|
|
|
3149
3149
|
"""
|
|
3150
3150
|
def add_label(L, S, T, m):
|
|
3151
3151
|
if L.is_empty():
|
|
3152
|
-
assert T.
|
|
3152
|
+
assert T.number_of_nodes() == 1
|
|
3153
3153
|
return LabelledBinaryTree([], m)
|
|
3154
3154
|
l = L.label()
|
|
3155
3155
|
if T[0] == S[0]:
|
|
@@ -4258,9 +4258,9 @@ class RuleDomino(Rule):
|
|
|
4258
4258
|
r"""
|
|
4259
4259
|
Return the union of the two partitions.
|
|
4260
4260
|
"""
|
|
4261
|
-
return [max(p,q) for
|
|
4261
|
+
return [max(p, q) for p, q in zip_longest(la, mu, fillvalue=0)]
|
|
4262
4262
|
|
|
4263
|
-
if content not in [0,1
|
|
4263
|
+
if content not in [0, 1, -1]:
|
|
4264
4264
|
raise ValueError("domino: the content of the filling must be in {-1,0,1}")
|
|
4265
4265
|
|
|
4266
4266
|
if content == 1:
|
|
@@ -4294,7 +4294,7 @@ class RuleDomino(Rule):
|
|
|
4294
4294
|
elif len(diff) == 1:
|
|
4295
4295
|
z = copy(x)
|
|
4296
4296
|
# diff is a single cell
|
|
4297
|
-
|
|
4297
|
+
k, l = diff.pop()
|
|
4298
4298
|
# add (k+1, l+1) to x
|
|
4299
4299
|
# either (k, l+1) or (k+1, l) must also be added
|
|
4300
4300
|
if z[k] <= l + 1:
|
sage/combinat/hall_polynomial.py
CHANGED
|
@@ -15,7 +15,7 @@ Hall polynomials
|
|
|
15
15
|
#
|
|
16
16
|
# The full text of the GPL is available at:
|
|
17
17
|
#
|
|
18
|
-
#
|
|
18
|
+
# https://www.gnu.org/licenses/
|
|
19
19
|
# ****************************************************************************
|
|
20
20
|
|
|
21
21
|
from sage.misc.misc_c import prod
|
sage/combinat/hillman_grassl.py
CHANGED
|
@@ -569,7 +569,7 @@ def hillman_grassl(M):
|
|
|
569
569
|
col_j_hook_mults += [(r, j)] * entry
|
|
570
570
|
hook_mults += reversed(col_j_hook_mults)
|
|
571
571
|
res = [[0] * rowlen for rowlen in lam]
|
|
572
|
-
for
|
|
572
|
+
for r, s in reversed(hook_mults):
|
|
573
573
|
i = r
|
|
574
574
|
j = lam[r] - 1
|
|
575
575
|
while True:
|