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.Sat, 30 Mar 2019 21:06:42 +0100Finding distributive lattices up to an identificationhttps://ask.sagemath.org/question/45918/finding-distributive-lattices-up-to-an-identification/I want for a given natural number n obtain all distributive lattices on n points where two such distributive lattices $L_1$ and $L_2$ get identified in case they are isomorphic as posets or $L_1$ is isomorphic to the opposite of $L_2$.
I know how to obtain the distributive lattices as follows in sage:
n=5
posets = [p for p in Posets(n) if p.has_bottom() and p.has_top() and p.is_lattice()]
lattices = [p for p in posets if LatticePoset(p).is_distributive()]
But I am not sure how to add the further condition as stated above.
So for n=5 the result should for example be that there are 2 distributive lattices up to the above identification.Tue, 26 Mar 2019 10:45:26 +0100https://ask.sagemath.org/question/45918/finding-distributive-lattices-up-to-an-identification/Comment by FrédéricC for <p>I want for a given natural number n obtain all distributive lattices on n points where two such distributive lattices $L_1$ and $L_2$ get identified in case they are isomorphic as posets or $L_1$ is isomorphic to the opposite of $L_2$.</p>
<p>I know how to obtain the distributive lattices as follows in sage:</p>
<p>n=5</p>
<p>posets = [p for p in Posets(n) if p.has_bottom() and p.has_top() and p.is_lattice()]</p>
<p>lattices = [p for p in posets if LatticePoset(p).is_distributive()]</p>
<p>But I am not sure how to add the further condition as stated above.</p>
<p>So for n=5 the result should for example be that there are 2 distributive lattices up to the above identification.</p>
https://ask.sagemath.org/question/45918/finding-distributive-lattices-up-to-an-identification/?comment=45955#post-id-45955You should rather iterate over all posets and use `P.order_ideals_lattice`.Sat, 30 Mar 2019 21:06:42 +0100https://ask.sagemath.org/question/45918/finding-distributive-lattices-up-to-an-identification/?comment=45955#post-id-45955