#20490: Hash error with multivariate Laurent polynomial rings
-------------------------------------+-------------------------------------
       Reporter:  tscrim             |        Owner:  tscrim
           Type:  defect             |       Status:  needs_review
       Priority:  critical           |    Milestone:  sage-7.2
      Component:  misc               |   Resolution:
       Keywords:  hash,              |    Merged in:
  multivariate Laurent polynomials   |    Reviewers:
        Authors:  Travis Scrimshaw   |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  d52cd769c5c1dbe795914b5aa1a5f52367bafa7e
  public/rings/hash_laurent_polynomial_ring-20490|     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Travis Scrimshaw', 'oldvalue': ''}):

 * status:  new => needs_review
 * commit:   => d52cd769c5c1dbe795914b5aa1a5f52367bafa7e
 * branch:   => public/rings/hash_laurent_polynomial_ring-20490
 * author:   => Travis Scrimshaw


Comment:

 Thanks. That indeed did solve the problem.

 With branch:
 {{{
 sage: R.<a,b> = LaurentPolynomialRing(ZZ)
 sage: p = (a + b + ~b + 1)^10
 sage: %timeit hash(p)
 10000 loops, best of 3: 170 µs per loop
 }}}
 (without the cython changes is ~180 µs)
 vs old version:
 {{{
 sage: p = (a + b + ~b + 1)^10
 sage: %timeit hash(p)
 10000 loops, best of 3: 34.2 µs per loop
 }}}
 Note that `p` has 121 terms with an upper degree of 10 and a lower degree
 of -10. The fact that we only get ~6x slowdown here is acceptable to me.
 (There's likely more speed to be gained from doing more cythonization of
 the internal methods of the (Laurent) multivariate polynomials.)
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=792d3a0dc1530178d12600cc02115937ae2dec56
 792d3a0]||{{{Fixing the hash function of multivariate Laurent
 polynomials.}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=d52cd769c5c1dbe795914b5aa1a5f52367bafa7e
 d52cd76]||{{{Making some methods of multivariate polynomials cpdef.}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/20490#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to