Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Plotting polynomials defined over a number field

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.