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

Commit

Permalink
better description for bruhat cone, wrapped and empty lines, correcte…
Browse files Browse the repository at this point in the history
…d doctests
  • Loading branch information
DennisJahn committed Nov 24, 2021
1 parent c816e55 commit 90393b2
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions src/sage/combinat/root_system/reflection_group_real.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,18 +709,26 @@ def simple_root_index(self, i):

def bruhat_cone(self, x, y, side='upper', backend='cdd'):
r"""
Return the polyhedral cone generated by the set of positive roots ``beta`` where ``s_beta`` is the reflection corresponding to ``beta`` and:
Return the (upper or lower) Bruhat cone associated to the interval ``[x,y]``.
For ``side`` = ``'upper'``: ``s_beta`` ``x`` covers ``x`` and ``x`` <= ``s_beta`` ``x`` <= ``y``.
To a cover relation `v \prec w` in strong Bruhat order you can assign a positive
root `\beta` given by the unique reflection `s_\beta` such that `s_\beta v = w`.
For ``side`` = ``'lower'``: ``y`` covers ``s_beta`` ``y`` and ``x`` <= ``s_beta`` ``y`` <= ``y``.
The upper Bruhat cone of the interval `[x,y]` is the non-empty, polyhedral cone generated
by the roots cooresponding to `x \prec a` for all atoms `a` in the interval.
The lower Bruhat cone of the interval `[x,y]` is the non-empty, polyhedral cone generated
by the roots cooresponding to `c \prec y` for all coatoms `c` in the interval.
INPUT:
- ``x`` - an element in the group `W`
- ``y`` - an element in the group `W`
- ``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``]
* ``'upper'`` - return the upper Bruhat cone of the interval [``x``, ``y``]
* ``'lower'`` - return the lower Bruhat cone of the interval [``x``, ``y``]
- ``backend`` -- string (default: ``'cdd'``); the backend to use to create the polyhedron
Expand All @@ -730,31 +738,44 @@ def bruhat_cone(self, x, y, side='upper', backend='cdd'):
sage: x = W.from_reduced_word([1]) # optional - gap3
sage: y = W.w0 # 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
A 2-dimensional polyhedron in QQ^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
sage: W.bruhat_cone(x, y, side='lower') # optional - gap3
A 6-dimensional polyhedron in QQ^6 defined as the convex hull of 1 vertex and 6 rays
"""
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)]
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)]
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(vertices = [[0]*self.rank()], rays=roots, ambient_dim=self.rank(), backend=backend)
return Polyhedron(vertices = [[0]*self.rank()],
rays=roots,
ambient_dim=self.rank(),
backend=backend)
else:
if backend == 'cdd':
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 as base_ring
else:
from sage.rings.qqbar import AA as base_ring
return Polyhedron(vertices = [[0]*self.rank()], rays=roots, ambient_dim=self.rank(), base_ring=base_ring, backend=backend)

return Polyhedron(vertices = [[0]*self.rank()],
rays=roots,
ambient_dim=self.rank(),
base_ring=base_ring,
backend=backend)

class Element(RealReflectionGroupElement, ComplexReflectionGroup.Element):

Expand Down

0 comments on commit 90393b2

Please sign in to comment.