Sur les exemples de dim 0 ca donne une tres belle amelioration et j'ai pu pousser plus loin. L'elimination de toutes les variables sauf une devient tres competitive Ex:
Code : Tout sélectionner
sage: L=genintersectioncomplete(5,GF(101))
Defining x0, x1, x2, x3, x4
sage: I=ideal(L)
sage: %time E1=I.elimination_ideal([x0,x1,x2,x3])
CPU times: user 3.79 s, sys: 19 µs, total: 3.79 s
Wall time: 3.79 s
sage: %time E2=giac_elimination(I,[x0,x1,x2,x3])
// Groebner basis computation time 0.152809 Memory 0.270704M
CPU times: user 1.57 s, sys: 4.04 ms, total: 1.57 s
Wall time: 1.57 s
sage: I
Ideal (12*x1^3 - 26*x0*x1*x2 + 12*x1^2*x2 - 17*x0*x2^2 - 15*x0^2*x3 + 37*x0*x3^2 + 39*x2*x3*x4 + 18*x3^2*x4 + 29*x1*x4^2 + 47*x4^3 - 22*x0^2 - 44*x0*x1 - 9*x0*x2 - 43*x2^2 + 19*x2*x3 - 28*x1*x4 - 15*x2*x4 + 38*x3*x4 + x4^2 + 4*x0, -8*x0^2*x1 + 24*x1^3 - 5*x1^2*x2 + 6*x0*x2^2 + 3*x0^2*x3 + 30*x1^2*x3 + 28*x1*x3^2 - 23*x2*x3^2 + 28*x0*x1*x4 - 4*x1*x2*x4 - 4*x0*x4^2 - 18*x1*x4^2 - 28*x2*x4^2 - 2*x3*x4^2 + 12*x0*x3 + 38*x3^2 + 43*x0*x4 + 11*x4^2 - 27*x0 - 34, -21*x1^3 - 19*x0*x1*x2 - 5*x1*x2^2 + 50*x2^2*x3 - 16*x2*x3^2 - 5*x0*x2*x4 + 5*x0*x3*x4 + 33*x1*x3*x4 + 24*x2*x3*x4 + 50*x2*x4^2 + 36*x4^3 + 14*x0^2 + 40*x0*x1 - 21*x1^2 - 49*x0*x2 - 49*x1*x2 - 34*x0*x4 + 2*x3*x4 + 43*x0 - 33*x1, 16*x0^2*x1 + 31*x0^2*x2 - 40*x0*x1*x2 - 13*x0*x2^2 - 45*x2^3 - 9*x0*x1*x3 + 48*x1*x2*x3 - 27*x2^2*x3 + 43*x0^2*x4 + 11*x0*x2*x4 + 20*x1*x2*x4 + 47*x3^2*x4 - 21*x2*x3 + 47*x0*x4 + 45*x1*x4 - 46*x3*x4 - x4^2 + 4*x0 - 39*x2 + 3*x3, 23*x0^2*x1 + 23*x1^3 + 47*x0^2*x2 - 9*x0*x1*x3 + 47*x2^2*x3 + 8*x0*x3^2 + 42*x1*x3^2 + 36*x0*x1*x4 + x1^2*x4 + 36*x0*x2*x4 - 31*x2^2*x4 + 46*x0*x3*x4 + 25*x2*x3*x4 + 34*x3^2*x4 - 41*x2*x4^2 + 13*x1^2 - 50*x0*x3 - 21*x1*x3 + 9*x0 - 24) of Multivariate Polynomial Ring in x0, x1, x2, x3, x4 over Finite Field of size 101
en revanche pour l'elimination de moins de variables en dim 0 singular est plus rapide.
Sur cet exemple de dim 2 singular est bien plus rapide:
(idem giac + transformed_basis (qui utlise je pense groebner walk) est plus rapide)
Code : Tout sélectionner
L2:=[-19*y0^3 - 45*y0^2*y1 - 24*y0*y1^2 + 13*y1^3 - 9*y0^2 - 48*y0*y1 - 8*y1^2 + z0 + 33*y0 - 47*y1 - 12, -49*y0^3 + 10*y0^2*y1 + 12*y0*y1^2 + 5*y1^3 + 9*y0^2 - 20*y0*y1 - 35*y1^2 + z1 + 9*y0 + 34*y1 - 48, 12*y0^3 + 50*y0^2*y1 - 16*y0*y1^2 + 45*y1^3 + 13*y0^2 - 14*y0*y1 - 47*y1^2 + z2 - 34*y0 + 29*y1 - 1, 41*y0^3 - 50*y0^2*y1 + 47*y0*y1^2 - 16*y1^3 + 38*y0^2 - y0*y1 - 9*y1^2 + z3 - 8*y0 - 45*y1 + 27, -38*y0^3 + 38*y0^2*y1 + 22*y0*y1^2 + 15*y1^3 - 34*y0^2 - 10*y0*y1 + 35*y1^2 + z4 - 42*y0 + 9*y1 + 17, 13*y0^3 + 36*y0^2*y1 + 26*y0*y1^2 + 24*y1^3 + 30*y0^2 - 26*y0*y1 - 49*y1^2 + z5 + 29*y0 + 5*y1 - 24, 49*y0^3 - 44*y0^2*y1 + 32*y0*y1^2 - 12*y1^3 - 6*y0^2 + 21*y0*y1 + 29*y1^2 + z6 - 31*y0 + 16*y1 + 21, 8*y0^3 + 22*y0^2*y1 + 49*y0*y1^2 - 38*y1^3 - y0^2 + 14*y0*y1 + 6*y1^2 + z7 - 44*y0 + 22*y1 + 44, -15*y0^3 - 28*y0^2*y1 + 46*y0*y1^2 + 6*y1^3 + y0^2 + 49*y0*y1 - 6*y1^2 + z8 - 50*y0 + 24*y1 - 11, 29*y0^3 - 30*y0^2*y1 + 44*y0*y1^2 + 27*y1^3 + 5*y0^2 + 16*y0*y1 + 40*y1^2 + z9 - 2*y0 - 32*y1 + 28] % 101;
eliminate(L2,[y0, y1, z0, z1, z2, z3]);// dim2, singular mets 0.016s, giac 23s?
:!: Dans ce exemple de dim 2 j'ai un probleme de corruption (il passe de temps en temps mais a force j'arrive a voir une erreur):
Code : Tout sélectionner
Lbugfree:=[-9*y1^2 + z0 - 25*y0 - 1/5, -2*y0^2 + 3*y0*y1 + z1 + 2*y0 + 2, -1/4*y0^2 - 2/5*y0*y1 - 2*y1^2 + z2 - 3*y0 + 7/2*y1 - 4, 2*y0^2 - y0*y1 + z3 + 33*y0 - 1/2*y1 - 1, 5*y0^2 - 3/2*y0*y1 + z4 + 8*y0 + y1 - 1/6, 8*y0^2 + 15*y1^2 + z5 - 4/3*y0 - 1/27*y1 + 2];
[-9*y1^2+z0-25*y0-1/5,-2*y0^2+3*y0*y1+z1+2*y0+2,-1/4*y0^2-2/5*y0*y1-2*y1^2+z2-3*y0+7/2*y1-4,2*y0^2-y0*y1+z3+33*y0-1/2*y1-1,5*y0^2-3/2*y0*y1+z4+8*y0+y1-1/6,8*y0^2+15*y1^2+z5-4/3*y0-1/27*y1+2];
eliminate(Lbugfree,[y0,y1,z0,z1,z2,z3]);
eliminate(Lbugfree,[y0,y1,z0,z1,z2,z3]);
eliminate(Lbugfree,[y0,y1,z0,z1,z2,z3]);
eliminate(Lbugfree,[y0,y1,z0,z1,z2,z3]);
eliminate(Lbugfree,[y0,y1,z0,z1,z2,z3]);
donne souvent:
Code : Tout sélectionner
// Time 0
// Groebner basis computation time 0.004876 Memory 0.0124M
[],
// Time 0.01
// Groebner basis computation time 0.001689 Memory 0.012416M
[],
// Time 0
// Groebner basis computation time 0.001695 Memory 0.012468M
[],
// Time 0.01
*** Error in `icas': free(): invalid next size (fast): 0x00007f70f800c4e0 ***