bug in cp_fm_invert ?
Hanning Chen
chenh... at gmail.com
Wed Nov 24 07:05:33 UTC 2010
Dear CP2k developers,
I used subroutine "cp_fm_invert" to calculate the determinant and the
inverse of a matrix, and found that sometimes there is a discrepancy on the
sign of determinant. For example, both MATLAB and GSL gave 0.985956424462
for the following 12x12 matrix in agreement with CP2k. However, on the 11x11
matrix, CP2k's solution of -0.167690021767 is opposite to the correct answer
of 0.167690021767.
I am wondering what "cp_fm_invert" actually calculates, or is it a
possible bug?
Thanks.
Hanning Chen
Department of Chemistry
Northwestern University
Evanston, IL 60208 .
12x12 Matrix:
0.999199 -0.000672 0.000280 -0.000199 0.000109 0.000631 0.000253 -0.001142
-0.000124 0.000693 0.002188 0.001618
0.000663 0.999305 0.000027 0.001681 0.002113 0.000150 0.001346 0.001019
-0.001870 -0.002973 -0.002747 -0.000586
0.000393 0.000051 0.999509 0.000319 0.000077 -0.000148 0.000330 0.000475
-0.000365 -0.000596 -0.000727 -0.000258
-0.000697 -0.001284 0.000246 0.999205 -0.000497 0.001035 0.000528 -0.002163
-0.000202 0.001603 0.004558 0.003429
-0.001479 -0.001894 0.000813 -0.000757 0.998991 0.001442 0.000495 -0.003395
0.000079 0.002597 0.006290 0.004653
-0.000765 0.000279 0.000209 -0.001416 -0.001597 0.999530 -0.001164 -0.001024
0.001694 0.002543 0.002156 0.000355
-0.001398 -0.000534 0.000395 -0.002065 -0.002184 0.000651 0.998659 -0.002636
0.001748 0.004101 0.005792 0.002838
0.000005 -0.001615 0.000392 0.001506 0.002156 0.001101 0.002075 0.998868
-0.002404 -0.002069 0.000952 0.002395
0.001943 0.001060 -0.000682 0.002348 0.002288 -0.001045 0.000926 0.003703
0.997828 -0.004828 -0.007578 -0.004153
0.001610 0.002764 -0.000875 0.000422 0.000141 -0.002073 -0.001358 0.004145
0.001031 0.997477 -0.008057 -0.006371
-0.000906 0.003813 -0.000284 -0.004163 -0.005091 -0.002425 -0.005616
0.001218 0.006627 0.005908 0.998421 -0.005509
-0.001534 0.002024 -0.000007 -0.004128 -0.004912 -0.001126 -0.004233
-0.001146 0.005358 0.006780 0.003616 0.998459
11x11 Matrix:
0.959602 -0.028013 0.030147 -0.022069 -0.073733 -0.003573 -0.019387
-0.068397 0.051648 0.094577 0.085067
-0.029391 0.978389 0.022461 -0.017467 -0.055452 -0.000449 -0.014748
-0.050543 0.039101 0.070648 0.061971
0.030718 0.021680 0.975750 0.018031 0.057802 0.002701 0.015084 0.054095
-0.042206 -0.073863 -0.066378
-0.022619 -0.014997 0.016342 0.986592 -0.039914 -0.005875 -0.009658
-0.037342 0.027425 0.047091 0.047450
-0.077915 -0.054333 0.058828 -0.045723 0.854288 -0.004938 -0.037919
-0.132490 0.101722 0.181213 0.163345
-0.001933 -0.003550 0.001547 0.002798 -0.005498 0.998936 -0.005081 -0.005224
0.006538 0.008079 0.008798
-0.019817 -0.013630 0.015114 -0.012611 -0.037144 0.002330 0.989544 -0.031761
0.023120 0.046730 0.038984
-0.068450 -0.048605 0.051127 -0.039863 -0.129351 -0.004394 -0.035990
0.881004 0.095143 0.159551 0.146483
0.056884 0.039437 -0.041209 0.033939 0.105766 0.001131 0.030483 0.092134
0.925001 -0.122981 -0.115925
0.090775 0.063626 -0.068649 0.057393 0.173166 0.004885 0.045038 0.160300
-0.130325 0.782704 -0.193978
0.079091 0.056981 -0.059929 0.045185 0.150758 0.002755 0.042173 0.137141
-0.108773 -0.189918 0.829109
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20101124/961aba67/attachment.htm>
More information about the CP2K-user
mailing list