<div dir="ltr"><div>Hi Jose,<br><br></div>Thanks for the pointers. Here's what I observed on probing it further:<br><br><ol><li>The ||B - B^H|| norm was 1e-18. So I explicitly made it Hermitian by setting B = 0.5(B+B^H). However, this didn't help.</li><li>Next, I checked for the conditioning of B by computing the ratio of the highest and lowest eigenvalues. The conditioning of the order 1e-9. <br></li><li>I monitored the imaginary the imaginary part of VecDot(y,x, dotXY) where y = B*x and noted that only when the imaginary part is more than 1e-16 in magnitude, the error of "The inner product is not well defined" is flagged. For the first few iterations of orhtogonalization (i.e., the one where orthogonization is successful), the values of VecDot(y,x, dotXY) are all found to be lower than 1e-16. I guess this small imaginary part might be the cause of the error. <br></li></ol><p>Let me know if there is a way to bypass the abort by changing the tolerance for imaginary part.</p><p><br></p><p>Regards,<br>Bikash<br></p></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 13, 2016 at 4:48 AM, Jose E. Roman <span dir="ltr"><<a href="mailto:jroman@dsic.upv.es" target="_blank">jroman@dsic.upv.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> El 13 oct 2016, a las 5:26, Bikash Kanungo <<a href="mailto:bikash@umich.edu">bikash@umich.edu</a>> escribió:<br>
><br>
> Hi,<br>
><br>
> I facing the following issue. I'm trying to use orthogonalize a set of vectors (all complex) with a non-standard inner product (.i.e. with BVSetMatrix). Let's call the basis vector to be BV and the matrix to be B. After certain number of iterations, I'm getting an error "The inner product is not well defined: nonzero imaginary part". I investigated this further. What I did was obtain the vec (column) which was throwing the error. Let's call the vec to be x and its column ID in BV to be j. I obtained x^H*B*x in two different ways: (1). by first getting y=B*x and then performing VecDot(x,y, dotXY), and (2) by using BVNormColumn(BV, j, NORM_2, normj). I'm doing this check even before calling the BVOrthogonalize routine.<br>
><br>
> In principle, the value from (1) should be the square of the value from (2). For the iterations where I'm successful to perform the orthogonalization this check is satisfied. However, for the iteration where it fails with the above error, the value from (2) is zero. I'm unable to understand why this is the case.<br>
><br>
> Thanks,<br>
> Bikash<br>
<br>
</span>Please note that to compute x^H*y you have to call VecDot(y,x,dot), with y first. Anyway, this does not matter for what you are reporting.<br>
<br>
Probably the call for (2) is aborting due to an error, so it does not return a value. Add CHKERRQ(ierr) after it. In general, it is always recommended to add this to every PETSc/SLEPc call, also in Fortran code (although SLEPc Fortran examples do not have it).<br>
<br>
One possible explanation for the error "The inner product is not well defined" is that the matrix is not exactly Hermitian, that is B^H-B is tiny but not zero. If this is the case, I would suggest explicitly making it Hermitian. Also, things could go bad if matrix B is ill-conditioned.<br>
<span class="HOEnZb"><font color="#888888"><br>
Jose<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div><div><font color="#666666">Bikash S. Kanungo<br></font></div><font color="#666666">PhD Student<br></font></div><font color="#666666">Computational Materials Physics Group<br></font></div><font color="#666666">Mechanical Engineering <br></font></div><font color="#666666">University of Michigan<br><br></font></div></div>
</div>