Open fe60a72e-b3d0-4317-856b-4536ec0e4b8d opened 11 years ago
Attachment: trac_15272_parabolic_bruhat_posets.patch.gz
Author: Vít Tuček
Branch: u/vittucek/ticket/15272
Description changed:
---
+++
@@ -1,13 +1,5 @@
-This patch extends the functionality of bruhat_poset and introduces new parabolic_bruhat_graph for finite Weyl groups.
+This patch adds method minimal_representatives and extends the functionality of bruhat_poset and bruhat_graphs.
Let W be a finite Weyl group and let W_S be the subgroup of W generated by reflections associated with a subset S of simple roots. Then the cosets W / W_S have unique representatives of minimal length which are ordered by the Bruhat order of W. Similarly for W_S \ W. These poset structures appear in many places, e.g. intersection cohomology of generalized flag varieties or nilpotent Lie algebra cohomology.
-This patch adds a parameters index_set (= S) and side (left / right).
-
-
----
-
-
-Introducing parabolic_bruhat_graph is ugly. Ideally, one would just extend the existing bruhat_graph. However, this method is based upon bruhat_interval which belongs to categories/coxeter_groups.py
-
-I was unsure where to put the code, which I haven't written yet nor which I need in the foreseeable future anyway. Since it seems that the best course of action would be to implement class (or category?) for parabolic subroot systems / groups I think that one more method for Weyl group is not much of an issue.
+This patch adds a parameters index_set (= S), crossed_nodes and side (left / right).
Commit: 472c090
There is a merge conflict with develop:
x = x.coset_representative(index_set,side)
y = y.coset_representative(index_set,side)
g = self.bruhat_poset(index_set, crossed_nodes, side, facade=True).interval(x,y)
ref = self.reflections()
d = {}
for x in g:
<<<<<<< HEAD
d[x] = [y for y in g if x.length() < y.length() and x*y.inverse() in ref]
=======
d[x] = {}
for y in g:
if side == "right":
r = y*x.inverse()
else:
r = x.inverse()*y
if x.length() < y.length() and ref.has_key(r):
d[x][y] = r
>>>>>>> 92888b345acb3f6726c1d38ab16d4f1366fbb757
return DiGraph(d)
I'm pushing a branch (warning: branch change!) in which I resolve this in favor of your patch's version (the longer one, with the "for y in g" loop and the dictionary rather than the list). If this is wrong, please let me know.
New commits:
1b1220d | manual merge commit due to conflict with develop |
Changed branch from u/vittucek/ticket/15272 to public/combinat/15272
That said, what do you think about pulling the if side == "right"
check outside of the loop, so as to not repeat it over and over?
Oh, and also the conflict was because some other patch replaced ref.has_key(...)
by ... in ref
. Maybe do the same in your code? (I don't know what the difference is; it just sounds like a logical thing to do.)
The has_key
is being deprecated (removed?) in python3 in favor of the in
syntax (which I believe is faster...?). Also I agree with Darij since this loop is so small, I'd pull the side == "right"
statement outside as:
if side == "right":
for y in g:
r = y*x.inverse()
if x.length() < y.length() and r in ref:
d[x][y] = r
else:
for y in g:
r = x.inverse()*y
if x.length() < y.length() and r in ref:
d[x][y] = r
Changed branch from public/combinat/15272 to u/vittucek/ticket/15272
Replying to @darijgr:
There is a merge conflict with develop:
x = x.coset_representative(index_set,side) y = y.coset_representative(index_set,side) g = self.bruhat_poset(index_set, crossed_nodes, side, facade=True).interval(x,y) ref = self.reflections() d = {} for x in g: <<<<<<< HEAD d[x] = [y for y in g if x.length() < y.length() and x*y.inverse() in ref] ======= d[x] = {} for y in g: if side == "right": r = y*x.inverse() else: r = x.inverse()*y if x.length() < y.length() and ref.has_key(r): d[x][y] = r >>>>>>> 92888b345acb3f6726c1d38ab16d4f1366fbb757 return DiGraph(d)
I'm pushing a branch (warning: branch change!) in which I resolve this in favor of your patch's version (the longer one, with the "for y in g" loop and the dictionary rather than the list). If this is wrong, please let me know.
Thanks! I've made the change you've requested (and moreover I've switched the order of tests to benefit from short-circuiting. I didn't know how to add the patch on top of your branch (insufficient permissions?) so I just went with what sage -dev push
suggested. I hope that's fine.
New commits:
b1e25e6 | Performance enhancement in bruhat_graph |
Branch pushed to git repo; I updated commit sha1. New commits:
64ea7c8 | Bugfix: FiniteFamily is not a dictionary! |
Replying to @darijgr:
Oh, and also the conflict was because some other patch replaced
ref.has_key(...)
by... in ref
. Maybe do the same in your code? (I don't know what the difference is; it just sounds like a logical thing to do.)
Ehm. I have done this change too hastily. As it turns out ref
is not a dictionary but a FiniteFamily
which means that its __contains__
method looks at the values. It's __contains__
method was changed #15784 to use in
in favor of has_key
.
does not apply
This patch adds method minimal_representatives and extends the functionality of bruhat_poset and bruhat_graphs.
Let W be a finite Weyl group and let W_S be the subgroup of W generated by reflections associated with a subset S of simple roots. Then the cosets W / W_S have unique representatives of minimal length which are ordered by the Bruhat order of W. Similarly for W_S \ W. These poset structures appear in many places, e.g. intersection cohomology of generalized flag varieties or nilpotent Lie algebra cohomology.
This patch adds a parameters index_set (= S), crossed_nodes and side (left / right).
CC: @nthiery @dwbump @tscrim @anneschilling
Component: combinatorics
Author: Vít Tuček
Branch/Commit: u/vittucek/ticket/15272 @
64ea7c8
Issue created by migration from https://trac.sagemath.org/ticket/15272