@@ -968,7 +968,7 @@ def internal_coproduct(self):
968
968
sage: def int_copr_on_F_via_M(I):
969
969
....: result = tensor([F.zero(), F.zero()])
970
970
....: w = M(F(I)).internal_coproduct()
971
- ....: for lam, a in w.monomial_coefficients().items() :
971
+ ....: for lam, a in w:
972
972
....: (U, V) = lam
973
973
....: result += a * tensor([F(M(U)), F(M(V))])
974
974
....: return result
@@ -987,7 +987,7 @@ def internal_coproduct(self):
987
987
sage: def int_copr_of_e_in_M(mu):
988
988
....: result = tensor([M.zero(), M.zero()])
989
989
....: w = e(mu).internal_coproduct()
990
- ....: for lam, a in w.monomial_coefficients().items() :
990
+ ....: for lam, a in w:
991
991
....: (nu, kappa) = lam
992
992
....: result += a * tensor([M(e(nu)), M(e(kappa))])
993
993
....: return result
@@ -1011,7 +1011,7 @@ def internal_coproduct(self):
1011
1011
F = parent .realization_of ().F ()
1012
1012
from sage .categories .tensor import tensor
1013
1013
result = tensor ([parent .zero (), parent .zero ()])
1014
- for lam , a in F (self ).internal_coproduct (). monomial_coefficients (). items () :
1014
+ for lam , a in F (self ).internal_coproduct ():
1015
1015
(I , J ) = lam
1016
1016
result += a * tensor ([parent (F (I )), parent (F (J ))])
1017
1017
return result
@@ -1116,7 +1116,7 @@ def frobenius(self, n):
1116
1116
M = parent .realization_of ().M ()
1117
1117
C = parent ._basis_keys
1118
1118
dct = {C (map (lambda i : n * i , I )): coeff
1119
- for (I , coeff ) in M (self ). monomial_coefficients (). items () }
1119
+ for (I , coeff ) in M (self )}
1120
1120
result_in_M_basis = M ._from_dict (dct )
1121
1121
return parent (result_in_M_basis )
1122
1122
@@ -1193,8 +1193,7 @@ def star_involution(self):
1193
1193
# involution componentwise, then convert back.
1194
1194
parent = self .parent ()
1195
1195
M = parent .realization_of ().M ()
1196
- dct = {I .reversed (): coeff
1197
- for (I , coeff ) in M (self ).monomial_coefficients ().items ()}
1196
+ dct = {I .reversed (): coeff for (I , coeff ) in M (self )}
1198
1197
return parent (M ._from_dict (dct ))
1199
1198
1200
1199
def omega_involution (self ):
@@ -1348,8 +1347,7 @@ def psi_involution(self):
1348
1347
# involution componentwise, then convert back.
1349
1348
parent = self .parent ()
1350
1349
F = parent .realization_of ().F ()
1351
- dct = {I .complement (): coeff
1352
- for (I , coeff ) in F (self ).monomial_coefficients ().items ()}
1350
+ dct = {I .complement (): coeff for (I , coeff ) in F (self )}
1353
1351
return parent (F ._from_dict (dct ))
1354
1352
1355
1353
def expand (self , n , alphabet = 'x' ):
@@ -1707,8 +1705,7 @@ def lambda_of_monomial(self, I, n):
1707
1705
for k in lam ])
1708
1706
QQ_result *= (- 1 ) ** n
1709
1707
# QQ_result is now \lambda^n(M_I) over QQ.
1710
- result = self .sum_of_terms ([(J , ZZ (coeff )) for (J , coeff ) in
1711
- QQ_result .monomial_coefficients ().items ()],
1708
+ result = self .sum_of_terms ([(J , ZZ (coeff )) for (J , coeff ) in QQ_result ],
1712
1709
distinct = True )
1713
1710
return result
1714
1711
@@ -2293,7 +2290,7 @@ def internal_coproduct(self):
2293
2290
result = F2 .zero ()
2294
2291
from sage .categories .tensor import tensor
2295
2292
from sage .combinat .permutation import Permutation
2296
- for I , a in self . monomial_coefficients (). items () :
2293
+ for I , a in self :
2297
2294
# We must add a * \Delta^\times(F_I) to result.
2298
2295
from sage .combinat .permutation import descents_composition_last
2299
2296
pi = descents_composition_last (I )
@@ -2364,8 +2361,7 @@ def star_involution(self):
2364
2361
0
2365
2362
"""
2366
2363
parent = self .parent ()
2367
- dct = {I .reversed (): coeff
2368
- for (I , coeff ) in self .monomial_coefficients ().items ()}
2364
+ dct = {I .reversed (): coeff for (I , coeff ) in self }
2369
2365
return parent ._from_dict (dct )
2370
2366
2371
2367
F = Fundamental
@@ -2558,7 +2554,7 @@ def _from_fundamental_on_basis(self, comp):
2558
2554
QS[1, 2, 1, 1] + QS[1, 3, 1] - QS[2, 2, 1]
2559
2555
"""
2560
2556
comp = Composition (comp )
2561
- if comp == [] :
2557
+ if not comp . _list :
2562
2558
return self .one ()
2563
2559
comps = compositions_order (comp .size ())
2564
2560
T = self ._from_fundamental_transition_matrix (comp .size ())
@@ -2625,7 +2621,7 @@ def _to_Monomial_on_basis(self, J):
2625
2621
4*M[1, 1, 1, 1, 1] + 3*M[1, 1, 1, 2] + 2*M[1, 1, 2, 1] + M[1, 1, 3] + M[1, 2, 1, 1] + M[1, 2, 2] + M[2, 1, 1, 1] + M[2, 1, 2]
2626
2622
"""
2627
2623
M = self .realization_of ().Monomial ()
2628
- if J == [] :
2624
+ if not J . _list :
2629
2625
return M ([])
2630
2626
C = Compositions ()
2631
2627
C_size = Compositions (J .size ())
0 commit comments