diff --git a/src/doc/en/reference/references/index.rst b/src/doc/en/reference/references/index.rst index 478171842e8..e8361cdeac0 100644 --- a/src/doc/en/reference/references/index.rst +++ b/src/doc/en/reference/references/index.rst @@ -2153,6 +2153,10 @@ REFERENCES: and Genocchi numbers `_, in FPSAC 2011, Reykjav´k, Iceland DMTCS proc. AO, 2011, 493-504. +.. [HoDaCG17] Toth, Csaba D., Joseph O'Rourke, and Jacob E. Goodman. + Handbook of Discrete and Computational Geometry (3rd Edition). + Chapman and Hall/CRC, 2017. + .. [Hoc] Winfried Hochstaettler, "About the Tic-Tac-Toe Matroid", preprint. @@ -2555,7 +2559,7 @@ REFERENCES: Compositio Mathematica, **149** (2013), no. 10. :arxiv:`1111.3660`. -.. [Kly1990] Klyachko, Aleksandr Anatolevich. +.. [Kly1990] Klyachko, Aleksandr Anatolevich. Equivariant Bundles on Toral Varieties, Math USSR Izv. 35 (1990), 337-375. http://iopscience.iop.org/0025-5726/35/2/A04/pdf/0025-5726_35_2_A04.pdf diff --git a/src/doc/en/thematic_tutorials/geometry/polyhedra_quickref.rst b/src/doc/en/thematic_tutorials/geometry/polyhedra_quickref.rst index aaf8ba7d96a..229e92dfc11 100644 --- a/src/doc/en/thematic_tutorials/geometry/polyhedra_quickref.rst +++ b/src/doc/en/thematic_tutorials/geometry/polyhedra_quickref.rst @@ -110,6 +110,7 @@ List of Polyhedron methods :meth:`~sage.geometry.polyhedron.base.Polyhedron_base.truncation` | truncates all vertices simultaneously :meth:`~sage.geometry.polyhedron.base.Polyhedron_base.lawrence_extension` | returns the Lawrence extension of self on a given point :meth:`~sage.geometry.polyhedron.base.Polyhedron_base.lawrence_polytope` | returns the Lawrence polytope of self + :meth:`~sage.geometry.polyhedron.base.Polyhedron_base.wedge` | returns the wedge over a face of self **Combinatorics** diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 34b00600e08..4d8905d28f0 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -4118,6 +4118,91 @@ def stack(self, face, position=None): parent = self.parent().base_extend(new_vertex) return parent.element_class(parent, [self.vertices() + (new_vertex,), self.rays(), self.lines()], None) + def wedge(self, face, width=1): + r""" + Return the wedge over a ``face`` of ``self``. ``self`` must be a + polytope and ``width`` must be nonzero. + + The wedge over a face `F` of a polytope `P` with width `w \not\eq 0` + is defined as: + + .. MATH:: + + (P \times \mathbb{R}) \cap \{a^\top x + |w x_{d+1}| \leq b\} + + where `a^\top x = b` is a supporting hyperplane for `F`. + + INPUT: + + - ``face`` -- a PolyhedronFace of ``self``, the face which we take + the wedge over + - ``width`` -- a nonzero number (default: ``1``), the width of the + resulting polytope + + OUTPUT: + + A (bounded) Polyhedron object + + EXAMPLES:: + + sage: P = polytopes.regular_polygon(4) + sage: W1 = wedge(P, P.faces(1)[0]); W1 + A 3-dimensional polyhedron in AA^3 defined as the convex hull of 6 vertices + sage: W1.is_simple() + True + + sage: Q = polytopes.hypersimplex(4,2) + sage: W2 = wedge(Q, Q.faces(2)[0]); W2 + A 4-dimensional polyhedron in QQ^5 defined as the convex hull of 9 vertices + sage: W2.vertices() + (A vertex at (0, 1, 0, 1, 0), + A vertex at (0, 0, 1, 1, 0), + A vertex at (1, 0, 0, 1, -1), + A vertex at (1, 0, 0, 1, 1), + A vertex at (1, 0, 1, 0, 1), + A vertex at (1, 1, 0, 0, -1), + A vertex at (0, 1, 1, 0, 0), + A vertex at (1, 0, 1, 0, -1), + A vertex at (1, 1, 0, 0, 1)) + + sage: W3 = wedge(Q, Q.faces(1)[0]); W3 + A 4-dimensional polyhedron in QQ^5 defined as the convex hull of 10 vertices + sage: W3.vertices() + (A vertex at (0, 1, 0, 1, 0), + A vertex at (0, 0, 1, 1, 0), + A vertex at (1, 0, 0, 1, -1), + A vertex at (1, 0, 0, 1, 1), + A vertex at (1, 0, 1, 0, 2), + A vertex at (0, 1, 1, 0, 1), + A vertex at (1, 0, 1, 0, -2), + A vertex at (1, 1, 0, 0, 2), + A vertex at (0, 1, 1, 0, -1), + A vertex at (1, 1, 0, 0, -2)) + + REFERENCES: + + For more information, see Chapter 15 of [HoDaCG17]_. + """ + if not self.is_compact(): + raise NotImplementedError("polyhedron `self` must be a polytope") + + if width == 0: + raise ValueError("the width should be nonzero") + + from sage.geometry.polyhedron.face import PolyhedronFace + if not isinstance(face, PolyhedronFace): + raise TypeError("{} should be a PolyhedronFace of {}".format(face, self)) + + F_Hrep = vector([0]*(self.ambient_dim()+1)) + for facet in face.ambient_Hrepresentation(): + if facet.is_inequality(): + F_Hrep = F_Hrep + facet.vector() + + L = Polyhedron(rays=[[1],[-1]]) + Q = self.product(L) + H = Polyhedron(ieqs=[list(F_Hrep) + [width], list(F_Hrep) + [-width]]) + return Q.intersection(H) + def lawrence_extension(self, v): """ Return the Lawrence extension of ``self`` on the point ``v``.