When you say "plot these values", do you mean as real or complex values? To do so you need to choose an embedding, e.g.
sage: K.<a> = QQ[sqrt(5)]; K Number Field in sqrt5 with defining polynomial x^2 - 5 sage: K.embeddings(CC) [ Ring morphism: From: Number Field in sqrt5 with defining polynomial x^2 - 5 To: Complex Field with 53 bits of precision Defn: sqrt5 |--> -2.23606797749979, Ring morphism: From: Number Field in sqrt5 with defining polynomial x^2 - 5 To: Complex Field with 53 bits of precision Defn: sqrt5 |--> 2.23606797749979 ] sage: f = K.embeddings(CC)[1] sage: f(a) 2.23606797749979 sage: f(1 + a) 3.23606797749979 sage: f(a^2) 5.00000000000000 If they are actually integral, you can do sage: ZZ(a^2) 5 sage: ZZ(a) ------------------------------------------------------------ Traceback (most recent call last): File "<ipython console>", line 1, in <module> File "parent.pyx", line 804, in sage.structure.parent.Parent.__call__ (sage/structure/parent.c:7228) File "coerce_maps.pyx", line 156, in sage.structure.coerce_maps.NamedConvertMap._call_ (sage/structure/coerce_maps.c:4557) File "number_field_element_quadratic.pyx", line 956, in sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic._integer_ (sage/rings/number_field/number_field_element_quadratic.cpp:8718) TypeError: Unable to coerce sqrt5 to an integer On Wed, Oct 17, 2012 at 10:45 AM, Eric Kangas <[email protected]> wrote: > Hi, > > I am working with eigenvalues, and want to figure out a way to plot these > values as a return map. I am using sage 4.7.2 on a ubuntu 10.10 on a Toshiba > M200 tablet. Do I need to convert the algrbraic number to integers, or is > there a way to plot these values? > > Eric > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > Visit this group at http://groups.google.com/group/sage-support?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support?hl=en.
