Hi On Thu, Dec 04, 2008 at 11:22:11AM -0600, Jason Grout wrote: > > http://sagenb.org:8000/home/pub/94/ and included some timings there. > Nice. > If you use: > R.<j> = QQ.extension(x^2+1) > then the imaginary number prints as "j" instead of "I", which might make > more sense.
I would like to understand, why does this make more sense? Is it just stylistic? Later in the exercise we wish to work with sqrt(2), e.g., and I'm not sure exactly how j can be used. sage: R.<j> = QQ.extension(x^2+1) sage: type(j) <type 'sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic'> sage: type(R) <class 'sage.rings.number_field.number_field.NumberField_quadratic'> sage: j*2 2*j sage: j*sqrt(2) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/local/src/sage-3.0.2-ubuntu32-intel-i686-Linux/<ipython console> in <module>() /usr/local/src/sage-3.0.2-ubuntu32-intel-i686-Linux/element.pyx in sage.structure.element.RingElement.__mul__ (sage/structure/element.c:8544)() /usr/local/src/sage-3.0.2-ubuntu32-intel-i686-Linux/coerce.pyx in sage.structure.coerce.CoercionModel_cache_maps.bin_op_c (sage/structure/coerce.c:5301)() TypeError: unsupported operand parent(s) for '*': 'Number Field in j with defining polynomial x^2 + 1' and 'Symbolic Ring' versus this, with i: sage: R=QQ[i] sage: type(i) <class 'sage.functions.constants.I_class'> sage: type(R) <class 'sage.rings.number_field.number_field.NumberField_quadratic'> sage: i*sqrt(2) sqrt(2)*I Students are asked to verify that the matrix (which is called u because it is unitary) of orthonormal eigenvectors (which they have computed by hand) diagonalizes the matrix formed with: sage: R.<j> = QQ.extension(x^2+1) sage: m=matrix([[-1,4*j,2],[-4*j,-1,2*j],[2,-2*j,2]]) Here there is a problem, u has elements which are complex and involve sqrt. regards, Jan --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---