#20693: Sage crashes when computing newforms
---------------------------------+------------------------
       Reporter:  ehlen          |        Owner:
           Type:  defect         |       Status:  new
       Priority:  critical       |    Milestone:  sage-7.3
      Component:  modular forms  |   Resolution:
       Keywords:                 |    Merged in:
        Authors:                 |    Reviewers:
Report Upstream:  N/A            |  Work issues:
         Branch:                 |       Commit:
   Dependencies:                 |     Stopgaps:
---------------------------------+------------------------

Comment (by pbruin):

 Replying to [comment:24 ehlen]:
 > However, the pari alternative seems to be kind of slow (which is much
 better than crashing, of course).
 I would have hoped for PARI to be quite fast, but it seems this is not
 particularly optimised in PARI.  In any case I didn't try hard to make it
 fast; it was just the easiest solution that didn't crash.
 > With the example I gave in #20749, the pari inversion takes about 7
 minutes but the code below, which mimics the _invert_c function, runs in
 about 1.5 minutes for me:
 >
 > {{{
 > d = alpha.polynomial().denominator()
 > D = alpha.parent().absolute_polynomial().denominator()
 > r,s,tt =
 
xgcd(alpha.polynomial().numerator()*D,alpha.parent().absolute_polynomial().numerator()*d)
 > b = s*d/D
 > F = alpha.parent()
 > beta = F(F.polynomial_quotient_ring()(b))
 > }}}
 >
 > I don't like the last line of the code and I still have to make sure I
 understood everything correctly and it works in all cases but then I could
 submit a patch for the number field element to use a variant of this code
 as an alternative. What do you think?
 This is definitely a good start.  The `xgcd` is implemented using FLINT,
 which suggests a slightly more direct approach: use the functions from
 `sage.libs.flint.ntl_interface` to convert `alpha.__numerator` and
 `alpha.__denominator` to FLINT `fmpz_poly` and `fmpz` objects,
 respectively (and similarly for the defining polynomial of the number
 field), then call the FLINT function `fmpz_poly_xgcd`, and then convert
 back to NTL.  It could even be reasonable to simply always use FLINT
 instead of NTL in `__invert__`.

--
Ticket URL: <http://trac.sagemath.org/ticket/20693#comment:25>
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