ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 24 Aug 2020 09:29:02 +0200Finding the list of isomorphism classes of objects of another listhttps://ask.sagemath.org/question/53156/finding-the-list-of-isomorphism-classes-of-objects-of-another-list/ Given a finite list L of connected posets in Sage. Is there a quick way to obtain the list L2 of all isomorphism classes of posets in L?
So in the list L there might be isomorphic posets, and the goal is to obtain a list L2 where that contains exactly one poset of each isomorphism class of L.
For example the list L might contain the posets $B_2, B_3, B_3 , B_4$, where $B_n$ denotes the Boolean lattice.
Then the list L2 would contain the posets $B_2,B_3,B_4$.
Of course in the list, two posets might be isomorphic even when they look very different.Mon, 24 Aug 2020 08:29:47 +0200https://ask.sagemath.org/question/53156/finding-the-list-of-isomorphism-classes-of-objects-of-another-list/Answer by FrédéricC for <p>Given a finite list L of connected posets in Sage. Is there a quick way to obtain the list L2 of all isomorphism classes of posets in L? </p>
<p>So in the list L there might be isomorphic posets, and the goal is to obtain a list L2 where that contains exactly one poset of each isomorphism class of L.</p>
<p>For example the list L might contain the posets $B_2, B_3, B_3 , B_4$, where $B_n$ denotes the Boolean lattice.
Then the list L2 would contain the posets $B_2,B_3,B_4$.
Of course in the list, two posets might be isomorphic even when they look very different.</p>
https://ask.sagemath.org/question/53156/finding-the-list-of-isomorphism-classes-of-objects-of-another-list/?answer=53157#post-id-53157Here is a tentative
def filtre_iso(liste_posets):
from collections import defaultdict
table = defaultdict(list)
for po in liste_posets:
dp = po.degree_polynomial()
connus = table[dp]
if not any(q.is_isomorphic(po) for q in connus):
table[dp].append(po)
return table
Mon, 24 Aug 2020 09:29:02 +0200https://ask.sagemath.org/question/53156/finding-the-list-of-isomorphism-classes-of-objects-of-another-list/?answer=53157#post-id-53157