4.13.3 An Important Concept

Author: Neal Harris

The following illustrates an important concept: how SAGE interacts with the data being used and returned by Singular. Let's compute a Gröbner basis for some ideal, using Singular through SAGE.

sage: singular.lib('poly.lib')
sage: singular.ring(32003, '(a,b,c,d,e,f)', 'lp')
        //   characteristic : 32003
        //   number of vars : 6
        //        block   1 : ordering lp
        //                        : names    a b c d e f 
        //        block   2 : ordering C
sage: I = singular.ideal('cyclic(6)')
sage: g = singular('groebner(I)')             
Traceback (most recent call last):
...
TypeError: Singular error:
   ? `I` is undefined
   ? error occurred in standard.lib::groebner line 164: `parameter def i;
parameter  list #;  `
   ? leaving standard.lib::groebner
   skipping text from `;` error at token `)`
sage: g = I.groebner()             # not tested since crashes doctest system
sage: g
   f^48-2554*f^42-15674*f^36+12326*f^30-12326*f^18+15674*f^12+2554*f^6-1,
   ...

It's important to understand why the first attempt at computing a basis failed. The line where we gave singular the input 'groebner(I)' was useless because Singular has no idea what 'I' is! Although 'I' is an object that we computed with calls to Singular functions, it actually lives in SAGE. As a consequence, the name 'I' means nothing to Singular. When we called I.groebner(), SAGE was able to call the groebner function on'I' in Singular, since 'I' actually means something to SAGE.

See About this document... for information on suggesting changes.