Using Singular's ring normalization inside Sage

asked 2019-12-28 00:17:43 +0100

azerbajdzan gravatar image

How to use the following Singular's code in Sage?

LIB "normal.lib";
ring r=0,(x,y,z),dp;
ideal i=y^2-x^2*z;
list NN=normal(i);
def N=NN[1];
setring N;
PP;

The original code can be found on this Singular page:

Ring Normalization

I figured out how to write it in Sage only for the first half of the code:

Input:

singular.lib('normal.lib')
R = singular.ring(0,'(x,y,z)','dp')
i = singular.ideal('y^2-x^2*z')
NN=singular.normal(i)
NN

Output:

[1]:
   [1]:
      // coefficients: QQ
// number of vars : 4
//        block   1 : ordering dp
//                  : names    T(1)
//        block   2 : ordering dp
//                  : names    x y z
//        block   3 : ordering C
[2]:
   [1]:
      _[1]=x*z
      _[2]=y

But then I can not figure out how to use the commands 'list', 'def', 'setring' and 'PP'. Any suggestions?

edit retag flag offensive close merge delete