global sections of structure sheaf on the toric Calabi-Yau

Let P be a lattice polytope and lying in $N \times {1} \subset N \times \mathbb{R}$. Let $\sigma$ be the cone over this polytope and $X_\sigma$ be the corresponding toric variety, which is an affine,Gorenstein, toric variety.

Is there a simple algorithm for computing the ring of global sections of the structure sheaf on X_{\sigma}? I would like the presentation in terms of generators and relations if possible. If this is not possible in general, I would be happy if this is possible under some nice, fairly general situation. Thank you for your help.

I suppose a different version of this question is: Are there computer programs which are freely available and which can make these computations quickly?

• Isn't it something like: Generators are all lattice points in the cone that are not sums of other lattice points in the cone, relations are identities where one sum of lattice points equals another sum of lattice points? Or the dual cone? – Will Sawin May 25 '13 at 22:30
• Yes, it is as you say in the dual cone. But this description is not so explicit(at least I have trouble to implement it in practice) and I was hoping know what the best algorithm is for computing. – Eleanor Von Hohlandsbourg May 26 '13 at 5:20

Probably this answer comes too late, but anyway:

What you want to do can be divided into two tasks:

1. Find a Hilbert basis of (the dual of) your cone.
2. Compute the toric ideal for the Hilbert basis.

I.e. let $M=\mathbb Z^n$ be the dual lattice of $N\times\mathbb Z$. You start with your cone $\sigma$, dualize it and obtain $\sigma^\vee$. Now you compute a minimal generating set $H:=\{h_1,\ldots,h_m\}\subseteq M$ of the semigroup $\sigma^\vee\cap M$. Then you get a surjection $$k[x_1,\ldots, x_m]\to k[\sigma^\vee\cap M],\ x_i\mapsto x^{h_i}$$ The kernel of this morphism is the ideal $I$ you want. If you denote $H$ as a matrix, it can be described as $$I=( x^u - x^v\ | u,v\in\mathbb Z^m_{\ge 0},\ H\cdot(u-v)=0).$$ Thus you can obtain generators of $I$ by just taking all vectors of $\ker H$, splitting them into positive and negative part, and then take the corresponding binomials.

This you probably knew already, but now for the software:

1. I know two (three) frameworks for computing Hilbert bases: 4ti2 and Normaliz. You can enter your cone via rays or give the facet inequalities, i.e. the rays of $\sigma$. Thus, dualization can be done on the fly. Macaulay2 is also able to compute Hilbert bases via the Polyhedra package, but the first two are probably faster.
2. To compute the toric ideal you can use the groebner method of 4ti2 (see Usage->groebner on the 4ti2 page). Singular provides some algorithms for computing toric ideals on its own, via the toric.lib package. If performance is an issue, 4ti2 is probably faster.

Both Macaulay2 and Singular provide packages interfacing 4ti2, which makes dealing with the algebraic aspect easier.