passagemath-graphs 10.6.1rc1__cp310-cp310-musllinux_1_2_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. passagemath_graphs-10.6.1rc1.dist-info/METADATA +292 -0
  2. passagemath_graphs-10.6.1rc1.dist-info/RECORD +260 -0
  3. passagemath_graphs-10.6.1rc1.dist-info/WHEEL +5 -0
  4. passagemath_graphs-10.6.1rc1.dist-info/top_level.txt +2 -0
  5. passagemath_graphs.libs/libgcc_s-69c45f16.so.1 +0 -0
  6. passagemath_graphs.libs/libgmp-8e78bd9b.so.10.5.0 +0 -0
  7. passagemath_graphs.libs/libstdc++-1f1a71be.so.6.0.33 +0 -0
  8. sage/all__sagemath_graphs.py +39 -0
  9. sage/combinat/abstract_tree.py +2723 -0
  10. sage/combinat/all__sagemath_graphs.py +34 -0
  11. sage/combinat/binary_tree.py +5306 -0
  12. sage/combinat/cluster_algebra_quiver/all.py +22 -0
  13. sage/combinat/cluster_algebra_quiver/cluster_seed.py +5208 -0
  14. sage/combinat/cluster_algebra_quiver/interact.py +124 -0
  15. sage/combinat/cluster_algebra_quiver/mutation_class.py +625 -0
  16. sage/combinat/cluster_algebra_quiver/mutation_type.py +1555 -0
  17. sage/combinat/cluster_algebra_quiver/quiver.py +2290 -0
  18. sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py +2468 -0
  19. sage/combinat/designs/MOLS_handbook_data.py +570 -0
  20. sage/combinat/designs/all.py +58 -0
  21. sage/combinat/designs/bibd.py +1655 -0
  22. sage/combinat/designs/block_design.py +1071 -0
  23. sage/combinat/designs/covering_array.py +269 -0
  24. sage/combinat/designs/covering_design.py +530 -0
  25. sage/combinat/designs/database.py +5615 -0
  26. sage/combinat/designs/design_catalog.py +122 -0
  27. sage/combinat/designs/designs_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
  28. sage/combinat/designs/designs_pyx.pxd +21 -0
  29. sage/combinat/designs/designs_pyx.pyx +993 -0
  30. sage/combinat/designs/difference_family.py +3951 -0
  31. sage/combinat/designs/difference_matrices.py +279 -0
  32. sage/combinat/designs/evenly_distributed_sets.cpython-310-aarch64-linux-gnu.so +0 -0
  33. sage/combinat/designs/evenly_distributed_sets.pyx +661 -0
  34. sage/combinat/designs/ext_rep.py +1064 -0
  35. sage/combinat/designs/gen_quadrangles_with_spread.cpython-310-aarch64-linux-gnu.so +0 -0
  36. sage/combinat/designs/gen_quadrangles_with_spread.pyx +339 -0
  37. sage/combinat/designs/group_divisible_designs.py +361 -0
  38. sage/combinat/designs/incidence_structures.py +2357 -0
  39. sage/combinat/designs/latin_squares.py +581 -0
  40. sage/combinat/designs/orthogonal_arrays.py +2244 -0
  41. sage/combinat/designs/orthogonal_arrays_build_recursive.py +1780 -0
  42. sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-310-aarch64-linux-gnu.so +0 -0
  43. sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +967 -0
  44. sage/combinat/designs/resolvable_bibd.py +815 -0
  45. sage/combinat/designs/steiner_quadruple_systems.py +1306 -0
  46. sage/combinat/designs/subhypergraph_search.cpython-310-aarch64-linux-gnu.so +0 -0
  47. sage/combinat/designs/subhypergraph_search.pyx +530 -0
  48. sage/combinat/designs/twographs.py +306 -0
  49. sage/combinat/finite_state_machine.py +14874 -0
  50. sage/combinat/finite_state_machine_generators.py +2006 -0
  51. sage/combinat/graph_path.py +448 -0
  52. sage/combinat/interval_posets.py +3908 -0
  53. sage/combinat/nu_tamari_lattice.py +269 -0
  54. sage/combinat/ordered_tree.py +1446 -0
  55. sage/combinat/posets/all.py +46 -0
  56. sage/combinat/posets/bubble_shuffle.py +247 -0
  57. sage/combinat/posets/cartesian_product.py +493 -0
  58. sage/combinat/posets/d_complete.py +182 -0
  59. sage/combinat/posets/elements.py +273 -0
  60. sage/combinat/posets/forest.py +30 -0
  61. sage/combinat/posets/hasse_cython.cpython-310-aarch64-linux-gnu.so +0 -0
  62. sage/combinat/posets/hasse_cython.pyx +174 -0
  63. sage/combinat/posets/hasse_diagram.py +3672 -0
  64. sage/combinat/posets/hochschild_lattice.py +158 -0
  65. sage/combinat/posets/incidence_algebras.py +794 -0
  66. sage/combinat/posets/lattices.py +5117 -0
  67. sage/combinat/posets/linear_extension_iterator.cpython-310-aarch64-linux-gnu.so +0 -0
  68. sage/combinat/posets/linear_extension_iterator.pyx +292 -0
  69. sage/combinat/posets/linear_extensions.py +1037 -0
  70. sage/combinat/posets/mobile.py +275 -0
  71. sage/combinat/posets/moebius_algebra.py +776 -0
  72. sage/combinat/posets/poset_examples.py +2178 -0
  73. sage/combinat/posets/posets.py +9360 -0
  74. sage/combinat/rooted_tree.py +1070 -0
  75. sage/combinat/shard_order.py +239 -0
  76. sage/combinat/tamari_lattices.py +384 -0
  77. sage/combinat/yang_baxter_graph.py +923 -0
  78. sage/databases/all__sagemath_graphs.py +1 -0
  79. sage/databases/knotinfo_db.py +1231 -0
  80. sage/ext_data/all__sagemath_graphs.py +1 -0
  81. sage/ext_data/graphs/graph_plot_js.html +330 -0
  82. sage/ext_data/kenzo/CP2.txt +45 -0
  83. sage/ext_data/kenzo/CP3.txt +349 -0
  84. sage/ext_data/kenzo/CP4.txt +4774 -0
  85. sage/ext_data/kenzo/README.txt +49 -0
  86. sage/ext_data/kenzo/S4.txt +20 -0
  87. sage/graphs/all.py +42 -0
  88. sage/graphs/asteroidal_triples.cpython-310-aarch64-linux-gnu.so +0 -0
  89. sage/graphs/asteroidal_triples.pyx +320 -0
  90. sage/graphs/base/all.py +1 -0
  91. sage/graphs/base/boost_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  92. sage/graphs/base/boost_graph.pxd +106 -0
  93. sage/graphs/base/boost_graph.pyx +3045 -0
  94. sage/graphs/base/c_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  95. sage/graphs/base/c_graph.pxd +106 -0
  96. sage/graphs/base/c_graph.pyx +5096 -0
  97. sage/graphs/base/dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  98. sage/graphs/base/dense_graph.pxd +28 -0
  99. sage/graphs/base/dense_graph.pyx +801 -0
  100. sage/graphs/base/graph_backends.cpython-310-aarch64-linux-gnu.so +0 -0
  101. sage/graphs/base/graph_backends.pxd +5 -0
  102. sage/graphs/base/graph_backends.pyx +797 -0
  103. sage/graphs/base/overview.py +85 -0
  104. sage/graphs/base/sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  105. sage/graphs/base/sparse_graph.pxd +90 -0
  106. sage/graphs/base/sparse_graph.pyx +1653 -0
  107. sage/graphs/base/static_dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  108. sage/graphs/base/static_dense_graph.pxd +5 -0
  109. sage/graphs/base/static_dense_graph.pyx +1032 -0
  110. sage/graphs/base/static_sparse_backend.cpython-310-aarch64-linux-gnu.so +0 -0
  111. sage/graphs/base/static_sparse_backend.pxd +27 -0
  112. sage/graphs/base/static_sparse_backend.pyx +1583 -0
  113. sage/graphs/base/static_sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  114. sage/graphs/base/static_sparse_graph.pxd +37 -0
  115. sage/graphs/base/static_sparse_graph.pyx +1375 -0
  116. sage/graphs/bipartite_graph.py +2732 -0
  117. sage/graphs/centrality.cpython-310-aarch64-linux-gnu.so +0 -0
  118. sage/graphs/centrality.pyx +1038 -0
  119. sage/graphs/cographs.py +519 -0
  120. sage/graphs/comparability.cpython-310-aarch64-linux-gnu.so +0 -0
  121. sage/graphs/comparability.pyx +851 -0
  122. sage/graphs/connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
  123. sage/graphs/connectivity.pxd +157 -0
  124. sage/graphs/connectivity.pyx +4813 -0
  125. sage/graphs/convexity_properties.cpython-310-aarch64-linux-gnu.so +0 -0
  126. sage/graphs/convexity_properties.pxd +16 -0
  127. sage/graphs/convexity_properties.pyx +870 -0
  128. sage/graphs/digraph.py +4754 -0
  129. sage/graphs/digraph_generators.py +1993 -0
  130. sage/graphs/distances_all_pairs.cpython-310-aarch64-linux-gnu.so +0 -0
  131. sage/graphs/distances_all_pairs.pxd +12 -0
  132. sage/graphs/distances_all_pairs.pyx +2938 -0
  133. sage/graphs/domination.py +1363 -0
  134. sage/graphs/dot2tex_utils.py +100 -0
  135. sage/graphs/edge_connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
  136. sage/graphs/edge_connectivity.pyx +1215 -0
  137. sage/graphs/generators/all.py +1 -0
  138. sage/graphs/generators/basic.py +1769 -0
  139. sage/graphs/generators/chessboard.py +538 -0
  140. sage/graphs/generators/classical_geometries.py +1611 -0
  141. sage/graphs/generators/degree_sequence.py +235 -0
  142. sage/graphs/generators/distance_regular.cpython-310-aarch64-linux-gnu.so +0 -0
  143. sage/graphs/generators/distance_regular.pyx +2846 -0
  144. sage/graphs/generators/families.py +4759 -0
  145. sage/graphs/generators/intersection.py +565 -0
  146. sage/graphs/generators/platonic_solids.py +262 -0
  147. sage/graphs/generators/random.py +2623 -0
  148. sage/graphs/generators/smallgraphs.py +5741 -0
  149. sage/graphs/generators/world_map.py +724 -0
  150. sage/graphs/generic_graph.py +26867 -0
  151. sage/graphs/generic_graph_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
  152. sage/graphs/generic_graph_pyx.pxd +34 -0
  153. sage/graphs/generic_graph_pyx.pyx +1673 -0
  154. sage/graphs/genus.cpython-310-aarch64-linux-gnu.so +0 -0
  155. sage/graphs/genus.pyx +622 -0
  156. sage/graphs/graph.py +9645 -0
  157. sage/graphs/graph_coloring.cpython-310-aarch64-linux-gnu.so +0 -0
  158. sage/graphs/graph_coloring.pyx +2284 -0
  159. sage/graphs/graph_database.py +1177 -0
  160. sage/graphs/graph_decompositions/all.py +1 -0
  161. sage/graphs/graph_decompositions/bandwidth.cpython-310-aarch64-linux-gnu.so +0 -0
  162. sage/graphs/graph_decompositions/bandwidth.pyx +428 -0
  163. sage/graphs/graph_decompositions/clique_separators.cpython-310-aarch64-linux-gnu.so +0 -0
  164. sage/graphs/graph_decompositions/clique_separators.pyx +616 -0
  165. sage/graphs/graph_decompositions/cutwidth.cpython-310-aarch64-linux-gnu.so +0 -0
  166. sage/graphs/graph_decompositions/cutwidth.pyx +753 -0
  167. sage/graphs/graph_decompositions/fast_digraph.cpython-310-aarch64-linux-gnu.so +0 -0
  168. sage/graphs/graph_decompositions/fast_digraph.pxd +13 -0
  169. sage/graphs/graph_decompositions/fast_digraph.pyx +212 -0
  170. sage/graphs/graph_decompositions/graph_products.cpython-310-aarch64-linux-gnu.so +0 -0
  171. sage/graphs/graph_decompositions/graph_products.pyx +508 -0
  172. sage/graphs/graph_decompositions/modular_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
  173. sage/graphs/graph_decompositions/modular_decomposition.pxd +27 -0
  174. sage/graphs/graph_decompositions/modular_decomposition.pyx +1536 -0
  175. sage/graphs/graph_decompositions/slice_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
  176. sage/graphs/graph_decompositions/slice_decomposition.pxd +18 -0
  177. sage/graphs/graph_decompositions/slice_decomposition.pyx +1106 -0
  178. sage/graphs/graph_decompositions/tree_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
  179. sage/graphs/graph_decompositions/tree_decomposition.pxd +17 -0
  180. sage/graphs/graph_decompositions/tree_decomposition.pyx +1996 -0
  181. sage/graphs/graph_decompositions/vertex_separation.cpython-310-aarch64-linux-gnu.so +0 -0
  182. sage/graphs/graph_decompositions/vertex_separation.pxd +5 -0
  183. sage/graphs/graph_decompositions/vertex_separation.pyx +1963 -0
  184. sage/graphs/graph_editor.py +82 -0
  185. sage/graphs/graph_generators.py +3314 -0
  186. sage/graphs/graph_generators_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
  187. sage/graphs/graph_generators_pyx.pyx +95 -0
  188. sage/graphs/graph_input.py +812 -0
  189. sage/graphs/graph_latex.py +2064 -0
  190. sage/graphs/graph_list.py +410 -0
  191. sage/graphs/graph_plot.py +1756 -0
  192. sage/graphs/graph_plot_js.py +338 -0
  193. sage/graphs/hyperbolicity.cpython-310-aarch64-linux-gnu.so +0 -0
  194. sage/graphs/hyperbolicity.pyx +1704 -0
  195. sage/graphs/hypergraph_generators.py +364 -0
  196. sage/graphs/independent_sets.cpython-310-aarch64-linux-gnu.so +0 -0
  197. sage/graphs/independent_sets.pxd +13 -0
  198. sage/graphs/independent_sets.pyx +402 -0
  199. sage/graphs/isgci.py +1033 -0
  200. sage/graphs/isoperimetric_inequalities.cpython-310-aarch64-linux-gnu.so +0 -0
  201. sage/graphs/isoperimetric_inequalities.pyx +489 -0
  202. sage/graphs/line_graph.cpython-310-aarch64-linux-gnu.so +0 -0
  203. sage/graphs/line_graph.pyx +743 -0
  204. sage/graphs/lovasz_theta.py +77 -0
  205. sage/graphs/matching.py +1633 -0
  206. sage/graphs/matching_covered_graph.py +3590 -0
  207. sage/graphs/orientations.py +1489 -0
  208. sage/graphs/partial_cube.py +459 -0
  209. sage/graphs/path_enumeration.cpython-310-aarch64-linux-gnu.so +0 -0
  210. sage/graphs/path_enumeration.pyx +2040 -0
  211. sage/graphs/pq_trees.py +1129 -0
  212. sage/graphs/print_graphs.py +201 -0
  213. sage/graphs/schnyder.py +865 -0
  214. sage/graphs/spanning_tree.cpython-310-aarch64-linux-gnu.so +0 -0
  215. sage/graphs/spanning_tree.pyx +1457 -0
  216. sage/graphs/strongly_regular_db.cpython-310-aarch64-linux-gnu.so +0 -0
  217. sage/graphs/strongly_regular_db.pyx +3340 -0
  218. sage/graphs/traversals.cpython-310-aarch64-linux-gnu.so +0 -0
  219. sage/graphs/traversals.pxd +9 -0
  220. sage/graphs/traversals.pyx +1872 -0
  221. sage/graphs/trees.cpython-310-aarch64-linux-gnu.so +0 -0
  222. sage/graphs/trees.pxd +15 -0
  223. sage/graphs/trees.pyx +310 -0
  224. sage/graphs/tutte_polynomial.py +713 -0
  225. sage/graphs/views.cpython-310-aarch64-linux-gnu.so +0 -0
  226. sage/graphs/views.pyx +794 -0
  227. sage/graphs/weakly_chordal.cpython-310-aarch64-linux-gnu.so +0 -0
  228. sage/graphs/weakly_chordal.pyx +604 -0
  229. sage/groups/all__sagemath_graphs.py +1 -0
  230. sage/groups/perm_gps/all__sagemath_graphs.py +1 -0
  231. sage/groups/perm_gps/partn_ref/all__sagemath_graphs.py +1 -0
  232. sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-310-aarch64-linux-gnu.so +0 -0
  233. sage/groups/perm_gps/partn_ref/refinement_graphs.pxd +38 -0
  234. sage/groups/perm_gps/partn_ref/refinement_graphs.pyx +1666 -0
  235. sage/knots/all.py +6 -0
  236. sage/knots/free_knotinfo_monoid.py +507 -0
  237. sage/knots/gauss_code.py +291 -0
  238. sage/knots/knot.py +682 -0
  239. sage/knots/knot_table.py +284 -0
  240. sage/knots/knotinfo.py +2900 -0
  241. sage/knots/link.py +4715 -0
  242. sage/sandpiles/all.py +13 -0
  243. sage/sandpiles/examples.py +225 -0
  244. sage/sandpiles/sandpile.py +6365 -0
  245. sage/topology/all.py +22 -0
  246. sage/topology/cell_complex.py +1214 -0
  247. sage/topology/cubical_complex.py +1976 -0
  248. sage/topology/delta_complex.py +1806 -0
  249. sage/topology/filtered_simplicial_complex.py +744 -0
  250. sage/topology/moment_angle_complex.py +823 -0
  251. sage/topology/simplicial_complex.py +5160 -0
  252. sage/topology/simplicial_complex_catalog.py +92 -0
  253. sage/topology/simplicial_complex_examples.py +1680 -0
  254. sage/topology/simplicial_complex_homset.py +205 -0
  255. sage/topology/simplicial_complex_morphism.py +836 -0
  256. sage/topology/simplicial_set.py +4102 -0
  257. sage/topology/simplicial_set_catalog.py +55 -0
  258. sage/topology/simplicial_set_constructions.py +2954 -0
  259. sage/topology/simplicial_set_examples.py +865 -0
  260. sage/topology/simplicial_set_morphism.py +1464 -0
