No matter what the relative phases of the eigenvectors of your first and second solutions are, the magnitude of the inner product will remain unchanged. I do not think there is any meaning in the phase of that inner product. If there was, you could rotate the returned eigenvectors using whatever extra information you have that determines their phase (I am skeptical that there is any).<br>
<br>Jack<br><br><div class="gmail_quote">On Tue, Jan 3, 2012 at 12:48 PM, Dharmendar Reddy <span dir="ltr">&lt;<a href="mailto:dharmareddy84@gmail.com">dharmareddy84@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hello Jack,<br>                 I get what you say. For this specific test case, the Hamiltonian is real hermitian and it can be complex hermitian in some problems that i may work with later on, so i kept the PetscScalar to be complex. I understand that it can be arbitrary and it doesn&#39;t matter as long as i work with magnitudes and inner products. But In my case, i am looking at the following problem:<br>

 A1 psi1 = lambda1 B1 psi1  : problem1<br> A2 psi2 = lambda2  B1 psi2 : problem2<br><br> Where A1 and A2 are different Hamiltonian, since i use the same spatial discretization (B1=B2 here). I am interested in inner products between  eigenvectors of problem1 and problem2. If i use the same solver for problem1 and problem2, as long as the arbitrary phase picked up for eigenvectors of problem1 and problem2 is same, the inner products will be consistent but if the solver picks phase phi1 and phase phi2 (phi1 /= phi2) then i am not sure how to interpret the inner product <br>

<br> innerproduct = psi1^H B1 psi2<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">On Tue, Jan 3, 2012 at 12:07 PM, Jack Poulson <span dir="ltr">&lt;<a href="mailto:jack.poulson@gmail.com" target="_blank">jack.poulson@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dharmendar,<br><br>If your matrix is real, and you want real eigenvectors, you should set PetscScalar to be real. I&#39;m sure that you are aware that the phase of eigenvectors is arbitrary; there is no reason to assume that a complex eigensolver would pick out a purely real eigenvector when it exists.<span><font color="#888888"><br>


<br>Jack</font></span><div><div><br><br><div class="gmail_quote">On Tue, Jan 3, 2012 at 11:55 AM, Dharmendar Reddy <span dir="ltr">&lt;<a href="mailto:dharmareddy84@gmail.com" target="_blank">dharmareddy84@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I use EPS_GHEP and PetscScalar is complex. I am wondering why i see this result. <br>You can see from the eigenvectors in the previous email that the magnitudes of the components match. For the lapack/matlab solution the phase is pi (180 degres)  for each component where as for defualt or arpack method phase is 56.53 degrees for each component. I will prepare a test case and email the code. <br>



<br>thanks<span><font color="#888888"><br>Reddy</font></span><div><div><br><br><div class="gmail_quote">On Tue, Jan 3, 2012 at 1:59 AM, Jose E. Roman <span dir="ltr">&lt;<a href="mailto:jroman@dsic.upv.es" target="_blank">jroman@dsic.upv.es</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br>
On 03/01/2012, Dharmendar Reddy wrote:<br>
<br>
&gt; Hello,<br>
&gt;          I have a query regarding the eigenvectors computed in slepc. I am solving a genralized eigenvalue problem. I have attached the A and B matrices with this email.  If i run slepc solver with default options are arpack, i get one set of vectors (complex) as solution. If i run with eps_type lapack I get real vectors. A is hermitian, and B is positive definite. ( the actual problem is a schrodinger equation for particle in infinite potential well, so the solution will be of the form sin(x)). I check the solution in matlab using eig(A,B) i get real vectors. Looks like there is some unitary transformation involved here, can you tell me what could be going on.<br>





&gt;<br>
&gt; i copy a small portion of the eigen vector of the lowest magnitude eigenvlaue (=0.0887)<br>
&gt; ---Method: (slepc and eps_type lapack) or matlab-----<br>
&gt; (-0.101596582735892,0.000000000000000E+000)<br>
&gt;  (-0.200421875537261,0.000000000000000E+000)<br>
&gt;  (-0.293780182034781,0.000000000000000E+000)<br>
&gt;  (-0.379124930994127,0.000000000000000E+000)<br>
&gt;  ...<br>
&gt;  ...<br>
&gt;  ...<br>
&gt;   (-0.293780182033444,0.000000000000000E+000)<br>
&gt;  (-0.200421875536298,0.000000000000000E+000)<br>
&gt;  (-0.101596582735387,0.000000000000000E+000)<br>
&gt; ------------------------------------------------------------------------------<br>
&gt; ---Method: (slepc and eps_type defualt or arpack) ----<br>
&gt;<br>
&gt;<br>
&gt;   (5.602609025416389E-002,8.475224384072830E-002)<br>
&gt;  (0.110523934800485,0.167192667375096) (0.162006974547097,0.245072510835553)<br>
&gt;  (0.209070886310831,0.316267414979582) (0.250431889351034,0.378835368586700)<br>
&gt;  (0.284961763219882,0.431069680779720) (0.311718623092706,0.471545535910556)<br>
&gt;  (0.329972611445050,0.499158857936955) (0.339225807211469,0.513156427631836)<br>
&gt;  (0.339225807166595,0.513156427588630) (0.329972611486755,0.499158857980068)<br>
&gt;  (0.311718623054404,0.471545535864886) (0.284961763251251,0.431069680822535)<br>
&gt;  (0.250431889322221,0.378835368543795) (0.209070886332945,0.316267415014661)<br>
&gt;  (0.162006974528570,0.245072510805346) (0.110523934811968,0.167192667394530)<br>
&gt;  (5.602609024797538E-002,8.475224382992022E-002)<br>
<br>
</div></div>I cannot reproduce the problem. I always get the correct eigenvector. Are you doing the computation in real arithmetic? Are you setting the problem type to EPS_GHEP?<br>
<span><font color="#888888"><br>
Jose<br>
<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><div><div>-- <br>-----------------------------------------------------<br>Dharmendar Reddy Palle<br>Graduate Student<br>Microelectronics Research center,<br>


University of Texas at Austin,<br>

10100 Burnet Road, Bldg. 160<br>MER 2.608F, TX 78758-4445<br>e-mail: <a href="mailto:dharmareddy84@gmail.com" target="_blank">dharmareddy84@gmail.com</a><br>Phone: <a href="tel:%2B1-512-350-9082" value="+15123509082" target="_blank">+1-512-350-9082</a><br>



United States of America.<br><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>-----------------------------------------------------<br>Dharmendar Reddy Palle<br>Graduate Student<br>Microelectronics Research center,<br>University of Texas at Austin,<br>

10100 Burnet Road, Bldg. 160<br>MER 2.608F, TX 78758-4445<br>e-mail: <a href="mailto:dharmareddy84@gmail.com" target="_blank">dharmareddy84@gmail.com</a><br>Phone: <a href="tel:%2B1-512-350-9082" value="+15123509082" target="_blank">+1-512-350-9082</a><br>
United States of America.<br><br>
</div></div></blockquote></div><br>