Yichao is right, you cannot give eigenvectors an orientation; A good way to think of them is as defining linear subspaces.
So what is unique is the projector v\|v| \otimes v/|v| or in the case of multiple e-vals the projector onto the eigenspace \sum v_i \otimes v_i. But never the e-evecs themselves. On Saturday, 10 September 2016 17:20:25 UTC+1, Stuart Brorson wrote: > > Just a question from a non-mathematician. Also, this is a math > question, not a Julia/Matlab question. > > I agree that Matlab and Julia are both correct -- within the > definitions of eigenvector and eigenvalue they compute, it's OK that > one eigenvector differes between the two by a factor -1. They're > probably calling the same library anyway. > > However, from a physics perspective, this bugs me. In physics, an > important feature of a space is its orientation. For example, > physics and engineering undergrads learn early on about about the > "right-hand rule" for taking cross products of vectors. This type of > product imposes an orientation (or chirality) on the vector space > under consideration. Real mathematicians may be familiar with > the wedge product in exterior algebra, which (I belive) also imposes > an orientation on a vector space. Wikipedia says: > > https://en.wikipedia.org/wiki/Orientation_(vector_space) > > The problem I have with Julia and Matlab returning a set of > eigenvectors where only one eigenvector is the negative of the other > is that the two eigenvector sets span spaces of opposite > orientation, so the returns are -- in some sense -- not the same. > > So my question: Is there anything like a set of "oriented" > eigenvectors? Is this even possible? Or am I totally wrong, and > the two different sets of eigenvectors span the same space independent > of concerns about orientation? > > Stuart > > > > > On Sat, 10 Sep 2016, Tracy Wadleigh wrote: > > > Looks good to me. The eigenvalues look the same up to the precision > shown > > and eigenvectors are only unique up to a scalar multiple. > > > > On Sep 10, 2016 8:11 AM, "Dennis Eckmeier" < > > dennis....@neuro.fchampalimaud.org <javascript:>> wrote: > > > >> Hi! > >> > >> Here is a simple example: > >> > >> *Matlab:* > >> (all types are double) > >> covX(1:4,1:4) > >> > >> 1.0e+006 * > >> > >> 3.8626 3.4157 2.4049 1.2403 > >> 3.4157 3.7375 3.3395 2.3899 > >> 2.4049 3.3395 3.7372 3.4033 > >> 1.2403 2.3899 3.4033 3.8548 > >> > >> [V,D] = eig(covX(1:4,1:4)) > >> > >> V = > >> > >> 0.2583 0.5402 -0.6576 0.4571 > >> -0.6622 -0.4518 -0.2557 0.5404 > >> 0.6565 -0.4604 0.2552 0.5403 > >> -0.2525 0.5404 0.6611 0.4551 > >> > >> > >> D = > >> > >> 1.0e+007 * > >> > >> 0.0006 0 0 0 > >> 0 0.0197 0 0 > >> 0 0 0.3010 0 > >> 0 0 0 1.1978 > >> > >> > >> > >> *Julia:* > >> (all types are Float 64) > >> *D = * > >> *5759.7016...* > >> *197430.4962...* > >> *3.0104794 ... e6* > >> *1.1978 ... e7* > >> > >> V = > >> 0.2583 0.5402 -0.6576 *-0.4571* > >> -0.6622 -0.4518 -0.2557 *-0.5404* > >> 0.6565 -0.4604 0.2552 *-0.5403* > >> -0.2525 0.5404 0.6611 *-0.4551* > >> > >> cheers, > >> > >> D > >> > >> > >> On Saturday, September 10, 2016 at 12:48:17 PM UTC+1, Michele Zaffalon > >> wrote: > >>> > >>> You mean they are not simply permuted? Can you report the MATLAB and > >>> Julia results in the two cases for a small covX matrix? > >>> > >>> On Sat, Sep 10, 2016 at 1:34 PM, Dennis Eckmeier < > >>> dennis....@neuro.fchampalimaud.org> wrote: > >>> > >>>> Hi, > >>>> > >>>> I am new to Julia and rather lay in math. For practice, I am > translating > >>>> a Matlab script (written by somebody else) and compare the result of > each > >>>> step in Matlab and Julia. > >>>> > >>>> The Matlab script uses [V,D] = eig(covX); > >>>> > >>>> which I translated to Julia as: (D,V) = eig(covX) > >>>> > >>>> However, the outcomes don't match, although covX is the same. > >>>> > >>>> D. > >>>> > >>>> > >>>> > >>> > > >