Ask Your Question
0

Multivariate Polynomial Ring +1 variable

asked 2021-06-02 22:23:39 +0100

whatupmatt gravatar image

updated 2021-06-02 22:26:07 +0100

So the idea is I was first working over

R.<w,x,y,z>=QQ[]

I have a function f and J is the Jacobian of f belonging to the ring above. I do some stuff and I end with a polynomial g in a symbolic ring in variables w,x,z. I want to lift g. So I want to do

q1, q2, q3, q4 = g.lift(J)
q1=1/3 * q1(w,x,y,z).derivative(w)
q2=1/3 *q2(w,x,y,z).derivative(x)
q3=1/3 *q3(w,x,y,z).derivative(y)
q4=1/3*q4(w,x,y,z).derivative(z)
h1=q1+q2+q3+q4

Now, the Symbolic ring has no attribute lift. This can be fixed by moving to Multivariate Polynomiial Ring by doing

g=g.polynomial(QQ)

The issue is, because g is only a function in w,x,z, this moves g to the Multivariate Polynomial Ring of w,x,z. This gives error as the Jacobian and function f is in Multivariate Polynomial Ring of w,x,y,z. I want g to be in the Multivariate Polynomial Ring of w,x,y,z even though there is no y in g. How can I do this? See my 2 attachment. In the attachment, h2 plays the role of g in my explanation above. C:\fakepath\Screenshot (126).pngC:\fakepath\Screenshot (123).png

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2021-06-02 23:23:33 +0100

tmonteil gravatar image

Some data is missing to reproduce your context. So let me simulate one:

Your symbolic function:

sage: var('w,x,y')
(w, x, y)
sage: g = w+2*x+y^2
sage: g
y^2 + w + 2*x
sage: g.parent()
Symbolic Ring

Your polynomial ring:

sage: R.<w,x,y,z>=QQ[]

You can directly convert the symbolic expression as an element of the ring:

sage: R(g)
y^2 + w + 2*x
sage: R(g).parent()
Multivariate Polynomial Ring in w, x, y, z over Rational Field

If you have a polynomial with less variables, it is also doable:

sage: g.polynomial(QQ)
y^2 + w + 2*x
sage: g.polynomial(QQ).parent()
Multivariate Polynomial Ring in w, x, y over Rational Field
sage: R(g.polynomial(QQ))
y^2 + w + 2*x
sage: R(g.polynomial(QQ)).parent()
Multivariate Polynomial Ring in w, x, y, z over Rational Field
edit flag offensive delete link more

Comments

Great thanks.

whatupmatt gravatar imagewhatupmatt ( 2021-06-03 07:31:58 +0100 )edit
0

answered 2021-06-02 23:22:47 +0100

rburing gravatar image

You can do conversion:

R(g)

or

g = R(g)

However it is often better to avoid the symbolic ring altogether, if possible.

edit flag offensive delete link more

Comments

Great thanks.

whatupmatt gravatar imagewhatupmatt ( 2021-06-03 07:32:08 +0100 )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: 2021-06-02 22:23:39 +0100

Seen: 270 times

Last updated: Jun 02 '21