Getting output of libsingular when it gives several objects

50 views
Skip to first unread message

mmarco

unread,
Oct 12, 2015, 4:05:36 PM10/12/15
to sage-devel
In #19391 i am trying to move the method .invariant_generators() to libsingular. It works on the non modular case, but for the modular case, we need to call singular's invariant_ring function. This function returns three matrices, and we need the first two. But if i call it through libsingular, i only get the first one:

sage: from sage.libs.singular.function import singular_function
sage
: import sage.libs.singular.function_factory
sage
: sage.libs.singular.function_factory.lib('finvar.lib')
sage
: inring = singular_function('invariant_ring')
sage
: F=FiniteField(2)
sage
: R.<x,y> = F[]
sage
: m1 = matrix(R, 2, [0,1,1,0])
sage
: inring(m1)
[x + y   x*y]


If you do the corresponding call within singular:

                     SINGULAR                                 /  Development
 A Computer Algebra System for Polynomial Computations       /   version 3-1-7
                                                           0<
 by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   Aug 2013
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> LIB "finvar.lib";
// ** loaded /home/mmarco/sage/local/share/singular/finvar.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/algebra.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/ring.lib (4.0.0.0,Jun_2013)
// ** loaded /home/mmarco/sage/local/share/singular/primdec.lib (4.0.1.1,Nov_2014)
// ** loaded /home/mmarco/sage/local/share/singular/absfact.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/triang.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/random.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/poly.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/inout.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/general.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/elim.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/matrix.lib (3-1-7-0,Sep_2013)
// ** loaded /home/mmarco/sage/local/share/singular/nctools.lib (3-1-7-0,Sep_2013)
> ring r=2,(x,y),dp;
> matrix A[2][2] = 0,1,1,0;
> matrix P,S,IS=invariant_ring(A);
> P;
P[1,1]=x+y
> S;
S[1,1]=xy
> IS;
IS[1,1]=1



How can i get these three matrices through libsingular?

Kwankyu Lee

unread,
Oct 13, 2015, 5:05:54 AM10/13/15
to sage-devel
I heard from the author of the libSingular interface that multiple return values were not considered in the initial design. So I guess you need to revise Sage's libSingular interface first.
Reply all
Reply to author
Forward
0 new messages