# Ticket #11634: trac_11634_fix_sage_5_beta8.patch

File trac_11634_fix_sage_5_beta8.patch, 3.7 KB (added by vbraun, 10 years ago)

Initial patch

• ## sage/combinat/root_system/associahedron.py

```# HG changeset patch
# User Volker Braun <vbraun@stp.dias.ie>
# Date 1332083129 14400
# Node ID 223cfbcf4b299db33fcd7580621e2b48cf4b0b73
# Parent  6ec226849973f0b9be09d010fc81c6c0f5020cc2
Trac #11634: Fix the Associahedron class introduced in sage-5.0.alpha8

diff --git a/sage/combinat/root_system/associahedron.py b/sage/combinat/root_system/associahedron.py```
 a # #                  http://www.gnu.org/licenses/ #***************************************************************************** from sage.geometry.polyhedra import Polyhedron from sage.geometry.polyhedron.backend_ppl import Polyhedron_QQ_ppl from sage.combinat.root_system.cartan_type import CartanType from sage.modules.free_module_element import vector class Associahedron(Polyhedron): class Associahedron(Polyhedron_QQ_ppl): r""" The generalized associahedron is a polytopal complex with vertices in one-to-one correspondence with clusters in the cluster complex, and with edges between two vertices if and only if the associated two sage: sorted(Asso.Hrepresentation(), key=repr) [An inequality (-1, 0) x + 1 >= 0, An inequality (0, -1) x + 1 >= 0, An inequality (0, 1) x + 1 >= 0, An inequality (1, 0) x + 1 >= 0, An inequality (1, 1) x + 1 >= 0] sage: Asso.Vrepresentation() [A vertex at (-1, 1), A vertex at (1, 1), A vertex at (1, -1), A vertex at (0, -1), A vertex at (-1, 0)] (A vertex at (1, -1), A vertex at (1, 1), A vertex at (-1, 1), A vertex at (-1, 0), A vertex at (0, -1)) sage: Associahedron(['B',2]) Generalized associahedron of type ['B', 2] with 6 vertices c = rhocheck.coefficient(orbit.leading_support()) for beta in orbit: inequalities.append( [c] + [ beta.coefficient(i) for i in I ] ) Polyhedron.__init__(self,ieqs=inequalities) Polyhedron_QQ_ppl.__init__(self, len(I), None, [inequalities,[]]) # check that there are non non trivial facets assert self.n_facets() == len(inequalities) EXAMPLES:: sage: Asso = Associahedron(['A',2]) sage: Asso.vertices() [[-1, 1], [1, 1], [1, -1], [0, -1], [-1, 0]] [[1, -1], [1, 1], [-1, 1], [-1, 0], [0, -1]] sage: Asso.vertices_in_root_space() [-alpha + alpha, alpha + alpha, alpha - alpha, -alpha, -alpha] (alpha - alpha, alpha + alpha, -alpha + alpha, -alpha, -alpha) """ root_space = self._cartan_type.root_system().root_space() return [ root_space.from_vector(vector(V)) for V in self.vertex_generator() ] return tuple( root_space.from_vector(vector(V)) for V in self.vertex_generator() )
• ## sage/geometry/polyhedron/base.py

`diff --git a/sage/geometry/polyhedron/base.py b/sage/geometry/polyhedron/base.py`
 a - ``ambient_dim`` -- integer. The dimension of the ambient space. - ``Vrep`` -- a list `[vertices, rays, lines]``. - ``Vrep`` -- a list `[vertices, rays, lines]`` or ``None``. The V-representation of the polyhedron. If ``None``, the polyhedron is determined by the H-representation. - ``Hrep`` -- a list `[ieqs, eqns]``. - ``Hrep`` -- a list `[ieqs, eqns]`` or ``None``. The H-representation of the polyhedron. If ``None``, the polyhedron is determined by the V-representation. Only one of ``Vrep`` or ``Hrep`` can be different from ``None``. TESTS::