@@ -0,0 +1,776 @@
1
+ # sage_setup: distribution = sagemath-graphs
2
+ # sage.doctest: needs sage.modules
3
+ r"""
4
+ Möbius algebras
5
+ """
6
+ # ****************************************************************************
7
+ # Copyright (C) 2014 Travis Scrimshaw <tscrim at ucdavis.edu>,
8
+ #
9
+ # Distributed under the terms of the GNU General Public License (GPL)
10
+ #
11
+ # This code is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # General Public License for more details.
15
+ #
16
+ # The full text of the GPL is available at:
17
+ #
18
+ # https://www.gnu.org/licenses/
19
+ # ****************************************************************************
20
+
21
+ from sage.misc.cachefunc import cached_method
22
+ from sage.misc.bindable_class import BindableClass
23
+ from sage.structure.parent import Parent
24
+ from sage.structure.unique_representation import UniqueRepresentation
25
+ from sage.categories.algebras import Algebras
26
+ from sage.categories.realizations import Realizations, Category_realization_of_parent
27
+ from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
28
+ from sage.combinat.free_module import CombinatorialFreeModule
29
+ from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing
30
+ from sage.rings.integer_ring import ZZ
31
+
32
+
33
+ class BasisAbstract(CombinatorialFreeModule, BindableClass):
34
+ """
35
+ Abstract base class for a basis.
36
+ """
37
+ def __getitem__(self, x):
38
+ """
39
+ Return the basis element indexed by ``x``.
40
+
41
+ INPUT:
42
+
43
+ - ``x`` -- an element of the lattice
44
+
45
+ EXAMPLES::
46
+
47
+ sage: L = posets.BooleanLattice(4)
48
+ sage: E = L.moebius_algebra(QQ).E()
49
+ sage: E[5]
50
+ E[5]
51
+ sage: C = L.quantum_moebius_algebra().C()
52
+ sage: C[5]
53
+ C[5]
54
+ """
55
+ L = self.realization_of()._lattice
56
+ return self.monomial(L(x))
57
+
58
+
59
+ class MoebiusAlgebra(Parent, UniqueRepresentation):
60
+ r"""
61
+ The Möbius algebra of a lattice.
62
+
63
+ Let `L` be a lattice. The *Möbius algebra* `M_L` was originally
64
+ constructed by Solomon [Solomon67]_ and has a natural basis
65
+ `\{ E_x \mid x \in L \}` with multiplication given by
66
+ `E_x \cdot E_y = E_{x \vee y}`. Moreover this has a basis given by
67
+ orthogonal idempotents `\{ I_x \mid x \in L \}` (so
68
+ `I_x I_y = \delta_{xy} I_x` where `\delta` is the Kronecker delta)
69
+ related to the natural basis by
70
+
71
+ .. MATH::
72
+
73
+ I_x = \sum_{x \leq y} \mu_L(x, y) E_y,
74
+
75
+ where `\mu_L` is the Möbius function of `L`.
76
+
77
+ .. NOTE::
78
+
79
+ We use the join `\vee` for our multiplication, whereas [Greene73]_
80
+ and [Etienne98]_ define the Möbius algebra using the meet `\wedge`.
81
+ This is done for compatibility with :class:`QuantumMoebiusAlgebra`.
82
+
83
+ REFERENCES:
84
+
85
+ .. [Solomon67] Louis Solomon.
86
+ *The Burnside Algebra of a Finite Group*.
87
+ Journal of Combinatorial Theory, **2**, 1967.
88
+ :doi:`10.1016/S0021-9800(67)80064-4`.
89
+
90
+ .. [Greene73] Curtis Greene.
91
+ *On the Möbius algebra of a partially ordered set*.
92
+ Advances in Mathematics, **10**, 1973.
93
+ :doi:`10.1016/0001-8708(73)90106-0`.
94
+
95
+ .. [Etienne98] Gwihen Etienne.
96
+ *On the Möbius algebra of geometric lattices*.
97
+ European Journal of Combinatorics, **19**, 1998.
98
+ :doi:`10.1006/eujc.1998.0227`.
99
+ """
100
+ def __init__(self, R, L) -> None:
101
+ """
102
+ Initialize ``self``.
103
+
104
+ TESTS::
105
+
106
+ sage: L = posets.BooleanLattice(3)
107
+ sage: M = L.moebius_algebra(QQ)
108
+ sage: TestSuite(M).run()
109
+ """
110
+ cat = Algebras(R).Commutative().WithBasis()
111
+ if L in FiniteEnumeratedSets():
112
+ cat = cat.FiniteDimensional()
113
+ self._lattice = L
114
+ self._category = cat
115
+ Parent.__init__(self, base=R, category=self._category.WithRealizations())
116
+
117
+ def _repr_(self) -> str:
118
+ """
119
+ Return a string representation of ``self``.
120
+
121
+ EXAMPLES::
122
+
123
+ sage: L = posets.BooleanLattice(4)
124
+ sage: L.moebius_algebra(QQ)
125
+ Moebius algebra of Finite lattice containing 16 elements over Rational Field
126
+ """
127
+ return f"Moebius algebra of {self._lattice} over {self.base_ring()}"
128
+
129
+ def a_realization(self):
130
+ r"""
131
+ Return a particular realization of ``self`` (the `B`-basis).
132
+
133
+ EXAMPLES::
134
+
135
+ sage: L = posets.BooleanLattice(4)
136
+ sage: M = L.moebius_algebra(QQ)
137
+ sage: M.a_realization()
138
+ Moebius algebra of Finite lattice containing 16 elements
139
+ over Rational Field in the natural basis
140
+ """
141
+ return self.E()
142
+
143
+ def lattice(self):
144
+ """
145
+ Return the defining lattice of ``self``.
146
+
147
+ EXAMPLES::
148
+
149
+ sage: L = posets.BooleanLattice(4)
150
+ sage: M = L.moebius_algebra(QQ)
151
+ sage: M.lattice()
152
+ Finite lattice containing 16 elements
153
+ sage: M.lattice() == L
154
+ True
155
+ """
156
+ return self._lattice
157
+
158
+ class E(BasisAbstract):
159
+ r"""
160
+ The natural basis of a Möbius algebra.
161
+
162
+ Let `E_x` and `E_y` be basis elements of `M_L` for some lattice `L`.
163
+ Multiplication is given by `E_x E_y = E_{x \vee y}`.
164
+ """
165
+ def __init__(self, M, prefix='E') -> None:
166
+ """
167
+ Initialize ``self``.
168
+
169
+ TESTS::
170
+
171
+ sage: L = posets.BooleanLattice(4)
172
+ sage: M = L.moebius_algebra(QQ)
173
+ sage: TestSuite(M.E()).run()
174
+ """
175
+ self._basis_name = "natural"
176
+ CombinatorialFreeModule.__init__(self, M.base_ring(),
177
+ tuple(M._lattice),
178
+ prefix=prefix,
179
+ category=MoebiusAlgebraBases(M))
180
+
181
+ @cached_method
182
+ def _to_idempotent_basis(self, x):
183
+ """
184
+ Convert the element indexed by ``x`` to the idempotent basis.
185
+
186
+ EXAMPLES::
187
+
188
+ sage: M = posets.BooleanLattice(4).moebius_algebra(QQ)
189
+ sage: E = M.E()
190
+ sage: all(E(E._to_idempotent_basis(x)) == E.monomial(x)
191
+ ....: for x in E.basis().keys())
192
+ True
193
+ """
194
+ M = self.realization_of()
195
+ I = M.idempotent()
196
+ return I.sum_of_monomials(M._lattice.order_filter([x]))
197
+
198
+ def product_on_basis(self, x, y):
199
+ """
200
+ Return the product of basis elements indexed by ``x`` and ``y``.
201
+
202
+ EXAMPLES::
203
+
204
+ sage: L = posets.BooleanLattice(4)
205
+ sage: E = L.moebius_algebra(QQ).E()
206
+ sage: E.product_on_basis(5, 14)
207
+ E[15]
208
+ sage: E.product_on_basis(2, 8)
209
+ E[10]
210
+
211
+ TESTS::
212
+
213
+ sage: M = posets.BooleanLattice(4).moebius_algebra(QQ)
214
+ sage: E = M.E()
215
+ sage: I = M.I()
216
+ sage: all(I(x)*I(y) == I(x*y) for x in E.basis() for y in E.basis())
217
+ True
218
+ """
219
+ return self.monomial(self.realization_of()._lattice.join(x, y))
220
+
221
+ @cached_method
222
+ def one(self):
223
+ """
224
+ Return the element ``1`` of ``self``.
225
+
226
+ EXAMPLES::
227
+
228
+ sage: L = posets.BooleanLattice(4)
229
+ sage: E = L.moebius_algebra(QQ).E()
230
+ sage: E.one()
231
+ E[0]
232
+ """
233
+ elts = self.realization_of()._lattice.minimal_elements()
234
+ return self.sum_of_monomials(elts)
235
+
236
+ natural = E
237
+
238
+ class I(BasisAbstract):
239
+ r"""
240
+ The (orthogonal) idempotent basis of a Möbius algebra.
241
+
242
+ Let `I_x` and `I_y` be basis elements of `M_L` for some lattice `L`.
243
+ Multiplication is given by `I_x I_y = \delta_{xy} I_x` where
244
+ `\delta_{xy}` is the Kronecker delta.
245
+ """
246
+ def __init__(self, M, prefix='I') -> None:
247
+ """
248
+ Initialize ``self``.
249
+
250
+ TESTS::
251
+
252
+ sage: L = posets.BooleanLattice(4)
253
+ sage: M = L.moebius_algebra(QQ)
254
+ sage: TestSuite(M.I()).run()
255
+
256
+ Check that the transition maps can be pickled::
257
+
258
+ sage: L = posets.BooleanLattice(4)
259
+ sage: M = L.moebius_algebra(QQ)
260
+ sage: E = M.E()
261
+ sage: I = M.I()
262
+ sage: phi = E.coerce_map_from(I)
263
+ sage: loads(dumps(phi))
264
+ Generic morphism:
265
+ ...
266
+ """
267
+ self._basis_name = "idempotent"
268
+ CombinatorialFreeModule.__init__(self, M.base_ring(),
269
+ tuple(M._lattice),
270
+ prefix=prefix,
271
+ category=MoebiusAlgebraBases(M))
272
+
273
+ # Change of basis:
274
+ E = M.E()
275
+ self.module_morphism(self._to_natural_basis,
276
+ codomain=E, category=self.category(),
277
+ triangular='lower', unitriangular=True,
278
+ key=M._lattice._element_to_vertex
279
+ ).register_as_coercion()
280
+
281
+ E.module_morphism(E._to_idempotent_basis,
282
+ codomain=self, category=self.category(),
283
+ triangular='lower', unitriangular=True,
284
+ key=M._lattice._element_to_vertex
285
+ ).register_as_coercion()
286
+
287
+ @cached_method
288
+ def _to_natural_basis(self, x):
289
+ """
290
+ Convert the element indexed by ``x`` to the natural basis.
291
+
292
+ EXAMPLES::
293
+
294
+ sage: M = posets.BooleanLattice(4).moebius_algebra(QQ)
295
+ sage: I = M.I()
296
+ sage: all(I(I._to_natural_basis(x)) == I.monomial(x)
297
+ ....: for x in I.basis().keys())
298
+ True
299
+ """
300
+ M = self.realization_of()
301
+ N = M.natural()
302
+ moebius = M._lattice.moebius_function
303
+ return N.sum_of_terms((y, moebius(x, y))
304
+ for y in M._lattice.order_filter([x]))
305
+
306
+ def product_on_basis(self, x, y):
307
+ """
308
+ Return the product of basis elements indexed by ``x`` and ``y``.
309
+
310
+ EXAMPLES::
311
+
312
+ sage: L = posets.BooleanLattice(4)
313
+ sage: I = L.moebius_algebra(QQ).I()
314
+ sage: I.product_on_basis(5, 14)
315
+ 0
316
+ sage: I.product_on_basis(2, 2)
317
+ I[2]
318
+
319
+ TESTS::
320
+
321
+ sage: M = posets.BooleanLattice(4).moebius_algebra(QQ)
322
+ sage: E = M.E()
323
+ sage: I = M.I()
324
+ sage: all(E(x)*E(y) == E(x*y) for x in I.basis() for y in I.basis())
325
+ True
326
+ """
327
+ if x == y:
328
+ return self.monomial(x)
329
+ return self.zero()
330
+
331
+ @cached_method
332
+ def one(self):
333
+ """
334
+ Return the element ``1`` of ``self``.
335
+
336
+ EXAMPLES::
337
+
338
+ sage: L = posets.BooleanLattice(4)
339
+ sage: I = L.moebius_algebra(QQ).I()
340
+ sage: I.one()
341
+ I[0] + I[1] + I[2] + I[3] + I[4] + I[5] + I[6] + I[7] + I[8]
342
+ + I[9] + I[10] + I[11] + I[12] + I[13] + I[14] + I[15]
343
+ """
344
+ return self.sum_of_monomials(self.realization_of()._lattice)
345
+
346
+ def __getitem__(self, x):
347
+ """
348
+ Return the basis element indexed by ``x``.
349
+
350
+ INPUT:
351
+
352
+ - ``x`` -- an element of the lattice
353
+
354
+ EXAMPLES::
355
+
356
+ sage: L = posets.BooleanLattice(4)
357
+ sage: I = L.moebius_algebra(QQ).I()
358
+ sage: I[5]
359
+ I[5]
360
+ """
361
+ L = self.realization_of()._lattice
362
+ return self.monomial(L(x))
363
+
364
+ idempotent = I
365
+
366
+
367
+ class QuantumMoebiusAlgebra(Parent, UniqueRepresentation):
368
+ r"""
369
+ The quantum Möbius algebra of a lattice.
370
+
371
+ Let `L` be a lattice, and we define the *quantum Möbius algebra* `M_L(q)`
372
+ as the algebra with basis `\{ E_x \mid x \in L \}` with
373
+ multiplication given by
374
+
375
+ .. MATH::
376
+
377
+ E_x E_y = \sum_{z \geq a \geq x \vee y} \mu_L(a, z)
378
+ q^{\operatorname{crk} a} E_z,
379
+
380
+ where `\mu_L` is the Möbius function of `L` and `\operatorname{crk}`
381
+ is the corank function (i.e., `\operatorname{crk} a =
382
+ \operatorname{rank} L - \operatorname{rank}` a). At `q = 1`, this
383
+ reduces to the multiplication formula originally given by Solomon.
384
+ """
385
+ def __init__(self, L, q=None) -> None:
386
+ """
387
+ Initialize ``self``.
388
+
389
+ TESTS::
390
+
391
+ sage: L = posets.BooleanLattice(4)
392
+ sage: M = L.quantum_moebius_algebra()
393
+ sage: TestSuite(M).run() # long time
394
+
395
+ sage: from sage.combinat.posets.moebius_algebra import QuantumMoebiusAlgebra
396
+ sage: L = posets.Crown(2)
397
+ sage: QuantumMoebiusAlgebra(L)
398
+ Traceback (most recent call last):
399
+ ...
400
+ ValueError: L must be a lattice
401
+ """
402
+ if not L.is_lattice():
403
+ raise ValueError("L must be a lattice")
404
+ if q is None:
405
+ q = LaurentPolynomialRing(ZZ, 'q').gen()
406
+ self._q = q
407
+ R = q.parent()
408
+ cat = Algebras(R).WithBasis()
409
+ if L in FiniteEnumeratedSets():
410
+ cat = cat.Commutative().FiniteDimensional()
411
+ self._lattice = L
412
+ self._category = cat
413
+ Parent.__init__(self, base=R, category=self._category.WithRealizations())
414
+
415
+ def _repr_(self) -> str:
416
+ """
417
+ Return a string representation of ``self``.
418
+
419
+ EXAMPLES::
420
+
421
+ sage: L = posets.BooleanLattice(4)
422
+ sage: L.quantum_moebius_algebra()
423
+ Quantum Moebius algebra of Finite lattice containing 16 elements
424
+ with q=q over Univariate Laurent Polynomial Ring in q over Integer Ring
425
+ """
426
+ txt = "Quantum Moebius algebra of {} with q={} over {}"
427
+ return txt.format(self._lattice, self._q, self.base_ring())
428
+
429
+ def a_realization(self):
430
+ r"""
431
+ Return a particular realization of ``self`` (the `B`-basis).
432
+
433
+ EXAMPLES::
434
+
435
+ sage: L = posets.BooleanLattice(4)
436
+ sage: M = L.quantum_moebius_algebra()
437
+ sage: M.a_realization()
438
+ Quantum Moebius algebra of Finite lattice containing 16 elements
439
+ with q=q over Univariate Laurent Polynomial Ring in q
440
+ over Integer Ring in the natural basis
441
+ """
442
+ return self.E()
443
+
444
+ def lattice(self):
445
+ """
446
+ Return the defining lattice of ``self``.
447
+
448
+ EXAMPLES::
449
+
450
+ sage: L = posets.BooleanLattice(4)
451
+ sage: M = L.quantum_moebius_algebra()
452
+ sage: M.lattice()
453
+ Finite lattice containing 16 elements
454
+ sage: M.lattice() == L
455
+ True
456
+ """
457
+ return self._lattice
458
+
459
+ class E(BasisAbstract):
460
+ r"""
461
+ The natural basis of a quantum Möbius algebra.
462
+
463
+ Let `E_x` and `E_y` be basis elements of `M_L` for some lattice `L`.
464
+ Multiplication is given by
465
+
466
+ .. MATH::
467
+
468
+ E_x E_y = \sum_{z \geq a \geq x \vee y} \mu_L(a, z)
469
+ q^{\operatorname{crk} a} E_z,
470
+
471
+ where `\mu_L` is the Möbius function of `L` and `\operatorname{crk}`
472
+ is the corank function (i.e., `\operatorname{crk} a =
473
+ \operatorname{rank} L - \operatorname{rank}` a).
474
+ """
475
+ def __init__(self, M, prefix='E') -> None:
476
+ """
477
+ Initialize ``self``.
478
+
479
+ TESTS::
480
+
481
+ sage: L = posets.BooleanLattice(4)
482
+ sage: M = L.quantum_moebius_algebra()
483
+ sage: TestSuite(M.E()).run() # long time
484
+ """
485
+ self._basis_name = "natural"
486
+ CombinatorialFreeModule.__init__(self, M.base_ring(),
487
+ tuple(M._lattice),
488
+ prefix=prefix,
489
+ category=MoebiusAlgebraBases(M))
490
+
491
+ def product_on_basis(self, x, y):
492
+ """
493
+ Return the product of basis elements indexed by ``x`` and ``y``.
494
+
495
+ EXAMPLES::
496
+
497
+ sage: L = posets.BooleanLattice(4)
498
+ sage: E = L.quantum_moebius_algebra().E()
499
+ sage: E.product_on_basis(5, 14)
500
+ E[15]
501
+ sage: E.product_on_basis(2, 8)
502
+ q^2*E[10] + (q-q^2)*E[11] + (q-q^2)*E[14] + (1-2*q+q^2)*E[15]
503
+ """
504
+ L = self.realization_of()._lattice
505
+ q = self.realization_of()._q
506
+ moebius = L.moebius_function
507
+ rank = L.rank_function()
508
+ R = L.rank()
509
+ j = L.join(x, y)
510
+ return self.sum_of_terms((z, moebius(a, z) * q**(R - rank(a)))
511
+ for z in L.order_filter([j])
512
+ for a in L.closed_interval(j, z))
513
+
514
+ @cached_method
515
+ def one(self):
516
+ """
517
+ Return the element ``1`` of ``self``.
518
+
519
+ EXAMPLES::
520
+
521
+ sage: L = posets.BooleanLattice(4)
522
+ sage: E = L.quantum_moebius_algebra().E()
523
+ sage: all(E.one() * b == b for b in E.basis())
524
+ True
525
+ """
526
+ L = self.realization_of()._lattice
527
+ q = self.realization_of()._q
528
+ moebius = L.moebius_function
529
+ rank = L.rank_function()
530
+ R = L.rank()
531
+ return self.sum_of_terms((x, moebius(y, x) * q**(rank(y) - R))
532
+ for x in L for y in L.order_ideal([x]))
533
+
534
+ natural = E
535
+
536
+ class C(BasisAbstract):
537
+ r"""
538
+ The characteristic basis of a quantum Möbius algebra.
539
+
540
+ The characteristic basis `\{ C_x \mid x \in L \}` of `M_L`
541
+ for some lattice `L` is defined by
542
+
543
+ .. MATH::
544
+
545
+ C_x = \sum_{a \geq x} P(F^x; q) E_a,
546
+
547
+ where `F^x = \{ y \in L \mid y \geq x \}` is the principal order
548
+ filter of `x` and `P(F^x; q)` is the characteristic polynomial
549
+ of the (sub)poset `F^x`.
550
+ """
551
+ def __init__(self, M, prefix='C') -> None:
552
+ """
553
+ Initialize ``self``.
554
+
555
+ TESTS::
556
+
557
+ sage: L = posets.BooleanLattice(3)
558
+ sage: M = L.quantum_moebius_algebra()
559
+ sage: TestSuite(M.C()).run() # long time
560
+ """
561
+ self._basis_name = "characteristic"
562
+ CombinatorialFreeModule.__init__(self, M.base_ring(),
563
+ tuple(M._lattice),
564
+ prefix=prefix,
565
+ category=MoebiusAlgebraBases(M))
566
+
567
+ # Change of basis:
568
+ E = M.E()
569
+ phi = self.module_morphism(self._to_natural_basis,
570
+ codomain=E, category=self.category(),
571
+ triangular='lower', unitriangular=True,
572
+ key=M._lattice._element_to_vertex)
573
+
574
+ phi.register_as_coercion()
575
+ (~phi).register_as_coercion()
576
+
577
+ @cached_method
578
+ def _to_natural_basis(self, x):
579
+ """
580
+ Convert the element indexed by ``x`` to the natural basis.
581
+
582
+ EXAMPLES::
583
+
584
+ sage: M = posets.BooleanLattice(4).quantum_moebius_algebra()
585
+ sage: C = M.C()
586
+ sage: all(C(C._to_natural_basis(x)) == C.monomial(x)
587
+ ....: for x in C.basis().keys())
588
+ True
589
+ """
590
+ M = self.realization_of()
591
+ N = M.natural()
592
+ q = M._q
593
+ L = M._lattice
594
+
595
+ def poly(x, y):
596
+ return L.subposet(L.closed_interval(x, y)).characteristic_polynomial()
597
+ return N.sum_of_terms((y, poly(x, y)(q=q))
598
+ for y in L.order_filter([x]))
599
+
600
+ characteristic_basis = C
601
+
602
+ class KL(BasisAbstract):
603
+ r"""
604
+ The Kazhdan-Lusztig basis of a quantum Möbius algebra.
605
+
606
+ The Kazhdan-Lusztig basis `\{ B_x \mid x \in L \}` of `M_L`
607
+ for some lattice `L` is defined by
608
+
609
+ .. MATH::
610
+
611
+ B_x = \sum_{y \geq x} P_{x,y}(q) E_a,
612
+
613
+ where `P_{x,y}(q)` is the Kazhdan-Lusztig polynomial of `L`,
614
+ following the definition given in [EPW14]_.
615
+
616
+ EXAMPLES:
617
+
618
+ We construct some examples of Proposition 4.5 of [EPW14]_::
619
+
620
+ sage: M = posets.BooleanLattice(4).quantum_moebius_algebra()
621
+ sage: KL = M.KL()
622
+ sage: KL[4] * KL[5]
623
+ (q^2+q^3)*KL[5] + (q+2*q^2+q^3)*KL[7] + (q+2*q^2+q^3)*KL[13]
624
+ + (1+3*q+3*q^2+q^3)*KL[15]
625
+ sage: KL[4] * KL[15]
626
+ (1+3*q+3*q^2+q^3)*KL[15]
627
+ sage: KL[4] * KL[10]
628
+ (q+3*q^2+3*q^3+q^4)*KL[14] + (1+4*q+6*q^2+4*q^3+q^4)*KL[15]
629
+ """
630
+ def __init__(self, M, prefix='KL') -> None:
631
+ """
632
+ Initialize ``self``.
633
+
634
+ TESTS::
635
+
636
+ sage: L = posets.BooleanLattice(3)
637
+ sage: M = L.quantum_moebius_algebra()
638
+ sage: TestSuite(M.KL()).run() # long time
639
+ """
640
+ self._basis_name = "Kazhdan-Lusztig"
641
+ CombinatorialFreeModule.__init__(self, M.base_ring(),
642
+ tuple(M._lattice),
643
+ prefix=prefix,
644
+ category=MoebiusAlgebraBases(M))
645
+
646
+ # Change of basis:
647
+ E = M.E()
648
+ phi = self.module_morphism(self._to_natural_basis,
649
+ codomain=E, category=self.category(),
650
+ triangular='lower', unitriangular=True,
651
+ key=M._lattice._element_to_vertex)
652
+
653
+ phi.register_as_coercion()
654
+ (~phi).register_as_coercion()
655
+
656
+ @cached_method
657
+ def _to_natural_basis(self, x):
658
+ """
659
+ Convert the element indexed by ``x`` to the natural basis.
660
+
661
+ EXAMPLES::
662
+
663
+ sage: M = posets.BooleanLattice(4).quantum_moebius_algebra()
664
+ sage: KL = M.KL()
665
+ sage: all(KL(KL._to_natural_basis(x)) == KL.monomial(x) # long time
666
+ ....: for x in KL.basis().keys())
667
+ True
668
+ """
669
+ M = self.realization_of()
670
+ L = M._lattice
671
+ E = M.E()
672
+ q = M._q
673
+ rank = L.rank_function()
674
+ return E.sum_of_terms((y, q**(rank(y) - rank(x)) *
675
+ L.kazhdan_lusztig_polynomial(x, y)(q=q**-2))
676
+ for y in L.order_filter([x]))
677
+
678
+ kazhdan_lusztig = KL
679
+
680
+
681
+ class MoebiusAlgebraBases(Category_realization_of_parent):
682
+ r"""
683
+ The category of bases of a Möbius algebra.
684
+
685
+ INPUT:
686
+
687
+ - ``base`` -- a Möbius algebra
688
+
689
+ TESTS::
690
+
691
+ sage: from sage.combinat.posets.moebius_algebra import MoebiusAlgebraBases
692
+ sage: M = posets.BooleanLattice(4).moebius_algebra(QQ)
693
+ sage: bases = MoebiusAlgebraBases(M)
694
+ sage: M.E() in bases
695
+ True
696
+ """
697
+ def _repr_(self) -> str:
698
+ r"""
699
+ Return the representation of ``self``.
700
+
701
+ EXAMPLES::
702
+
703
+ sage: from sage.combinat.posets.moebius_algebra import MoebiusAlgebraBases
704
+ sage: M = posets.BooleanLattice(4).moebius_algebra(QQ)
705
+ sage: MoebiusAlgebraBases(M)
706
+ Category of bases of Moebius algebra of Finite lattice
707
+ containing 16 elements over Rational Field
708
+ """
709
+ return f"Category of bases of {self.base()}"
710
+
711
+ def super_categories(self):
712
+ r"""
713
+ The super categories of ``self``.
714
+
715
+ EXAMPLES::
716
+
717
+ sage: from sage.combinat.posets.moebius_algebra import MoebiusAlgebraBases
718
+ sage: M = posets.BooleanLattice(4).moebius_algebra(QQ)
719
+ sage: bases = MoebiusAlgebraBases(M)
720
+ sage: bases.super_categories()
721
+ [Category of finite dimensional commutative algebras with basis over Rational Field,
722
+ Category of realizations of Moebius algebra of Finite lattice
723
+ containing 16 elements over Rational Field]
724
+ """
725
+ return [self.base()._category, Realizations(self.base())]
726
+
727
+ class ParentMethods:
728
+ def _repr_(self) -> str:
729
+ """
730
+ Text representation of this basis of a Möbius algebra.
731
+
732
+ EXAMPLES::
733
+
734
+ sage: M = posets.BooleanLattice(4).moebius_algebra(QQ)
735
+ sage: M.E()
736
+ Moebius algebra of Finite lattice containing 16 elements
737
+ over Rational Field in the natural basis
738
+ sage: M.I()
739
+ Moebius algebra of Finite lattice containing 16 elements
740
+ over Rational Field in the idempotent basis
741
+ """
742
+ return f"{self.realization_of()} in the {self._basis_name} basis"
743
+
744
+ def product_on_basis(self, x, y):
745
+ """
746
+ Return the product of basis elements indexed by ``x`` and ``y``.
747
+
748
+ EXAMPLES::
749
+
750
+ sage: L = posets.BooleanLattice(4)
751
+ sage: C = L.quantum_moebius_algebra().C()
752
+ sage: C.product_on_basis(5, 14)
753
+ q^3*C[15]
754
+ sage: C.product_on_basis(2, 8)
755
+ q^4*C[10]
756
+ """
757
+ R = self.realization_of().a_realization()
758
+ return self(R(self.monomial(x)) * R(self.monomial(y)))
759
+
760
+ @cached_method
761
+ def one(self):
762
+ """
763
+ Return the element ``1`` of ``self``.
764
+
765
+ EXAMPLES::
766
+
767
+ sage: L = posets.BooleanLattice(4)
768
+ sage: C = L.quantum_moebius_algebra().C()
769
+ sage: all(C.one() * b == b for b in C.basis())
770
+ True
771
+ """
772
+ R = self.realization_of().a_realization()
773
+ return self(R.one())
774
+
775
+ class ElementMethods:
776
+ pass