What is wrong with this primary decomposition calculation?

51 views
Skip to first unread message

Eloísa Grifo

unread,
Mar 23, 2022, 12:52:43 PM3/23/22
to maca...@googlegroups.com
Dear all,


When I run the calculation below

R = QQ[x,y,z, Degrees => {25,72,29}]
P = ker map(QQ[t],R,{t^(25),t^(72),t^(29)})
primaryDecomposition(P^3)

M2 gives me the error

"stdio:3:1:(3): error: array index 0 out of bounds 0 .. -1"

This appears to be caused by the fact that my ring is not standard graded (and maybe the degrees are too large?), since the calculation runs perfectly fine if I take away the funny grading:

R = QQ[x,y,z]
P = ker map(QQ[t],R,{t^(25),t^(72),t^(29)})
primaryDecomposition(P^3)

The original grading was meant to make P homogeneous, which I thought would make the calculation more efficient. What is wrong with the first example?


Best,
Eloísa



jche...@gmail.com

unread,
Mar 23, 2022, 2:01:50 PM3/23/22
to Macaulay2
Hi Eloisa,

Thanks for reporting this bug - it is indeed the funny grading that's causing the issue. The problem is with minimalPrimes, specifically the (more recent, ~2020) default Strategy => "Birational":

R = QQ[x,y,z]
P = ker map(QQ[t],R,{t^(25),t^(72),t^(29)})
I = P^3
minimalPrimes(I, Strategy => "Birational") -- gives an error
minimalPrimes(I, Strategy => "Legacy") -- returns {P}

Unfortunately right now it isn't so easy to tell associatedPrimes/primaryDecomposition to use the "Legacy" strategy for minimalPrimes (which apparently would be a good feature to add). The easiest thing to do (barring any modifications to your own M2 installation) is probably to write a custom associatedPrimes command:

myAssociatedPrimes = I -> flatten apply(toList(codim I..pdim comodule I), i -> select(minimalPrimes(ann Ext^i(comodule I, R), Strategy => "Legacy"), P -> codim P == i))

For I = P^3 as above, this returns two primes, namely the unique minimal prime P and one embedded prime (the irrelevant ideal).

Justin

Mahrud Sayrafi

unread,
Mar 23, 2022, 2:30:43 PM3/23/22
to maca...@googlegroups.com
Hi Justin,

Are you sure this bug was introduced in 2020? It's possible that it was rarer before we changed the default options, but I looked at where the error is occuring and I don't remember that particular part changing recently.

Best,
Mahrud

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/macaulay2/909de74f-9565-4ac4-a7ea-3dd4067590a6n%40googlegroups.com.

mike stillman

unread,
Mar 23, 2022, 2:34:57 PM3/23/22
to Macaulay2
The Birational strategy is older, and it might very well not have been tested for such degrees, sadly (probably my fault too...!)

jche...@gmail.com

unread,
Mar 23, 2022, 3:08:53 PM3/23/22
to Macaulay2
Hi Mahrud,

I only meant that the change to make Birational the default strategy (as opposed to Legacy) is more recent - probably the actual bug has existed in MinimalPrimes.m2 for many years. I'll try and hunt the bug down at some point, although also exposing minimalPrimes options to associatedPrimes would probably be good in any case.

(I also realized that I used the wrong ring in my example: it should be R = QQ[x,y,z, Degrees => {25,72,29}] to see the error, instead of R = QQ[x,y,z].)

Justin

On Wednesday, March 23, 2022 at 2:30:43 PM UTC-4 mah...@umn.edu wrote:

Mahrud Sayrafi

unread,
Mar 23, 2022, 3:42:42 PM3/23/22
to maca...@googlegroups.com
Ah, I see, yes I think you're right then.

> exposing minimalPrimes options to associatedPrimes would probably be good in any case.

Yes. We should think about how to do that without making the options too messy.

Fortunately, minimalPrimes are catched, so, Eloísa, here is a workaround:

R = QQ[x,y,z, Degrees => {25,72,29}]
P = ker map(QQ[t],R,{t^(25),t^(72),t^(29)})
Q = P^3
minimalPrimes(Q, Strategy => "Legacy")
primaryDecomposition Q

