#9188: lattice_polytope.facet_normal bug with polytopes of less that full
dimension
----------------------------+-----------------------------------------------
   Reporter:  vbraun        |       Owner:  mhampton  
       Type:  defect        |      Status:  new       
   Priority:  major         |   Milestone:  sage-4.4.4
  Component:  geometry      |    Keywords:            
     Author:  Volker Braun  |    Upstream:  N/A       
   Reviewer:                |      Merged:            
Work_issues:                |  
----------------------------+-----------------------------------------------
 In general, `lattice_polytope._embedding_matrix` is not orthogonal. But
 `facet_normal()` implicitly makes this assumption by embedding the normals
 (which live in the dual vector space) by the transpose of the
 `_embedding_matrix`.

 Here is an example of the incorrect result:
 {{{
 sage: lp =
 LatticePolytope(matrix([[1,1,-1,0],[1,-1,-1,0],[1,1,1,0],[3,3,3,0]]))
 sage: lp.vertices()
 [ 1  1 -1  0]
 [ 1 -1 -1  0]
 [ 1  1  1  0]
 [ 3  3  3  0]
 sage: lp.facet_normal(0)
 (-1, 0, 1, 3)
 sage: lp.vertices() * lp.facet_normal(0)
 (-2, -2, 0, 0)
 sage: lp.facet_constant(0)
 -9
 }}}
 If `lp.facet_normal(0)` would define a facet then its equation would be
 satisfied at 3 out of 4 vertices.

 The attached patch fixes this issue. A scale factor for the dual embedding
 is introduced to keep the facet normal coordinates integral. Moreover, a
 suitable doctest is added.

 NOTE: This bug impacts the toric variety code under development in #8986,
 #8987:
 {{{
 sage: c = Cone([(1,0,0,0),(0,1,0,0),(0,0,1,0)])
 sage: c.faces()
 ((0-dimensional face of 3-dimensional cone,), (1-dimensional face of
 3-dimensional cone, 1-dimensional face of 3-dimensional cone,
 1-dimensional face of 3-dimensional cone), (2-dimensional face of
 3-dimensional cone, 2-dimensional face of 3-dimensional cone,
 2-dimensional face of 3-dimensional cone), (3-dimensional face of
 3-dimensional cone,))
 sage: c = Cone([(1,1,1,3),(1,-1,1,3),(-1,-1,1,3)])
 sage: c.faces()
 ((0-dimensional face of 3-dimensional cone,), (2-dimensional face of
 3-dimensional cone,), (3-dimensional face of 3-dimensional cone,))
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9188>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to