Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce new apozeta polynomial for posets #39248

Merged
merged 4 commits into from
Feb 21, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 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.apozeta_polynomial` | Return the apozeta 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.
Expand Down Expand Up @@ -7236,6 +7237,8 @@
In particular, `Z(2)` is the number of vertices and `Z(3)` is
the number of intervals.

.. SEEALSO:: :meth:`apozeta_polynomial`

EXAMPLES::

sage: posets.ChainPoset(2).zeta_polynomial()
Expand Down Expand Up @@ -7276,6 +7279,53 @@
f = g[n] + f / n
return f

def apozeta_polynomial(self):
r"""
Return the apozeta polynomial of the poset ``self``.

The poset is assumed to be graded.

The apozeta polynomial of a poset is the unique polynomial
`Z^{a}(q)` such that for every integer `m > 1`, `Z^{a}(m)` is
the number of weakly increasing sequences `x_1 \leq x_2 \leq
\dots \leq x_{m-1}` of elements of the poset whose largest
element belongs to the top level of the poset.

When the poset `P` has a unique maximal element, this is
equal to `Z(q-1)` where `Z` is the zeta polynomial of `P`.

The name comes from the greek radical ``apo``.

.. SEEALSO:: :meth:`zeta_polynomial`

EXAMPLES::

sage: P = posets.NoncrossingPartitions(SymmetricGroup(4))
sage: P.apozeta_polynomial()

Check failure on line 7304 in src/sage/combinat/posets/posets.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 728, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1152, in compile_and_execute exec(compiled, globs) File "<doctest sage.combinat.posets.posets.FinitePoset.apozeta_polynomial[1]>", line 1, in <module> P.apozeta_polynomial() File "/sage/src/sage/combinat/posets/posets.py", line 7326, in apozeta_polynomial return sum(binomial(q - 2, len(c) - 1) File "/sage/src/sage/combinat/posets/posets.py", line 7326, in <genexpr> return sum(binomial(q - 2, len(c) - 1) NameError: name 'binomial' is not defined
8/3*q^3 - 10*q^2 + 37/3*q - 5

sage: P = Poset({"a": "bc", "b": "d", "c": "de"})
sage: P.apozeta_polynomial()

Check failure on line 7308 in src/sage/combinat/posets/posets.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 728, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1152, in compile_and_execute exec(compiled, globs) File "<doctest sage.combinat.posets.posets.FinitePoset.apozeta_polynomial[3]>", line 1, in <module> P.apozeta_polynomial() File "/sage/src/sage/combinat/posets/posets.py", line 7326, in apozeta_polynomial return sum(binomial(q - 2, len(c) - 1) File "/sage/src/sage/combinat/posets/posets.py", line 7326, in <genexpr> return sum(binomial(q - 2, len(c) - 1) NameError: name 'binomial' is not defined
3/2*q^2 - 5/2*q + 1
sage: P.zeta_polynomial()
3/2*q^2 - 1/2*q

TESTS:

Checking the simplest case::

sage: Poset({1: []}).apozeta_polynomial()

Check failure on line 7317 in src/sage/combinat/posets/posets.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Exception raised: Traceback (most recent call last): File "/sage/src/sage/doctest/forker.py", line 728, in _run self.compile_and_execute(example, compiler, test.globs) File "/sage/src/sage/doctest/forker.py", line 1152, in compile_and_execute exec(compiled, globs) File "<doctest sage.combinat.posets.posets.FinitePoset.apozeta_polynomial[5]>", line 1, in <module> Poset({Integer(1): []}).apozeta_polynomial() File "/sage/src/sage/combinat/posets/posets.py", line 7326, in apozeta_polynomial return sum(binomial(q - 2, len(c) - 1) File "/sage/src/sage/combinat/posets/posets.py", line 7326, in <genexpr> return sum(binomial(q - 2, len(c) - 1) NameError: name 'binomial' is not defined
1
sage: parent(_)
Univariate Polynomial Ring in q over Rational Field
"""
R = PolynomialRing(QQ, 'q')
q = R.gen()

top_level = self.level_sets()[-1]
return sum(binomial(q - 2, len(c) - 1)
for c in self.chains() if c and c[-1] in top_level)

def M_triangle(self):
r"""
Return the M-triangle of the poset.
Expand Down
Loading