Note that I gave P^3 a name so that the minimalPrimes can be cached in Q. This is probably a good idea in general.

Best,
Mahrud

Daniel R. Grayson

unread,
Mar 23, 2022, 4:00:06 PM3/23/22
to Macaulay2
It worked in 1.16:

+ /Applications/Macaulay2-1.16/bin/M2 --no-readline --print-width 101
Macaulay2, version 1.16
with packages: ConwayPolynomials, Elimination, IntegralClosure, InverseSystems, LLLBases,
               MinimalPrimes, PrimaryDecomposition, ReesAlgebra, TangentCone, Truncations

i1 : R = QQ[x,y,z, Degrees => {25,72,29}]

o1 = R

o1 : PolynomialRing

i2 : P = ker map(QQ[t],R,{t^(25),t^(72),t^(29)})

             3    4 4   11      7   7 2    11
o2 = ideal (y  - x z , x   - y*z , x y  - z  )

o2 : Ideal of R

i4 : primaryDecomposition(P^3)

              9     4 6 4     8 3 8    12 12   11 6     15 3 4    7 7    19 8     4 4 11    8   15
o4 = {ideal (y  - 3x y z  + 3x y z  - x  z  , x  y  - 2x  y z  - y z  + x  z  + 2x y z   - x y*z  ,
     ------------------------------------------------------------------------------------------------
      18 4    3 8 3    22   4     7 5 7     11 2 11    3 18    4 22   30    15 4 3    8 6     19   7
     x  y  + x y z  - x  y*z  - 4x y z  + 3x  y z   + y z   - x z  , x   + x  y z  + y z  - 4x  y*z
     ------------------------------------------------------------------------------------------------
         4 5 10     8 2 14      25   7 8     11 5 4    15 2 8    6 11     4 3 15    8 19   10 7  
     - 4x y z   + 6x y z   - x*z  , x y  - 2x  y z  + x  y z  - y z   + 2x y z   - x z  , x  y  +
     ------------------------------------------------------------------------------------------------
      29     14 4 4     18   8     3 5 11     7 2 15    26   22 3    26 4     11 4 7     15   11  
     x  z - x  y z  - 3x  y*z  - 2x y z   + 5x y z   - z  , x  y  - x  z  - 2x  y z  + 2x  y*z   +
     ------------------------------------------------------------------------------------------------
      5 14    4 2 18   29     14 5 3     18 2 7    3 6 10     7 3 14    11 18      25           8   9
     y z   - x y z  , x  y + x  y z  - 4x  y z  - x y z   + 3x y z   + x  z   - y*z  ), ideal (z , y
     ------------------------------------------------------------------------------------------------
         4 6 4   11 6     15 3 4    7 7   7 8     11 5 4   22 3    26 4     11 4 7   18 5    22 2 4  
     - 3x y z , x  y  - 2x  y z  - y z , x y  - 2x  y z , x  y  - x  z  - 2x  y z , x  y  - x  y z  -
     ------------------------------------------------------------------------------------------------
      7 6 7   33     22   7   18 4 4    3 8 7   29 2     18 3 7   29   4    14 5 7   10 7 7
     x y z , x   - 3x  y*z , x  y z  + x y z , x  y  - 2x  y z , x  y*z  + x  y z , x  y z )}

o4 : List

Mahrud Sayrafi

unread,
Mar 23, 2022, 4:02:12 PM3/23/22
to maca...@googlegroups.com
Did minimalPrimes with the Birational strategy work back then also?

Mahrud

--
You received this message because you are subscribed to the Google Groups "Macaulay2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macaulay2+...@googlegroups.com.

jche...@gmail.com

unread,
Mar 23, 2022, 4:18:46 PM3/23/22
to Macaulay2
Dan: I believe 1.16 doesn't use MinimalPrimes.m2 by default (i.e. does exactly what Strategy => "Legacy" does now). 

Mahrud: This caching was the first thing I thought of, but for some reason when I tried it I thought it didn't work. I'm not sure if it will continue to work if there are more non-standard-graded non-minimal associated primes. In this case though, this is definitely the quickest fix.

Justin

Reply all
Reply to author
Forward
0 new messages