diff --git a/src/sage/algebras/fusion_rings/fusion_ring.py b/src/sage/algebras/fusion_rings/fusion_ring.py index 915ca62e73b..8f4ed4b3cb7 100644 --- a/src/sage/algebras/fusion_rings/fusion_ring.py +++ b/src/sage/algebras/fusion_rings/fusion_ring.py @@ -401,7 +401,7 @@ def test_braid_representation(self, max_strands=6, anyon=None): sage: A21 = FusionRing("A2", 1) sage: A21.test_braid_representation(max_strands=4) True - sage: F41 = FusionRing("F4", 1) # long time + sage: F41 = FusionRing("F4", 1) # long time sage: F41.test_braid_representation() # long time True """ diff --git a/src/sage/combinat/root_system/weyl_characters.py b/src/sage/combinat/root_system/weyl_characters.py index f306df7eddf..b65e3eff5e5 100644 --- a/src/sage/combinat/root_system/weyl_characters.py +++ b/src/sage/combinat/root_system/weyl_characters.py @@ -154,9 +154,11 @@ def next_level(wt): else: B = self._space - cat = AlgebrasWithBasis(base_ring).Subobjects() + cat = AlgebrasWithBasis(base_ring).Commutative() if k is None: - cat = cat.Graded() + cat = cat.Subobjects().Graded() + else: + cat = cat.FiniteDimensional() CombinatorialFreeModule.__init__(self, base_ring, B, category=cat) # Register the embedding of self into ambient as a coercion @@ -537,7 +539,7 @@ def _product_helper(self, d1, b): d[g] = d.get(g,0) + d1[k] elif epsilon == -1: d[g] = d.get(g,0) - d1[k] - return self._from_dict(d) + return self._from_dict(d, coerce=True) def dot_reduce(self, a): r""" @@ -715,8 +717,15 @@ def _demazure_helper(self, dd, word="long", debug=False): alpha = self._space.simple_roots() r = self.rank() cm = {} + supp = [] for i in index_set: - cm[i] = tuple(int(alpha[i].inner_product(alphacheck[j])) for j in index_set) + temp = [] + cm[i] = [0] * r + for ind,j in enumerate(index_set): + cm[i][ind] = int(alpha[i].inner_product(alphacheck[j])) + if cm[i][ind]: + temp.append(ind) + supp.append(temp) if debug: print("cm[%s]=%s" % (i, cm[i])) accum = dd @@ -733,15 +742,21 @@ def _demazure_helper(self, dd, word="long", debug=False): if coroot >= 0: mu = v for j in range(coroot+1): - next[mu] = next.get(mu,0)+accum[v] + next[mu] = next.get(mu,0) + accum[v] if debug: print(" mu=%s, next[mu]=%s" % (mu, next[mu])) - mu = tuple(mu[k] - cm[i][k] for k in range(r)) + mu = list(mu) + for k in supp[i-1]: + mu[k] -= cm[i][k] + mu = tuple(mu) else: mu = v for j in range(-1-coroot): - mu = tuple(mu[k] + cm[i][k] for k in range(r)) - next[mu] = next.get(mu,0)-accum[v] + mu = list(mu) + for k in supp[i-1]: + mu[k] += cm[i][k] + mu = tuple(mu) + next[mu] = next.get(mu,0) - accum[v] if debug: print(" mu=%s, next[mu]=%s" % (mu, next[mu])) accum = {} @@ -1779,7 +1794,7 @@ def __init__(self, parent, prefix): # TODO: this only works for irreducible Cartan types! prefix = (self._cartan_type[0].lower() + str(self._rank)) self._prefix = prefix - category = AlgebrasWithBasis(self._base_ring) + category = AlgebrasWithBasis(self._base_ring).Commutative() CombinatorialFreeModule.__init__(self, self._base_ring, self._space, category=category) def _repr_(self):