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.Fri, 02 Sep 2016 22:06:44 +0200Triangulation of Lattice Polytopehttps://ask.sagemath.org/question/34638/triangulation-of-lattice-polytope/Hello!
SAGE seems to depend on order when dealing with triangulations and shifts it in some way.
For example, for the identical configurations: (just with the origin (0,0) in a different place)
pt1 = PointConfiguration([(1, 0), (0, 1), (0, -1), (-1, 0), (1, 1), (0, 0)]);
pt2 = PointConfiguration([(0, 0), (1, 0), (0, 1), (0, -1), (-1, 0), (1, 1)]);
triang = pt1.triangulate();
triang.plot(axes=True)
triang = pt2.triangulate();
triang.plot(axes=True)
the second is clearly correct but the first configuration is left-shifted by (-1,0) for some reason.
Any ideas?
many thanks!!Mon, 29 Aug 2016 14:04:09 +0200https://ask.sagemath.org/question/34638/triangulation-of-lattice-polytope/Comment by FrédéricC for <p>Hello!
SAGE seems to depend on order when dealing with triangulations and shifts it in some way.</p>
<p>For example, for the identical configurations: (just with the origin (0,0) in a different place)</p>
<pre><code>pt1 = PointConfiguration([(1, 0), (0, 1), (0, -1), (-1, 0), (1, 1), (0, 0)]);
pt2 = PointConfiguration([(0, 0), (1, 0), (0, 1), (0, -1), (-1, 0), (1, 1)]);
triang = pt1.triangulate();
triang.plot(axes=True)
triang = pt2.triangulate();
triang.plot(axes=True)
</code></pre>
<p>the second is clearly correct but the first configuration is left-shifted by (-1,0) for some reason.</p>
<p>Any ideas?</p>
<p>many thanks!!</p>
https://ask.sagemath.org/question/34638/triangulation-of-lattice-polytope/?comment=34700#post-id-34700looks like a bug, indeedFri, 02 Sep 2016 21:58:58 +0200https://ask.sagemath.org/question/34638/triangulation-of-lattice-polytope/?comment=34700#post-id-34700Comment by FrédéricC for <p>Hello!
SAGE seems to depend on order when dealing with triangulations and shifts it in some way.</p>
<p>For example, for the identical configurations: (just with the origin (0,0) in a different place)</p>
<pre><code>pt1 = PointConfiguration([(1, 0), (0, 1), (0, -1), (-1, 0), (1, 1), (0, 0)]);
pt2 = PointConfiguration([(0, 0), (1, 0), (0, 1), (0, -1), (-1, 0), (1, 1)]);
triang = pt1.triangulate();
triang.plot(axes=True)
triang = pt2.triangulate();
triang.plot(axes=True)
</code></pre>
<p>the second is clearly correct but the first configuration is left-shifted by (-1,0) for some reason.</p>
<p>Any ideas?</p>
<p>many thanks!!</p>
https://ask.sagemath.org/question/34638/triangulation-of-lattice-polytope/?comment=34701#post-id-34701Problem located here:
sage: [p.reduced_affine() for p in triang1.point_configuration()]
[(0, 0), (-1, 1), (-1, -1), (-2, 0), (0, 1), (-1, 0)]
sage: [p.reduced_affine() for p in triang2.point_configuration()]
[(0, 0), (1, 0), (0, 1), (0, -1), (-1, 0), (1, 1)]Fri, 02 Sep 2016 22:04:04 +0200https://ask.sagemath.org/question/34638/triangulation-of-lattice-polytope/?comment=34701#post-id-34701Comment by FrédéricC for <p>Hello!
SAGE seems to depend on order when dealing with triangulations and shifts it in some way.</p>
<p>For example, for the identical configurations: (just with the origin (0,0) in a different place)</p>
<pre><code>pt1 = PointConfiguration([(1, 0), (0, 1), (0, -1), (-1, 0), (1, 1), (0, 0)]);
pt2 = PointConfiguration([(0, 0), (1, 0), (0, 1), (0, -1), (-1, 0), (1, 1)]);
triang = pt1.triangulate();
triang.plot(axes=True)
triang = pt2.triangulate();
triang.plot(axes=True)
</code></pre>
<p>the second is clearly correct but the first configuration is left-shifted by (-1,0) for some reason.</p>
<p>Any ideas?</p>
<p>many thanks!!</p>
https://ask.sagemath.org/question/34638/triangulation-of-lattice-polytope/?comment=34702#post-id-34702Maybe this is not a bug after all. We use some new coordinates (method reduced_affine instead of method affine) to plot the point configuration. This is potentially useful for 2d configs in 3d.Fri, 02 Sep 2016 22:06:44 +0200https://ask.sagemath.org/question/34638/triangulation-of-lattice-polytope/?comment=34702#post-id-34702