Ticket #13800: trac_13800-cn.patch

File trac_13800-cn.patch, 1.4 KB (added by jhpalmieri, 9 years ago)
  • sage/algebras/steenrod/steenrod_algebra_mult.py

    # HG changeset patch
    # User Christian Nassau <nassau@nullhomotopie.de>
    # Date 1354721575 -3600
    # Node ID 56685d8014326620e68cf2588cf1b1010d721a37
    # Parent  8cc80651f64a106e1f3765e5bfcb91c11b79c10d
    fix sign in milnor_multiplication_odd
    
    diff --git a/sage/algebras/steenrod/steenrod_algebra_mult.py b/sage/algebras/steenrod/steenrod_algebra_mult.py
    a b def milnor_multiplication_odd(m1,m2,p): 
    437437        sage: A.P(36,6)*A.P(27,9,81)
    438438        2 P(13,21,83) + P(14,24,82) + P(17,20,83) + P(25,18,83) + P(26,21,82) + P(36,15,80,1) + P(49,12,83) + 2 P(50,15,82) + 2 P(53,11,83) + 2 P(63,15,81)
    439439
     440    Associativity once failed because of a sign error::
     441
     442        sage: a,b,c = A.Q_exp(0,1), A.P(3), A.Q_exp(1,1)
     443        sage: (a*b)*c == a*(b*c)
     444        True
     445
    440446    This uses the same algorithm Monks does in his Maple package to
    441447    iterate through the possible matrices: see
    442448    http://mathweb.scranton.edu/monks/software/Steenrod/steen.html.
    def milnor_multiplication_odd(m1,m2,p): 
    473479                        ind = len(q_mono.intersection(range(k+i,1+max(q_mono))))
    474480                    else:
    475481                        ind = 0
    476                     coeff = (-1)**ind
     482                    coeff = (-1)**ind * old_answer[mono]
    477483                    lst = list(mono[0])
    478484                    if ind == 0:
    479485                        lst.append(k+i)