Ask Your Question
0

Performance of discriminant calculations over power series rings

asked 2023-11-03 13:01:33 +0100

Marco Castronovo gravatar image

updated 2023-11-03 19:28:12 +0100

Let $P=\mathbb{Q}[t_1,\ldots ,t_n]$ be the ring of polynomials of variables $t_1,\ldots ,t_n$ with rational coefficients, and let $S=P[[q]]$ be the ring of power series of variable $q$ with coefficients in $P$. Given a polynomial $p\in S[x]$ of variable $x$ with coefficients in $S$, denote $\Delta(p)=\operatorname{resultant}(p(x),p'(x))\in S$ the discriminant of $p$, which is the resultant of $p(x)$ and its $x$-derivative $p'(x)$. What is the performance of SageMath in computing $\Delta(p)$ modulo $q^A$ for a given $A\in\mathbb{N}$?

I'm interested in a theoretical answer describing the complexity class of the algorithms used by SageMath, as well as in an empirical answer estimating how much time it would take to do this calculation in the case below, where $n=4$, $A=2$, and $p(x)$ is as shown. It doesn't seem to terminate in any reasonable time on a laptop.

P.<t2,t3,t4,t5> = PolynomialRing(QQ)
S.<q> = PowerSeriesRing(R, default_prec=2)
p = x^6 + ((-1/6*t2^3 - t2^2*t3 - 1/2*t2*t3^2 - 2*t2*t4 - t3*t4 - 2*t5)*q)*x^5 + ((28*t2*t3 - 32*t4*t5)*q + (1/6*t2^5*t3 - 1/6*t2^4*t3^2 + 1/2*t2^3*t3^3 + 1/3*t2^4*t4 + 5/3*t2^3*t3*t4 + 2*t2^2*t3^2*t4 + 3/2*t2^2*t4^2 + 2*t2*t3*t4^2 + 1/3*t2^3*t5 - 6*t2^2*t3*t5 + t2*t3^2*t5 + 9*t2*t4*t5^2 + 3*t2*t4*t5 + 2*t3*t4*t5)*q^2)*x^4 + ((-2/3*t2^4*t3 - 104/3*t2^3*t3^2 - 8*t2^2*t3^3 + 16/3*t2^3*t4*t5 + 40*t2^2*t3*t4*t5 + 16*t2*t3^2*t4*t5 + 18*t2^3*t4 - 44*t2^2*t3*t4 + 8*t2*t3^2*t4 + 96*t2*t4^2*t5 + 32*t3*t4^2*t5 + 48*t2*t4^2 + 24*t3*t4^2 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^4 + 12*t2*t4^2*t5^3 - 90*t2*t3*t5^4 + 240*t4*t5^5 + 96*t4*t5^4)*q^5
Delta = p.resultant(p.differentiate())
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2023-11-03 21:27:07 +0100

Max Alekseyev gravatar image

First off, the code appears to be incomplete as neither R nor x is defined. Per textual description, the set-up should be

P.<t2,t3,t4,t5> = PolynomialRing(QQ)
S.<q> = PowerSeriesRing(P, default_prec=2)
R.<x> = PolynomialRing(S)

Next, the discriminant can be computed directly as p.discriminant().

Finally, there seems to be a misunderstanding of what default precision is. Per documentation:

default_prec – the default precision used if an exact object must be changed to an approximate object in order to do an arithmetic operation. [...] The default precision is specified at construction, but does not bound the precision of created elements.

In your code, the coefficients of p are specified as exact and thus have infinite precision. Hence, the discriminant is not computed modulo q^2 but exactly, In order to perform computation modulo q^2, the precision of the coefficients has to be changed to 2 first:

p.map_coefficients(lambda t: t.add_bigoh(2)).discriminant()

which instantly returns O(q^10).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-11-03 13:01:33 +0100

Seen: 150 times

Last updated: Nov 03 '23