0

I am trying to demonstrate Handelman's theorem and the example 1 here with Macaulay2. I cannot understand the error in defining the ideal for the polytope restricted by the intervals.

R=QQ[x1,x2,x3,MonomialOrder=>Lex];
I=ideal(x1-0.2,-x1+0.5,x2,-x2+1,x3-1,-x3+1)

stdio:2:11:(3): error: can't promote number to ring

and what is the error for? How should I define the constants?

Community
  • 1
  • 1
hhh
  • 50,788
  • 62
  • 179
  • 282

2 Answers2

0

For some reason, Macaulay2 only accepts the computation for polynomial ring with RR not QQ:

i1 : R=RR[x1,x2,x3,MonomialOrder=>Lex]

o1 = R

o1 : PolynomialRing

i2 : I=ideal(x1-0.2,-x1+0.5,x2,-x2+1,x3-1,-x3+1)

o2 = ideal (x1 - .2, - x1 + .5, x2, - x2 + 1, x3 - 1, - x3 + 1)

o2 : Ideal of R
hhh
  • 50,788
  • 62
  • 179
  • 282
0

You get the error because M2 views decimals as real numbers as opposed to rationals:

i1 : .2

o1 = .2

o1 : RR (of precision 53)

So .2 isn't in your base ring. Use fraction notation (as opposed to decimal notation) to input your ideal and you'll be in business.

i2 : R=QQ[x1,x2,x3, MonomialOrder => Lex];

i3 : I=ideal(x1-1/5,-x1+1/2,x2,-x2+1,x3-1,-x3+1)

o3 = ideal (x1 - 1/5, - x1 + 1/2, x2, - x2 + 1, x3 - 1, - x3 + 1)

o3 : Ideal of R

Aaron Dall
  • 139
  • 5