ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 10 Jan 2023 15:41:45 +0100Integer polynomial factorization and RecursionErrorhttps://ask.sagemath.org/question/65423/integer-polynomial-factorization-and-recursionerror/Hi all,
I use sage to factorize integer polynomials, sometimes with very large coefficients. But when the polynomial is too large (for example a degree 3885), I get the following error
RecursionError: maximum recursion depth exceeded during compilation
I have tried to set a higher recursion limit through, e.g.
sys.setrecursionlimit(10000)
But I still get the same error. The script file is also large (more than 7Mb) and the sage.py file is even larger (22Mb).
Thanks for your help.
Wed, 21 Dec 2022 01:31:31 +0100https://ask.sagemath.org/question/65423/integer-polynomial-factorization-and-recursionerror/Comment by nickux for <p>Hi all,</p>
<p>I use sage to factorize integer polynomials, sometimes with very large coefficients. But when the polynomial is too large (for example a degree 3885), I get the following error </p>
<p>RecursionError: maximum recursion depth exceeded during compilation</p>
<p>I have tried to set a higher recursion limit through, e.g.</p>
<p>sys.setrecursionlimit(10000)</p>
<p>But I still get the same error. The script file is also large (more than 7Mb) and the sage.py file is even larger (22Mb). </p>
<p>Thanks for your help.</p>
https://ask.sagemath.org/question/65423/integer-polynomial-factorization-and-recursionerror/?comment=65520#post-id-65520Sure. Here is a link to a script file producing such an error [example.sage](https://nick-ux.org/~regnault/example.sage)Sun, 25 Dec 2022 03:30:39 +0100https://ask.sagemath.org/question/65423/integer-polynomial-factorization-and-recursionerror/?comment=65520#post-id-65520Comment by Max Alekseyev for <p>Hi all,</p>
<p>I use sage to factorize integer polynomials, sometimes with very large coefficients. But when the polynomial is too large (for example a degree 3885), I get the following error </p>
<p>RecursionError: maximum recursion depth exceeded during compilation</p>
<p>I have tried to set a higher recursion limit through, e.g.</p>
<p>sys.setrecursionlimit(10000)</p>
<p>But I still get the same error. The script file is also large (more than 7Mb) and the sage.py file is even larger (22Mb). </p>
<p>Thanks for your help.</p>
https://ask.sagemath.org/question/65423/integer-polynomial-factorization-and-recursionerror/?comment=65490#post-id-65490Please provide an example illustrating the issue.Sat, 24 Dec 2022 04:16:32 +0100https://ask.sagemath.org/question/65423/integer-polynomial-factorization-and-recursionerror/?comment=65490#post-id-65490Answer by nickux for <p>Hi all,</p>
<p>I use sage to factorize integer polynomials, sometimes with very large coefficients. But when the polynomial is too large (for example a degree 3885), I get the following error </p>
<p>RecursionError: maximum recursion depth exceeded during compilation</p>
<p>I have tried to set a higher recursion limit through, e.g.</p>
<p>sys.setrecursionlimit(10000)</p>
<p>But I still get the same error. The script file is also large (more than 7Mb) and the sage.py file is even larger (22Mb). </p>
<p>Thanks for your help.</p>
https://ask.sagemath.org/question/65423/integer-polynomial-factorization-and-recursionerror/?answer=65856#post-id-65856Ok.
I manage to find a workaround. For people interested in, I directly wrote a python code rather than letting sage writing its own python. From there, I split the polynomial such that each smaller polynomial contains at most 1000 terms. Then I define the full polynomial as the sum of these smaller ones.
Tue, 10 Jan 2023 15:41:45 +0100https://ask.sagemath.org/question/65423/integer-polynomial-factorization-and-recursionerror/?answer=65856#post-id-65856