Hi,
On 2014-11-05, moep <[email protected]> wrote:
> (1) sage: singular.eval('ring r6 =3D (9,a), (x,y,z),lp')(2) 'ring r6 =3D (9=
> ,a), (x,y,z),lp;'(3) sage: Q =3D singular('std(ideal(x^2,x+y^2+z^3))', type=
>=3D'qring')(4) sage: Q.sage_global_ring()(5) Quotient of Multivariate Polyn=
> omial Ring in x, y, z over Finite Field in a of size 3^2 by the ideal (y^4 =
> - y^2*z^3 + z^6, x + y^2 + z^3)
>
> ...
> The ideal here is fairly simple and it's not a problem to type it in by han=
> d. However I have an ideal that has over 100 generators, which I have defin=
> ed as a variable before. Now I have the problem that I cannot simply adjust=
> the given example to my situation, i.e. if I replace the third line by
>
> Q =3D singular(I, type=3D'qring')
>
>
> then I just get the full polynomial ring back again.
I don't understand what you mean by "... which I have defined as a
variable before". Do you mean the following:
sage: singular.eval('ring r6 = (9,a), (x,y,z),lp')
'ring r6 = (9,a), (x,y,z),lp;'
sage: I = singular.ideal(['x^2', 'x+y^2+z^3']).std()
sage: Q = singular(I, type='qring')
sage: Q
y4-y2z3+z6,
x+y2+z3
That's indeed a bit odd. However, here is a work-around:
sage: Q = singular(I.name(), type='qring')
sage: Q
// # ground field : 9
// primitive element : a
// minpoly : 1*a^2+2*a^1+2*a^0
// number of vars : 3
// block 1 : ordering lp
// : names x y z
// block 2 : ordering C
// quotient ring from ideal
_[1]=y4-y2z3+z6
_[2]=x+y2+z3
Explanation: Each object O in Sage's singular interface has a name, and
this name is the variable in a Singular session holding the data
associated with the object. If you do singular(O), then the object is
returned unaltered. However, if you pass a string to the singular(...)
function, then the string is evaluated by the singular session. And if
you do singular(O.name()), then a new object is returned, and in
particular an evaluation has happened:
sage: singular.eval('setring r6')
'setring r6;'
sage: singular(I, type='qring') is I
True
sage: singular(I.name()) is I
False
I tend to say that singular(O, type='...') function should return O if
and only if the given type coincides with the type of O, otherwise it
should create a new object. I am a bit too busy now, but could be that
I'll relatively soon open a trac ticket for it.
Best regards,
Simon
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.