Skip to content

Commit

Permalink
Various improvements to Weyl character rings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tscrim committed Feb 24, 2023
1 parent 8f5bbd2 commit d008a9c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/fusion_rings/fusion_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
33 changes: 24 additions & 9 deletions src/sage/combinat/root_system/weyl_characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"""
Expand Down Expand Up @@ -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
Expand All @@ -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 = {}
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit d008a9c

Please sign in to comment.