ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 06 Jan 2018 04:35:56 +0100Using Singular's solve.libhttps://ask.sagemath.org/question/40490/using-singulars-solvelib/ I am trying to use Singular's `solve.lib` from Sage, but I am running into issues with getting the result out of Singular. I tried using the Singular interface and was able to make it this far:
sage: singular.lib('solve.lib')
sage: r = singular.ring('complex', '(x,y)', 'lp')
sage: I = singular.ideal('(x-5)*y/32', 'y^2-x^3-5*x-10')
sage: R = singular.fglm_solve(I)
sage: singular.setring(R)
at which point the result is stored in a list `rlist` inside of `R`. I can do `singular.eval('rlist')` and see the answer, but in order to get it back into Sage I would have to parse the resulting string. Is there a better way to get `rlist`?
Alternatively, I tried to use `libSingular` as follows:
sage: from sage.libs.singular.function import singular_function, lib
sage: lib('solve.lib')
sage: fglm_solve = singular_function('fglm_solve')
sage: P = PolynomialRing(QQ,'x,y',order='lex'); x,y = P.gens()
sage: I = Ideal((x-5)*y/32, y^2-x^3-5*x-10)
sage: R = fglm_solve(I)
// 'fglm_solve' created a ring, in which a list rlist of numbers (the
// complex solutions) is stored.
// To access the list of complex solutions, type (if the name R was assigned
// to the return value):
setring R; rlist;
<RingWrap>
But then `R` is a `<RingWrap>` instance and this time I don't even know how to go about seeing the answer. Also, I would prefer to work over the complex field, but I couldn't get `fglm_solve` to accept an ideal in `CC['x,y']`
Any help in either direction would be greatly appreciated.jaebondSat, 06 Jan 2018 04:35:56 +0100https://ask.sagemath.org/question/40490/