passagemath-graphs 10.5.39__cp312-cp312-musllinux_1_2_aarch64.whl → 10.6.1rc1__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_graphs-10.5.39.dist-info → passagemath_graphs-10.6.1rc1.dist-info}/METADATA +84 -14
- {passagemath_graphs-10.5.39.dist-info → passagemath_graphs-10.6.1rc1.dist-info}/RECORD +150 -148
- {passagemath_graphs-10.5.39.dist-info → passagemath_graphs-10.6.1rc1.dist-info}/WHEEL +1 -1
- sage/all__sagemath_graphs.py +5 -0
- sage/combinat/abstract_tree.py +189 -18
- sage/combinat/binary_tree.py +1 -1
- sage/combinat/cluster_algebra_quiver/all.py +1 -1
- sage/combinat/cluster_algebra_quiver/cluster_seed.py +18 -12
- sage/combinat/cluster_algebra_quiver/interact.py +3 -0
- sage/combinat/cluster_algebra_quiver/mutation_type.py +518 -519
- sage/combinat/cluster_algebra_quiver/quiver.py +233 -205
- sage/combinat/designs/MOLS_handbook_data.py +5 -5
- sage/combinat/designs/bibd.py +1 -1
- sage/combinat/designs/covering_array.py +3 -3
- sage/combinat/designs/covering_design.py +4 -7
- sage/combinat/designs/database.py +11 -10
- sage/combinat/designs/designs_pyx.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/designs_pyx.pyx +2 -2
- sage/combinat/designs/difference_matrices.py +1 -1
- sage/combinat/designs/evenly_distributed_sets.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/evenly_distributed_sets.pyx +4 -4
- sage/combinat/designs/ext_rep.py +9 -14
- sage/combinat/designs/gen_quadrangles_with_spread.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/group_divisible_designs.py +1 -1
- sage/combinat/designs/latin_squares.py +54 -21
- sage/combinat/designs/orthogonal_arrays.py +2 -1
- sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +22 -21
- sage/combinat/designs/resolvable_bibd.py +192 -158
- sage/combinat/designs/steiner_quadruple_systems.py +1 -1
- sage/combinat/designs/subhypergraph_search.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/designs/subhypergraph_search.pyx +4 -4
- sage/combinat/designs/twographs.py +2 -2
- sage/combinat/finite_state_machine.py +6 -6
- sage/combinat/finite_state_machine_generators.py +2 -2
- sage/combinat/graph_path.py +3 -3
- sage/combinat/ordered_tree.py +1 -1
- sage/combinat/posets/bubble_shuffle.py +247 -0
- sage/combinat/posets/cartesian_product.py +1 -1
- sage/combinat/posets/d_complete.py +4 -4
- sage/combinat/posets/elements.py +3 -3
- sage/combinat/posets/forest.py +1 -1
- sage/combinat/posets/hasse_cython.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/posets/hasse_cython.pyx +1 -1
- sage/combinat/posets/hasse_diagram.py +16 -22
- sage/combinat/posets/hochschild_lattice.py +158 -0
- sage/combinat/posets/incidence_algebras.py +15 -17
- sage/combinat/posets/lattices.py +51 -53
- sage/combinat/posets/linear_extension_iterator.cpython-312-aarch64-linux-musl.so +0 -0
- sage/combinat/posets/linear_extensions.py +11 -23
- sage/combinat/posets/moebius_algebra.py +5 -5
- sage/combinat/posets/poset_examples.py +70 -23
- sage/combinat/posets/posets.py +294 -103
- sage/combinat/rooted_tree.py +1 -1
- sage/databases/knotinfo_db.py +2 -1
- sage/graphs/asteroidal_triples.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/asteroidal_triples.pyx +24 -3
- sage/graphs/base/boost_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/boost_graph.pxd +3 -3
- sage/graphs/base/c_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/c_graph.pyx +1 -1
- sage/graphs/base/dense_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/dense_graph.pxd +5 -3
- sage/graphs/base/dense_graph.pyx +44 -0
- sage/graphs/base/graph_backends.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/sparse_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/static_dense_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/static_sparse_backend.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/static_sparse_backend.pyx +8 -5
- sage/graphs/base/static_sparse_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/base/static_sparse_graph.pyx +86 -15
- sage/graphs/bipartite_graph.py +59 -36
- sage/graphs/centrality.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/centrality.pyx +82 -9
- sage/graphs/cographs.py +1 -1
- sage/graphs/comparability.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/comparability.pyx +64 -26
- sage/graphs/connectivity.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/convexity_properties.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/convexity_properties.pyx +52 -9
- sage/graphs/digraph.py +439 -95
- sage/graphs/digraph_generators.py +174 -102
- sage/graphs/distances_all_pairs.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/dot2tex_utils.py +1 -1
- sage/graphs/edge_connectivity.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/generators/basic.py +1 -1
- sage/graphs/generators/distance_regular.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/generators/distance_regular.pyx +1 -1
- sage/graphs/generators/families.py +37 -27
- sage/graphs/generators/random.py +2 -2
- sage/graphs/generators/smallgraphs.py +3 -3
- sage/graphs/generic_graph.py +558 -86
- sage/graphs/generic_graph_pyx.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/generic_graph_pyx.pyx +58 -11
- sage/graphs/genus.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/genus.pyx +3 -4
- sage/graphs/graph.py +291 -8
- sage/graphs/graph_coloring.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_database.py +67 -12
- sage/graphs/graph_decompositions/bandwidth.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.pyx +24 -3
- sage/graphs/graph_decompositions/cutwidth.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.pyx +1 -1
- sage/graphs/graph_decompositions/graph_products.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/graph_products.pyx +67 -21
- sage/graphs/graph_decompositions/modular_decomposition.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.pyx +34 -8
- sage/graphs/graph_decompositions/tree_decomposition.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_decompositions/vertex_separation.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_generators.py +45 -32
- sage/graphs/graph_generators_pyx.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/graph_generators_pyx.pyx +15 -15
- sage/graphs/graph_latex.py +1 -1
- sage/graphs/graph_list.py +54 -12
- sage/graphs/graph_plot.py +7 -0
- sage/graphs/hyperbolicity.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/hyperbolicity.pyx +2 -0
- sage/graphs/independent_sets.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/isoperimetric_inequalities.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/isoperimetric_inequalities.pyx +42 -6
- sage/graphs/line_graph.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/line_graph.pyx +153 -37
- sage/graphs/matching_covered_graph.py +84 -60
- sage/graphs/orientations.py +3 -18
- sage/graphs/path_enumeration.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/path_enumeration.pyx +2 -2
- sage/graphs/spanning_tree.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/strongly_regular_db.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/strongly_regular_db.pyx +15 -15
- sage/graphs/traversals.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/traversals.pyx +13 -12
- sage/graphs/trees.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/tutte_polynomial.py +1 -1
- sage/graphs/views.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/weakly_chordal.cpython-312-aarch64-linux-musl.so +0 -0
- sage/graphs/weakly_chordal.pyx +50 -8
- sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-312-aarch64-linux-musl.so +0 -0
- sage/knots/free_knotinfo_monoid.py +3 -3
- sage/knots/knotinfo.py +102 -82
- sage/knots/link.py +72 -39
- sage/sandpiles/sandpile.py +1 -2
- sage/topology/cubical_complex.py +4 -5
- sage/topology/delta_complex.py +4 -4
- sage/topology/simplicial_complex.py +0 -1
- sage/topology/simplicial_complex_catalog.py +6 -0
- sage/topology/simplicial_complex_examples.py +4 -16
- {passagemath_graphs-10.5.39.dist-info → passagemath_graphs-10.6.1rc1.dist-info}/top_level.txt +0 -0
@@ -1,16 +1,6 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
r"""
|
3
|
-
Linear
|
4
|
-
|
5
|
-
This module defines two classes:
|
6
|
-
|
7
|
-
- :class:`LinearExtensionOfPoset`
|
8
|
-
- :class:`LinearExtensionsOfPoset`
|
9
|
-
- :class:`LinearExtensionsOfPosetWithHooks`
|
10
|
-
- :class:`LinearExtensionsOfForest`
|
11
|
-
|
12
|
-
Classes and methods
|
13
|
-
-------------------
|
3
|
+
Linear extensions of posets
|
14
4
|
"""
|
15
5
|
# ****************************************************************************
|
16
6
|
# Copyright (C) 2012 Anne Schilling <anne at math.ucdavis.edu>
|
@@ -131,7 +121,7 @@ class LinearExtensionOfPoset(ClonableArray,
|
|
131
121
|
return linear_extension
|
132
122
|
return LinearExtensionsOfPoset(poset)(linear_extension)
|
133
123
|
|
134
|
-
def check(self):
|
124
|
+
def check(self) -> None:
|
135
125
|
r"""
|
136
126
|
Check whether ``self`` is indeed a linear extension of the underlying poset.
|
137
127
|
|
@@ -162,7 +152,7 @@ class LinearExtensionOfPoset(ClonableArray,
|
|
162
152
|
"""
|
163
153
|
return self.parent().poset()
|
164
154
|
|
165
|
-
def _latex_(self):
|
155
|
+
def _latex_(self) -> str:
|
166
156
|
r"""
|
167
157
|
Return the latex string for ``self``.
|
168
158
|
|
@@ -218,12 +208,12 @@ class LinearExtensionOfPoset(ClonableArray,
|
|
218
208
|
True
|
219
209
|
"""
|
220
210
|
P = self.parent().poset()
|
221
|
-
old =
|
211
|
+
old = (P.unwrap(x) for x in self)
|
222
212
|
new = [P.unwrap(x) for x in P]
|
223
213
|
relabelling = dict(zip(old, new))
|
224
214
|
return P.relabel(relabelling).with_linear_extension(new)
|
225
215
|
|
226
|
-
def is_greedy(self):
|
216
|
+
def is_greedy(self) -> bool:
|
227
217
|
r"""
|
228
218
|
Return ``True`` if the linear extension is greedy.
|
229
219
|
|
@@ -257,7 +247,7 @@ class LinearExtensionOfPoset(ClonableArray,
|
|
257
247
|
return False
|
258
248
|
return True
|
259
249
|
|
260
|
-
def is_supergreedy(self):
|
250
|
+
def is_supergreedy(self) -> bool:
|
261
251
|
r"""
|
262
252
|
Return ``True`` if the linear extension is supergreedy.
|
263
253
|
|
@@ -431,7 +421,7 @@ class LinearExtensionOfPoset(ClonableArray,
|
|
431
421
|
self = self.tau(j)
|
432
422
|
return self
|
433
423
|
|
434
|
-
def jump_count(self):
|
424
|
+
def jump_count(self) -> int:
|
435
425
|
r"""
|
436
426
|
Return the number of jumps in the linear extension.
|
437
427
|
|
@@ -551,7 +541,7 @@ class LinearExtensionsOfPoset(UniqueRepresentation, Parent):
|
|
551
541
|
facade = (list,)
|
552
542
|
Parent.__init__(self, category=FiniteEnumeratedSets(), facade=facade)
|
553
543
|
|
554
|
-
def _repr_(self):
|
544
|
+
def _repr_(self) -> str:
|
555
545
|
"""
|
556
546
|
TESTS::
|
557
547
|
|
@@ -710,7 +700,7 @@ class LinearExtensionsOfPoset(UniqueRepresentation, Parent):
|
|
710
700
|
return (isinstance(obj, (list, tuple)) and
|
711
701
|
self.poset().is_linear_extension(obj))
|
712
702
|
|
713
|
-
def markov_chain_digraph(self, action='promotion', labeling='identity'):
|
703
|
+
def markov_chain_digraph(self, action='promotion', labeling='identity') -> DiGraph:
|
714
704
|
r"""
|
715
705
|
Return the digraph of the action of generalized promotion or tau on ``self``.
|
716
706
|
|
@@ -747,7 +737,6 @@ class LinearExtensionsOfPoset(UniqueRepresentation, Parent):
|
|
747
737
|
([2, 1, 3, 4], [1, 2, 4, 3], 1), ([2, 1, 3, 4], [2, 1, 3, 4], 4), ([2, 1, 3, 4], [2, 1, 4, 3], 2),
|
748
738
|
([2, 1, 3, 4], [2, 1, 4, 3], 3), ([2, 1, 4, 3], [1, 4, 2, 3], 1), ([2, 1, 4, 3], [2, 1, 3, 4], 2),
|
749
739
|
([2, 1, 4, 3], [2, 1, 3, 4], 3), ([2, 1, 4, 3], [2, 1, 4, 3], 4)]
|
750
|
-
|
751
740
|
sage: G = L.markov_chain_digraph(labeling='source')
|
752
741
|
sage: G.vertices(sort=True, key=repr)
|
753
742
|
[[1, 2, 3, 4], [1, 2, 4, 3], [1, 4, 2, 3], [2, 1, 3, 4], [2, 1, 4, 3]]
|
@@ -909,11 +898,10 @@ class LinearExtensionsOfPoset(UniqueRepresentation, Parent):
|
|
909
898
|
lst = list(lst)
|
910
899
|
if not isinstance(lst, (list, tuple)):
|
911
900
|
raise TypeError("input should be a list or tuple")
|
912
|
-
lst = [self._poset(
|
901
|
+
lst = [self._poset(e) for e in lst]
|
913
902
|
if self._is_facade:
|
914
903
|
return lst
|
915
|
-
|
916
|
-
return self.element_class(self, lst, check)
|
904
|
+
return self.element_class(self, lst, check)
|
917
905
|
|
918
906
|
Element = LinearExtensionOfPoset
|
919
907
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# sage_setup: distribution = sagemath-graphs
|
2
2
|
# sage.doctest: needs sage.modules
|
3
3
|
r"""
|
4
|
-
Möbius
|
4
|
+
Möbius algebras
|
5
5
|
"""
|
6
6
|
# ****************************************************************************
|
7
7
|
# Copyright (C) 2014 Travis Scrimshaw <tscrim at ucdavis.edu>,
|
@@ -114,7 +114,7 @@ class MoebiusAlgebra(Parent, UniqueRepresentation):
|
|
114
114
|
self._category = cat
|
115
115
|
Parent.__init__(self, base=R, category=self._category.WithRealizations())
|
116
116
|
|
117
|
-
def _repr_(self):
|
117
|
+
def _repr_(self) -> str:
|
118
118
|
"""
|
119
119
|
Return a string representation of ``self``.
|
120
120
|
|
@@ -412,7 +412,7 @@ class QuantumMoebiusAlgebra(Parent, UniqueRepresentation):
|
|
412
412
|
self._category = cat
|
413
413
|
Parent.__init__(self, base=R, category=self._category.WithRealizations())
|
414
414
|
|
415
|
-
def _repr_(self):
|
415
|
+
def _repr_(self) -> str:
|
416
416
|
"""
|
417
417
|
Return a string representation of ``self``.
|
418
418
|
|
@@ -694,7 +694,7 @@ class MoebiusAlgebraBases(Category_realization_of_parent):
|
|
694
694
|
sage: M.E() in bases
|
695
695
|
True
|
696
696
|
"""
|
697
|
-
def _repr_(self):
|
697
|
+
def _repr_(self) -> str:
|
698
698
|
r"""
|
699
699
|
Return the representation of ``self``.
|
700
700
|
|
@@ -725,7 +725,7 @@ class MoebiusAlgebraBases(Category_realization_of_parent):
|
|
725
725
|
return [self.base()._category, Realizations(self.base())]
|
726
726
|
|
727
727
|
class ParentMethods:
|
728
|
-
def _repr_(self):
|
728
|
+
def _repr_(self) -> str:
|
729
729
|
"""
|
730
730
|
Text representation of this basis of a Möbius algebra.
|
731
731
|
|
@@ -30,15 +30,17 @@ The infinite set of all posets can be used to find minimal examples::
|
|
30
30
|
|
31
31
|
:meth:`~Posets.AntichainPoset` | Return an antichain on `n` elements.
|
32
32
|
:meth:`~Posets.BooleanLattice` | Return the Boolean lattice on `2^n` elements.
|
33
|
+
:meth:`~Posets.BubblePoset` | Return the Bubble lattice for `(m,n)`.
|
33
34
|
:meth:`~Posets.ChainPoset` | Return a chain on `n` elements.
|
34
35
|
:meth:`~Posets.Crown` | Return the crown poset on `2n` elements.
|
35
36
|
:meth:`~Posets.DexterSemilattice` | Return the Dexter semilattice.
|
36
37
|
:meth:`~Posets.DiamondPoset` | Return the lattice of rank two on `n` elements.
|
37
38
|
:meth:`~Posets.DivisorLattice` | Return the divisor lattice of an integer.
|
38
39
|
:meth:`~Posets.DoubleTailedDiamond` | Return the double tailed diamond poset on `2n + 2` elements.
|
40
|
+
:meth:`~Posets.HochschildLattice` | Return the Hochschild lattice for `n`.
|
39
41
|
:meth:`~Posets.IntegerCompositions` | Return the poset of integer compositions of `n`.
|
40
42
|
:meth:`~Posets.IntegerPartitions` | Return the poset of integer partitions of ``n``.
|
41
|
-
:meth:`~Posets.IntegerPartitionsDominanceOrder` | Return the lattice of integer partitions
|
43
|
+
:meth:`~Posets.IntegerPartitionsDominanceOrder` | Return the lattice of integer partitions of the integer `n` ordered by dominance.
|
42
44
|
:meth:`~Posets.MobilePoset` | Return the mobile poset formed by the `ribbon` with `hangers` below and an `anchor` above.
|
43
45
|
:meth:`~Posets.NoncrossingPartitions` | Return the poset of noncrossing partitions of a finite Coxeter group ``W``.
|
44
46
|
:meth:`~Posets.PentagonPoset` | Return the Pentagon poset.
|
@@ -53,6 +55,7 @@ The infinite set of all posets can be used to find minimal examples::
|
|
53
55
|
:meth:`~Posets.RestrictedIntegerPartitions` | Return the poset of integer partitions of `n`, ordered by restricted refinement.
|
54
56
|
:meth:`~Posets.SetPartitions` | Return the poset of set partitions of the set `\{1,\dots,n\}`.
|
55
57
|
:meth:`~Posets.ShardPoset` | Return the shard intersection order.
|
58
|
+
:meth:`~Posets.ShufflePoset` | Return the Shuffle lattice for `(m,n)`.
|
56
59
|
:meth:`~Posets.SSTPoset` | Return the poset on semistandard tableaux of shape `s` and largest entry `f` that is ordered by componentwise comparison.
|
57
60
|
:meth:`~Posets.StandardExample` | Return the standard example of a poset with dimension `n`.
|
58
61
|
:meth:`~Posets.SymmetricGroupAbsoluteOrderPoset` | The poset of permutations with respect to absolute order.
|
@@ -100,6 +103,7 @@ from sage.misc.classcall_metaclass import ClasscallMetaclass
|
|
100
103
|
import sage.categories.posets
|
101
104
|
from sage.combinat.permutation import Permutations, Permutation, to_standard
|
102
105
|
from sage.combinat.posets.posets import Poset, FinitePoset, FinitePosets_n
|
106
|
+
from sage.combinat.posets import bubble_shuffle, hochschild_lattice
|
103
107
|
from sage.combinat.posets.d_complete import DCompletePoset
|
104
108
|
from sage.combinat.posets.mobile import MobilePoset as Mobile
|
105
109
|
from sage.combinat.posets.lattices import (LatticePoset, MeetSemilattice,
|
@@ -281,6 +285,12 @@ class Posets(metaclass=ClasscallMetaclass):
|
|
281
285
|
category=FiniteLatticePosets(),
|
282
286
|
facade=facade)
|
283
287
|
|
288
|
+
BubblePoset = staticmethod(bubble_shuffle.BubblePoset)
|
289
|
+
|
290
|
+
ShufflePoset = staticmethod(bubble_shuffle.ShufflePoset)
|
291
|
+
|
292
|
+
HochschildLattice = staticmethod(hochschild_lattice.hochschild_lattice)
|
293
|
+
|
284
294
|
@staticmethod
|
285
295
|
def ChainPoset(n, facade=None):
|
286
296
|
r"""
|
@@ -465,11 +475,11 @@ class Posets(metaclass=ClasscallMetaclass):
|
|
465
475
|
|
466
476
|
@staticmethod
|
467
477
|
def DivisorLattice(n, facade=None):
|
468
|
-
"""
|
478
|
+
r"""
|
469
479
|
Return the divisor lattice of an integer.
|
470
480
|
|
471
|
-
Elements of the lattice are divisors of `n
|
472
|
-
lattice if `x` divides `y`.
|
481
|
+
Elements of the lattice are divisors of `n`, and we have
|
482
|
+
`x \leq y` in the lattice if `x` divides `y`.
|
473
483
|
|
474
484
|
INPUT:
|
475
485
|
|
@@ -502,15 +512,52 @@ class Posets(metaclass=ClasscallMetaclass):
|
|
502
512
|
category=FiniteLatticePosets())
|
503
513
|
|
504
514
|
@staticmethod
|
505
|
-
def
|
515
|
+
def HessenbergPoset(H):
|
516
|
+
r"""
|
517
|
+
Return the poset associated to a Hessenberg function ``H``.
|
518
|
+
|
519
|
+
A *Hessenberg function* (of length `n`) is a function `H: \{1,\ldots,n\}
|
520
|
+
\to \{1,\ldots,n\}` such that `\max(i, H(i-1)) \leq H(i) \leq n` for all
|
521
|
+
`i` (where `H(0) = 0` by convention). The corresponding poset is given
|
522
|
+
by `i < j` (in the poset) if and only if `H(i) < j` (as integers).
|
523
|
+
These posets correspond to the natural unit interval order posets.
|
524
|
+
|
525
|
+
INPUT:
|
526
|
+
|
527
|
+
- ``H`` -- list of the Hessenberg function values
|
528
|
+
(without `H(0)`)
|
529
|
+
|
530
|
+
EXAMPLES::
|
531
|
+
|
532
|
+
sage: P = posets.HessenbergPoset([2, 3, 5, 5, 5]); P
|
533
|
+
Finite poset containing 5 elements
|
534
|
+
sage: P.cover_relations()
|
535
|
+
[[2, 4], [2, 5], [1, 3], [1, 4], [1, 5]]
|
536
|
+
|
537
|
+
TESTS::
|
538
|
+
|
539
|
+
sage: P = posets.HessenbergPoset([2, 2, 6, 4, 5, 6])
|
540
|
+
Traceback (most recent call last):
|
541
|
+
...
|
542
|
+
ValueError: [2, 2, 6, 4, 5, 6] is not a Hessenberg function
|
543
|
+
sage: P = posets.HessenbergPoset([]); P
|
544
|
+
Finite poset containing 0 elements
|
506
545
|
"""
|
546
|
+
n = len(H)
|
547
|
+
if not all(max(i+1, H[i-1]) <= H[i] for i in range(1, n)) or 0 < n < H[-1]:
|
548
|
+
raise ValueError(f"{H} is not a Hessenberg function")
|
549
|
+
return Poset((tuple(range(1, n+1)), lambda i, j: H[i-1] < j))
|
550
|
+
|
551
|
+
@staticmethod
|
552
|
+
def IntegerCompositions(n):
|
553
|
+
r"""
|
507
554
|
Return the poset of integer compositions of the integer ``n``.
|
508
555
|
|
509
556
|
A composition of a positive integer `n` is a list of positive
|
510
557
|
integers that sum to `n`. The order is reverse refinement:
|
511
|
-
`[p_1,p_2,...,p_l]
|
512
|
-
of an integer composition of `p_1`, followed by an
|
513
|
-
composition of `p_2`, and so on.
|
558
|
+
`p = [p_1,p_2,...,p_l] \leq q = [q_1,q_2,...,q_m]` if `q`
|
559
|
+
consists of an integer composition of `p_1`, followed by an
|
560
|
+
integer composition of `p_2`, and so on.
|
514
561
|
|
515
562
|
EXAMPLES::
|
516
563
|
|
@@ -527,7 +574,7 @@ class Posets(metaclass=ClasscallMetaclass):
|
|
527
574
|
@staticmethod
|
528
575
|
def IntegerPartitions(n):
|
529
576
|
"""
|
530
|
-
Return the poset of integer partitions
|
577
|
+
Return the poset of integer partitions of the integer ``n``.
|
531
578
|
|
532
579
|
A partition of a positive integer `n` is a non-increasing list
|
533
580
|
of positive integers that sum to `n`. If `p` and `q` are
|
@@ -566,7 +613,7 @@ class Posets(metaclass=ClasscallMetaclass):
|
|
566
613
|
@staticmethod
|
567
614
|
def RestrictedIntegerPartitions(n):
|
568
615
|
"""
|
569
|
-
Return the poset of integer partitions
|
616
|
+
Return the poset of integer partitions of the integer `n`
|
570
617
|
ordered by restricted refinement.
|
571
618
|
|
572
619
|
That is, if `p` and `q` are integer partitions of `n`, then
|
@@ -605,12 +652,12 @@ class Posets(metaclass=ClasscallMetaclass):
|
|
605
652
|
@staticmethod
|
606
653
|
def IntegerPartitionsDominanceOrder(n):
|
607
654
|
r"""
|
608
|
-
Return the lattice of integer partitions
|
655
|
+
Return the lattice of integer partitions of the integer `n`
|
609
656
|
ordered by dominance.
|
610
657
|
|
611
658
|
That is, if `p=(p_1,\ldots,p_i)` and `q=(q_1,\ldots,q_j)` are
|
612
|
-
integer partitions of `n`, then `p
|
613
|
-
only if `p_1+\cdots+p_k
|
659
|
+
integer partitions of `n`, then `p \geq q` if and
|
660
|
+
only if `p_1+\cdots+p_k \geq q_1+\cdots+q_k` for all `k`.
|
614
661
|
|
615
662
|
INPUT:
|
616
663
|
|
@@ -1433,16 +1480,16 @@ class Posets(metaclass=ClasscallMetaclass):
|
|
1433
1480
|
return ((a[0] == b[0] + 1 and a[1] == b[1]) or
|
1434
1481
|
(a[1] == b[1] + 1 and a[0] == b[0]))
|
1435
1482
|
return JoinSemilattice((lam.cells(), cell_geq), cover_relations=True)
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1483
|
+
|
1484
|
+
def cell_leq(a, b):
|
1485
|
+
"""
|
1486
|
+
Nested function that returns ``True`` if the cell `a` is
|
1487
|
+
to the left or above
|
1488
|
+
the cell `b` in the (English) Young diagram.
|
1489
|
+
"""
|
1490
|
+
return ((a[0] == b[0] - 1 and a[1] == b[1]) or
|
1491
|
+
(a[1] == b[1] - 1 and a[0] == b[0]))
|
1492
|
+
return MeetSemilattice((lam.cells(), cell_leq), cover_relations=True)
|
1446
1493
|
|
1447
1494
|
@staticmethod
|
1448
1495
|
def YoungsLattice(n):
|