Macaulay2 » Documentation
Packages » gfanInterface :: Conventions for calling methods with options
next | previous | forward | backward | up | index | toc

Conventions for calling methods with options

In creating gfanInterface the objective has been to mirror the gfan commands as closely as possible in Macaulay 2. Many commands in gfan allow command line options and these reproduced in gfanInterface as optional arguments.

For example, say we want to find the Groebner bases of an ideal with symmetry. From the command line, one would type gfan _bases --symmetry and then give the ring, ideal and symmetries of the ideal as input.

In gfanInterface we pass the optional argument "symmetry" the symmetries and provide the ideal as an argument.

i1 : QQ[x,y,z];
i2 : gfan(ideal(x^2*y -z, y^2*z - x, z^2*x - y), "symmetry" => {{0,1,2}, {1,2,0}})

         2            2           2     3    2      3    2          3   
o2 = {{(y z) - x, (x*z ) - y, (x*y ) - z , (x z) - y , (x y) - z, (x ) -
     ------------------------------------------------------------------------
        2    4     2    4     2      3       2    4     2      2         2  
     y*z , (z ) - x , (y ) - z }, {(x ) - y*z , (z ) - x , (x*z ) - y, (x y)
     ------------------------------------------------------------------------
              2     3    2          3     2       6             4      
     - z, (x*y ) - z , (y z) - x, (y ) - x z}, {(z ) - x*y, (y*z ) - z,
     ------------------------------------------------------------------------
         2         2          3     5      2     3    2     4      4     2 
     (x*z ) - y, (y z) - x, (y ) - z , (x*y ) - z , (x ) - z }, {(y ) - z ,
     ------------------------------------------------------------------------
         2     3    2          2     4      2           4         5     3  
     (x*y ) - z , (y z) - x, (x ) - z , (x*z ) - y, (y*z ) - z, (z ) - y },
     ------------------------------------------------------------------------
        4     2    2 3           4         5     3         2       9      
     {(y ) - z , (y z ) - y, (y*z ) - z, (z ) - y , (x) - y z}, {(y ) - z,
     ------------------------------------------------------------------------
       6               2     2     4      2     8           6    2     4 
     (y z) - y, (x) - y z, (z ) - y }, {(x ) - y , (x*z) - y , (z ) - y ,
     ------------------------------------------------------------------------
       2            4         9           3     5           6    2     4 
     (y z) - x, (x*y ) - y, (y ) - z}, {(x ) - y , (x*z) - y , (z ) - y ,
     ------------------------------------------------------------------------
       2          2            4         8     2      8     2    2 3      
     (x y) - z, (y z) - x, (x*y ) - y, (y ) - x }, {(y ) - x , (x y ) - x,
     ------------------------------------------------------------------------
         4         3     5         2       11           4              9 
     (x*y ) - y, (x ) - y , (z) - x y}, {(y  ) - x, (x*y ) - y, (z) - y ,
     ------------------------------------------------------------------------
       2     8      15              9         11
     (x ) - y }, {(y  ) - y, (z) - y , (x) - y  }}

o2 : List

For each optional gfan argument, the corresponding gfanInterface argument is obtained by simply removing the dashes.

Here's another example. If we run gfanBuchberger without a weight vector, it will use the lexicographic order.

i3 : QQ[x,y,z];
i4 : gfanBuchberger(ideal(x,y+z))

o4 = {(y) + z, (x)}

o4 : MarkedPolynomialList

If we want to use a different order, the gfan documentation tells us to use the -w argument. So, in Macaulay 2, we set the w argument to the desired weight vector.

i5 : QQ[x,y,z];
i6 : gfanBuchberger(ideal(x,y+z), "w" => {1,2,3})

o6 = {(x), (z) + y}

o6 : MarkedPolynomialList

Many optional arguments to gfan require no additional input. In this case, we set the optional argument in Macaulay 2 to be true.