On Dec 7, 5:03 pm, andrew ewart <aewartma...@googlemail.com> wrote:
> I have the following code
>
> P.<x0,x1,y0,y1,y2,y3> = PolynomialRing(QQ,order='degrevlex')
> I = Ideal(x0^4-y0,x0^3*x1-y1,x0*x1^3-y2,x1^4-y3)
> print I
> R.<y0,y1,y2,y3> = PolynomialRing(QQ,order='degrevlex')
> I1=Ideal(1)
> J=I.intersection(I1)
> print J
> but gives error
> File "/usr/local/sage/sage-4.6/local/lib/python2.6/site-packages/sage/
> rings/polynomial/multi_polynomial_ideal.py", line 369, in wrapper
>     return func(*args, **kwds)
>   File "/usr/local/sage/sage-4.6/local/lib/python2.6/site-packages/
> sage/rings/polynomial/multi_polynomial_ideal.py", line 1327, in
> intersection
>     raise ValueError, "other must be an ideal in the ring of self, but
> it isn't."
> ValueError: other must be an ideal in the ring of self, but it isn't.
>
> becuase I doesnt lie in R
> so how do I change this so that sage will be happy for I, an ideal in
> P, intersecting with any ideal in R
> (also R is supposed to be a subring of P where the x0 and x1 are
> removed)

Sort answer, you cannot intersect ideals in different rings.
Note that I1 is an ideal of ZZ since you wrote Ideal(1) which is
assumed to be 1 in ZZ.

You could define the ideal 1 in R as (for instance)

I1 = Ideal(R(1))
I2 = I1.change_ring(P) # Now it is an ideal in P with the same
generators as I1
I2.intersection(I)
Ideal (x1^4 - y3, x0*x1^3 - y2, x0^3*x1 - y1, x0^4 - y0) of
Multivariate Polynomial Ring in x0, x1, y0, y1, y2, y3 over Rational
Field

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to