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

Commit

Permalink
work on revising self.s_ij
Browse files Browse the repository at this point in the history
  • Loading branch information
dwbump committed Feb 1, 2019
1 parent 7a5b4ae commit 2904d89
Showing 1 changed file with 44 additions and 22 deletions.
66 changes: 44 additions & 22 deletions src/sage/combinat/root_system/weyl_characters.py
Expand Up @@ -2289,25 +2289,33 @@ def __classcall__(cls, ct, k, base_ring=ZZ, prefix=None, style="coroots", conjug
prefix=prefix, style=style, k=k, conjugate=conjugate)

@lazy_attribute
def _q_field(self):
"""
The cyclotomic field of 4l-th roots of unity, where
l is the fusion_l of the category (see above). Call this
lazy attribute via the method `self.q_field()`.
"""
self._K = CyclotomicField(4*self._l)
return self._K

def q_field(self):
"""
Return the generator of the cyclotomic field of 2l-th roots of unity, where
l is the fusion_l of the category (see above).
Return the cyclotomic field of 4l-th roots of unity, where
`l` is the ``fusion_l`` of the category (see above).
This field contains the twists, categorical dimensions, and the entries of the
S-matrix.
EXAMPLES::
sage: B22=FusionRing("B2",2)
sage: B22.q_field
sage: B22.q_field()
Cyclotomic Field of order 40 and degree 16
sage: A11=FusionRing('A1',1)
sage: A11.q_field
sage: A11.q_field()
Cyclotomic Field of order 12 and degree 4
"""
self._K = CyclotomicField(4*self._l)
return self._K
return self._q_field

def _element_constructor(self,weight):
return self._parent._element_constructor(self._parent,weight)
Expand Down Expand Up @@ -2442,27 +2450,41 @@ def ordered_basis(self):
raise ValueError("ordered basis not yet available for this FusionRing")
return ord_basis

def s_ij(self, elt_i, elt_j, fusion_mat_i=[]):
def s_ij_legacy(self, elt_i, elt_j, fusion_mat_i=[]):
"""
Return the element of the S-matrix of this FusionRing corresponding to
the given elements.
EXAMPLES::
#TODO: update docstring using next iteration of ordered basis method
Remove this soon
"""
dims = self.q_dims()
ord_basis = self.ordered_basis()
twists = [x.twist() for x in ord_basis]
rng = range(len(ord_basis))
j = ord_basis.index(elt_j)
fusion_matrix = fusion_mat_i if fusion_mat_i else elt_i.fusion_matrix()
q = self.q_field.gen()
q = self.q_field().gen()
l = self.fusion_l()
s_ij = sum(fusion_matrix[k,j]*q**(2*l*twists[k])*dims[k] for k in rng)
s_ij *= q**(-2*l*(elt_i.twist() + elt_j.twist()))
return s_ij

def s_ij(self, elt_i, elt_j):
"""
Return the element of the S-matrix of this FusionRing corresponding to
the given elements.
INPUT:
- ``elt_i``, ``elt_j`` -- elements of the fusion basis
EXAMPLES::
#TODO: update docstring using next iteration of ordered basis method
"""
l = self.fusion_l()
K = self.q_field()
q = K.gen()
ijtwist = -2*l*(elt_i.twist() + elt_j.twist())
return sum(self(k).q_dimension()*q**(2*l*self(k).twist()+ijtwist) for k in (elt_i.dual()*elt_j).monomial_coefficients())

def s_matrix(self):
r"""
Return the S-matrix of this FusionRing.
Expand All @@ -2486,7 +2508,7 @@ def s_matrix(self):
ord_basis = self.ordered_basis()
fusion_mats = [x.fusion_matrix() for x in ord_basis]
rng = range(len(ord_basis))
S = matrix(self.q_field, len(ord_basis))
S = matrix(self.q_field(), len(ord_basis))
for i in rng:
for j in rng:
S[i,j] = self.s_ij(ord_basis[i], ord_basis[j], fusion_mats[i])
Expand Down Expand Up @@ -2539,7 +2561,7 @@ class Element(WeylCharacterRing.Element):
"""
A class for FusionRing elements
"""
def is_simple_obj(self):
def is_simple_object(self):
"""
Determine whether element is a simple object of the FusionRing.
Expand All @@ -2548,11 +2570,11 @@ def is_simple_obj(self):
sage: A22=FusionRing("A2",2)
sage: x = A22(1,0); x
A22(1,0)
sage: x.is_simple_obj()
sage: x.is_simple_object()
True
sage: x^2
A22(0,1) + A22(2,0)
sage: (x^2).is_simple_obj()
sage: (x^2).is_simple_object()
False
"""
return self.parent()._k is not None and len(self.monomial_coefficients())==1
Expand All @@ -2578,7 +2600,7 @@ def twist(self):
sage: F41(0,0,0,1).twist()
4/5
"""
if not self.is_simple_obj():
if not self.is_simple_object():
raise ValueError("quantum twist is only available for simple objects of a FusionRing")
rho = sum(self.parent().positive_roots())/2
lam = self.highest_weight()
Expand All @@ -2604,7 +2626,7 @@ def q_dimension(self):
sage: [(b.q_dimension())^2 for b in B22.basis()]
[1, 5, 4, 1, 5, 4]
"""
if not self.is_simple_obj():
if not self.is_simple_object():
raise ValueError("quantum twist is only available for simple objects of a FusionRing")
lam = self.highest_weight()
space = self.parent().space()
Expand All @@ -2617,7 +2639,7 @@ def q_dimension(self):
q = pr.gen()**2
expr = pr(expr)
expr = expr.substitute(q=q**2)/q**(expr.degree())
zet = self.parent().q_field.gen()
zet = self.parent().q_field().gen()
return expr.substitute(q=zet)

def fusion_matrix(self):
Expand All @@ -2633,7 +2655,7 @@ def fusion_matrix(self):
[0 1]
[1 1]
"""
if not self.is_simple_obj():
if not self.is_simple_object():
raise ValueError("fusion matrix is only available for simple objects of a FusionRing")
ord_basis = self.parent().ordered_basis()
wts = [x.highest_weight() for x in ord_basis]
Expand Down

0 comments on commit 2904d89

Please sign in to comment.