This function is deprecated and will be removed in a future version of Sage. Please use Posets.AntichainPoset instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.BooleanLattice instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.ChainPoset instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.DiamondPoset instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.PentagonPoset instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.IntegerCompositions instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.IntegerPartitions instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.RestrictedIntegerPartitions instead.
Bases: object
A collection of examples of posets.
Returns an antichain (a poset with no comparable elements) containing n elements.
EXAMPLES:
sage: A = Posets.AntichainPoset(6); A
Finite poset containing 6 elements
sage: for i in range(5):
... for j in range(5):
... if A.covers(A(i),A(j)):
... print "TEST FAILED"
TESTS:
Check that #8422 is solved:
sage: Posets.AntichainPoset(0)
Finite poset containing 0 elements
sage: C = Posets.AntichainPoset(1); C
Finite poset containing 1 elements
sage: C.cover_relations()
[]
sage: C = Posets.AntichainPoset(2); C
Finite poset containing 2 elements
sage: C.cover_relations()
[]
Returns the Boolean lattice containing elements.
EXAMPLES:
sage: Posets.BooleanLattice(5)
Finite lattice containing 32 elements
Returns a chain (a totally ordered poset) containing n elements.
EXAMPLES:
sage: C = Posets.ChainPoset(6); C
Finite lattice containing 6 elements
sage: C.linear_extension()
[0, 1, 2, 3, 4, 5]
sage: for i in range(5):
... for j in range(5):
... if C.covers(C(i),C(j)) and j != i+1:
... print "TEST FAILED"
TESTS:
Check that #8422 is solved:
sage: Posets.ChainPoset(0)
Finite lattice containing 0 elements
sage: C = Posets.ChainPoset(1); C
Finite lattice containing 1 elements
sage: C.cover_relations()
[]
sage: C = Posets.ChainPoset(2); C
Finite lattice containing 2 elements
sage: C.cover_relations()
[[0, 1]]
Returns the lattice of rank two containing n elements.
EXAMPLES:
sage: Posets.DiamondPoset(7)
Finite lattice containing 7 elements
Returns the poset of integer compositions of the integer n.
A composition of a positive integer is a list of positive integers that sum to . The order is reverse refinement: [p_1,p_2,...,p_l] < [q_1,q_2,...,q_m] if q consists of an integer composition of p_1, followed by an integer composition of p_2, and so on.
EXAMPLES:
sage: P = Posets.IntegerCompositions(7); P
Finite poset containing 64 elements
sage: len(P.cover_relations())
192
Returns the poset of integer partitions on the integer n.
A partition of a positive integer is a non-increasing list of positive integers that sum to . If p and q are integer partitions of , then p covers q if and only if q is obtained from p by joining two parts of p (and sorting, if necessary).
EXAMPLES:
sage: P = Posets.IntegerPartitions(7); P
Finite poset containing 15 elements
sage: len(P.cover_relations())
28
Return the “pentagon”.
EXAMPLES:
sage: Posets.PentagonPoset()
Finite lattice containing 5 elements
Generate a random poset on n vertices according to a probability distribution p.
EXAMPLES:
sage: Posets.RandomPoset(17,.15)
Finite poset containing 17 elements
Returns the poset of integer partitions on the integer n ordered by restricted refinement. That is, if p and q are integer partitions of n, then p covers q if and only if q is obtained from p by joining two distinct parts of p (and sorting, if necessary).
EXAMPLES:
sage: P = Posets.RestrictedIntegerPartitions(7); P
Finite poset containing 15 elements
sage: len(P.cover_relations())
17
The poset of permutations with respect to Bruhat order.
INPUT:
Note
Must have start <= end.
EXAMPLES:
Any interval is rank symmetric if and only if it avoids these permutations:
sage: P1 = Posets.SymmetricGroupBruhatIntervalPoset([0,1,2,3], [2,3,0,1])
sage: P2 = Posets.SymmetricGroupBruhatIntervalPoset([0,1,2,3], [3,1,2,0])
sage: ranks1 = [P1.rank(v) for v in P1]
sage: ranks2 = [P2.rank(v) for v in P2]
sage: [ranks1.count(i) for i in uniq(ranks1)]
[1, 3, 5, 4, 1]
sage: [ranks2.count(i) for i in uniq(ranks2)]
[1, 3, 5, 6, 4, 1]
The poset of permutations with respect to Bruhat order.
EXAMPLES:
sage: Posets.SymmetricGroupBruhatOrderPoset(4)
Finite poset containing 24 elements
The poset of permutations with respect to weak order.
EXAMPLES:
sage: Posets.SymmetricGroupWeakOrderPoset(4)
Finite poset containing 24 elements
This function is deprecated and will be removed in a future version of Sage. Please use Posets.RandomPoset instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.SymmetricGroupBruhatOrderPoset instead.
This function is deprecated and will be removed in a future version of Sage. Please use Posets.SymmetricGroupWeakOrderPoset instead.