#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 ehlen):
Sorry for the delay.
It's a bit weird but I really must have made a mistake when I timed the
implementation in comment:24, although I really don't know what went
wrong. Anyway, I cannot reproduce the results and instead all my tests
indicate that pari inversion is about as fast as xgcd and also as the
following more direct approach using flint which can be used in
{{{number_field_element.pyx}}}
{{{
#!python
cdef void _invert_flint_(self, ZZX_c *num, ZZ_c *den):
cdef ZZX_c a, b
ZZX_mul_ZZ( a, self.__numerator, self.__fld_denominator.x )
ZZX_mul_ZZ( b, self.__fld_numerator.x, self.__denominator )
cdef fmpz_poly_t a_f, b_f, t_f
cdef fmpz_poly_t num_f #flint numerator
cdef fmpz_t den_f #flint denominator
fmpz_poly_init(a_f); fmpz_poly_init(b_f);
fmpz_poly_init(t_f); fmpz_poly_init(num_f); fmpz_init(den_f)
fmpz_poly_set_ZZX(a_f, a) #convert to flint
fmpz_poly_set_ZZX(b_f, b) #convert to flint
fmpz_poly_xgcd_modular(den_f, num_f, t_f, a_f, b_f)
fmpz_poly_get_ZZX(num[0], num_f) #convert back to NTL
fmpz_get_ZZ(den[0], den_f) #convert back to NTL
#finishing up
ZZX_mul_ZZ(num[0], num[0], self.__fld_denominator.x )
ZZX_mul_ZZ(num[0], num[0], self.__denominator )
}}}
So, I'm not sure if it's worth it to include the flint alternative.
But I found something else that even avoids the NTLError to happen and
makes the newforms computations way faster in many cases!
I'm cleaning up my branch now after a lot of testing and will then push
the changes, including your pari alternative.
--
Ticket URL: <http://trac.sagemath.org/ticket/20693#comment:27>
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.