<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">(Putting back petsc-dev on c/c)<div class="">I don’t think you are the one that needs to do the changes.</div><div class="">There should be clarifications from the PETSc side of things, first.</div><div class="">From the man page your are quoting (<a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATSEQSBAIJ.html" class="">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATSEQSBAIJ.html</a>):</div><div class="">1) how to make a SBAIJ Mat Hermitian but not symmetric? Is this handled by PETSc? Is this legal to do MatSetOption(A, MAT_SYMMETRIC, PETSC_FALSE) followed by MatSetOption(A, MAT_HERMITIAN, PETSC_TRUE)? I think this is the case where bs>1 is not handled internally by PETSc, so for this case it should be OK to error out.</div><div class="">2) “Hermitian symmetric” is a fancy way of saying that the matrix has no imaginary part. Or is just “Hermitian" what is supposed to be written on the page? In which case, how do you tell to PETSc that you are indeed dealing with a matrix with no imaginary part.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Pierre<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 11 Sep 2019, at 11:51 AM, Jose E. Roman <<a href="mailto:jroman@dsic.upv.es" class="">jroman@dsic.upv.es</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Now I understand better. You are right. Maybe I should do some changes in SLEPc. I will think about this next week.<br class=""><br class=""><br class=""><blockquote type="cite" class="">El 11 sept 2019, a las 11:38, Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" class="">pierre.jolivet@enseeiht.fr</a>> escribió:<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On 11 Sep 2019, at 11:21 AM, Jose E. Roman <<a href="mailto:jroman@dsic.upv.es" class="">jroman@dsic.upv.es</a>> wrote:<br class=""><br class="">In <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATSEQSBAIJ.html" class="">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATSEQSBAIJ.html</a> it says "To make it Hermitian symmetric you can call MatSetOption(Mat, MAT_HERMITIAN);" So my understanding is that in SBAIJ assumes MAT_SYMMETRIC and the user must set MAT_HERMITIAN if desired.<br class=""></blockquote><br class="">Right, that is exactly what you do in STMatSetHermitian. You get from the user a SBAIJ matrix (so SYMMETRIC = true), and you set yourself HERMITIAN = true.<br class=""><br class=""><blockquote type="cite" class="">I don't think it makes sense to set both MAT_HERMITIAN and MAT_SYMMETRIC.<br class=""></blockquote><br class="">Why? A symmetric (or Hermitian) matrix with no imaginary part is both Hermitian and symmetric, so at least this set of options defines correctly the structure of the matrix (which is not the case if you only assume it is _either_ symmetric or Hermitian).<br class=""><br class=""><blockquote type="cite" class="">But I may be wrong because I find this part of PETSc very confusing.<br class=""><br class=""><br class=""><blockquote type="cite" class="">El 11 sept 2019, a las 11:08, Jose E. Roman <<a href="mailto:jroman@dsic.upv.es" class="">jroman@dsic.upv.es</a>> escribió:<br class=""><br class="">Do you mean setting both flags MAT_HERMITIAN and MAT_SYMMETRIC? Is this possible?<br class=""></blockquote></blockquote><br class="">It was possible before my commit for bs == 1, but not for bs > 1.<br class=""><br class="">At least now my tests are not failing.<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">El 11 sept 2019, a las 11:04, Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" class="">pierre.jolivet@enseeiht.fr</a>> escribió:<br class=""><br class="">Symmetric <=> a_ij = a_ji<br class="">Hermitian <=> a_ij = conj(a_ji)<br class=""><br class="">Symmetric + Hermitian <=> a_ij = conj(a_ji) = a_ji <=> imag(a_ji) = 0 \forall ij<br class=""><br class="">Or am I stupid?<br class=""><br class=""><blockquote type="cite" class="">On 11 Sep 2019, at 10:59 AM, Jose E. Roman <<a href="mailto:jroman@dsic.upv.es" class="">jroman@dsic.upv.es</a>> wrote:<br class=""><br class="">Not sure if I understand you. Do you mean that a complex SBAIJ Mat with MAT_HERMITIAN flag can be assumed to have zero imaginary part? I don't think so. This matrix should have real diagonal entries, but off-diagonal entries should be allowed to have nonzero imaginary part. This is what is done in MatMult_SeqSBAIJ_1_Hermitian(), where off-diagonal entries are conjugated when used for the strict lower triangular part. So I guess the right fix is to implement MatMult_SeqSBAIJ_2_Hermitian(), MatMult_SeqSBAIJ_3_Hermitian() and so on with appropriate use of PetscConj().<br class=""><br class="">Jose<br class=""><br class=""><blockquote type="cite" class="">El 11 sept 2019, a las 10:36, Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" class="">pierre.jolivet@enseeiht.fr</a>> escribió:<br class=""><br class="">Nevermind, this is the wrong fix.<br class="">The proper fix is in PETSc. It should not error out if the matrix is also symmetric.<br class="">Indeed, complex symmetric Hermitian => complex with no imaginary part.<br class="">Thus all operations like MatMult, MatMultHermitianTranspose, Cholesky… will work for bs > 1, since all is filled with zeroes.<br class="">I will take care of this, I’m c/c’ing petsc-dev so that they don’t have to “reverse engineer” the trivial change to MatSetOption_SeqSBAIJ.<br class=""><br class="">Sorry about the noise.<br class=""><br class="">Thank you,<br class="">Pierre<br class=""><br class=""><blockquote type="cite" class="">On 10 Sep 2019, at 8:37 AM, Pierre Jolivet <<a href="mailto:pierre.jolivet@enseeiht.fr" class="">pierre.jolivet@enseeiht.fr</a>> wrote:<br class=""><br class="">Hello,<br class="">Could you consider not setting MAT_HERMITIAN here <a href="http://slepc.upv.es/documentation/current/src/sys/classes/st/interface/stsles.c.html#line276" class="">http://slepc.upv.es/documentation/current/src/sys/classes/st/interface/stsles.c.html#line276</a> when using SBAIJ matrices with bs > 1?<br class="">This makes PETSc error out with<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>[1]PETSC ERROR: No support for this operation for this object type<br class="">#<span class="Apple-tab-span" style="white-space:pre"> </span>[1]PETSC ERROR: No support for Hermitian with block size greater than 1<br class=""><br class="">The change does not bring any regression, since PETSc is always giving an error without it, but on the contrary, it improves the range of applicability of SLEPc, e.g., for complex Hermitian problems with SBAIJ matrices and bs > 1 that _don’t_ require the flag MAT_HERMITIAN set to true.<br class=""><br class="">Thanks,<br class="">Pierre<br class=""></blockquote><br class=""></blockquote><br class=""></blockquote><br class=""></blockquote><br class=""></blockquote><br class=""></blockquote><br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div></body></html>