Ask Your Question
0

list_plot number field elements

asked 2016-06-17 21:00:51 +0100

I'm working in, say, K.<x>=QuadraticField(-5,embedding=sqrt(5)*I) and I create a list L of elements of K. I try list_plot(L) and get a pile of errors, recursion depth something something. I try to convert types first, using complex_embedding() or numerical_approx(), but it won't convert, even thought something like x.complex_embedding() works just fine.

Basically type converting in number fields is the bane of my existence and makes Sage absolutely worthless to me.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-06-18 20:34:06 +0100

slelievre gravatar image

Try using points instead of list_plot, as in the following example.

sage: K.<x> = QuadraticField(-5, embedding=sqrt(5)*I)
sage: L = [K.random_element() for _ in xrange(10)]
sage: L
[-7*x - 4, -2*x + 1, 1, -x - 6, x - 11, -x - 4, -x, -2, -2*x + 11, x - 1]
sage: points(L)
Launched png viewer for Graphics object consisting of 1 graphics primitive
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: 2016-06-17 21:00:51 +0100

Seen: 185 times

Last updated: Jun 18 '16