Iterations do not converge

I have this input file:

//# ch3cl_acetone scan_0
import numpy as np
memory 50 GB

R1_vals=[3.0]
A2_vals=[180]

table=Table(rows=[‘R’,‘A’], cols=[‘E(Electrostatics)’,‘E(Exchange)’,‘E(Induction)’,‘E(Dispersion)’,‘E(Total Energy)’])

set globals {
basis aug-cc-pvtz
}

set sapt {
freeze_core true
}

for R in R1_vals:
for A in A2_vals:
molecule ch3cl_acetone {
0 1
C -1.45820104 0.54178831 -0.57092078
O -0.25653349 0.28377346 -0.81624384
C -2.40629683 0.98953016 -1.69885766
C -1.95815240 0.50281340 0.88514570
H -3.11460164 1.69186797 -1.31165499
H -1.83852894 1.44962882 -2.48042585
H -2.92450180 0.13818706 -2.08818853
H -2.70944886 1.25184320 1.02445827
H -2.37256634 -0.46125415 1.09427448
H -1.13981081 0.69077117 1.54838692

0 1
Cl 2 R 1 130.0 3 180.0
X 11 1 2 90.0 1 90.0
C 11 1.72357 2 A 1 180.0
H 1.68227857 -0.03766162 -1.72542421
H 3.12124786 0.34284666 -0.81019338
H 2.69381495 -1.32407879 -1.11305854
}
ch3cl_acetone.A=A
ch3cl_acetone.R=R
energy(‘sapt2+3’,molecule=ch3cl_acetone)
Eelst = get_variable(‘SAPT2+3 ELST ENERGY’)
Eexch = get_variable(‘SAPT2+3 EXCH ENERGY’)
Eind = get_variable(‘SAPT2+3 IND ENERGY’)
Edisp = get_variable(‘SAPT2+3 DISP ENERGY’)
ET = get_variable(‘SAPT2+3 TOTAL ENERGY’)
table[R][A] = [Eelst, Eexch, Eind,Edisp,ET]

print(table)
//
which gives me the following error:

//Traceback (most recent call last):
File “/projects/shreya54@colostate.edu/psi4conda/bin/psi4”, line 248, in
exec(content)
File “”, line 56, in
File “/projects/shreya54@colostate.edu/psi4conda/lib//python2.7/site-packages/psi4/driver/driver.py”, line 460, in energy
wfn = procedures[‘energy’][lowername](lowername, molecule=molecule, **kwargs)
File “/projects/shreya54@colostate.edu/psi4conda/lib//python2.7/site-packages/psi4/driver/procrouting/proc.py”, line 3184, in run_sapt
dimer_wfn = scf_helper(‘RHF’, molecule=sapt_dimer, **kwargs)
File “/projects/shreya54@colostate.edu/psi4conda/lib//python2.7/site-packages/psi4/driver/procrouting/proc.py”, line 1330, in scf_helper
e_scf = scf_wfn.compute_energy()

RuntimeError:
Fatal Error: Iterations did not converge.
Error occurred in file: /scratch/psilocaluser/conda-builds/psi4_1495009270718/work/psi4/src/psi4/libparallel/process.cc on line: 194
The most recent 5 function calls were:

psi::PsiException::PsiException(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, char const*, int)
psi::die_if_not_converged()
psi::scf::HF::finalize_E()
psi::scf::HF::compute_energy()
//
What can I do to converge my iterations ?
Thank you

In general, you can try setting SCF damping, use second order convergence methods, or try doing orbital castup. Hard to prescribe without seeing the iterations. Can you post the SCF iterations?

1 Like

Yeah it looks like setting:

soscf_max_iter 35
basis_guess true
damping_percentage 40

Will get you there.

1 Like

Thank you for your reply
Can you tell me how do you decide these values soscf_max_iter & damping_percentage ?

Trial and error mostly. For the damping it’s probably a bit too high. Usually start at 20% and work your way up if it shows improvement. Damping is good for oscillating SCF, such as moving between two energies back and forth, or even three or four. It can also help with cases where one criterion (either energy or density) is stable (repeated Deltas of around 1e-11) but the other is cycling at a much higher value (like 2 or 3 orders of magnitude or so). The soscf_max_iter setting is good to increase if you see a the number of soscf iterations repeatedly hitting the max (default is 5). That usually means that the soscf algorithm didn’t fully converge, so the step taken is probably going to have more noise than you would like.

