Skip to content

Commit

Permalink
Trac #34368: implement the F,H,M triangles
Browse files Browse the repository at this point in the history
as useful invariants of posets and simplicial complexes

URL: https://trac.sagemath.org/34368
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Travis Scrimshaw, John Palmieri
  • Loading branch information
Release Manager committed Oct 31, 2022
2 parents 859c351 + aa6105d commit f634f6b
Show file tree
Hide file tree
Showing 4 changed files with 840 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/doc/en/reference/combinat/module_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ Comprehensive Module List
sage/combinat/tamari_lattices
sage/combinat/tiling
sage/combinat/tools
sage/combinat/triangles_FHM
sage/combinat/tuple
sage/combinat/tutorial
sage/combinat/vector_partition
Expand Down
51 changes: 49 additions & 2 deletions src/sage/combinat/posets/posets.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
:meth:`~FinitePoset.flag_h_polynomial` | Return the flag h-polynomial of the poset.
:meth:`~FinitePoset.order_polynomial` | Return the order polynomial of the poset.
:meth:`~FinitePoset.zeta_polynomial` | Return the zeta polynomial of the poset.
:meth:`~FinitePoset.M_triangle` | Return the M-triangle of the poset.
:meth:`~FinitePoset.kazhdan_lusztig_polynomial` | Return the Kazhdan-Lusztig polynomial of the poset.
:meth:`~FinitePoset.coxeter_polynomial` | Return the characteristic polynomial of the Coxeter transformation.
:meth:`~FinitePoset.degree_polynomial` | Return the generating polynomial of degrees of vertices in the Hasse diagram.
Expand Down Expand Up @@ -7259,6 +7260,47 @@ def zeta_polynomial(self):
f = g[n] + f / n
return f

def M_triangle(self):
r"""
Return the M-triangle of the poset.
The poset is expected to be graded.
OUTPUT:
an :class:`~sage.combinat.triangles_FHM.M_triangle`
The M-triangle is the generating polynomial of the Möbius numbers
.. MATH::
M(x, y)=\sum_{a \leq b} \mu(a,b) x^{|a|}y^{|b|} .
EXAMPLES::
sage: P = posets.DiamondPoset(5)
sage: P.M_triangle()
M: x^2*y^2 - 3*x*y^2 + 3*x*y + 2*y^2 - 3*y + 1
TESTS::
sage: P = posets.PentagonPoset()
sage: P.M_triangle()
Traceback (most recent call last):
...
ValueError: the poset is not graded
"""
from sage.combinat.triangles_FHM import M_triangle
hasse = self._hasse_diagram
rk = hasse.rank_function()
if rk is None:
raise ValueError('the poset is not graded')
x, y = polygen(ZZ, 'x,y')
p = sum(hasse.moebius_function(a, b) * x**rk(a) * y**rk(b)
for a in hasse
for b in hasse.principal_order_filter(a))
return M_triangle(p)

def f_polynomial(self):
r"""
Return the `f`-polynomial of the poset.
Expand Down Expand Up @@ -7296,12 +7338,17 @@ def f_polynomial(self):
sage: P = Poset({2: []})
sage: P.f_polynomial()
1
sage: P = Poset({2:[1,3]})
sage: P.f_polynomial()
Traceback (most recent call last):
...
ValueError: the poset is not bounded
"""
q = polygen(ZZ, 'q')
one = q.parent().one()
hasse = self._hasse_diagram
if len(hasse) == 1:
return one
return q.parent().one()
maxi = hasse.top()
mini = hasse.bottom()
if mini is None or maxi is None:
Expand Down
Loading

0 comments on commit f634f6b

Please sign in to comment.