From octave-sources-request at bevo dot che dot wisc dot edu Thu Jan 11 03:49:02 2001 Subject: Re: improved/corrected dot.m From: Rolf Fabian To: "'Dirk Laurie'" Cc: "'octave-sources UWISC'" Date: Thu, 11 Jan 2001 10:45:30 +0100 Dirk Laurie wrote >From the mathematical point of view, the dot product of two >column vectors A and B can only be A'*B. This is because the >relationship dot(A,A) == norm(A)^2 needs to be satisfied. >It is not a Matlab peculiarity to define it that way, rather >Matlab defines it thus because the inventor of Matlab is a >mathematician. IMHO it is misleading and dangerous to have >a routine dot.m that could possibly give A.'*B instead. >I would strongly prefer a separate routine with a different >name for the latter case, e.g. udot.m for "unconjugated dot". 1) I insist on my previous statement, that the dot product z = dot( x, y ) in unitary space as a hermitian bilinear form can be DEFINED in TWO different flavours. (A) One possibility defines a complex conjugation to the SECOND argument y z2 = SUM x(k) * conj(y(k)) whereas the second possibility defines a complex conjugation to the FIRST argument (B) z1 = SUM conj(x(k)) * y(k) In euclidian space( real x,y vectors ) there's no difference between modes (A) and (B), because conj(x)==x and conj(y) ==y . But for complex vectors (unitary space), the two results z1,z2 according to the definitions above differ by a complex conjugation operation, i.e. z2 = conj ( z1 ) 2) MOST standard textbooks I've consulted , e.g. [1] S. Lipschutz, 'Linear Algebra' Schaum (English) [2] Kowalski, 'Linear Algebra' DeGruyter (German) ( to reference only two of them ) DEFINE the dot product in unitary space according to (A), i.e. complex conjugation of the second argument. In contrast, Matlab defines it according to definition (B), giving preference to complex conjugation of the 1st argument. This is also legal, but less common and may lead to confusion ( as we can see). 3) The relationship dot(x,x) ==norm( x )^2 always holds, no matter whether 'dot' is defined according to (A) -or- (B). My version of the dot-function ( uploaded to Octave sources list ) enables switching between those two possible modes of definition. This function always applies a complex conjugation to one of the arguments, either to the first -or- to the second according to selected mode. Thus, your statement > IMHO it is misleading and dangerous to have > a routine dot.m that could possibly give A.'*B instead. is completely wrong, because the function NETHER returns an > > "unconjugated dot" > result. I can't see how you come to such a conclusion. Furthermore, I suggest to you to consult a linear algebra textbook ( I recommend reference [1] ) to get more familiar with the problem before setting up such peculiar statements as cited in the intro above Rolf ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------