Ask Your Question

Plotting polynomials defined over a number field

asked 2019-10-30 16:50:29 +0100

ConfusedMark gravatar image

I have an element of a polynomial ring over a number field K. It's a pretty benign number field -- I have just adjoined a square root of 3, called 't'.

I want to be able to plot the polynomial (specifically, it's a polynomial of two variables, and I want an implicit plot of where it vanishes). How do I get Sage to coerce 't' to a real number and draw the plot? Of course this should involve fixing an embedding of my number field into RR, but it's just a square root, so this shouldn't be hard.

For a minimal example:

K.<t> = NumberField(w^2-3)
R = PolynomialRing(K,2,'x,y')
f = y - t*x

It (quite understandably) chokes with "TypeError: Unable to coerce -t to a rational". I would like to coerce t to be the positive real square root of 3 and draw the plot.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-10-30 17:04:37 +0100

rburing gravatar image

You have the right idea: do f.change_ring(R) with the argument R set to one of K.embeddings(RR):

K.<t> = NumberField(w^2-3)
R.<x,y> = PolynomialRing(K)
f = y - t*x

You might also like:

implicit_plot(f.change_ring(K.embeddings(RR)[0]),(x,-3,3),(y,-3,3), color='blue') + implicit_plot(f.change_ring(K.embeddings(RR)[1]),(x,-3,3),(y,-3,3), color='red')
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2019-10-30 16:50:29 +0100

Seen: 66 times

Last updated: Oct 30 '19