Ticket #12174 (new task)

Opened 17 months ago

Last modified 17 months ago

modular resultants for multivariate polynomials over QQ

Reported by: saraedum Owned by: AlexGhitza
Priority: minor Milestone: sage-5.10
Component: algebra Keywords: resultant, discriminant, polynomial, multivariate, sd35
Cc: burcin, fschulze Work issues:
Report Upstream: N/A Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description (last modified by saraedum) (diff)

Sage is somewhat slow when computing discriminants of multivariate polynomials:

sage: R.<a0,a1,a2,a3,d,t> = QQ[]
sage: f=(16/27)*(a3+d)^2*(3*a2^2*t^7*d^2+12*a1*t^7*d^3+4*a2^3*a3*t^6-2*a2^3*t^6*d+18*a1*a2*a3*t^6*d-6*a1*a2*t^6*d^2+12*a0*t^6*d^3+3*a2^4*t^5+6*a1*a2^2*a3*t^5-9*a1^2*a3^2*t^5+12*a1*a2^2*t^5*d+18*a1^2*a3*t^5*d+18*a0*a2*a3*t^5*d+3*a1^2*t^5*d^2-6*a0*a2*t^5*d^2+6*a1*a2^3*t^4-6*a1^2*a2*a3*t^4+6*a0*a2^2*a3*t^4-18*a0*a1*a3^2*t^4+18*a1^2*a2*t^4*d+12*a0*a2^2*t^4*d+36*a0*a1*a3*t^4*d+6*a0*a1*t^4*d^2+3*a1^2*a2^2*t^3+6*a0*a2^3*t^3-4*a1^3*a3*t^3-12*a0*a1*a2*a3*t^3-9*a0^2*a3^2*t^3+8*a1^3*t^3*d+36*a0*a1*a2*t^3*d+18*a0^2*a3*t^3*d+3*a0^2*t^3*d^2+6*a0*a1*a2^2*t^2-12*a0*a1^2*a3*t^2-6*a0^2*a2*a3*t^2+24*a0*a1^2*t^2*d+18*a0^2*a2*t^2*d+3*a0^2*a2^2*t-12*a0^2*a1*a3*t+24*a0^2*a1*t*d-4*a0^3*a3+8*a0^3*d)
sage: time d=f.discriminant(t)
Time: CPU 3101.66 s, Wall: 3101.78 s

Sage is relying on singular to compute the resultant of f and the derivative of f. Alternatively, one can compute the determinant of the Sylvester matrix; doing this mod p and using chinese remaindering then is much faster in this example:

sage: time dm=modular_discriminant(f,t)
Time: CPU 42.55 s, Wall: 42.55 s
sage: d==dm
True

I attached the implementation of modular_discriminant(). This should not go into sage like this, it's just some experiments I did. I haven't tested it or thought about it too carefully.

Btw. Maple 9.5 needs about 4s to compute this; a recent version of Maple was even faster, but I don't have the data here right now.

Attachments

disc.sage Download (2.8 KB) - added by saraedum 17 months ago.
hack of a modular discriminant/resultant algorithm

Change History

Changed 17 months ago by saraedum

hack of a modular discriminant/resultant algorithm

comment:1 Changed 17 months ago by saraedum

  • Description modified (diff)

comment:2 Changed 17 months ago by saraedum

  • Keywords multivariate, sd35 added; multivariate removed
Note: See TracTickets for help on using tickets.