@@ -648,7 +648,7 @@ def _basis_key_iterator(self):
648648 EXAMPLES::
649649
650650 sage: A = SteenrodAlgebra(3,basis='adem')
651- sage: for ( idx,key) in zip((1,..,10),A._basis_key_iterator()):
651+ sage: for idx, key in zip((1,..,10),A._basis_key_iterator()):
652652 ....: print("> %2d %-20s %s" % (idx,key,A.monomial(key)))
653653 > 1 () 1
654654 > 2 (1,) beta
@@ -767,17 +767,15 @@ def _repr_(self) -> str:
767767 sage: SteenrodAlgebra(p=5, profile=(lambda n: 4, lambda n: 1))
768768 sub-Hopf algebra of mod 5 Steenrod algebra, milnor basis, profile function ([4, 4, 4, ..., 4, 4, +Infinity, +Infinity, +Infinity, ...], [1, 1, 1, ..., 1, 1, 2, 2, ...])
769769 """
770- def abridge_list (l ):
770+ def abridge_list (li ):
771771 """
772- String rep for list ``l `` if ``l `` is short enough;
772+ String rep for list ``li `` if ``li `` is short enough;
773773 otherwise print the first few terms and the last few
774774 terms, with an ellipsis in between.
775775 """
776- if len (l ) < 8 :
777- l_str = str (l )
778- else :
779- l_str = str (l [:3 ]).rstrip ("]" ) + ", ..., " + str (l [- 2 :]).lstrip ("[" )
780- return l_str
776+ if len (li ) < 8 :
777+ return str (li )
778+ return str (li [:3 ]).rstrip ("]" ) + ", ..., " + str (li [- 2 :]).lstrip ("[" )
781779
782780 from sage .rings .infinity import Infinity
783781 profile = self ._profile
@@ -1345,8 +1343,8 @@ def coprod_list(t):
13451343 right_q = sorted (all_q - a )
13461344 sign = Permutation (convert_perm (left_q + right_q )).signature ()
13471345 tens_q [(tuple (left_q ), tuple (right_q ))] = sign
1348- tens = {((q [0 ], l ), (q [1 ], r )): tq
1349- for l , r in zip (left_p , right_p )
1346+ tens = {((q [0 ], lp ), (q [1 ], rp )): tq
1347+ for lp , rp in zip (left_p , right_p )
13501348 for q , tq in tens_q .items ()}
13511349 return self .tensor_square ()._from_dict (tens , coerce = True )
13521350 elif basis == 'serre-cartan' :
@@ -1642,14 +1640,14 @@ def _milnor_on_basis(self, t):
16421640 elif basis == 'woody' or basis == 'woodz' :
16431641 # each entry in t is a pair (m,k), corresponding to w(m,k), defined by
16441642 # `w(m,k) = \text{Sq}^{2^m (2^{k+1}-1)}`.
1645- for ( m , k ) in t :
1643+ for m , k in t :
16461644 ans = ans * A .Sq (2 ** m * (2 ** (k + 1 ) - 1 ))
16471645
16481646 # wall[_long]
16491647 elif basis .find ('wall' ) >= 0 :
16501648 # each entry in t is a pair (m,k), corresponding to Q^m_k, defined by
16511649 # `Q^m_k = Sq(2^k) Sq(2^{k+1}) ... Sq(2^m)`.
1652- for ( m , k ) in t :
1650+ for m , k in t :
16531651 exponent = 2 ** k
16541652 ans = ans * A .Sq (exponent )
16551653 for i in range (m - k ):
@@ -1660,22 +1658,22 @@ def _milnor_on_basis(self, t):
16601658 elif basis .find ('pst' ) >= 0 :
16611659 if not self ._generic :
16621660 # each entry in t is a pair (i,j), corresponding to P^i_j
1663- for ( i , j ) in t :
1661+ for i , j in t :
16641662 ans = ans * A .pst (i , j )
16651663 else :
16661664 # t = (Q, P) where Q is the tuple of Q_i's, and P is a
16671665 # tuple with entries of the form ((i,j), n),
16681666 # corresponding to (P^i_j)^n
16691667 if t [0 ]:
16701668 ans = ans * A .Q (* t [0 ])
1671- for (( i , j ), n ) in t [1 ]:
1669+ for (i , j ), n in t [1 ]:
16721670 ans = ans * (A .pst (i , j ))** n
16731671
16741672 # arnona[_long]
16751673 elif basis .find ('arnona' ) >= 0 :
16761674 # each entry in t is a pair (m,k), corresponding to X^m_k, defined by
16771675 # `X^m_k = Sq(2^m) ... Sq(2^{k+1}) Sq(2^k)`
1678- for ( m , k ) in t :
1676+ for m , k in t :
16791677 exponent = 2 ** k
16801678 X = A .Sq (exponent )
16811679 for i in range (m - k ):
@@ -1689,7 +1687,7 @@ def _milnor_on_basis(self, t):
16891687 # each entry in t is a pair (i,j), corresponding to
16901688 # c_{i,j}, the iterated commutator defined by c_{i,1}
16911689 # = Sq(2^i) and c_{i,j} = [c_{i,j-1}, Sq(2^{i+j-1})].
1692- for ( i , j ) in t :
1690+ for i , j in t :
16931691 comm = A .Sq (2 ** i )
16941692 for k in range (2 , j + 1 ):
16951693 y = A .Sq (2 ** (i + k - 1 ))
@@ -1703,7 +1701,7 @@ def _milnor_on_basis(self, t):
17031701 # c_{i,j} = [P(p^{i+j-1}), c_{i,j-1}].
17041702 if t [0 ]:
17051703 ans = ans * A .Q (* t [0 ])
1706- for (( i , j ), n ) in t [1 ]:
1704+ for (i , j ), n in t [1 ]:
17071705 comm = A .P (p ** i )
17081706 for k in range (2 , j + 1 ):
17091707 y = A .P (p ** (i + k - 1 ))
@@ -1947,7 +1945,7 @@ def q_degree(m, prime=3):
19471945 if basis == 'woody' or basis == 'woodz' :
19481946 # each entry in t is a pair (m,k), corresponding to w(m,k), defined by
19491947 # `w(m,k) = \text{Sq}^{2^m (2^{k+1}-1)}`.
1950- return sum (2 ** m * (2 ** (k + 1 )- 1 ) for ( m , k ) in t )
1948+ return sum (2 ** m * (2 ** (k + 1 )- 1 ) for m , k in t )
19511949
19521950 # wall, arnon_a
19531951 if basis .find ('wall' ) >= 0 or basis .find ('arnona' ) >= 0 :
@@ -1958,7 +1956,7 @@ def q_degree(m, prime=3):
19581956 # Arnon A: each entry in t is a pair (m,k), corresponding
19591957 # to X^m_k, defined by `X^m_k = Sq(2^m) ... Sq(2^{k+1})
19601958 # Sq(2^k)`
1961- return sum (2 ** k * (2 ** (m - k + 1 )- 1 ) for ( m , k ) in t )
1959+ return sum (2 ** k * (2 ** (m - k + 1 )- 1 ) for m , k in t )
19621960
19631961 # pst, comm
19641962 if basis .find ('pst' ) >= 0 or basis .find ('comm' ) >= 0 :
@@ -1969,7 +1967,7 @@ def q_degree(m, prime=3):
19691967 # to c_{i,j}, the iterated commutator defined by
19701968 # c_{i,1} = Sq(2^i) and c_{i,j} = [c_{i,j-1},
19711969 # Sq(2^{i+j-1})].
1972- return sum (2 ** m * (2 ** k - 1 ) for ( m , k ) in t )
1970+ return sum (2 ** m * (2 ** k - 1 ) for m , k in t )
19731971 # p odd:
19741972 #
19751973 # Pst: have pair (Q, P) where Q is a tuple of Q's, as in
@@ -1982,7 +1980,7 @@ def q_degree(m, prime=3):
19821980 # iterated commutator defined by c_{s,1} = P(p^s) and
19831981 # c_{s,t} = [P(p^{s+t-1}), c_{s,t-1}].
19841982 q_deg = q_degree (t [0 ], prime = p )
1985- p_deg = sum (2 * n * p ** s * (p ** t - 1 ) for (( s , t ), n ) in t [1 ])
1983+ p_deg = sum (2 * n * p ** s * (p ** t - 1 ) for (s , t ), n in t [1 ])
19861984 return q_deg + p_deg
19871985
19881986 # coercion methods:
@@ -2236,7 +2234,7 @@ def basis(self, d=None):
22362234 Lazy family (Term map from basis key family of mod 7 Steenrod algebra, milnor basis
22372235 to mod 7 Steenrod algebra, milnor basis(i))_{i in basis key family
22382236 of mod 7 Steenrod algebra, milnor basis}
2239- sage: for ( idx,a) in zip((1,..,9),A7.basis()):
2237+ sage: for idx, a in zip((1,..,9),A7.basis()):
22402238 ....: print("{} {}".format(idx, a))
22412239 1 1
22422240 2 Q_0
@@ -3435,7 +3433,7 @@ def coproduct(self, algorithm='milnor'):
34353433 1
34363434 sage: Sq(*supp[0][1])
34373435 Sq(2)
3438- sage: [(Sq(*x), Sq(*y)) for (x,y) in supp]
3436+ sage: [(Sq(*x), Sq(*y)) for x, y in supp]
34393437 [(1, Sq(2)), (Sq(1), Sq(1)), (Sq(2), 1)]
34403438
34413439 The ``support`` of an element does not include the
@@ -3453,7 +3451,7 @@ def coproduct(self, algorithm='milnor'):
34533451 (((), (1,)), ((), (1,))): 2,
34543452 (((), (2,)), ((), ())): 2}
34553453 sage: mc = b.monomial_coefficients()
3456- sage: sorted([(A3.monomial(x), A3.monomial(y), mc[x,y]) for (x,y) in mc])
3454+ sage: sorted([(A3.monomial(x), A3.monomial(y), mc[x,y]) for x, y in mc])
34573455 [(1, P(2), 2), (P(1), P(1), 2), (P(2), 1, 2)]
34583456 """
34593457 A = self .parent ()
@@ -3627,7 +3625,7 @@ def may_weight(self):
36273625 return wt
36283626 else : # p odd
36293627 wt = Infinity
3630- for ( mono1 , mono2 ) in self .milnor ().support ():
3628+ for mono1 , mono2 in self .milnor ().support ():
36313629 P_wt = 0
36323630 index = 1
36333631 for n in mono2 :
0 commit comments