Skip to content

Commit

Permalink
Trac #34537: Upgrade to pari 2.15.2
Browse files Browse the repository at this point in the history
PARI/GP 2.15 is out, and homebrew, gentoo, arch, debian-unstable already
have the new version.

- giac does not build, see [[https://trac.sagemath.org/raw-
attachment/ticket/34537/giac-1.9.0.15p0.log|giac-1.9.0.15p0.log]]

URL: https://trac.sagemath.org/34537
Reported by: vdelecroix
Ticket author(s): Bill Allombert, Vincent Delecroix, Antonio Rojas
Reviewer(s): Dima Pasechnik, John Cremona
  • Loading branch information
Release Manager committed Jan 29, 2023
2 parents b5c9fed + e8cfad0 commit 0f25b00
Show file tree
Hide file tree
Showing 57 changed files with 346 additions and 454 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=7d95f0aa4a25b8160594f08bf5832fdad6774ee1
md5=08d682dfb7eae43af051188205449f02
cksum=1634731426
sha1=989f4d14dd5ffaa6ec10c3574eb05bf8936bc493
md5=b5c5cde1e8679d1859d8535ed9df961c
cksum=2678132185
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
272c557d1f34fab9617dcf289a13bc7f51e2854e
156046b3bdfd1913720f061f9cd1cd9b23487041
21 changes: 21 additions & 0 deletions build/pkgs/giac/patches/pari_2_15.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ANYARG patch

diff --git a/src/pari.cc b/src/pari.cc
index 76ce8e1..50d08ab 100644
--- a/src/pari.cc
+++ b/src/pari.cc
@@ -40,6 +40,13 @@ using namespace std;

#ifdef HAVE_LIBPARI

+// Anyarg disappeared from PARI 2.15.0
+#ifdef __cplusplus
+# define ANYARG ...
+#else
+# define ANYARG
+#endif
+
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif

