On Sun, Jul 28, 2024 at 6:51 AM 'Animesh Shree' via sage-support
<
sage-s...@googlegroups.com> wrote:
>
> I was looking into this issue
>
> This throws error:
> -----------------------------------------------------------------------------------------
> sage: R1.<x,y,z> = QQ[]
> sage: p = (x^2 - y^2) * (x + y + z)
> sage: S = QQ['z']['x,y']
> sage: try:
> ....: S(p)
> ....: except Exception as e:
> ....: print(e)
> x^3 + x^2*y - x*y^2 - y^3 is not a constant polynomial
>
>
> But this passes
> --------------------------------------------------------------------------------------------
> sage: R2.<z,x,y> = QQ[]
> sage: p = (x^2 - y^2) * (x + y + z)
> sage: S(p)
> x^3 + x^2*y - x*y^2 - y^3 + z*x^2 + (-z)*y^2
> sage:
>
>
> So the output of
> p = R1.random_element()
> S(p) and S(R2(p))
> should they be same or different ?
I don't know whether S(p), i.e. coersion of p into the ring S, should work for
different monomial order, or one should explicitly use R1.change_ring
You get lucky with S and R2, as this is the same order.
I'd also be vary of using the same variable names for different rings:
if you declare
two rings, R1 amd R2, using the same variable, say, y, how does Sage
supposed to know whether
y is a member of R1, or a member of R2 (you can still use R1(y) and
R2(y) to be explicit)
HTH,
Dima
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-support/f25ed01f-2b98-47bd-bb56-52a42ed19149n%40googlegroups.com.