In general, the order that I try is: damping 20%, basis guess on, soscf on , damping 30-40%

2 Likes

@DF-RHF iter 69: -1996.85745462688828 5.43605e-09 4.10790e-05 DIIS
@DF-RHF iter 70: -1996.85745462827254 -1.38425e-09 4.10790e-05 DIIS
@DF-RHF iter 71: -1996.85745462678142 1.49112e-09 4.10790e-05 DIIS
@DF-RHF iter 72: -1996.85745463060357 -3.82215e-09 4.10790e-05 DIIS
@DF-RHF iter 73: -1996.85745462690647 3.69710e-09 4.10790e-05 DIIS
@DF-RHF iter 74: -1996.85745462739260 -4.86125e-10 4.10790e-05 DIIS
@DF-RHF iter 75: -1996.85745462710020 2.92403e-10 4.10790e-05 DIIS
@DF-RHF iter 76: -1996.85745462895375 -1.85355e-09 4.10790e-05 DIIS
@DF-RHF iter 77: -1996.85745462822115 7.32598e-10 4.10790e-05 DIIS
@DF-RHF iter 78: -1996.85745463058811 -2.36696e-09 4.10790e-05 DIIS
@DF-RHF iter 79: -1996.85745462835848 2.22963e-09 4.10790e-05 DIIS
@DF-RHF iter 80: -1996.85745463149806 -3.13958e-09 4.10790e-05 DIIS
@DF-RHF iter 81: -1996.85745462905106 2.44700e-09 4.10790e-05 DIIS
@DF-RHF iter 82: -1996.85745463109470 -2.04363e-09 4.10790e-05 DIIS
@DF-RHF iter 83: -1996.85745462725799 3.83670e-09 4.10790e-05 DIIS
@DF-RHF iter 84: -1996.85745462862587 -1.36788e-09 4.10790e-05 DIIS
@DF-RHF iter 85: -1996.85745463132253 -2.69665e-09 4.10790e-05 DIIS
@DF-RHF iter 86: -1996.85745462838668 2.93585e-09 4.10790e-05 DIIS
@DF-RHF iter 87: -1996.85745462933937 -9.52696e-10 4.10790e-05 DIIS
@DF-RHF iter 88: -1996.85745462712339 2.21598e-09 4.10790e-05 DIIS
@DF-RHF iter 89: -1996.85745463024750 -3.12411e-09 4.10790e-05 DIIS
@DF-RHF iter 90: -1996.85745463089188 -6.44377e-10 4.10790e-05 DIIS
@DF-RHF iter 91: -1996.85745462973136 1.16052e-09 4.10790e-05 DIIS
@DF-RHF iter 92: -1996.85745462966042 7.09406e-11 4.10790e-05 DIIS
@DF-RHF iter 93: -1996.85745462803243 1.62800e-09 4.10790e-05 DIIS
@DF-RHF iter 94: -1996.85745463026296 -2.23054e-09 4.10790e-05 DIIS
@DF-RHF iter 95: -1996.85745462686464 3.39833e-09 4.10790e-05 DIIS
@DF-RHF iter 96: -1996.85745463039575 -3.53111e-09 4.10790e-05 DIIS
@DF-RHF iter 97: -1996.85745462969544 7.00311e-10 3.21129e-05 DIIS
@DF-RHF iter 98: -1996.85745462842397 1.27147e-09 3.04650e-05 DIIS
@DF-RHF iter 99: -1996.85745462785189 5.72072e-10 4.10790e-05 DIIS
@DF-RHF iter 100: -1996.85745462832756 -4.75666e-10 4.10790e-05 DIIS

What do you think I should do for this ?

So my iterations do not converge .
and my input file is like this :
ch3i_acetone_scan_0_8_0.txt (5.4 KB)

The settings in the SAPT block seem like they should work if you put them in a SCF block.

1 Like

set scf {
Settings
}

1 Like

Let me know if that doesn’t work! :slight_smile:

1 Like

no it didn’t work
The error was this :

RuntimeError:
Fatal Error: Option DAMPING_PERCENTAGE has been declared as a double and a int
Error occurred in file: /scratch/psilocaluser/conda-builds/psi4_1495009270718/work/psi4/src/psi4/liboptions/liboptions.cc on line: 945

Hm, try removing it from the SAPT block and changing it to 30.0 instead of 30 in the SCF block. Looks like its just the wrong type.