sage: u=vector([2+3*I,5+2*I,-3+I]) sage: v=vector([1+2*I,-4+5*I,0+5*I]) sage: p1=u*v;p1.expand() 9*I - 39 sage: p2=u.inner_product(v);p2.expand() 9*I - 39 sage: p3=u.dot_product(v);p3.expand() 9*I - 39 sage: p4=u.inner_product(vector([i.conjugate() for i in v]));p4.expand() 3 - 19*I
Am I right in the assumption that for the inner product of two complex vectors, the result should be the sum of the element wise multiplication of the element of the first vector times the complex conjugate of the element of the second vector? I had to do this by hand, as you can see for p4. I had a look at Mathematica, and it seems like they don't do it either. So I might be wrong. Another thing: sage: parent(p1) Symbolic Ring sage: parent(u) Vector space of dimension 3 over Symbolic Ring is it meant to be over symbolic Ring? and one more: sage: k=vector([complex(1,2),complex(3,4),complex(25,15)]) Traceback (most recent call last): ... TypeError: unable to find a common ring for all elements seriously? why that? sage: u=vector(CC,[complex(1,2),complex(3,4),complex(25,15)]);u (1.00000000000000 + 2.00000000000000*I, 3.00000000000000 + 4.00000000000000*I, 25.0000000000000 + 15.0000000000000*I) And now I've got creepy precision stuff in there. And the inner product still doesn't do what I'd like it to. Does a complex number from CC constructed by complex(<re>,<im>) have as resulting real and imaginary part have elements from RR? What's the difference between RR and QQ anyway? QQ is arbitrary precision, does RR use machine precision maybe? Now maybe I've asked too many questions, but I've had no luck with the reference manual so far (maybe I just don't get the explanations in there...). I know that today there's the big AMS meeting (good luck for that), so no need to hurry in order to reply for anyone. And excuse my English, there maybe some mistakes since I'm in a rush... Thanks a lot, Fabio --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@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-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---