Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
merged two methods together to one method with a flag, rearranged stu…
Browse files Browse the repository at this point in the history
…ff for the docmentation
  • Loading branch information
DennisJahn committed Oct 13, 2021
1 parent 41b85a0 commit 8774d2d
Showing 1 changed file with 25 additions and 29 deletions.
54 changes: 25 additions & 29 deletions src/sage/combinat/root_system/reflection_group_real.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,47 +707,43 @@ def simple_root_index(self, i):
"""
return self._index_set_inverse[i]

def bruhat_upper_cone(self, x, y):
def bruhat_cone(self, x, y, side = 'upper'):
r"""
Returns the polyhedral cone generated by the set of positive roots
``beta`` where ``s_beta`` is the reflection corresponding to
``beta``, ``s_beta`` ``x`` covers ``x``, and
``x`` <= ``s_beta`` ``x`` <= ``y``
Returns the polyhedral cone generated by the set of positive roots ``beta``
where ``s_beta`` is the reflection corresponding to ``beta`` and:
EXAMPLES::
For ``side`` = ``'upper'``: ``s_beta`` ``x`` covers ``x`` and ``x`` <= ``s_beta`` ``x`` <= ``y``.
sage: W = ReflectionGroup(['A',2]) # optional - gap3
sage: x = W.from_reduced_word([1]) # optional - gap3
sage: y = W.w0 # optional - gap3
sage: W.bruhat_upper_cone(x,y) # optional - gap3
A 2-dimensional polyhedron in ZZ^2 defined as the convex hull of 1 vertex and 2 rays
"""
roots = [self.reflection_to_positive_root(x*r*x.inverse()) for z, r in x.bruhat_upper_covers_reflections() if z.bruhat_le(y)]
from sage.geometry.polyhedron.constructor import Polyhedron
if self.is_crystallographic():
return Polyhedron(rays = roots, ambient_dim = self.rank())
else:
from warnings import warn
warn("Using floating point numbers for roots of unity. This might cause numerical errors!")
from sage.rings.real_double import RDF
return Polyhedron(rays = roots, ambient_dim = self.rank(), base_ring = RDF)
For ``side`` = ``'lower'``: ``y`` covers ``s_beta`` ``y`` and ``x`` <= ``s_beta`` ``y`` <= ``y``.
INPUT:
def bruhat_lower_cone(self, x, y):
r"""
Returns the polyhedral cone generated by the set of positive roots
``beta`` where ``s_beta`` is the reflection corresponding to
``beta``, ``y`` covers ``s_beta`` ``y``, and
``x`` <= ``s_beta`` ``y`` <= ``y``
- ``side`` (default: ``'upper'``) -- must be one of the following:
* ``'upper'`` - roots of reflections corresponding to atoms in the interval [``x``, ``y``]
* ``'lower'`` - roots of reflections corresponding to coatoms in the interval [``x``, ``y``]
EXAMPLES::
sage: W = ReflectionGroup(['A',2]) # optional - gap3
sage: x = W.from_reduced_word([1]) # optional - gap3
sage: y = W.w0 # optional - gap3
sage: W.bruhat_lower_cone(x,y) # optional - gap3
sage: W.bruhat_cone(x, y) # optional - gap3
A 2-dimensional polyhedron in ZZ^2 defined as the convex hull of 1 vertex and 2 rays
sage: W = ReflectionGroup(['E',6]) # optional - gap3
sage: x = W.one() # optional - gap3
sage: y = W.w0 # optional - gap3
sage: W.bruhat_cone(x, y, side = 'lower') # optional - gap3
A 6-dimensional polyhedron in ZZ^6 defined as the convex hull of 1 vertex and 6 rays
"""
roots = [self.reflection_to_positive_root(y*r*y.inverse()) for z, r in y.bruhat_lower_covers_reflections() if x.bruhat_le(z)]
if side == 'upper':
roots = [self.reflection_to_positive_root(x*r*x.inverse()) for z, r in x.bruhat_upper_covers_reflections() if z.bruhat_le(y)]
elif side == 'lower':
roots = [self.reflection_to_positive_root(y*r*y.inverse()) for z, r in y.bruhat_lower_covers_reflections() if x.bruhat_le(z)]
else:
raise ValueError("side must be either 'upper' or 'lower'")
from sage.geometry.polyhedron.constructor import Polyhedron
if self.is_crystallographic():
return Polyhedron(rays = roots, ambient_dim = self.rank())
Expand Down

0 comments on commit 8774d2d

Please sign in to comment.