Ask Your Question
0

Remove a variable from a polynomial ring k(a,b)[x1,x2,x0] where a,b are parameters

asked 2017-09-01 14:09:49 -0600

KittyL gravatar image

I am trying to homogenize polynomials using variable x0 in a polynomial ring k(a,b)[x1,x2] defined as follows:

R.<a,b>    = PolynomialRing( QQ, order='degrevlex' )
K = FractionField( R )
RK.<x1,x2> = PolynomialRing( K, order='degrevlex' )

After homogenization, I define the new polynomial ring with block order:

RKH.<x1,x2,x0>=PolynomialRing(K,order='degrevlex(2),degrevlex(1)')

Then in my program, I need to dehomogenize my polynomials by setting x0=1, and remove the variable x0 from the polynomial ring. This works fine in a polynomial ring without the parameter fraction field. For example

P.<x,y,z>=PolynomialRing(QQ,order='degrevlex(2),degrevlex(1)')
fp=x^2+x*y+4*z^2
R=P.remove_var(z,order='degrevlex');R
R(fp(z=1)).parent()
    Multivariate Polynomial Ring in x, y, z over Rational Field
    Multivariate Polynomial Ring in x, y over Rational Field
    Multivariate Polynomial Ring in x, y over Rational Field

However, with the fraction field k(a,b), the same method does not work any more:

R.<a,b>    = PolynomialRing( QQ, order='degrevlex' )
K = FractionField( R )
RK.<x1,x2> = PolynomialRing( K, order='degrevlex' )
RKH.<x1,x2,x0>=PolynomialRing(K,order='degrevlex(2),degrevlex(1)')
pf=a*x1^2-b*x1*x2+x0^2
RKHn=RKH.remove_var(x0,order='degrevlex')
pfn=pf(x0=1)
RKHn(pfn)
Multivariate Polynomial Ring in x1, x2, x0 over Fraction Field of Multivariate Polynomial Ring in a, b over Rational Field
Error in lines 11-11
 TypeError: not a constant polynomial

I didn't copy down the whole error message so it doesn't look so long. Is there a way to fix this? Thank you for your help!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-09-01 23:23:15 -0600

nbruin gravatar image

That seems like an error to me that should be reported. In the mean time, a workaround:

sage: phi=Hom(RKH,RKHn)([RKHn.0,RKHn.1,1])
sage: phi(pfn)
a*x1^2 + (-b)*x1*x2 + 1
sage: parent(phi(pfn))
Multivariate Polynomial Ring in x1, x2 over Fraction Field of Multivariate Polynomial Ring in a, b over Rational Field
edit flag offensive delete link more

Comments

Thank you! That worked! How do we report the error?

KittyL gravatar imageKittyL ( 2017-09-18 13:26:56 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-09-01 14:09:49 -0600

Seen: 32 times

Last updated: Sep 01