Jose,<div>sbaij is for symmetric matrix, not Hermitian, as you noticed.</div><div><br></div><div>Petsc does not have support for Hermitian operations for Cholesky solve yet.</div><div>We need MatSolve_SeqSBAIJ_1_Hermitian().</div>
<div><br></div><div>Hong</div><div><br><div class="gmail_quote">On Wed, Jul 25, 2012 at 3:08 PM, 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">In complex arithmetic, Cholesky requires a complex Hermitian positive definite matrix, right?<br>
<br>
$ ./ex10 -f $PETSC_DIR/share/petsc/datafiles/matrices/hpd-complex-int32-float64 -ksp_type preonly -pc_type lu<br>
Number of iterations =   1<br>
Residual norm < 1.e-12<br>
<br>
$ ./ex10 -f $PETSC_DIR/share/petsc/datafiles/matrices/hpd-complex-int32-float64 -ksp_type preonly -pc_type cholesky<br>
Number of iterations =   1<br>
Residual norm 1.64361<br>
<br>
The second run gives a wrong solution. I guess I should run with SBAIJ:<br>
<br>
$ ./ex10 -f $PETSC_DIR/share/petsc/datafiles/matrices/hpd-complex-int32-float64 -ksp_type preonly -pc_type cholesky -mat_type sbaij<br>
Number of iterations =   1<br>
Residual norm < 1.e-12<br>
<br>
Ok. The thing is that this latter run is not solving the system that I intended to, i.e., the matrix is not the same as in the first run. If I add -mat_view_matlab I can see that the matrix is not complex Hermitian but complex symmetric, because SBAIJ only reads the upper triangular part and assumes that the matrix is symmetric. If I add MatSetOption(A,MAT_HERMITIAN,PETSC_TRUE) after MatLoad as hinted in the MATSEQSBAIJ manpage, I get a bad residual:<br>

<br>
$ ./ex10 -f $PETSC_DIR/share/petsc/datafiles/matrices/hpd-complex-int32-float64 -ksp_type preonly -pc_type cholesky -mat_type sbaij<br>
Number of iterations =   1<br>
Residual norm 1.64361<br>
<br>
... and -mat_view_matlab does not show a complex Hermitian matrix either.<br>
<br>
I am a bit confused. Am I doing something wrong? Or is there a bug somewhere?<br>
<span class="HOEnZb"><font color="#888888"><br>
Jose<br>
<br>
</font></span></blockquote></div><br></div>