From f673aec39c5dbb81c65ae72fd70154c5674585f5 Mon Sep 17 00:00:00 2001 From: Travis Scrimshaw Date: Sat, 2 Jan 2016 04:20:53 -0600 Subject: [PATCH] A better method to find the minimal length coset representatives. --- src/sage/categories/weyl_groups.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sage/categories/weyl_groups.py b/src/sage/categories/weyl_groups.py index ba953c05376..a2b05886c72 100644 --- a/src/sage/categories/weyl_groups.py +++ b/src/sage/categories/weyl_groups.py @@ -160,8 +160,9 @@ def quantum_bruhat_graph(self, index_set=()): """ if not self.cartan_type().is_finite(): raise ValueError("the Cartan type {} is not finite".format(self.cartan_type())) - from sage.graphs.digraph import DiGraph - WP = [x for x in self if x == x.coset_representative(index_set)] + + # Find all the minimal length coset representatives + WP = [x for x in self if all(not x.has_descent(i) for i in index_set)] # This is a modified form of quantum_bruhat_successors. # It does not do any error checking and also is more efficient @@ -201,6 +202,7 @@ def succ(x): successors.append((wrc, alpha)) return successors + from sage.graphs.digraph import DiGraph return DiGraph([[x,i[0],i[1]] for x in WP for i in succ(x)], name="Parabolic Quantum Bruhat Graph of %s for nodes %s"%(self, index_set))