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.Wed, 27 Feb 2019 23:28:32 +0100Calculating Milnor Numbers of Polynomials Using Singular via Sagehttps://ask.sagemath.org/question/45557/calculating-milnor-numbers-of-polynomials-using-singular-via-sage/I'm using Singular via Sage Math to calculate the Milnor numbers of a large number of polynomials. For most polynomials, doing `polynomial.milnor()` works fine, however I am getting a `-1` when I have a variable raised to a power times another variable. I have manually calculated the first Milnor number, and it should be `8`. For instance:
Works fine:
sage: ring = singular.ring(0,'(x,y,z)','ds')
sage: polynomial = singular('-x2+x3-y3+xy3-z5+xz5')
sage: _=singular.lib('sing.lib')
sage: polynomial.milnor()
8
Returns error:
sage: polynomial2 = singular('y2-x3-z2x2')
sage: polynomial2.milnor()
-1
I am following these documentation pages:
- Interface to Singular (Sage Interpreter Interfaces)
- D.6.15.10 milnor (Singular Documentation)
I can't publish links due to low karma, sorry!
By the second page, the `-1` would imply that the function is an isolated complete intersection singularity. This function does not have an ICIS to my knowledge, and I have tested several other functions which I can provide. I think that singular is interpreting the polynomial as `y2-x3-z^(2x2)`, instead of the wanted `y2-x3-(z2)(x2)`, but I am new to Sage and unsure of how to fix this (I attempted parentheses and it threw back an error).Wed, 27 Feb 2019 04:36:56 +0100https://ask.sagemath.org/question/45557/calculating-milnor-numbers-of-polynomials-using-singular-via-sage/Answer by rburing for <p>I'm using Singular via Sage Math to calculate the Milnor numbers of a large number of polynomials. For most polynomials, doing <code>polynomial.milnor()</code> works fine, however I am getting a <code>-1</code> when I have a variable raised to a power times another variable. I have manually calculated the first Milnor number, and it should be <code>8</code>. For instance:</p>
<p>Works fine:</p>
<pre><code>sage: ring = singular.ring(0,'(x,y,z)','ds')
sage: polynomial = singular('-x2+x3-y3+xy3-z5+xz5')
sage: _=singular.lib('sing.lib')
sage: polynomial.milnor()
8
</code></pre>
<p>Returns error:</p>
<pre><code>sage: polynomial2 = singular('y2-x3-z2x2')
sage: polynomial2.milnor()
-1
</code></pre>
<p>I am following these documentation pages: </p>
<ul>
<li>Interface to Singular (Sage Interpreter Interfaces)</li>
<li>D.6.15.10 milnor (Singular Documentation)</li>
</ul>
<p>I can't publish links due to low karma, sorry!</p>
<p>By the second page, the <code>-1</code> would imply that the function is an isolated complete intersection singularity. This function does not have an ICIS to my knowledge, and I have tested several other functions which I can provide. I think that singular is interpreting the polynomial as <code>y2-x3-z^(2x2)</code>, instead of the wanted <code>y2-x3-(z2)(x2)</code>, but I am new to Sage and unsure of how to fix this (I attempted parentheses and it threw back an error).</p>
https://ask.sagemath.org/question/45557/calculating-milnor-numbers-of-polynomials-using-singular-via-sage/?answer=45562#post-id-45562Sage is simply giving you what Singular computes. Indeed, repeating the calculation in Singular gives the same answer.
Note that the [Singular documentation D.6.15.10 milnor](https://www.singular.uni-kl.de/Manual/4-0-3/sing_1637.htm#SEC1712) states that `milnor` returns `-1` if it is **not** an ICIS in generic form (and otherwise it returns the Milnor number).
Unfortunately I cannot judge if something is wrong, because I'm unfamiliar with these localized rings (defined using `ds`).
(Maybe you can explain the calculation.)
If you think something is wrong, you can [submit a ticket in Singular's trac](https://www.singular.uni-kl.de:8005/trac/newticket).Wed, 27 Feb 2019 19:41:07 +0100https://ask.sagemath.org/question/45557/calculating-milnor-numbers-of-polynomials-using-singular-via-sage/?answer=45562#post-id-45562Comment by StrongPiccolo for <p>Sage is simply giving you what Singular computes. Indeed, repeating the calculation in Singular gives the same answer.
Note that the <a href="https://www.singular.uni-kl.de/Manual/4-0-3/sing_1637.htm#SEC1712">Singular documentation D.6.15.10 milnor</a> states that <code>milnor</code> returns <code>-1</code> if it is <strong>not</strong> an ICIS in generic form (and otherwise it returns the Milnor number).</p>
<p>Unfortunately I cannot judge if something is wrong, because I'm unfamiliar with these localized rings (defined using <code>ds</code>).
(Maybe you can explain the calculation.)</p>
<p>If you think something is wrong, you can <a href="https://www.singular.uni-kl.de:8005/trac/newticket">submit a ticket in Singular's trac</a>.</p>
https://ask.sagemath.org/question/45557/calculating-milnor-numbers-of-polynomials-using-singular-via-sage/?comment=45565#post-id-45565You're right, I was wrongly interpreting the error. Thanks!Wed, 27 Feb 2019 23:28:32 +0100https://ask.sagemath.org/question/45557/calculating-milnor-numbers-of-polynomials-using-singular-via-sage/?comment=45565#post-id-45565