# toricMarkov -- calculates a generating set of the toric ideal I_A, given A; invokes "markov" from 4ti2

## Synopsis

• Usage:
toricMarkov(A) or toricMarkov(A, InputType => "lattice") or toricMarkov(A,R)
• Inputs:
• A, , whose columns parametrize the toric variety; the toric ideal is the kernel of the map defined by A. Otherwise, if InputType is set to "lattice", the rows of A are a lattice basis and the toric ideal is the saturation of the lattice basis ideal.
• R, a ring, polynomial ring in which the toric ideal $I_A$ should live
• Optional inputs:
• InputType => , default value null, which is the string "lattice" if rows of A specify a lattice basis
• Outputs:
• B, , whose rows form a Markov Basis of the lattice $\{z {\rm integral} : A z = 0\}$ or the lattice spanned by the rows of A if the option InputType => "lattice" is used

## Description

Suppose we would like to comput the toric ideal defining the variety parametrized by the following matrix:

 i1 : A = matrix"1,1,1,1;0,1,2,3" o1 = | 1 1 1 1 | | 0 1 2 3 | 2 4 o1 : Matrix ZZ <--- ZZ

Since there are 4 columns, the ideal will live in the polynomial ring with 4 variables.

 i2 : R = QQ[a..d] o2 = R o2 : PolynomialRing i3 : M = toricMarkov(A) o3 = | 0 1 -2 1 | | 1 -2 1 0 | | 1 -1 -1 1 | 3 4 o3 : Matrix ZZ <--- ZZ

Note that rows of M are the exponents of minimal generators of $I_A$. To get the ideal, we can do the following:

 i4 : I = toBinomial(M,R) 2 2 o4 = ideal (- c + b*d, - b + a*c, - b*c + a*d) o4 : Ideal of R

Alternately, we might wish to give a lattice basis ideal instead of the matrix A. The lattice basis will be specified by a matrix, as follows:

 i5 : B = syz A o5 = | -1 2 | | 2 -3 | | -1 0 | | 0 1 | 4 2 o5 : Matrix ZZ <--- ZZ i6 : N = toricMarkov(transpose B, InputType => "lattice") o6 = | 0 1 -2 1 | | 1 -2 1 0 | | 1 -1 -1 1 | 3 4 o6 : Matrix ZZ <--- ZZ i7 : J = toBinomial(N,R) -- toricMarkov(transpose B, R, InputType => "lattice") 2 2 o7 = ideal (- c + b*d, - b + a*c, - b*c + a*d) o7 : Ideal of R

We can see that the two ideals are equal:

 i8 : I == J o8 = true

Also, notice that instead of the sequence of commands above, we could have used the following:

 i9 : toricMarkov(A,R) 2 2 o9 = ideal (- c + b*d, - b + a*c, - b*c + a*d) o9 : Ideal of R

## Ways to use toricMarkov :

• "toricMarkov(Matrix)"
• "toricMarkov(Matrix,Ring)"

## For the programmer

The object toricMarkov is .