@@ -234,13 +234,13 @@ def __classcall_private__(cls, R, q=None):
234
234
q = R (q )
235
235
if q == 0 :
236
236
raise ValueError ("q cannot be 0" )
237
- if 1 / q not in R :
237
+ if 1 / q not in R :
238
238
raise ValueError ("q={} is not invertible in {}" .format (q , R ))
239
239
if R not in Rings ().Commutative ():
240
240
raise ValueError ("{} is not a commutative ring" .format (R ))
241
241
return super ().__classcall__ (cls , R , q )
242
242
243
- def __init__ (self , R , q ):
243
+ def __init__ (self , R , q ) -> None :
244
244
r"""
245
245
Initialize ``self``.
246
246
@@ -258,7 +258,7 @@ def __init__(self, R, q):
258
258
category = cat )
259
259
self ._assign_names ('A,B,C,a,b,g' )
260
260
261
- def _repr_term (self , t ):
261
+ def _repr_term (self , t ) -> str :
262
262
r"""
263
263
Return a string representation of the basis element indexed by ``t``.
264
264
@@ -278,14 +278,14 @@ def exp(l, e):
278
278
if e == 1 :
279
279
return '*' + l
280
280
return '*' + l + '^{}' .format (e )
281
- ret = '' .join (exp (l , e ) for l , e in zip ([ 'A' , 'B' , 'C' , 'a' , 'b' , 'g' ] , t ))
281
+ ret = '' .join (exp (l , e ) for l , e in zip ('ABCabg' , t ))
282
282
if not ret :
283
283
return '1'
284
284
if ret [0 ] == '*' :
285
285
ret = ret [1 :]
286
286
return ret
287
287
288
- def _latex_term (self , t ):
288
+ def _latex_term (self , t ) -> str :
289
289
r"""
290
290
Return a latex representation of the basis element indexed by ``t``.
291
291
@@ -389,7 +389,7 @@ def q(self):
389
389
return self ._q
390
390
391
391
@cached_method
392
- def an_element (self ):
392
+ def _an_element_ (self ):
393
393
r"""
394
394
Return an element of ``self``.
395
395
@@ -451,13 +451,13 @@ def casimir_element(self):
451
451
"""
452
452
q = self ._q
453
453
I = self ._indices
454
- d = {I ((1 ,1 , 1 , 0 , 0 , 0 )): q , # q ABC
455
- I ((2 ,0 , 0 , 0 , 0 , 0 )): q ** 2 , # q^2 A^2
456
- I ((0 ,2 , 0 , 0 , 0 , 0 )): q ** - 2 , # q^-2 B^2
457
- I ((0 ,0 , 2 , 0 , 0 , 0 )): q ** 2 , # q^2 C^2
458
- I ((1 ,0 , 0 , 1 , 0 , 0 )): - q , # -q A\alpha
459
- I ((0 ,1 , 0 , 0 , 1 , 0 )): - q ** - 1 , # -q^-1 B\beta
460
- I ((0 ,0 , 1 , 0 , 0 , 1 )): - q } # -q C\gamma
454
+ d = {I ((1 , 1 , 1 , 0 , 0 , 0 )): q , # q ABC
455
+ I ((2 , 0 , 0 , 0 , 0 , 0 )): q ** 2 , # q^2 A^2
456
+ I ((0 , 2 , 0 , 0 , 0 , 0 )): q ** - 2 , # q^-2 B^2
457
+ I ((0 , 0 , 2 , 0 , 0 , 0 )): q ** 2 , # q^2 C^2
458
+ I ((1 , 0 , 0 , 1 , 0 , 0 )): - q , # -q A\alpha
459
+ I ((0 , 1 , 0 , 0 , 1 , 0 )): - q ** - 1 , # -q^-1 B\beta
460
+ I ((0 , 0 , 1 , 0 , 0 , 1 )): - q } # -q C\gamma
461
461
return self .element_class (self , d )
462
462
463
463
@cached_method
@@ -505,7 +505,7 @@ def product_on_basis(self, x, y):
505
505
# Commute the central parts to the right
506
506
lhs = list (x [:3 ])
507
507
rhs = list (y )
508
- for i in range (3 ,6 ):
508
+ for i in range (3 , 6 ):
509
509
rhs [i ] += x [i ]
510
510
511
511
# No ABC variables on the RHS to move past
@@ -515,44 +515,44 @@ def product_on_basis(self, x, y):
515
515
# We recurse using the PBW-type basis property:
516
516
# that YX = XY + lower order terms (see Theorem 4.1 in Terwilliger).
517
517
q = self ._q
518
- if lhs [2 ] > 0 : # lhs has a C
519
- if rhs [0 ] > 0 : # rhs has an A to commute with C
518
+ if lhs [2 ] > 0 : # lhs has a C
519
+ if rhs [0 ] > 0 : # rhs has an A to commute with C
520
520
lhs [2 ] -= 1
521
521
rhs [0 ] -= 1
522
- rel = {I ((1 ,0 , 1 , 0 , 0 , 0 )): q ** - 2 , # q^2 AC
523
- I ((0 ,1 , 0 , 0 , 0 , 0 )): q ** - 3 - q ** 1 , # q^-1(q^-2-q^2) B
524
- I ((0 ,0 , 0 , 0 , 1 , 0 )): 1 - q ** - 2 } # -q^-1(q^-1-q) b
522
+ rel = {I ((1 , 0 , 1 , 0 , 0 , 0 )): q ** - 2 , # q^2 AC
523
+ I ((0 , 1 , 0 , 0 , 0 , 0 )): q ** - 3 - q ** 1 , # q^-1(q^-2-q^2) B
524
+ I ((0 , 0 , 0 , 0 , 1 , 0 )): 1 - q ** - 2 } # -q^-1(q^-1-q) b
525
525
rel = self .element_class (self , rel )
526
526
return self .monomial (I (lhs + [0 ]* 3 )) * (rel * self .monomial (I (rhs )))
527
- elif rhs [1 ] > 0 : # rhs has a B to commute with C
527
+ elif rhs [1 ] > 0 : # rhs has a B to commute with C
528
528
lhs [2 ] -= 1
529
529
rhs [1 ] -= 1
530
- rel = {I ((0 ,1 , 1 , 0 , 0 , 0 )): q ** 2 , # q^2 BC
531
- I ((1 ,0 , 0 , 0 , 0 , 0 )): q ** 3 - q ** - 1 , # q(q^2-q^-2) A
532
- I ((0 ,0 , 0 , 1 , 0 , 0 )): - q ** 2 + 1 } # -q(q-q^-1) a
530
+ rel = {I ((0 , 1 , 1 , 0 , 0 , 0 )): q ** 2 , # q^2 BC
531
+ I ((1 , 0 , 0 , 0 , 0 , 0 )): q ** 3 - q ** - 1 , # q(q^2-q^-2) A
532
+ I ((0 , 0 , 0 , 1 , 0 , 0 )): - q ** 2 + 1 } # -q(q-q^-1) a
533
533
rel = self .element_class (self , rel )
534
534
return self .monomial (I (lhs + [0 ]* 3 )) * (rel * self .monomial (I (rhs )))
535
- else : # nothing to commute as rhs has no A nor B
535
+ else : # nothing to commute as rhs has no A nor B
536
536
rhs [2 ] += lhs [2 ]
537
537
rhs [1 ] = lhs [1 ]
538
538
rhs [0 ] = lhs [0 ]
539
539
return self .monomial (I (rhs ))
540
540
541
- elif lhs [1 ] > 0 : # lhs has a B
542
- if rhs [0 ] > 0 : # rhs has an A to commute with B
541
+ elif lhs [1 ] > 0 : # lhs has a B
542
+ if rhs [0 ] > 0 : # rhs has an A to commute with B
543
543
lhs [1 ] -= 1
544
544
rhs [0 ] -= 1
545
- rel = {I ((1 ,1 , 0 , 0 , 0 , 0 )): q ** 2 , # q^2 AB
546
- I ((0 ,0 , 1 , 0 , 0 , 0 )): q ** 3 - q ** - 1 , # q(q^2-q^-2) C
547
- I ((0 ,0 , 0 , 0 , 0 , 1 )): - q ** 2 + 1 } # -q(q-q^-1) g
545
+ rel = {I ((1 , 1 , 0 , 0 , 0 , 0 )): q ** 2 , # q^2 AB
546
+ I ((0 , 0 , 1 , 0 , 0 , 0 )): q ** 3 - q ** - 1 , # q(q^2-q^-2) C
547
+ I ((0 , 0 , 0 , 0 , 0 , 1 )): - q ** 2 + 1 } # -q(q-q^-1) g
548
548
rel = self .element_class (self , rel )
549
549
return self .monomial (I (lhs + [0 ]* 3 )) * (rel * self .monomial (I (rhs )))
550
- else : # nothing to commute as rhs has no A
550
+ else : # nothing to commute as rhs has no A
551
551
rhs [1 ] += lhs [1 ]
552
552
rhs [0 ] = lhs [0 ]
553
553
return self .monomial (I (rhs ))
554
554
555
- elif lhs [0 ] > 0 : # lhs has an A
555
+ elif lhs [0 ] > 0 : # lhs has an A
556
556
rhs [0 ] += lhs [0 ]
557
557
return self .monomial (I (rhs ))
558
558
@@ -905,7 +905,7 @@ def _on_basis(self, c):
905
905
+ (3-3*q^2)*g^2 - q^2*C + q*g
906
906
"""
907
907
return self .codomain ().prod (self ._on_generators [i ]** exp
908
- for i ,exp in enumerate (c ))
908
+ for i , exp in enumerate (c ))
909
909
910
910
def _composition_ (self , right , homset ):
911
911
"""
0 commit comments