jjgoings / McMurchie-Davidson

do a simple closed shell Hartree-Fock using McMurchie-Davidson to compute integrals
BSD 3-Clause "New" or "Revised" License
78 stars 17 forks source link

H2O/6-31++G** SCF not convering #3

Closed erikkjellgren closed 7 years ago

erikkjellgren commented 7 years ago

Hi,

I tried run your gode with H2O/6-31++G**, but running:

from mmd.molecule import * 
from mmd.postscf import * 

water = """
0 1
H   0.866811829 0.601435778 0.0
O   0.000000000 -0.075791844    0.0
H   -0.866811829    0.601435778 0.0

"""

# init molecule and build integrals
mol = Molecule(geometry=water,basis='6-31ppgss')
mol.build()

# do the SCF
mol.RHF()

I took the basisset from the PSI4 github, since it uses the same format as your program. As an output I got:

NOT CONVERGED

I think it might be because your SCF solver dosent have DIIS? Atleast I couldnt see it when I looked in the script. I tried the same basis with my program with and without DIIS, see:

http://slowquant.readthedocs.io/en/latest/illustrativecalc.html

and it seems to yield no convergence too, when I turn off DIIS.

jjgoings commented 7 years ago

This isn't a bug. The SCF is by no means guaranteed to converge, as you show in your documentation, and this is true in general: even with DIIS. I'm closing this for now, but if you would like a working DIIS implementation, feel free to re-open a new ticket as a feature request. You are also welcome to add DIIS yourself and submit a pull request! I'm happy to take contributions.

jjgoings commented 7 years ago

@Melisius I had some time today and added DIIS. The H2O/6-31++G** test you suggested converges with DIIS and is now a part of the unit-testing suite. Thanks for suggesting this!

erikkjellgren commented 7 years ago

@jjgoings sweet, I will definitely take a look at it. My own implementation is messy af.