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

Commit

Permalink
Merge branch 'u/aram.dermenjian/generalize_bruhat_graphs' of git://tr…
Browse files Browse the repository at this point in the history
…ac.sagemath.org/sage into public/combinat/extend_bruhat_graphs-22854
  • Loading branch information
Travis Scrimshaw committed May 17, 2017
2 parents df03447 + d5875c1 commit 9164839
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 40 deletions.
103 changes: 103 additions & 0 deletions src/sage/categories/coxeter_groups.py
Expand Up @@ -24,6 +24,8 @@
from sage.misc.flatten import flatten
from copy import copy

from sage.graphs.graph import DiGraph

class CoxeterGroups(Category_singleton):
r"""
The category of Coxeter groups.
Expand Down Expand Up @@ -543,6 +545,81 @@ def bruhat_interval(self, x, y):
ret.append(nextlayer)
return flatten(ret)

def bruhat_graph(self, x=None, y=None, edge_labels=False):
r"""
Return the Bruhat graph as a directed graph, with an edge `u \to v`
if and only if `u < v` in the Bruhat order, and `u = r \cdot v`.
The Bruhat graph `\Gamma(x,y)`, defined if `x \leq y` in the
Bruhat order, has as its vertices the Bruhat interval
`\{ t | x \leq t \leq y \}`, and as its edges are the pairs
`(u, v)` such that `u = r \cdot v` where `r` is a reflection,
that is, a conjugate of a simple reflection.
REFERENCES:
Carrell, The Bruhat graph of a Coxeter group, a conjecture of Deodhar,
and rational smoothness of Schubert varieties. Algebraic groups and
their generalizations: classical methods (University Park, PA, 1991),
53--61, Proc. Sympos. Pure Math., 56, Part 1, Amer. Math. Soc.,
Providence, RI, 1994.
EXAMPLES::
sage: W = CoxeterGroup(['H',3])
sage: G = W.bruhat_graph(); G
Digraph on 120 vertices
sage: W = CoxeterGroup(['A',2,1])
sage: s1, s2, s3 = W.simple_reflections()
sage: W.bruhat_graph(s1, s1*s3*s2*s3)
Digraph on 6 vertices
sage: W.bruhat_graph(s1, s3*s2*s3)
Digraph on 0 vertices
sage: W = WeylGroup("A3", prefix="s")
sage: s1, s2, s3 = W.simple_reflections()
sage: G = W.bruhat_graph(s1*s3, s1*s2*s3*s2*s1); G
Digraph on 10 vertices
Check that the graph has the correct number of edges
(see :trac:`17744`)::
sage: len(G.edges())
16
"""
if x is None:
x = self.one()
if y is None:
if self.is_finite():
y = self.long_element()
else:
raise TypeError("infinite groups must specify a maximal element")

g = self.bruhat_interval(x,y)
d = []

if self.is_finite():
ref = self.reflections()
for u in g:
for v in g:
if u.length() < v.length() and u*v.inverse() in ref:
if edge_labels:
d.append((u,v, u*v.inverse()))
else:
d.append((u,v))
else:
for u in g:
for v in g:
if u.length() < v.length() and (u*v.inverse()).is_reflection():
if edge_labels:
d.append((u,v,u*v.inverse()))
else:
d.append((u,v))
return DiGraph(d)

def canonical_representation(self):
r"""
Return the canonical faithful representation of ``self``.
Expand Down Expand Up @@ -1141,6 +1218,32 @@ def length(self):
"""
return len(self.reduced_word())

def reflection_length(self):
"""
Return the reflection length of ``self``.
The reflection length is the length of the shortest expression
of the element as a product of reflections.
.. SEEALSO::
:meth:`absolute_length`
EXAMPLES::
sage: W = WeylGroup(['A',3])
sage: s = W.simple_reflections()
sage: (s[1]*s[2]*s[3]).reflection_length()
3
sage: W = SymmetricGroup(4)
sage: s = W.simple_reflections()
sage: (s[3]*s[2]*s[3]).reflection_length()
1
"""
return self.absolute_length()

def absolute_length(self):
"""
Return the absolute length of ``self``.
Expand Down
40 changes: 0 additions & 40 deletions src/sage/combinat/root_system/weyl_group.py
Expand Up @@ -557,46 +557,6 @@ def classical(self):
raise ValueError("classical subgroup only defined for affine types")
return ClassicalWeylSubgroup(self._domain, prefix=self._prefix)

def bruhat_graph(self, x, y):
r"""
Return the Bruhat graph as a directed graph, with an edge `u \to v`
if and only if `u < v` in the Bruhat order, and `u = r \cdot v`.
The Bruhat graph `\Gamma(x,y)`, defined if `x \leq y` in the
Bruhat order, has as its vertices the Bruhat interval
`\{ t | x \leq t \leq y \}`, and as its edges are the pairs
`(u, v)` such that `u = r \cdot v` where `r` is a reflection,
that is, a conjugate of a simple reflection.
REFERENCES:
Carrell, The Bruhat graph of a Coxeter group, a conjecture of Deodhar,
and rational smoothness of Schubert varieties. Algebraic groups and
their generalizations: classical methods (University Park, PA, 1991),
53--61, Proc. Sympos. Pure Math., 56, Part 1, Amer. Math. Soc.,
Providence, RI, 1994.
EXAMPLES::
sage: W = WeylGroup("A3", prefix="s")
sage: s1, s2, s3 = W.simple_reflections()
sage: G = W.bruhat_graph(s1*s3, s1*s2*s3*s2*s1); G
Digraph on 10 vertices
Check that the graph has the correct number of edges
(see :trac:`17744`)::
sage: len(G.edges())
16
"""
g = self.bruhat_interval(x, y)
ref = self.reflections()
d = {}
for u in g:
d[u] = [v for v in g if u.length() < v.length() and u*v.inverse() in ref]
return DiGraph(d)


class ClassicalWeylSubgroup(WeylGroup_gens):
"""
A class for Classical Weyl Subgroup of an affine Weyl Group
Expand Down
12 changes: 12 additions & 0 deletions src/sage/groups/matrix_gps/coxeter_group.py
Expand Up @@ -397,6 +397,18 @@ def coxeter_diagram(self):

coxeter_graph = deprecated_function_alias(17798, coxeter_diagram)

def coxeter_type(self):
"""
Return the Coxeter type of ``self``.
EXAMPLES::
sage: W = CoxeterGroup(['H',3])
sage: W.coxeter_type()
Coxeter type of ['H', 3]
"""
return self._matrix.coxeter_type()

def bilinear_form(self):
r"""
Return the bilinear form associated to ``self``.
Expand Down

0 comments on commit 9164839

Please sign in to comment.