qcscine / sparrow

https://scine.ethz.ch
BSD 3-Clause "New" or "Revised" License
78 stars 15 forks source link

Non-symmetric Hessian matrix #3

Closed Jellby closed 4 years ago

Jellby commented 4 years ago

I'm getting a Hessian matrix that deviates from symmetric more than I'd consider healthy. Is this reasonable? If the accuracy is worse than 1e-6 (is it using single precision?), maybe the values should be reported accordingly?

Note e.g. the elements 1,2 and 2,1:

2.923406e-06 != -1.248019e-15

   2

 O     0.00000000     0.00000000     0.32845461
 H    -0.80293794     0.00000000    -0.16422730
Program call:  sparrow -x OH.xyz -c -1 -G -H -N
Method:                  PM6
Calculation Modus:       Spin-restricted formalism
Molecular charge:        -1
Spin multiplicity:       1
Convergence threshold:   1e-05 hartree
Max Iterations:          100
Convergence accelerator: diis
Parameters:             Resources/Pm6/parameters.xml

================================================================================
Calculation: 

Energy [hartree]:
-11.19363863

Gradients [hartree/bohr]:
                        1              2              3
         1   2.274519e-02   4.978353e-17   1.395642e-02
         2  -2.274519e-02  -4.978353e-17  -1.395642e-02

Hessian [hartree/bohr^2]:
                        1              2              3              4              5
         1   1.518872e-01   2.923406e-06   8.374429e-02  -1.518657e-01   2.923406e-06
         2  -1.248019e-15   1.539823e-02  -5.442137e-15   1.818960e-16  -1.539823e-02
         3   8.373304e-02   1.793799e-06   6.678640e-02  -8.371946e-02   1.793799e-06
         4  -1.518872e-01  -2.923406e-06  -8.374429e-02   1.518657e-01  -2.923406e-06
         5   1.248019e-15  -1.539823e-02   5.442137e-15  -1.818960e-16   1.539823e-02
         6  -8.373304e-02  -1.793799e-06  -6.678640e-02   8.371946e-02  -1.793799e-06

                        6
         1  -8.372811e-02
         2   2.881844e-15
         3  -6.678190e-02
         4   8.372811e-02
         5  -2.881844e-15
         6   6.678190e-02

================================================================================

Total job duration: 1026 milliseconds.

End: Tue Dec 17 16:41:42 2019
francesco-bosia commented 4 years ago

Hi! Many thanks for your report. In the next release we are including progresses related to numerical stability.

Furthermore, this particular issue can be probably mitigated by tightening the scf convergence threshold for the single point calculations (the Hessian matrix is calculated from finite differences in the analytical gradients, so the scf convergence threshold has a big impact on it).

Try using the option -t 1e-9 to tighten the threshold to 1e-9. From your output and program call it seems that 1e-5 (the standard value) was used. Smaller deviations from symmetry can then be expected.

Thanks again,

Francesco

francesco-bosia commented 4 years ago

At any rate, this issue is solved in the next release of Sparrow.

Many thanks for your input!

weymutht commented 4 years ago

In the newly available version 2.0.0 of Sparrow, Hessian matrices get explicitly symmetrized such that situations like this one should no longer occur. Therefore, I'm closing this issue.