Changes between Initial Version and Version 3 of Ticket #17895


Ignore:
Timestamp:
07/14/19 20:56:50 (3 years ago)
Author:
vdelecroix
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17895 – Description

    initial v3  
    1616}}}
    1717
    18 The computation for `z1` works reasonably well and completes in under 2 seconds, but the one for `z2` takes over a minute on my system. Which I find really strange, since computing all roots and then choosing the right one should be ''more'' work, not ''less'' than just computing a single one. Should we change `QQbar.polynomial_root` to go via the list of all roots, or is there a better solution?
     18The computation for `z1` works reasonably well and completes in under 2 seconds, but the one for `z2` takes over a minute. Which is definitely wrong, since computing all roots and then choosing the right one should be ''more'' work, not ''less'' than just computing a single one!
     19
     20The reason for this is the time spent in the square-free decomposition (called from `sage/rings/polynomial/complex_roots.py`) which behave differently depending whether the polynomial is defined with coefficients in `QQ` or `AA`
     21{{{
     22sage: %time _ = p4.squarefree_decomposition()
     23CPU times: user 807 µs, sys: 0 ns, total: 807 µs
     24Wall time: 883 µs
     25sage: %time _ = p4.change_ring(AA).squarefree_decomposition()
     26CPU times: user 40.1 s, sys: 3.21 ms, total: 40.1 s
     27Wall time: 40.1 s
     28}}}