diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py index 3b681d75d3b..040b3792380 100644 --- a/src/sage/algebras/fusion_rings/fusion_double.py +++ b/src/sage/algebras/fusion_rings/fusion_double.py @@ -22,8 +22,6 @@ from sage.misc.cachefunc import cached_method from sage.sets.set import Set from sage.rings.number_field.number_field import CyclotomicField -from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing -from sage.rings.ideal import Ideal from sage.matrix.constructor import matrix @@ -152,7 +150,7 @@ def __classcall_private__(cls, G, prefix='s', inject_variables=False): F.inject_variables() return F - def __init__(self, G, prefix='s'): + def __init__(self, G, prefix='s') -> None: """ EXAMPLES:: @@ -194,7 +192,7 @@ def __init__(self, G, prefix='s'): CombinatorialFreeModule.__init__(self, ZZ, list(self._names), prefix=prefix, bracket=False, category=cat) - def _repr_(self): + def _repr_(self) -> str: """ EXAMPLES:: @@ -575,6 +573,7 @@ def global_q_dimension(self, base_coercion=True): r""" Return the global quantum dimension, which is the sum of the squares of the quantum dimensions of the simple objects. + For the Drinfeld double, it is the square of the order of the underlying quantum group. EXAMPLES:: @@ -614,7 +613,7 @@ def total_q_order(self, base_coercion=True): D_minus = D_plus = total_q_order - def is_multiplicity_free(self, verbose=False): + def is_multiplicity_free(self, verbose=False) -> bool: """ Return ``True`` if all fusion coefficients are at most 1. @@ -642,7 +641,7 @@ def is_multiplicity_free(self, verbose=False): return False return True - return all(self.N_ijk(i,j,k) <= 1 for i in self.basis() + return all(self.N_ijk(i, j, k) <= 1 for i in self.basis() for j in self.basis() for k in self.basis()) @cached_method @@ -705,7 +704,8 @@ def product_on_basis(self, a, b): q1 + q2 + q5 + q6 + q7 """ d = {k.support_of_term(): val for k in self.basis() - if (val := self.N_ijk(self.monomial(a),self.monomial(b),self.dual(k)))} + if (val := self.N_ijk(self.monomial(a), self.monomial(b), + self.dual(k)))} return self._from_dict(d, remove_zeros=False) def group(self): @@ -737,7 +737,7 @@ def get_fmatrix(self, *args, **kwargs): return self.fmats class Element(CombinatorialFreeModule.Element): - def is_simple_object(self): + def is_simple_object(self) -> bool: r""" Determine whether ``self`` is a simple object (basis element) of the fusion ring. @@ -755,7 +755,7 @@ def g(self): class representative `g` and an irreducible character `\chi` of the centralizer of `g`. - Returns the conjugacy class representative of the underlying + This returns the conjugacy class representative of the underlying group corresponding to a simple object. See also :meth:`char`. EXAMPLES:: @@ -794,7 +794,7 @@ class representative `g` and an irreducible character `\chi` of def ribbon(self, base_coercion=True): """ - The twist or ribbon of the simple object. + Return the twist or ribbon of the simple object. EXAMPLES:: @@ -840,7 +840,7 @@ def twist(self, reduced=True): zeta = P.field().gen() rib = self.ribbon() norm = 2 * P._cyclotomic_order - for k in range(4*P._cyclotomic_order): + for k in range(4 * P._cyclotomic_order): if zeta ** k == rib: return k / norm @@ -895,4 +895,4 @@ def q_dimension(self, base_coercion=True): """ if not self.is_simple_object(): raise ValueError("quantum dimension is only available for simple objects") - return self.parent().s_ij(self,self.parent().one()) + return self.parent().s_ij(self, self.parent().one())