| 1 | initial version |
Like this for just the set of isoclasses.
def iso(P):
D = {}
for x, y in P.relations():
Q = P.subposet(P.interval(x, y))
dp = Q.degree_polynomial()
if dp not in D:
D[dp] = []
if not any(Q.is_isomorphic(R) for R in D[dp]):
D[dp].append(Q)
return D
then
sage: P = posets.PentagonPoset()
sage: iso(P)
{1: [Finite poset containing 1 elements],
x + y: [Finite poset containing 2 elements],
x^2 + 3*x*y + y^2: [Finite poset containing 5 elements],
x*y + x + y: [Finite poset containing 3 elements]}
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.