6 changes: 3 additions & 3 deletions build/pkgs/pari/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=pari-VERSION.tar.gz
sha1=e01647aab7e96a8cb4922cf26a4f224337c6647f
md5=922f740fcdf8630b30d63dc76b58f756
cksum=297133525
sha1=498e3cd0b7ded8be3fa1cba1125ca5213ed39453
md5=562a6e973ca3980dc6c1eb2c4f252e92
cksum=4081416981
upstream_url=https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/pari/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.3
2.15.2.p1
14 changes: 14 additions & 0 deletions build/pkgs/pari/patches/bug2441.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/basemath/ellsea.c b/src/basemath/ellsea.c
index a6871fa6a7..05f148eadd 100644
--- a/src/basemath/ellsea.c
+++ b/src/basemath/ellsea.c
@@ -852,7 +852,8 @@ find_isogenous_from_Atkin(GEN a4, GEN a6, ulong ell, struct meqn *MEQN, GEN g, G
GEN a4t, a6t, h;
a4a6t(&a4t, &a6t, ell, E4t, E6t, T, p);
h = find_kernel(a4, a6, ell, a4t, a6t, pp1, T, p, pp, e);
- if (h) return gerepilecopy(ltop, mkvec3(a4t, a6t, h));
+ if (h && signe(Fq_elldivpolmod(a4, a6, ell, h, T, pp))==0)
+ return gerepilecopy(ltop, mkvec3(a4t, a6t, h));
}
}
pari_err_BUG("find_isogenous_from_Atkin, kernel not found");
15 changes: 2 additions & 13 deletions build/pkgs/pari/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SAGE_SPKG_CONFIGURE([pari], [
dnl See gp_version below on how the version is computed from MAJV.MINV.PATCHV
m4_pushdef([SAGE_PARI_MINVER],["134401"])dnl this version and higher allowed
m4_pushdef([SAGE_PARI_MAXVER],["134912"])dnl this version and higher not allowed
m4_pushdef([SAGE_PARI_MINVER],["134912"])dnl this version and higher allowed
m4_pushdef([SAGE_PARI_MAXVER],["999999"])dnl this version and higher not allowed
SAGE_SPKG_DEPCHECK([gmp readline], [
AC_PATH_PROG([GP], [gp])
if test x$GP = x; then dnl GP test
Expand Down Expand Up @@ -67,17 +67,6 @@ SAGE_SPKG_CONFIGURE([pari], [
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.])
sage_spkg_install_pari=yes
fi
AC_MSG_CHECKING([whether rnfdisc bug of pari 2.13.1 is fixed])
bug_check=`echo "K = nfinit(y^4-10*y^2+1); disc = rnfdisc(K,x^2-(y^3/2+y^2-5*y/2+1)); idealnorm(K,disc)" | $GP -qf 2>> config.log`
expected="2304"
if test x"$bug_check" = x"$expected"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no; cannot use system pari/GP with known bug])
AC_MSG_NOTICE([Upgrade your system package and reconfigure.])
AC_MSG_NOTICE([Otherwise Sage will build its own pari/GP.])
sage_spkg_install_pari=yes
fi
fi dnl end GP test
if test x$sage_spkg_install_pari = xno; then dnl main PARI test
Expand Down
2 changes: 1 addition & 1 deletion src/doc/de/tutorial/tour_numtheory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ implementiert.
Univariate Quotient Polynomial Ring in a over Rational Field with modulus
x^3 + x^2 - 2*x + 8
sage: K.units()
(3*a^2 + 13*a + 13,)
(-3*a^2 - 13*a - 13,)
sage: K.discriminant()
-503
sage: K.class_group()
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/tour_numtheory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ NumberField class.
Univariate Quotient Polynomial Ring in a over Rational Field with modulus
x^3 + x^2 - 2*x + 8
sage: K.units()
(3*a^2 + 13*a + 13,)
(-3*a^2 - 13*a - 13,)
sage: K.discriminant()
-503
sage: K.class_group()
Expand Down
2 changes: 1 addition & 1 deletion src/doc/es/tutorial/tour_numtheory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Varios métodos relacionados están implementados en la clase ``NumberField``::
Univariate Quotient Polynomial Ring in a over Rational Field with modulus
x^3 + x^2 - 2*x + 8
sage: K.units()
(3*a^2 + 13*a + 13,)
(-3*a^2 - 13*a - 13,)
sage: K.discriminant()
-503
sage: K.class_group()
Expand Down
2 changes: 1 addition & 1 deletion src/doc/fr/tutorial/tour_numtheory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ dans la classe NumberField.
Univariate Quotient Polynomial Ring in a over Rational Field with modulus
x^3 + x^2 - 2*x + 8
sage: K.units()
(3*a^2 + 13*a + 13,)
(-3*a^2 - 13*a - 13,)
sage: K.discriminant()
-503
sage: K.class_group()
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ja/tutorial/tour_numtheory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Sageには :math:`p` \-進数体も組込まれている.
Univariate Quotient Polynomial Ring in a over Rational Field with modulus
x^3 + x^2 - 2*x + 8
sage: K.units()
(3*a^2 + 13*a + 13,)
(-3*a^2 - 13*a - 13,)
sage: K.discriminant()
-503
sage: K.class_group()
Expand Down
2 changes: 1 addition & 1 deletion src/doc/pt/tutorial/tour_numtheory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ NumberField.
Univariate Quotient Polynomial Ring in a over Rational Field with modulus
x^3 + x^2 - 2*x + 8
sage: K.units()
(3*a^2 + 13*a + 13,)
(-3*a^2 - 13*a - 13,)
sage: K.discriminant()
-503
sage: K.class_group()
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ru/tutorial/tour_numtheory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Sage содержит стандартные функции теории чис
Univariate Quotient Polynomial Ring in a over Rational Field with modulus
x^3 + x^2 - 2*x + 8
sage: K.units()
(3*a^2 + 13*a + 13,)
(-3*a^2 - 13*a - 13,)
sage: K.discriminant()
-503
sage: K.class_group()
Expand Down
10 changes: 5 additions & 5 deletions src/sage/arith/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,13 +1515,13 @@ def divisors(n):
sage: K.<a> = QuadraticField(7)
sage: divisors(K.ideal(7))
[Fractional ideal (1), Fractional ideal (-a), Fractional ideal (7)]
[Fractional ideal (1), Fractional ideal (a), Fractional ideal (7)]
sage: divisors(K.ideal(3))
[Fractional ideal (1), Fractional ideal (3),
Fractional ideal (-a + 2), Fractional ideal (-a - 2)]
Fractional ideal (a - 2), Fractional ideal (a + 2)]
sage: divisors(K.ideal(35))
[Fractional ideal (1), Fractional ideal (5), Fractional ideal (-a),
Fractional ideal (7), Fractional ideal (-5*a), Fractional ideal (35)]
[Fractional ideal (1), Fractional ideal (5), Fractional ideal (a),
Fractional ideal (7), Fractional ideal (5*a), Fractional ideal (35)]
TESTS::
Expand Down Expand Up @@ -2619,7 +2619,7 @@ def factor(n, proof=None, int_=False, algorithm='pari', verbose=0, **kwds):
sage: K.<i> = QuadraticField(-1)
sage: factor(122 - 454*i)
(-3*i - 2) * (-i - 2)^3 * (i + 1)^3 * (i + 4)
(-i) * (-i - 2)^3 * (i + 1)^3 * (-2*i + 3) * (i + 4)
To access the data in a factorization::
Expand Down
4 changes: 2 additions & 2 deletions src/sage/dynamics/arithmetic_dynamics/projective_ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -8313,9 +8313,9 @@ def reduce_base_field(self):
sage: f = DynamicalSystem_projective([x^2 + QQbar(sqrt(3))*y^2, y^2, QQbar(sqrt(2))*z^2])
sage: f.reduce_base_field()
Dynamical System of Projective Space of dimension 2 over Number Field in a with
defining polynomial y^4 - 4*y^2 + 1 with a = 1.931851652578137?
defining polynomial y^4 - 4*y^2 + 1 with a = -0.5176380902050415?
Defn: Defined on coordinates by sending (x : y : z) to
(x^2 + (a^2 - 2)*y^2 : y^2 : (a^3 - 3*a)*z^2)
(x^2 + (-a^2 + 2)*y^2 : y^2 : (a^3 - 3*a)*z^2)
::
Expand Down
28 changes: 14 additions & 14 deletions src/sage/ext_data/pari/simon/ellQ.gp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
gp > \r ellcommon.gp
gp > \r ellQ.gp

The main function is ellrank(), which takes as an argument
The main function is ellQ_ellrank(), which takes as an argument
any elliptic curve in the form [a1,a2,a3,a4,a6]
the result is a vector [r,s,v], where
r is a lower bound for the rank,
Expand All @@ -50,7 +50,7 @@
Example:

gp > ell = [1,2,3,4,5];
gp > ellrank(ell)
gp > ellQ_ellrank(ell)
%1 = [1, 1, [[1,2]]
In this example, the rank is exactly 1, and [1,2] has infinite order.

Expand Down Expand Up @@ -92,15 +92,15 @@
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Explications succintes :
La fonction ellrank() accepte toutes les courbes sous la forme
La fonction ellQ_ellrank() accepte toutes les courbes sous la forme
[a1,a2,a3,a4,a6]
Les coefficients peuvent etre entiers ou non.
L'algorithme utilise est celui de la 2-descente.
La 2-torsion peut etre quelconque.
Il suffit de taper :
gp > ell = [a1,a2,a3,a4,a6];
gp > ellrank(ell)
gp > ellQ_ellrank(ell)
Retourne un vecteur [r,s,v] ou
r est le rang probable (c'est toujours une minoration du rang),
Expand All @@ -110,7 +110,7 @@
Exemple :

gp > ell = [1,2,3,4,5];
gp > ellrank(ell)
gp > ellQ_ellrank(ell)
%1 = [1, 1, [[1,2]]
Ici, le rang est exactement 1, et le point [1,2] est d'ordre infini.
Expand Down Expand Up @@ -1571,12 +1571,12 @@ if( DEBUGLEVEL_ell >= 4, print(" end of ell2descent_gen"));
print("rank(E/Q) >= ",m1)
);
}
{ellrank(ell,help=[]) =
{ellQ_ellrank(ell,help=[]) =
\\ Algorithm of 2-descent on the elliptic curve ell.
\\ help is a list of known points on ell.
my(urst,urst1,den,eqell,tors2,bnf,rang,time1);
if( DEBUGLEVEL_ell >= 3, print(" starting ellrank"));
if( DEBUGLEVEL_ell >= 3, print(" starting ellQ_ellrank"));
if( #ell < 13, ell = ellinit(ell));
\\ kill the coefficients a1 and a3
Expand Down Expand Up @@ -1630,7 +1630,7 @@ if( DEBUGLEVEL_ell >= 1, print(" Elliptic curve: Y^2 = ",eqell));
));
rang[3] = ellchangepoint(rang[3],ellinverturst(urst));
if( DEBUGLEVEL_ell >= 3, print(" end of ellrank"));
if( DEBUGLEVEL_ell >= 3, print(" end of ellQ_ellrank"));
return(rang);
}
Expand Down Expand Up @@ -2106,13 +2106,13 @@ if( DEBUGLEVEL_ell >= 3, print(" end of ell2descent_viaisog"));
{
\\ functions for elliptic curves
addhelp(ell2descent_complete,
"ell2descent_complete(e1,e2,e3): Performs a complete 2-descent on the elliptic curve y^2 = (x-e1)*(x-e2)*(x-e3). See ?ellrank for the format of the output.");
"ell2descent_complete(e1,e2,e3): Performs a complete 2-descent on the elliptic curve y^2 = (x-e1)*(x-e2)*(x-e3). See ?ellQ_ellrank for the format of the output.");
addhelp(ell2descent_gen,
"ell2descent_gen((E,bnf,k=1,help=[]): E is a vector of the form [0,A,0,B,C], (or the result of ellinit of such a vector) A,B,C integers such that x^3+A*x^2+B*x+C; bnf is the corresponding bnfinit(,1); Performs 2-descent on the elliptic curve Ek: k*y^2=x^3+A*x^2+B*x+C. See ?ellrank for the format of the output.");
"ell2descent_gen((E,bnf,k=1,help=[]): E is a vector of the form [0,A,0,B,C], (or the result of ellinit of such a vector) A,B,C integers such that x^3+A*x^2+B*x+C; bnf is the corresponding bnfinit(,1); Performs 2-descent on the elliptic curve Ek: k*y^2=x^3+A*x^2+B*x+C. See ?ellQ_ellrank for the format of the output.");
addhelp(ell2descent_viaisog,
"ell2descent_viaisog(E,help=[]): E is an elliptic curve of the form [0,a,0,b,0], with a, b integers. Performs a 2-descent via isogeny on E. See ?ellrank for the format of the output.");
addhelp(ellrank,
"ellrank(E,help=[]): E is any elliptic curve defined over Q. Returns a vector [r,s,v], where r is a lower bound for the rank of E, s is the rank of its 2-Selmer group and v is a list of independant points in E(Q)/2E(Q). If help is a vector of nontrivial points on E, the result might be faster. This function might be used in conjunction with elltors2(E). See also ?default_ellQ");
"ell2descent_viaisog(E,help=[]): E is an elliptic curve of the form [0,a,0,b,0], with a, b integers. Performs a 2-descent via isogeny on E. See ?ellQ_ellrank for the format of the output.");
addhelp(ellQ_ellrank,
"ellQ_ellrank(E,help=[]): E is any elliptic curve defined over Q. Returns a vector [r,s,v], where r is a lower bound for the rank of E, s is the rank of its 2-Selmer group and v is a list of independant points in E(Q)/2E(Q). If help is a vector of nontrivial points on E, the result might be faster. This function might be used in conjunction with elltors2(E). See also ?default_ellQ");
addhelp(ellhalf,
"ellhalf(E,P): returns the vector of all points Q on the elliptic curve E such that 2Q = P");
addhelp(ellredgen,
Expand Down Expand Up @@ -2143,7 +2143,7 @@ if( DEBUGLEVEL_ell >= 3, print(" end of ell2descent_viaisog"));

\\ others
addhelp(default_ellQ,
"default_ellQ(DEBUGLEVEL_ell, LIM1, LIM3, LIMTRIV, ELLREDGENFLAG, COMPLETE, MAXPROB, LIMBIGPRIME): set the value of the global variables used for ellrank() and other related functions. DEBUGLEVEL_ell: 0-5: choose the quantity of information printed during the computation (default=0: print nothing); LIM1 (resp LIM3): search limit for easy (resp hard) points on quartics; LIMTRIV: search limit for trivial points on elliptic curves; ELLREDGENFLAG: if != 0, try to reduce the generators at the end; COMPLETE: if != 0 and full 2-torsion, use complete 2-descent, otherwise via 2-isogeny; MAXPROB, LIMBIGPRIME: technical.");
"default_ellQ(DEBUGLEVEL_ell, LIM1, LIM3, LIMTRIV, ELLREDGENFLAG, COMPLETE, MAXPROB, LIMBIGPRIME): set the value of the global variables used for ellQ_ellrank() and other related functions. DEBUGLEVEL_ell: 0-5: choose the quantity of information printed during the computation (default=0: print nothing); LIM1 (resp LIM3): search limit for easy (resp hard) points on quartics; LIMTRIV: search limit for trivial points on elliptic curves; ELLREDGENFLAG: if != 0, try to reduce the generators at the end; COMPLETE: if != 0 and full 2-torsion, use complete 2-descent, otherwise via 2-isogeny; MAXPROB, LIMBIGPRIME: technical.");
/* addhelp(DEBUGLEVEL_ell,
"DEBUGLEVEL_ell: Choose a higher value of this global variable to have more details of the computations printed during the 2-descent algorithm. 0 = don't print anything; 1 = (default) just print the result; 2 = print more details including the Selmer group and the nontrivial quartics.");
*/
Expand Down
Loading

0 comments on commit 0f25b00

Please sign in to comment.