ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 13 Aug 2015 02:57:28 -0500Isomorphisms of 2-skeletons of polytopeshttp://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/ Hi there,
We are interested in checking whether the 2-skeletons of two distinct polytopes are isomorphic (as posets). We understand that we can get the face_lattice of each of the polytope, but we don't know who to produce a poset which contains the 2-skeleton for each polytope so that we can use the function is_isomorphic for posets?
Thank you in advance, and regards,
Guillermo Thu, 13 Aug 2015 02:19:02 -0500http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/Answer by tmonteil for <p>Hi there,</p>
<p>We are interested in checking whether the 2-skeletons of two distinct polytopes are isomorphic (as posets). We understand that we can get the face_lattice of each of the polytope, but we don't know who to produce a poset which contains the 2-skeleton for each polytope so that we can use the function is_isomorphic for posets?</p>
<p>Thank you in advance, and regards,
Guillermo </p>
http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/?answer=28828#post-id-28828You can restrict the face_lattice poset by using the `subposet` method to restrict the poset to elements corresponding to 0-faces, 1-faces and 2-faces as follows: if `P` is your polytope, you can do:
sage: PP = P.face_lattice()
sage: P2 = PP.subposet(P.faces(0)+P.faces(1)+P.faces(2))
Then, if you do the same with another polytope `Q`, you can then check:
sage: P2.is_isomorphic(Q2)
Thu, 13 Aug 2015 02:39:28 -0500http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/?answer=28828#post-id-28828Comment by guillermo for <p>You can restrict the face_lattice poset by using the <code>subposet</code> method to restrict the poset to elements corresponding to 0-faces, 1-faces and 2-faces as follows: if <code>P</code> is your polytope, you can do:</p>
<pre><code>sage: PP = P.face_lattice()
sage: P2 = PP.subposet(P.faces(0)+P.faces(1)+P.faces(2))
</code></pre>
<p>Then, if you do the same with another polytope <code>Q</code>, you can then check:</p>
<pre><code>sage: P2.is_isomorphic(Q2)
</code></pre>
http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/?comment=28831#post-id-28831Great! Thanks a lot.Thu, 13 Aug 2015 02:57:28 -0500http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/?comment=28831#post-id-28831Comment by Nathann for <p>You can restrict the face_lattice poset by using the <code>subposet</code> method to restrict the poset to elements corresponding to 0-faces, 1-faces and 2-faces as follows: if <code>P</code> is your polytope, you can do:</p>
<pre><code>sage: PP = P.face_lattice()
sage: P2 = PP.subposet(P.faces(0)+P.faces(1)+P.faces(2))
</code></pre>
<p>Then, if you do the same with another polytope <code>Q</code>, you can then check:</p>
<pre><code>sage: P2.is_isomorphic(Q2)
</code></pre>
http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/?comment=28830#post-id-28830It could make sense to have a .skeleton() method, by the way...Thu, 13 Aug 2015 02:43:20 -0500http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/?comment=28830#post-id-28830Answer by Nathann for <p>Hi there,</p>
<p>We are interested in checking whether the 2-skeletons of two distinct polytopes are isomorphic (as posets). We understand that we can get the face_lattice of each of the polytope, but we don't know who to produce a poset which contains the 2-skeleton for each polytope so that we can use the function is_isomorphic for posets?</p>
<p>Thank you in advance, and regards,
Guillermo </p>
http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/?answer=28829#post-id-28829Couldn't you solve your problem by building the vertex graph of your polytope, and testing isomorphism between graphs?
http://doc.sagemath.org/html/en/reference/geometry/sage/geometry/polyhedron/base.html#sage.geometry.polyhedron.base.Polyhedron_base.vertex_graph
Thu, 13 Aug 2015 02:41:44 -0500http://ask.sagemath.org/question/28827/isomorphisms-of-2-skeletons-of-polytopes/?answer=28829#post-id-28829