Ask Your Question
1

Macaulay2 Does Nothing

asked 2014-09-07 20:01:12 +0200

OWG gravatar image

updated 2014-09-08 20:00:30 +0200

slelievre gravatar image

I've been trying to run Macaulay2 in Sage to generate some examples for a project I have.

I used cloud.sagemath.com and everything worked fine for a while, but some inputs just wouldn't evaluate. There was no error, and it wouldn't freeze- it's just that nothing would happen. I figured there was a calculation limit, so I downloaded sage and Macaulay2, but the same problem occurs. Sage and Macaulay2 appear to be properly installed.

An example of code which doesn't do anything is:

R = ZZ[O1,O2,O3,O4,O5,In1,In2,In3,In4,In5];
I = ideal(O1*O2,O2*O3,O3*O4,O4*O5,O5*O1,In1*In3,In3*In5,In5*In2,In2*In4,In4*In1,O1*In1,O2*In2,O3*In3,O4*In4,O5*In5);
J = ideal(O1,O2,O3,O4,O5,In1,In2,In3,In4,In5);
v = flatten entries mingens J;
e = flatten entries mingens I;
m = table(e,e,(a,b)->a*b);
s = unique flatten m;
for i when i<length e do s=delete(e#i^2,s);
dvds = (a,b) -> if b%(a*a)==0 then true else false;
f = x -> any(v, a -> dvds(a,x));
i = 0; while i<#s do if f(s#i)==false then s=delete(s#i,s) else i=i+1;
F = ideal(s);
betti F
betti I

Meanwhile, similar code which returns correct-looking output is

%macaulay2
R = ZZ[x1,x2,x3,x4];
I = ideal(x1*x2, x2*x3, x3*x4, x4*x1);
J = ideal (x1,x2,x3,x4);
v = flatten entries mingens J;
e = flatten entries mingens I;
m = table(e,e,(a,b)->a*b);
s = unique flatten m;
for i when i<length e do s=delete(e#i^2,s);
dvds = (a,b) -> if b%(a*a)==0 then true else false;
f = x -> any(v, a -> dvds(a,x));
i = 0; while i<#s do if f(s#i)==false then s=delete(s#i,s) else i=i+1;
F = ideal(s);
betti F
betti I

The output is

Ideal of R

Ideal of R

         2       2      2            2
{x1*x3*x4 , x2*x3 x4, x1 x2*x4, x1*x2 x3}

List

Ideal of R

       0 1
total: 1 4
    0: 1 .
    1: . .
    2: . .
    3: . 4

BettiTally

       0 1
total: 1 4
    0: 1 .
    1: . 4

BettiTally

The only real difference seems to be the number of calculations made, and this idea is confirmed in that the calculations always seem to fail around ZZ[x1..xn] for n>8. There must be some way to fix this. Can anyone help?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-09-08 20:06:34 +0200

slelievre gravatar image

When I try your two examples on SageMathCloud in a terminal, I get similar-looking output.

Here is what I get running your simpler example on SageMathCloud in a terminal.

~$ M2
Macaulay2, version 1.6
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition, ReesAlgebra, TangentCone

i1 : R = ZZ[x1,x2,x3,x4];

i2 : I = ideal(x1*x2, x2*x3, x3*x4, x4*x1);

o2 : Ideal of R

i3 : J = ideal (x1,x2,x3,x4);

o3 : Ideal of R

i4 : v = flatten entries mingens J;

i5 : e = flatten entries mingens I;

i6 : m = table(e,e,(a,b)->a*b);

i7 : s = unique flatten m;

i8 : for i when i<length e do s=delete(e#i^2,s);

i9 : dvds = (a,b) -> if b%(a*a)==0 then true else false;

i10 : f = x -> any(v, a -> dvds(a,x));

i11 : i = 0; while i<#s do if f(s#i)==false then s=delete(s#i,s) else i=i+1;

i13 : F = ideal(s);

o13 : Ideal of R

i14 : betti F

             0 1
o14 = total: 1 4
          0: 1 .
          1: . .
          2: . .
          3: . 4

o14 : BettiTally

i15 : betti I

             0 1
o15 = total: 1 4
          0: 1 .
          1: . 4

o15 : BettiTally

And here is what I get running your more involved example on SageMathCloud in a terminal.

~$ M2
Macaulay2, version 1.6
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition, ReesAlgebra, TangentCone

i1 : R = ZZ[O1,O2,O3,O4,O5,In1,In2,In3,In4,In5];

i2 : I = ideal(O1*O2,O2*O3,O3*O4,O4*O5,O5*O1,In1*In3,In3*In5,In5*In2,In2*In4,In4*In1,O1*In1,O2*In2,O3*In3,O4*In4,O5*In5);

o2 : Ideal of R

i3 : J = ideal(O1,O2,O3,O4,O5,In1,In2,In3,In4,In5);

o3 : Ideal of R

i4 : v = flatten entries mingens J;

i5 : e = flatten entries mingens I;

i6 : m = table(e,e,(a,b)->a*b);

i7 : s = unique flatten m;

i8 : for i when i<length e do s=delete(e#i^2,s);

i9 : dvds = (a,b) -> if b%(a*a)==0 then true else false;

i10 : f = x -> any(v, a -> dvds(a,x));

i11 : i = 0; while i<#s do if f(s#i)==false then s=delete(s#i,s) else i=i+1;

i13 : F = ideal(s);

o13 : Ideal of R

i14 : betti F

             0  1
o14 = total: 1 30
          0: 1  .
          1: .  .
          2: .  .
          3: . 30

o14 : BettiTally

i15 : betti I

             0  1
o15 = total: 1 15
          0: 1  .
          1: . 15

o15 : BettiTally
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

Stats

Asked: 2014-09-07 20:01:12 +0200

Seen: 493 times

Last updated: Sep 08 '14