Coder Social home page Coder Social logo

SCF-Direct about mcmurchie-davidson HOT 6 CLOSED

jjgoings avatar jjgoings commented on May 30, 2024
SCF-Direct

from mcmurchie-davidson.

Comments (6)

jjgoings avatar jjgoings commented on May 30, 2024

I think the problem here is the incredibly tight convergence criteria. For some reason I set the SCF convergence tolerance and the 2e integral tolerance to be equal (1E-12). 1E-12 is reasonable for integral screening, but is way too tight for SCF density changes, or even energy changes. RMS(P) changes are more reasonably set as 1E-8. So, the tight SCF convergence criteria, coupled with the integral screening means that in many cases the SCF will never "converge", due to error propagation (in general shouldn't expect SCF to be more accurate than the integral sit depends on).

The solution for now -- and this is not to say the direct SCF could be improved further -- would be to split the integral and SCF convergence criteria, a la:

def RHF(self,doPrint=True,DIIS=True,direct=False,conver=1e-8,acc2e=1e-12):
        """Routine to compute the RHF energy for a closed shell molecule"""

I think these are reasonable values, and are the defaults in Gaussian, for example.

from mcmurchie-davidson.

jjgoings avatar jjgoings commented on May 30, 2024

Now the input

from mmd.molecule import Molecule
from mmd.postscf import PostSCF

water = """
0 1
O    0.000000      -0.075791844    0.000000
H    0.866811829    0.601435779    0.000000
H   -0.866811829    0.601435779    0.000000
"""

# init molecule and build integrals
mol = Molecule(geometry=water,basis='aug-cc-pvdz')

# do the SCF
print("conventional")
mol.RHF(direct=False)
print(" ")
print("direct")
mol.RHF(direct=True)

Results in:

conventional
E(SCF)    =  -76.003846206182 in 15 iterations
  Convergence:
    FPS-SPF  =  5.917280296468369e-09
    RMS(P)   =  6.09e-09
    dE(SCF)  =  1.57e-08
  Dipole X =  -0.00000000
  Dipole Y =  2.10397365
  Dipole Z =  0.00000000

direct

E(SCF)    =  -76.003846206240 in 15 iterations
  Convergence:
    FPS-SPF  =  5.912503216000997e-09
    RMS(P)   =  6.11e-09
    dE(SCF)  =  1.57e-08
  Dipole X =  0.00000000
  Dipole Y =  2.10397365
  Dipole Z =  0.00000000

But direct=True is still very very slow.

from mcmurchie-davidson.

pwborthwick avatar pwborthwick commented on May 30, 2024

That looks a lot better doesn't it? Direct will be a lot slower as the eri's are being recalculated on every cycle at moment. But the density contraction works ok and given a bigger molecule the Schwartz should help too. Thanks, informative as always.

PS in BOMD.py pretty sure you should be dividing by mass as need acceleration in velocity-verlet ie Force/mass.

from mcmurchie-davidson.

jjgoings avatar jjgoings commented on May 30, 2024

@pwborthwick Thanks! I agree. I'll look at BOMD.py...I think you are right, but naively making the changes doesn't give me the vibrational period I'd expect, so there might be something else missing.

from mcmurchie-davidson.

pwborthwick avatar pwborthwick commented on May 30, 2024

from mcmurchie-davidson.

pwborthwick avatar pwborthwick commented on May 30, 2024

@pwborthwick Thanks! I agree. I'll look at BOMD.py...I think you are right, but naively making the changes doesn't give me the vibrational period I'd expect, so there might be something else missing.

You are using atomic mass units? Multiply by 1822.8839 to bring to atomic units. Is this why you're not getting the the right quantitative results? See psi4numpty. Psi4numpty still doesn't agree even if you divide by amu2au factor in your program. They use the half-step version of velocity-verlet but that is ok.

I'm getting a problem with BOMD and H2 for dz basis. Diis is failing with singular matrix (iteration 34). I've also had this problem in my program... I've had to trap error switch off diis and return the last Fock matrix for the scf to continue without diis.
Best, Peter

from mcmurchie-davidson.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.