Ask Your Question
1

Plotting polynomials defined over a number field

asked 2019-10-30 10:50:29 -0600

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:

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

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
2

answered 2019-10-30 11:04:37 -0600

rburing gravatar image

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

var('w')
K.<t> = NumberField(w^2-3)
R.<x,y> = PolynomialRing(K)
f = y - t*x
implicit_plot(f.change_ring(K.embeddings(RR)[0]),(x,-3,3),(y,-3,3))

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

Stats

Asked: 2019-10-30 10:50:29 -0600

Seen: 26 times

Last updated: Oct 30