# Mobile posets#

class sage.combinat.posets.mobile.MobilePoset(hasse_diagram, elements, category, facade, key, ribbon=None, check=True)[source]#

Bases: FinitePoset

A mobile poset.

Mobile posets are an extension of d-complete posets which permit a determinant formula for counting linear extensions. They are formed by having a ribbon poset with d-complete posets ‘hanging’ below it and at most one d-complete poset above it, known as the anchor. See [GGMM2020] for the definition.

EXAMPLES:

sage: P = posets.MobilePoset(posets.RibbonPoset(7, [1,3]),                      # needs sage.combinat sage.modules
....:                        {1: [posets.YoungDiagramPoset([3, 2], dual=True)],
....:                         3: [posets.DoubleTailedDiamond(6)]},
....:                        anchor=(4, 2, posets.ChainPoset(6)))
sage: len(P._ribbon)                                                            # needs sage.combinat sage.modules
8
sage: P._anchor                                                                 # needs sage.combinat sage.modules
(4, 5)

>>> from sage.all import *
>>> P = posets.MobilePoset(posets.RibbonPoset(Integer(7), [Integer(1),Integer(3)]),                      # needs sage.combinat sage.modules
...                        {Integer(1): [posets.YoungDiagramPoset([Integer(3), Integer(2)], dual=True)],
...                         Integer(3): [posets.DoubleTailedDiamond(Integer(6))]},
...                        anchor=(Integer(4), Integer(2), posets.ChainPoset(Integer(6))))
>>> len(P._ribbon)                                                            # needs sage.combinat sage.modules
8
>>> P._anchor                                                                 # needs sage.combinat sage.modules
(4, 5)


This example is Example 5.9 in [GGMM2020]:

sage: P1 = posets.MobilePoset(posets.RibbonPoset(8, [2,3,4]),
....:                         {4: [posets.ChainPoset(1)]},
....:                         anchor=(3, 0, posets.ChainPoset(1)))
sage: sorted([P1._element_to_vertex(i) for i in P1._ribbon])
[0, 1, 2, 6, 7, 9]
sage: P1._anchor
(3, 2)

sage: P2 = posets.MobilePoset(posets.RibbonPoset(15, [1,3,5,7,9,11,13]),
....:                         {}, anchor=(8, 0, posets.ChainPoset(1)))
sage: sorted(P2._ribbon)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
sage: P2._anchor
(8, (8, 0))
sage: P2.linear_extensions().cardinality()                                      # needs sage.modules
21399440939

sage: EP = posets.MobilePoset(posets.ChainPoset(0), {})
Traceback (most recent call last):
...
ValueError: the empty poset is not a mobile poset

>>> from sage.all import *
>>> P1 = posets.MobilePoset(posets.RibbonPoset(Integer(8), [Integer(2),Integer(3),Integer(4)]),
...                         {Integer(4): [posets.ChainPoset(Integer(1))]},
...                         anchor=(Integer(3), Integer(0), posets.ChainPoset(Integer(1))))
>>> sorted([P1._element_to_vertex(i) for i in P1._ribbon])
[0, 1, 2, 6, 7, 9]
>>> P1._anchor
(3, 2)

>>> P2 = posets.MobilePoset(posets.RibbonPoset(Integer(15), [Integer(1),Integer(3),Integer(5),Integer(7),Integer(9),Integer(11),Integer(13)]),
...                         {}, anchor=(Integer(8), Integer(0), posets.ChainPoset(Integer(1))))
>>> sorted(P2._ribbon)
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
>>> P2._anchor
(8, (8, 0))
>>> P2.linear_extensions().cardinality()                                      # needs sage.modules
21399440939

>>> EP = posets.MobilePoset(posets.ChainPoset(Integer(0)), {})
Traceback (most recent call last):
...
ValueError: the empty poset is not a mobile poset

anchor()[source]#

Return the anchor of the mobile poset.

EXAMPLES:

sage: from sage.combinat.posets.mobile import MobilePoset
sage: M2 = MobilePoset(Poset([[0,1,2,3,4,5,6,7,8],
....:          [(1,0),(3,0),(2,1),(2,3),(4,3),(5,4),(7,4),(7,8)]]))
sage: M2.anchor()
(4, 3)
sage: M3 = MobilePoset(Posets.RibbonPoset(5, [1,2]))
sage: M3.anchor() is None
True

>>> from sage.all import *
>>> from sage.combinat.posets.mobile import MobilePoset
>>> M2 = MobilePoset(Poset([[Integer(0),Integer(1),Integer(2),Integer(3),Integer(4),Integer(5),Integer(6),Integer(7),Integer(8)],
...          [(Integer(1),Integer(0)),(Integer(3),Integer(0)),(Integer(2),Integer(1)),(Integer(2),Integer(3)),(Integer(4),Integer(3)),(Integer(5),Integer(4)),(Integer(7),Integer(4)),(Integer(7),Integer(8))]]))
>>> M2.anchor()
(4, 3)
>>> M3 = MobilePoset(Posets.RibbonPoset(Integer(5), [Integer(1),Integer(2)]))
>>> M3.anchor() is None
True

ribbon()[source]#

Return the ribbon of the mobile poset.

EXAMPLES:

sage: from sage.combinat.posets.mobile import MobilePoset
sage: M3 = MobilePoset(Posets.RibbonPoset(5, [1,2]))
sage: sorted(M3.ribbon())
[1, 2, 3, 4]

>>> from sage.all import *
>>> from sage.combinat.posets.mobile import MobilePoset
>>> M3 = MobilePoset(Posets.RibbonPoset(Integer(5), [Integer(1),Integer(2)]))
>>> sorted(M3.ribbon())
[1, 2, 3, 4]