psi4 / psi4

Open-Source Quantum Chemistry – an electronic structure package in C++ driven by Python
http://psicode.org
GNU Lesser General Public License v3.0
974 stars 446 forks source link

SAPT: Matrix is not SPD #1682

Open JonathonMisiewicz opened 5 years ago

JonathonMisiewicz commented 5 years ago

Transferred from forums. Awaiting a more complete report from user, but we can say some things already.

A user is told that one of their matrices is not "SPD" during an open-shell SAPT0 computation, and the computation quits. The relevant lines in the code are here. I assume SPD is short for semi-positive definite.

Action Items: First, we need SAPT developers to translate the error message. Without that, the fix could be anything from writing an error message that tells the user what if anything they can do, or it could involve a change in the USAPT logic.

dgasmith commented 5 years ago

Not completely sure this is fixable besides using a different basis or tuning the overlap tolerance in the SCF. You can suggest a user changing the s_tolerance, but beyond that we cannot really reproduce or do much about it.

JonathonMisiewicz commented 5 years ago

Right, without more information, the most I'm expecting is to update the error message with something that makes clear whether this is something the user can fix by changing settings as well as what the problem is.

jgonthier commented 5 years ago

Hello everyone, So this is for a DFT-SAPT computation I'm assuming? I'm less familiar with this code, but in Hartree-Fock based SAPT this error indicates that the orbital hessian has a negative eigenvalue, i.e. the SCF did not converge on a minimum. This would usually be solved by doing a stability analysis on the SCF before passing the correct solution to SAPT.

The advanced example in the manual shows how to do that, and has the stability analysis included for monomer A in the Hartree-Fock case. Not sure any of that works for DFT.

I believe the array s in the incriminated lines contains the product of the orbital hessian with the amplitudes. I haven't touched the code in some time so I may be wrong but that is my current hypothesis.

JonathonMisiewicz commented 5 years ago

We now have a reproducible example of the problem! As @jgonthier suspected, this indicates a negative eigenvalue in the orbital hessian. The following input will run into the problem. Stability analysis indicates a tiny negative eigenvalue in the MO hessian. When you follow the instability, SAPT completes with no problems.

The error message should be rewritten to suggest the user adds stability following. If we want to collect pathological test cases for future SCF work, we should also recommend they post their failing inputs on the forums.

molecule {
0 1
C         -1.39179       -0.20044        0.00015
Cl        -0.43716        1.29883        0.00009
F         -1.08662       -0.91763        1.08111
F         -1.08730       -0.91729       -1.08123
H         -2.44780        0.05805        0.00053
--
0 2
Cl         2.22327       -0.26007       -0.00012
}

set {
basis 6-311++G**
reference uhf
soscf true
soscf_max_iter 30
}

energy('sapt0')