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.Tue, 09 Feb 2021 08:02:06 +0100Polyhedra, facets and verticeshttps://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/I have a 6-dimensional, convex, compact polyhedron in $\mathbb{R}^{12}$, that I am calling `P1`.
The polyhedron `P1` was specified by giving a large number of inequalities.
When I enter `P1.faces(5)` into Sage, I get the following
(A 5-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 6 vertices,
A 5-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 7 vertices,
A 5-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 7 vertices,
A 6-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 7 vertices,
A 5-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 6 vertices,
A 6-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 8 vertices,
...)
How can there be two 6-dimensional faces, each with a different number of vertices,
on the boundary of `P1`? I have checked that `P1` really does have dimension 6.
Also, when I try to find a list of vertices on the boundary of any 5-dimensional face of `P1`,
for example
P1.faces(5)[0].vertices_list()
I get an error message
AttributeError: 'tuple' object has no attribute 'vertices_list'
However, `P1.faces(5)[0].vertices()` works.
My second question is, how do I get a list of vertices on the boundary of an $n$-dimensional face?Sat, 06 Feb 2021 10:10:56 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/Answer by slelievre for <p>I have a 6-dimensional, convex, compact polyhedron in $\mathbb{R}^{12}$, that I am calling <code>P1</code>.
The polyhedron <code>P1</code> was specified by giving a large number of inequalities.
When I enter <code>P1.faces(5)</code> into Sage, I get the following</p>
<pre><code>(A 5-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 6 vertices,
A 5-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 7 vertices,
A 5-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 7 vertices,
A 6-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 7 vertices,
A 5-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 6 vertices,
A 6-dimensional face of a Polyhedron in RDF^12 defined as the convex hull of 8 vertices,
...)
</code></pre>
<p>How can there be two 6-dimensional faces, each with a different number of vertices,
on the boundary of <code>P1</code>? I have checked that <code>P1</code> really does have dimension 6.</p>
<p>Also, when I try to find a list of vertices on the boundary of any 5-dimensional face of <code>P1</code>,
for example</p>
<pre><code>P1.faces(5)[0].vertices_list()
</code></pre>
<p>I get an error message</p>
<pre><code>AttributeError: 'tuple' object has no attribute 'vertices_list'
</code></pre>
<p>However, <code>P1.faces(5)[0].vertices()</code> works.</p>
<p>My second question is, how do I get a list of vertices on the boundary of an $n$-dimensional face?</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?answer=55598#post-id-55598It seems you defined your polyhedron using inequalities with coefficients in `RDF`.
Polyhedral computations over inexact fields such as `RDF` tend to give
surprising results.
Try working over an exact field such as `QQ` or `AA`.Sat, 06 Feb 2021 11:14:59 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?answer=55598#post-id-55598Comment by slelievre for <p>It seems you defined your polyhedron using inequalities with coefficients in <code>RDF</code>.</p>
<p>Polyhedral computations over inexact fields such as <code>RDF</code> tend to give
surprising results.</p>
<p>Try working over an exact field such as <code>QQ</code> or <code>AA</code>.</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55625#post-id-55625Sharing the ipynb file on gitlab.com or github.com is probably easy too.Mon, 08 Feb 2021 17:32:14 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55625#post-id-55625Comment by John Palmieri for <p>It seems you defined your polyhedron using inequalities with coefficients in <code>RDF</code>.</p>
<p>Polyhedral computations over inexact fields such as <code>RDF</code> tend to give
surprising results.</p>
<p>Try working over an exact field such as <code>QQ</code> or <code>AA</code>.</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55627#post-id-55627`P1.faces(5).vertices()` is not supposed to work, since `P1.faces(5)` is just a tuple of the 5-dimensional faces. For me, `f.vertices()` works for each element `f` of `P1.faces(5)`. For example, `P1.faces(5)[0].vertices()` works.Tue, 09 Feb 2021 01:43:54 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55627#post-id-55627Comment by Ingrid for <p>It seems you defined your polyhedron using inequalities with coefficients in <code>RDF</code>.</p>
<p>Polyhedral computations over inexact fields such as <code>RDF</code> tend to give
surprising results.</p>
<p>Try working over an exact field such as <code>QQ</code> or <code>AA</code>.</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55599#post-id-55599Thanks! When I changed to QQ, the two spurious 6-dimensional faces disappeared.
However, now I get the error message "AttributeError: 'tuple' object has no attribute 'vertices'" for P1.faces(5)[0].vertices() as well as for P1.faces(5)[0].vertices_list()Sat, 06 Feb 2021 12:05:50 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55599#post-id-55599Comment by John Palmieri for <p>It seems you defined your polyhedron using inequalities with coefficients in <code>RDF</code>.</p>
<p>Polyhedral computations over inexact fields such as <code>RDF</code> tend to give
surprising results.</p>
<p>Try working over an exact field such as <code>QQ</code> or <code>AA</code>.</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55606#post-id-55606Please provide more details so we can reproduce the error.Sat, 06 Feb 2021 22:39:12 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55606#post-id-55606Comment by Ingrid for <p>It seems you defined your polyhedron using inequalities with coefficients in <code>RDF</code>.</p>
<p>Polyhedral computations over inexact fields such as <code>RDF</code> tend to give
surprising results.</p>
<p>Try working over an exact field such as <code>QQ</code> or <code>AA</code>.</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55610#post-id-55610Is there some way I can upload a file? The list of constraints used to define the polyhedron is too big to fit here.Sun, 07 Feb 2021 04:24:22 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55610#post-id-55610Comment by slelievre for <p>It seems you defined your polyhedron using inequalities with coefficients in <code>RDF</code>.</p>
<p>Polyhedral computations over inexact fields such as <code>RDF</code> tend to give
surprising results.</p>
<p>Try working over an exact field such as <code>QQ</code> or <code>AA</code>.</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55617#post-id-55617Some possibilities:
- put it on pastebin
- share it via CoCalc
- upload it somewhere and post a linkSun, 07 Feb 2021 16:58:13 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55617#post-id-55617Comment by Ingrid for <p>It seems you defined your polyhedron using inequalities with coefficients in <code>RDF</code>.</p>
<p>Polyhedral computations over inexact fields such as <code>RDF</code> tend to give
surprising results.</p>
<p>Try working over an exact field such as <code>QQ</code> or <code>AA</code>.</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55620#post-id-55620Ah, ok. It would be best if I could share the ipynb file, but I can't put anything on my website without help from someone who speaks Chinese, and everyone is on holiday for the new year celebrations.
Cocalc wants a lot of money for me to share files.
P1=Polyhedron(ieqs=Lconstraints, base_ring=QQ)
I've put the list Lconstraints here: https://pastebin.com/Uc8ANHcv
When I enter P1.faces(5).vertices() or P1.faces(5).vertices_list()
I get the error
AttributeError: 'tuple' object has no attribute 'vertices'
Thanks a lot everyone!Mon, 08 Feb 2021 04:19:45 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55620#post-id-55620Comment by Ingrid for <p>It seems you defined your polyhedron using inequalities with coefficients in <code>RDF</code>.</p>
<p>Polyhedral computations over inexact fields such as <code>RDF</code> tend to give
surprising results.</p>
<p>Try working over an exact field such as <code>QQ</code> or <code>AA</code>.</p>
https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55632#post-id-55632Thanks a lot John, I should have realised that.Tue, 09 Feb 2021 08:02:06 +0100https://ask.sagemath.org/question/55597/polyhedra-facets-and-vertices/?comment=55632#post-id-55632