#13199: Use FLINT to compute the partition function
-------------------------------------+--------------------------------------
       Reporter:  fredrik.johansson  |         Owner:  sage-combinat            
                         
           Type:  enhancement        |        Status:  needs_review             
                         
       Priority:  major              |     Milestone:  sage-5.10                
                         
      Component:  combinatorics      |    Resolution:                           
                         
       Keywords:                     |   Work issues:  needs rebase             
                         
Report Upstream:  N/A                |     Reviewers:  Andrew Mathas, Frederic 
Chapoton, Travis Scrimshaw
        Authors:  Fredrik Johansson  |     Merged in:                           
                         
   Dependencies:                     |      Stopgaps:                           
                         
-------------------------------------+--------------------------------------
Changes (by tscrim):

  * reviewer:  Andrew Mathas => Andrew Mathas, Frederic Chapoton, Travis
               Scrimshaw


Old description:

> Before:
>
> {{{
> sage: %timeit number_of_partitions(1)
> 625 loops, best of 3: 2.09 µs per loop
> sage: %timeit number_of_partitions(10^3)
> 625 loops, best of 3: 197 µs per loop
> sage: %timeit number_of_partitions(10^6)
> 25 loops, best of 3: 32.8 ms per loop
> sage: %time number_of_partitions(10^9);
> CPU times: user 37.92 s, sys: 0.00 s, total: 37.92 s
> Wall time: 37.93 s
> }}}
>
> After:
>
> {{{
> sage: %timeit number_of_partitions(1)
> 625 loops, best of 3: 1.94 µs per loop
> sage: %timeit number_of_partitions(10^3)
> 625 loops, best of 3: 51.4 µs per loop
> sage: %timeit number_of_partitions(10^6)
> 125 loops, best of 3: 2.66 ms per loop
> sage: %time number_of_partitions(10^9);
> CPU times: user 0.47 s, sys: 0.00 s, total: 0.47 s
> Wall time: 0.48 s
> }}}
>
> TODO: should add a 64-bit only test to check that evaluation works with n
> >= 2^32.

New description:

 Before:

 {{{
 sage: %timeit number_of_partitions(1)
 625 loops, best of 3: 2.09 µs per loop
 sage: %timeit number_of_partitions(10^3)
 625 loops, best of 3: 197 µs per loop
 sage: %timeit number_of_partitions(10^6)
 25 loops, best of 3: 32.8 ms per loop
 sage: %time number_of_partitions(10^9);
 CPU times: user 37.92 s, sys: 0.00 s, total: 37.92 s
 Wall time: 37.93 s
 }}}

 After:

 {{{
 sage: %timeit number_of_partitions(1)
 625 loops, best of 3: 1.94 µs per loop
 sage: %timeit number_of_partitions(10^3)
 625 loops, best of 3: 51.4 µs per loop
 sage: %timeit number_of_partitions(10^6)
 125 loops, best of 3: 2.66 ms per loop
 sage: %time number_of_partitions(10^9);
 CPU times: user 0.47 s, sys: 0.00 s, total: 0.47 s
 Wall time: 0.48 s
 }}}

 TODO: should add a 64-bit only test to check that evaluation works with n
 >= 2^32.

 ----

 Apply:

  * [attachment:trac_13199_flint_partition_function_v2.patch]
  * [attachment:trac_13199-flint_partition-review-ts.patch]

--

Comment:

 Here's a review patch which should fix the problem, which was the Bober's
 implementation was cached (since it was the default). I changed this to
 the FLINT.
 {{{
 sage -t ../misc/cachefunc.pyx
     [593 tests, 78.50 s]
 ----------------------------------------------------------------------
 All tests passed!
 ----------------------------------------------------------------------
 Total time for all tests: 79.6 seconds
     cpu time: 8.1 seconds
     cumulative wall time: 78.5 seconds
 }}}
 I also added the additional tests Andrew wanted and fixed the docstrings.

 For patchbot:

 Apply: trac_13199_flint_partition_function_v2.patch, trac_13199
 -flint_partition-review-ts.patch

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13199#comment:10>
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 http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to