From: Linda Davis on
please forget my last post - I didn't use the complex conjugate transpose for multiplying the matrix with complex numbers in it: someday I *will* learn to read!
From: Roger Stafford on
"Linda Davis" <linda.l.davis.removethis(a)jpl.nasa.gov> wrote in message <i10g08$ei8$1(a)fred.mathworks.com>...
> Ok, so I'm reviewing my math in order to get up to speed with what I want to do in MatLab. I'm using a couple of self-teaching books, making sure I go from beginning to end, so that I don't drown when doing the programming I need to do. I've stumbled with something simple and feel stupid. I'm given a column vector with imaginary numbers; I'm learning to use the dot product for a matrix with imaginary numbers. I am really, really rusty with respect to "i" and using "i." I know i^2=-1
> No sweat in MatLab getting the same answer as in the guides I am learning from; however, when try to multiply the matrix by itself, I cannot get the same answer (I can't get rid of i). So here's the deal:
> u=[-i; 1+i; 4+4*i]
> dot(u,u)
> ans = 35 - so says the text and my work in MatLab
> but, I I just try to multiply this out myself to check the work, I get -1 + 32i
> (-i*(-i)) + (1+i)*(1+i) + (4+4*i)*(4+4*i) =
> -1 +(1+2i -1) +(16 + 32i -16) =
> -1 + 32i
> What the devil am I doing wrong? Why won't my simple multiplication match the dot(u,u)?
> many thanks
> Linda
- - - - - - -
Check out this Wikipedia website on inner product vector spaces:

http://en.wikipedia.org/wiki/Inner_product_space

In Euclidean vector spaces over the complex field, the dot product, which is a special kind of inner product, is always defined in terms of complex conjugates as Matt has indicated.

Roger Stafford
From: James Tursa on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <i10gmo$t6q$1(a)fred.mathworks.com>...
> In steps:
>
> A = [-i;1+i;4+4i]
> Ac = conj(A)
> P = A.*Ac
> dot(A,A)==sum(P)

For the symmetric case you can put the conjugate on either argument and get the same result, but since the comparison is to dot a better example would have been:

P = Ac.*A

since the dot product conjugates the first argument, not the second.

James Tursa
From: James Tursa on
"Linda Davis" <linda.l.davis.removethis(a)jpl.nasa.gov> wrote in message <i10g08$ei8$1(a)fred.mathworks.com>...
> dot(u,u)

P.S. The dot function in MATLAB is slow for simple dot product calculations. In general you are better off using straight matrix multiplication or my mtimesx tool on the FEX. e.g., for a column vector u:

u'*u % is faster and more accurate than dot(u,u)
mtimesx(u,'c',u,'speed') % is also faster and more accurate than dot(u,u)

James Tursa
From: Linda Davis on
Many thanks: this will help when I get to the really huge database.

"James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <i10mk7$dr0$1(a)fred.mathworks.com>...
> "Linda Davis" <linda.l.davis.removethis(a)jpl.nasa.gov> wrote in message <i10g08$ei8$1(a)fred.mathworks.com>...
> > dot(u,u)
>
> P.S. The dot function in MATLAB is slow for simple dot product calculations. In general you are better off using straight matrix multiplication or my mtimesx tool on the FEX. e.g., for a column vector u:
>
> u'*u % is faster and more accurate than dot(u,u)
> mtimesx(u,'c',u,'speed') % is also faster and more accurate than dot(u,u)
>
> James Tursa